summaryrefslogtreecommitdiff
path: root/src/parsetree.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-11-30 16:26:39 -0500
committerAdrian Thurston <thurston@complang.org>2015-11-30 16:26:39 -0500
commit5e75abcbc165994b9c28fe98c1944da4ce31a7cb (patch)
treeef1fc4a4c275b4fe01a3458c5b4da2e348a42940 /src/parsetree.h
parentdd66b443403b72ef2e2a076db471d6d819d95e05 (diff)
downloadcolm-5e75abcbc165994b9c28fe98c1944da4ce31a7cb.tar.gz
allow omission of location in reductions
There is code in here for omission of location and data in reductions. Unfortunately we cannot enable the omission of data unless we make changes to the backtracking. In the current implementation we push the token data with an mcopy from the data in the token.
Diffstat (limited to 'src/parsetree.h')
-rw-r--r--src/parsetree.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parsetree.h b/src/parsetree.h
index 5f5f10a5..d1ce46d7 100644
--- a/src/parsetree.h
+++ b/src/parsetree.h
@@ -981,7 +981,9 @@ typedef Vector<ReduceAction*> ReduceActionVect;
struct Reduction
{
Reduction( const InputLoc &loc, String name )
- : loc(loc), name(name)
+ :
+ loc(loc), name(name),
+ needData(0), needLoc(0)
{
static int nextId = 1;
id = nextId++;
@@ -994,6 +996,9 @@ struct Reduction
String var;
int id;
+ bool *needData;
+ bool *needLoc;
+
ReduceActionList reduceActions;
ReduceNonTermList reduceNonTerms;
};