summaryrefslogtreecommitdiff
path: root/colm
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-05-21 11:27:36 -0400
committerAdrian Thurston <thurston@complang.org>2012-05-21 11:27:36 -0400
commitea46ba9ff428d536e27f1dc33a20eeef6d44e3d6 (patch)
tree4dfddcbf8997e4b9daf5a13a876152c3864a0334 /colm
parentc50b00ab3df74ed589036919baffd4c6edc4a7de (diff)
downloadcolm-ea46ba9ff428d536e27f1dc33a20eeef6d44e3d6.tar.gz
eliminated generation from IgnoreList
This field was the only field that extends the basic tree. Can now eliminate the structure and just use Tree.
Diffstat (limited to 'colm')
-rw-r--r--colm/pdarun.c2
-rw-r--r--colm/program.c1
-rw-r--r--colm/program.h1
-rw-r--r--colm/tree.c6
-rw-r--r--colm/tree.h2
5 files changed, 0 insertions, 12 deletions
diff --git a/colm/pdarun.c b/colm/pdarun.c
index c5daa4cd..008578cf 100644
--- a/colm/pdarun.c
+++ b/colm/pdarun.c
@@ -584,7 +584,6 @@ static void attachRightIgnore( Program *prg, Tree **sp, PdaRun *pdaRun, ParseTre
rightIgnore = ilAllocate( prg );
rightIgnore->id = LEL_ID_IGNORE;
rightIgnore->child = ignoreKid;
- rightIgnore->generation = prg->nextIlGen++;
/* About to alter the data tree. Split first. */
parseTree->shadow->tree = splitTree( prg, parseTree->shadow->tree );
@@ -653,7 +652,6 @@ static void attachLeftIgnore( Program *prg, Tree **sp, PdaRun *pdaRun, ParseTree
IgnoreList *leftIgnore = ilAllocate( prg );
leftIgnore->id = LEL_ID_IGNORE;
leftIgnore->child = ignoreKid;
- leftIgnore->generation = prg->nextIlGen++;
parseTree->shadow->tree = splitTree( prg, parseTree->shadow->tree );
diff --git a/colm/program.c b/colm/program.c
index d13c7d21..f166ffec 100644
--- a/colm/program.c
+++ b/colm/program.c
@@ -134,7 +134,6 @@ Program *colmNewProgram( RuntimeData *rtd, int argc, const char **argv )
prg->stdinVal = 0;
prg->stdoutVal = 0;
prg->stderrVal = 0;
- prg->nextIlGen = 0;
prg->induceExit = 0;
prg->exitStatus = 0;
diff --git a/colm/program.h b/colm/program.h
index 183834dd..6e588bf1 100644
--- a/colm/program.h
+++ b/colm/program.h
@@ -91,7 +91,6 @@ typedef struct ColmProgram
unsigned char ctxDepParsing;
RuntimeData *rtd;
Tree *global;
- long nextIlGen;
int induceExit;
int exitStatus;
diff --git a/colm/tree.c b/colm/tree.c
index c3bbfc1c..db016b0e 100644
--- a/colm/tree.c
+++ b/colm/tree.c
@@ -407,7 +407,6 @@ Tree *constructReplacementTree( Kid *kid, Tree **bindings, Program *prg, long pa
leftIgnore = ilAllocate( prg );
leftIgnore->id = LEL_ID_IGNORE;
leftIgnore->child = ignore;
- leftIgnore->generation = prg->nextIlGen++;
if ( tree->flags & AF_LEFT_IGNORE ) {
/* The token already has a left-ignore. Merge by attaching it as a
@@ -436,7 +435,6 @@ Tree *constructReplacementTree( Kid *kid, Tree **bindings, Program *prg, long pa
rightIgnore = ilAllocate( prg );
rightIgnore->id = LEL_ID_IGNORE;
rightIgnore->child = ignore;
- rightIgnore->generation = prg->nextIlGen++;
if ( tree->flags & AF_RIGHT_IGNORE ) {
/* The token already has a right-ignore. Merge by attaching it as a
@@ -478,7 +476,6 @@ Tree *constructReplacementTree( Kid *kid, Tree **bindings, Program *prg, long pa
ignoreList->id = LEL_ID_IGNORE;
ignoreList->refs = 1;
ignoreList->child = ignore;
- ignoreList->generation = prg->nextIlGen++;
Kid *ignoreHead = kidAllocate( prg );
ignoreHead->tree = (Tree*)ignoreList;
@@ -494,7 +491,6 @@ Tree *constructReplacementTree( Kid *kid, Tree **bindings, Program *prg, long pa
ignoreList->id = LEL_ID_IGNORE;
ignoreList->refs = 1;
ignoreList->child = ignore;
- ignoreList->generation = prg->nextIlGen++;
Kid *ignoreHead = kidAllocate( prg );
ignoreHead->tree = (Tree*)ignoreList;
@@ -2018,7 +2014,6 @@ Tree *treeTrim( struct ColmProgram *prg, Tree **sp, Tree *tree )
IgnoreList *leftIgnore = ilAllocate( prg );
leftIgnore->id = LEL_ID_IGNORE;
leftIgnore->child = 0;
- leftIgnore->generation = prg->nextIlGen++;
leftIgnore->flags |= AF_SUPPRESS_RIGHT;
tree = splitTree( prg, tree );
@@ -2049,7 +2044,6 @@ Tree *treeTrim( struct ColmProgram *prg, Tree **sp, Tree *tree )
rightIgnore = ilAllocate( prg );
rightIgnore->id = LEL_ID_IGNORE;
rightIgnore->child = 0;
- rightIgnore->generation = prg->nextIlGen++;
rightIgnore->flags |= AF_SUPPRESS_LEFT;
/* About to alter the data tree. Split first. */
diff --git a/colm/tree.h b/colm/tree.h
index 8c2df8f0..8cb31af2 100644
--- a/colm/tree.h
+++ b/colm/tree.h
@@ -99,8 +99,6 @@ typedef struct _IgnoreList
unsigned short flags;
long refs;
Kid *child;
-
- long generation;
} IgnoreList;
typedef struct _ParseTree