source: dev/trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp@ 750

Last change on this file since 750 was 750, checked in by イグトランス (egtra), 16 years ago

BOOST_FOREACHを可能なものはVC++ 2005 for eachへ置換(やや速くなる)。

File size: 906 bytes
Line 
1#include "stdafx.h"
2
3TypeDef::TypeDef( const Symbol &symbol, const std::string &baseName, const Type &baseType )
4 : RelationalObjectModuleItem( symbol )
5 , baseName( baseName )
6 , baseType( baseType )
7{
8}
9
10bool TypeDef::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors )
11{
12 this->baseType.Resolve( resolver, resolveErrors );
13 return true;
14}
15
16TypeDefCollection::TypeDefCollection(){
17}
18TypeDefCollection::~TypeDefCollection(){
19}
20void TypeDefCollection::Add( const Symbol &symbol, const std::string &baseName, int nowLine ){
21 TypeDef typeDef( symbol, baseName, nowLine );
22 this->push_back( typeDef );
23}
24
25const TypeDef *TypeDefCollection::Find( const Symbol &symbol ) const
26{
27 const TypeDefCollection &typeDefs = *this;
28 foreach( const TypeDef &typeDef, typeDefs )
29 {
30 if( typeDef.IsEqualSymbol( symbol ) )
31 {
32 return &typeDef;
33 }
34 }
35 return NULL;
36}
Note: See TracBrowser for help on using the repository browser.