diff options
author | Adrian Thurston <thurston@complang.org> | 2014-01-04 10:40:31 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2014-01-04 10:40:31 -0500 |
commit | 8385b445cebfad5c958681e61ca5fa2fcdac8a16 (patch) | |
tree | 38fd63b7af5661f89c12dbc1470da9d7c803fac4 | |
parent | 39a0d2775b9106462b1e41d18e8fbdbc25116f88 (diff) | |
download | colm-8385b445cebfad5c958681e61ca5fa2fcdac8a16.tar.gz |
eliminated varDeclaration as a distinct pass
-rw-r--r-- | src/compiler.cc | 8 | ||||
-rw-r--r-- | src/declare.cc | 8 | ||||
-rw-r--r-- | src/parsedata.h | 6 | ||||
-rw-r--r-- | src/resolve.cc | 2 |
4 files changed, 10 insertions, 14 deletions
diff --git a/src/compiler.cc b/src/compiler.cc index 63656e59..7494c91c 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1119,13 +1119,9 @@ void Compiler::compile() beginProcessing(); initKeyOps(); - varDeclaration(); + declarePass(); - /* Type declaration. */ - typeDeclaration(); - - /* Type resolving. */ - typeResolve(); + resolvePass(); makeTerminalWrappers(); makeEofElements(); diff --git a/src/declare.cc b/src/declare.cc index 1d4ab04e..eee9c2ab 100644 --- a/src/declare.cc +++ b/src/declare.cc @@ -110,7 +110,7 @@ void LexFactorAug::varDecl( Compiler *pd, TokenDef *tokenDef ) } } -void Compiler::varDeclaration() +void Compiler::declareReVars() { for ( NamespaceList::Iter n = namespaceList; n.lte(); n++ ) { for ( TokenDefListNs::Iter tok = n->tokenDefList; tok.lte(); tok++ ) { @@ -729,13 +729,13 @@ void Compiler::addCtx( ObjectDef *frame ) frame->insertField( el->name, el ); } - - /* * Type Declaration Root. */ -void Compiler::typeDeclaration() +void Compiler::declarePass() { + declareReVars(); + makeDefaultIterators(); makeIgnoreCollectors(); diff --git a/src/parsedata.h b/src/parsedata.h index 51a7e76c..fd997657 100644 --- a/src/parsedata.h +++ b/src/parsedata.h @@ -651,8 +651,8 @@ struct Compiler void makeIgnoreCollectors(); void setPrecedence(); - void typeDeclaration(); - void typeResolve(); + void declarePass(); + void resolvePass(); /* Parser generation. */ void advanceReductions( PdaGraph *pdaGraph ); @@ -986,7 +986,7 @@ struct Compiler bool beginContiguous( CodeVect &code, int stretch ); void endContiguous( CodeVect &code, bool resetContiguous ); - void varDeclaration(); + void declareReVars(); }; void afterOpMinimize( FsmGraph *fsm, bool lastInSeq = true ); diff --git a/src/resolve.cc b/src/resolve.cc index 774a8394..0b1110ba 100644 --- a/src/resolve.cc +++ b/src/resolve.cc @@ -765,7 +765,7 @@ void Compiler::makeEofElements() } } -void Compiler::typeResolve() +void Compiler::resolvePass() { /* * Type Resolving. |