Changeset 103 in dev for BasicCompiler_Common/Variable.h
- Timestamp:
- May 2, 2007, 4:08:58 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Variable.h
r100 r103 5 5 class Variable : public Type 6 6 { 7 const NamespaceScopes namespaceScopes; 7 8 string name; 8 9 bool isConst; … … 14 15 15 16 public: 16 Variable( const string &name, const Type &type, bool isConst = false, bool isRef = false ) :17 Type( type ),18 name( name ),19 isConst( isConst ),20 isRef( isRef ),21 isArray( false ),22 isParameter( false)17 Variable( const string &name, const Type &type, bool isConst = false, bool isRef = false ) 18 : Type( type ) 19 , name( name ) 20 , isConst( isConst ) 21 , isRef( isRef ) 22 , isArray( false ) 23 , isParameter( false) 23 24 { 24 25 subScripts[0] = -1; 25 26 } 26 Variable( const Variable &var ): 27 Type( var ), 28 name( var.name ), 29 isConst( var.isConst ), 30 isRef( var.isRef ), 31 isArray( false ), 32 isParameter( false ) 27 Variable( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, bool isConst = false, bool isRef = false ) 28 : namespaceScopes( namespaceScopes ) 29 , Type( type ) 30 , name( name ) 31 , isConst( isConst ) 32 , isRef( isRef ) 33 , isArray( false ) 34 , isParameter( false) 35 { 36 subScripts[0] = -1; 37 } 38 Variable( const Variable &var ) 39 : Type( var ) 40 , name( var.name ) 41 , isConst( var.isConst ) 42 , isRef( var.isRef ) 43 , isArray( false ) 44 , isParameter( false ) 33 45 { 34 46 subScripts[0] = -1; … … 48 60 return name; 49 61 } 62 63 bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const; 64 bool IsEqualSymbol( const string &name ) const; 50 65 51 66 void ConstOff(){ … … 150 165 && var.ScopeLevel == obj_LexScopes.GetNowLevel() //現在のスコープと同一レベル 151 166 ){ 152 if( var. GetName() == varName){167 if( var.IsEqualSymbol( varName ) ){ 153 168 return true; 154 169 } … … 166 181 && var.ScopeLevel <= obj_LexScopes.GetNowLevel() //現在のスコープレベルを超さないもの(Returnによる解放処理中を考慮) 167 182 ){ 168 if( var. GetName() == varName){183 if( var.IsEqualSymbol( varName ) ){ 169 184 return &var; 170 185 } … … 179 194 for( int i=0; i<max; i++ ){ 180 195 Variable *pVar = (*this)[i]; 181 if( pVar-> GetName() == varName){196 if( pVar->IsEqualSymbol( varName ) ){ 182 197 return pVar; 183 198 }
Note:
See TracChangeset
for help on using the changeset viewer.