summaryrefslogtreecommitdiff
path: root/colm
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2013-02-25 21:10:33 -0500
committerAdrian Thurston <thurston@complang.org>2013-02-25 21:10:33 -0500
commitc89ae2a6f05cab798f7504e8b3a4c1abf88797e9 (patch)
tree542a470d1e3d587f1ea21f710ff6976b52ee279d /colm
parent0898e21a8121a85e97523cedc77a71766785a349 (diff)
downloadcolm-c89ae2a6f05cab798f7504e8b3a4c1abf88797e9.tar.gz
removed tokenInstanceList from Namespace, not needed
Diffstat (limited to 'colm')
-rw-r--r--colm/lmparse.kl6
-rw-r--r--colm/parsetree.h15
2 files changed, 3 insertions, 18 deletions
diff --git a/colm/lmparse.kl b/colm/lmparse.kl
index 8d2b3728..c83c4946 100644
--- a/colm/lmparse.kl
+++ b/colm/lmparse.kl
@@ -212,7 +212,6 @@ void ColmParser::tokenInstance( const InputLoc &loc, String name, LexJoin *join,
regionSet->tokenIgnore, &reCaptureVect );
regionSet->tokenIgnore->tokenInstanceList.append( tokenInstance );
- nspace->tokenInstanceList.append( tokenInstance );
tokenDef->noPreIgnore = noPreIgnore;
tokenDef->noPostIgnore = noPostIgnore;
@@ -226,7 +225,6 @@ void ColmParser::tokenInstance( const InputLoc &loc, String name, LexJoin *join,
tokenInstanceIgn->dupOf = tokenInstance;
regionSet->ignoreOnly->tokenInstanceList.append( tokenInstanceIgn );
- nspace->tokenInstanceList.append( tokenInstanceIgn );
}
else {
/* The instance for the token-only. */
@@ -237,7 +235,6 @@ void ColmParser::tokenInstance( const InputLoc &loc, String name, LexJoin *join,
tokenInstanceTok->dupOf = tokenInstance;
regionSet->tokenOnly->tokenInstanceList.append( tokenInstanceTok );
- nspace->tokenInstanceList.append( tokenInstanceTok );
}
/* This is created and pushed in the name. */
@@ -289,7 +286,6 @@ void ColmParser::zeroDef( const InputLoc &loc, const String &data,
/* Doesn't go into instance list. */
ldel = nspace->literalDict.insert( interp, tokenInstance );
- nspace->tokenInstanceList.append( tokenInstance );
}
void ColmParser::literalDef( const InputLoc &loc, const String &data,
@@ -330,7 +326,6 @@ void ColmParser::literalDef( const InputLoc &loc, const String &data,
regionSet->tokenIgnore->tokenInstanceList.append( tokenInstance );
ldel = nspace->literalDict.insert( interp, tokenInstance );
- nspace->tokenInstanceList.append( tokenInstance );
/* Make the duplicate for the token-only region. */
tokenDef->noPreIgnore = noPreIgnore;
@@ -344,7 +339,6 @@ void ColmParser::literalDef( const InputLoc &loc, const String &data,
tokenInstanceTok->dupOf = tokenInstance;
regionSet->tokenOnly->tokenInstanceList.append( tokenInstanceTok );
- nspace->tokenInstanceList.append( tokenInstanceTok );
if ( !insideRegion )
popRegionSet();
diff --git a/colm/parsetree.h b/colm/parsetree.h
index 01b8552f..4f4a81fd 100644
--- a/colm/parsetree.h
+++ b/colm/parsetree.h
@@ -175,7 +175,6 @@ struct TokenDefListReg;
struct TokenDefListNs;
struct TokenInstance;
struct TokenInstanceListReg;
-struct TokenInstanceListNs;
struct Range;
struct LangEl;
@@ -437,20 +436,14 @@ struct TokenDef
bool isZero;
};
-struct TokenInstancePtr1
-{
- TokenInstance *prev, *next;
-};
-
-struct TokenInstancePtr2
+struct TokenInstancePtr
{
TokenInstance *prev, *next;
};
struct TokenInstance
:
- public TokenInstancePtr1,
- public TokenInstancePtr2
+ public TokenInstancePtr
{
TokenInstance()
:
@@ -550,8 +543,7 @@ struct NtDef
struct NtDefList : DList<NtDef> {};
/* Declare a new type so that ptreetypes.h need not include dlist.h. */
-struct TokenInstanceListReg : DListMel<TokenInstance, TokenInstancePtr1> {};
-struct TokenInstanceListNs : DListMel<TokenInstance, TokenInstancePtr2> {};
+struct TokenInstanceListReg : DListMel<TokenInstance, TokenInstancePtr> {};
/* Declare a new type so that ptreetypes.h need not include dlist.h. */
struct TokenDefListReg : DListMel<TokenDef, TokenDefPtr1> {};
@@ -801,7 +793,6 @@ struct Namespace
LiteralDict literalDict;
/* List of tokens defs in the namespace. */
- TokenInstanceListNs tokenInstanceList;
TokenDefListNs tokenDefList;
/* List of nonterminal defs in the namespace. */