diff options
author | Adrian Thurston <thurston@complang.org> | 2012-12-16 21:36:50 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-12-16 21:36:50 -0500 |
commit | 4622b43d2fd73038f0af946e5750a2969e3d8b28 (patch) | |
tree | a06e66621ee1eaaa0441010d330391e191746937 | |
parent | 4c74a6fa4b603b8b4edfd45a6ef29880085eaa12 (diff) | |
download | colm-4622b43d2fd73038f0af946e5750a2969e3d8b28.tar.gz |
no longer storing the token region name
The token region name is not actually used for anything. Going to experiment
with removing it from the language. Taking it out of the implementation first.
-rw-r--r-- | colm/compiler.cc | 2 | ||||
-rw-r--r-- | colm/lmparse.kl | 4 | ||||
-rw-r--r-- | colm/parsetree.h | 8 |
3 files changed, 8 insertions, 6 deletions
diff --git a/colm/compiler.cc b/colm/compiler.cc index 894a6dc4..e3469a7a 100644 --- a/colm/compiler.cc +++ b/colm/compiler.cc @@ -1049,7 +1049,7 @@ void Compiler::createDefaultScanner() /* Create a scanner which will be used when no other scanner can be * figured out. It returns single characters. */ - defaultRegion = new TokenRegion( InputLoc(), name, + defaultRegion = new TokenRegion( InputLoc(), regionList.length(), 0 ); regionList.append( defaultRegion ); diff --git a/colm/lmparse.kl b/colm/lmparse.kl index 462da306..d1609b4e 100644 --- a/colm/lmparse.kl +++ b/colm/lmparse.kl @@ -2617,7 +2617,7 @@ void ColmParser::init() /* Set up the root token region. */ const char *rootRegionName = "___ROOT_REGION"; - TokenRegion *rootRegion = new TokenRegion( InputLoc(), rootRegionName, + TokenRegion *rootRegion = new TokenRegion( InputLoc(), pd->regionList.length(), 0 ); pd->regionList.append( rootRegion ); addRegionDef( InputLoc(), namespaceStack.top(), rootRegionName, rootRegion ); @@ -2689,7 +2689,7 @@ void ColmParser::addRegularDef( const InputLoc &loc, Namespace *nspace, TokenRegion *ColmParser::createRegion( String &scannerName ) { - TokenRegion *tokenRegion = new TokenRegion( internal, scannerName, + TokenRegion *tokenRegion = new TokenRegion( internal, pd->regionList.length(), regionStack.top() ); regionStack.top()->childRegions.append( tokenRegion ); diff --git a/colm/parsetree.h b/colm/parsetree.h index f30204d4..c774af29 100644 --- a/colm/parsetree.h +++ b/colm/parsetree.h @@ -529,9 +529,11 @@ typedef Vector<TokenRegion*> RegionVect; struct TokenRegion { /* Construct with a list of joins */ - TokenRegion( const InputLoc &loc, const String &name, int id, - TokenRegion *parentRegion ) : - loc(loc), name(name), id(id), + TokenRegion( const InputLoc &loc, int id, TokenRegion *parentRegion ) + : + loc(loc), + name(128, "%p", this), + id(id), lmSwitchHandlesError(false), regionNameInst(0), parentRegion(parentRegion), defaultTokenDef(0), preEofBlock(0), |