source: dev/trunk/abdev/BasicCompiler_Common/include/TypeDef.h@ 193

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