source: dev/BasicCompiler_Common/TypeDef.h@ 114

Last change on this file since 114 was 114, checked in by dai_9181, 17 years ago

CClassクラスのインスタンスを全面的にconstにした。
TypeDefされたクラスの静的メソッドを呼び出せるようにした。(静的メンバへの対応はまだ)

File size: 1.2 KB
Line 
1#pragma once
2
3#include <vector>
4#include <string>
5
6#include "../Type.h"
7
8using namespace std;
9
10class TypeDefCollection;
11
12class TypeDef{
13 friend TypeDefCollection;
14
15 NamespaceScopes namespaceScopes;
16
17 string name;
18 string baseName;
19 Type baseType;
20public:
21 TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName );
22 ~TypeDef();
23
24 const string &GetName() const
25 {
26 return name;
27 }
28 const string &GetBaseName() const
29 {
30 return baseName;
31 }
32 const Type &GetBaseType() const
33 {
34 return baseType;
35 }
36
37 bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
38 bool IsEqualSymbol( const string &name ) const;
39};
40
41class TypeDefCollection : public vector<TypeDef>
42{
43public:
44 TypeDefCollection();
45 ~TypeDefCollection();
46
47 void Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName );
48 int GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const;
49 int GetIndex( const string &fullName ) const;
50
51private:
52 void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
53public:
54 void Init();
55};
Note: See TracBrowser for help on using the repository browser.