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 |
|
---|
9 | using namespace std;
|
---|
10 |
|
---|
11 | class TypeDefCollection;
|
---|
12 |
|
---|
13 | class TypeDef{
|
---|
14 | friend TypeDefCollection;
|
---|
15 |
|
---|
16 | NamespaceScopes namespaceScopes;
|
---|
17 |
|
---|
18 | string name;
|
---|
19 | string baseName;
|
---|
20 | Type baseType;
|
---|
21 | public:
|
---|
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 |
|
---|
42 | class TypeDefCollection : public vector<TypeDef>
|
---|
43 | {
|
---|
44 | public:
|
---|
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 |
|
---|
52 | private:
|
---|
53 | void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
|
---|
54 | public:
|
---|
55 | void Init();
|
---|
56 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.