source: dev/BasicCompiler_Common/TypeDef.h@ 113

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

TypeDef、Declareの名前空間対応を行った。
TypeDef、Declareをローカル領域で使用した際、エラーを表示するようにした。

File size: 1.1 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 string &typeName ) const;
49
50private:
51 void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
52public:
53 void Init();
54};
Note: See TracBrowser for help on using the repository browser.