diff options
author | Adrian Thurston <thurston@complang.org> | 2011-07-09 17:36:17 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2011-07-09 17:36:17 +0000 |
commit | 1d74b3e3da47dccf0e8c3157b6d3f2be0c1b157c (patch) | |
tree | 51c08b7042826e4fda173b30219081510f4fafa6 /colm/resolve.cc | |
parent | b550a23dc3e3a3b3d58f3cb8749c703900914a03 (diff) | |
download | colm-1d74b3e3da47dccf0e8c3157b6d3f2be0c1b157c.tar.gz |
More cleanup around LangEl declarations. Set the type in the declare function.
Added a new declare function that does not insert the name into the namespace's
map. Language elements that are not declared by the user don't need to go into
the map (eg repeats, default tokens).
Diffstat (limited to 'colm/resolve.cc')
-rw-r--r-- | colm/resolve.cc | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/colm/resolve.cc b/colm/resolve.cc index 2cbe6be8..6e1529b9 100644 --- a/colm/resolve.cc +++ b/colm/resolve.cc @@ -162,32 +162,12 @@ UniqueType *TypeRef::lookupType( ParseData *pd ) return uniqueType; } -void ParseData::resolveLiteralFactor( ProdEl *fact ) -{ - fact->typeRef->lookupType( this ); - fact->langEl = fact->typeRef->uniqueType->langEl; -} - -void ParseData::resolveReferenceFactor( ProdEl *fact ) +void ParseData::resolveFactor( ProdEl *fact ) { fact->typeRef->lookupType( this ); fact->langEl = fact->typeRef->uniqueType->langEl; } -void ParseData::resolveFactor( ProdEl *fact ) -{ - switch ( fact->type ) { - case ProdEl::LiteralType: - resolveLiteralFactor( fact ); - break; - case ProdEl::ReferenceType: - resolveReferenceFactor( fact ); - break; - } -} - - - void LangTerm::resolve( ParseData *pd ) const { switch ( type ) { |