summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-12-16 21:48:14 -0500
committerAdrian Thurston <thurston@complang.org>2012-12-16 21:48:14 -0500
commit955b475a3dbad2af679789f08946c01ee269ab65 (patch)
tree099256b892192b9d6c3d1a2e2940fcdf1b878aad
parent4622b43d2fd73038f0af946e5750a2969e3d8b28 (diff)
downloadcolm-955b475a3dbad2af679789f08946c01ee269ab65.tar.gz
removed graphDict from ParseData
This is a relic of the original ragel code. It is no longer needed for anything.
-rw-r--r--colm/compiler.cc2
-rw-r--r--colm/lmparse.kl21
-rw-r--r--colm/parsetree.h3
3 files changed, 9 insertions, 17 deletions
diff --git a/colm/compiler.cc b/colm/compiler.cc
index e3469a7a..41ec82a8 100644
--- a/colm/compiler.cc
+++ b/colm/compiler.cc
@@ -1054,7 +1054,7 @@ void Compiler::createDefaultScanner()
regionList.append( defaultRegion );
/* Insert the machine definition into the graph dictionary. */
- RegionGraphDictEl *newEl = rootNamespace->graphDict.insert( name );
+ RegionGraphDictEl *newEl = new RegionGraphDictEl( name );
assert( newEl != 0 );
newEl->value = new RegionDef( name, defaultRegion );
newEl->isInstance = true;
diff --git a/colm/lmparse.kl b/colm/lmparse.kl
index d1609b4e..fd678d08 100644
--- a/colm/lmparse.kl
+++ b/colm/lmparse.kl
@@ -2749,20 +2749,15 @@ void ColmParser::popRegionSet()
void ColmParser::addRegionDef( const InputLoc &loc, Namespace *nspace,
const String &name, TokenRegion *tokenRegion )
{
- RegionGraphDictEl *newEl = nspace->graphDict.insert( name );
- if ( newEl != 0 ) {
- /* New element in the dict, all good. */
- newEl->value = new RegionDef( name, tokenRegion );
- newEl->isInstance = true;
- newEl->loc = loc;
+ RegionGraphDictEl *newEl = new RegionGraphDictEl( name );
- /* It it is an instance, put on the instance list. */
- pd->instanceList.append( newEl );
- }
- else {
- // Recover by ignoring the duplicate.
- error(loc) << "regular definition \"" << name << "\" already exists" << endl;
- }
+ /* New element in the dict, all good. */
+ newEl->value = new RegionDef( name, tokenRegion );
+ newEl->isInstance = true;
+ newEl->loc = loc;
+
+ /* It it is an instance, put on the instance list. */
+ pd->instanceList.append( newEl );
}
ostream &ColmParser::parse_error( int tokId, Token &token )
diff --git a/colm/parsetree.h b/colm/parsetree.h
index c774af29..d3657ef1 100644
--- a/colm/parsetree.h
+++ b/colm/parsetree.h
@@ -758,9 +758,6 @@ struct Namespace
TypeMap typeMap;
GenericList genericList;
- /* Dictionary of graphs. Both instances and non-instances go here. */
- RegionGraphDict graphDict;
-
/* regular language definitions. */
GraphDict rlMap;