summaryrefslogtreecommitdiff
path: root/src/parsetree.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2017-07-27 12:11:13 -0400
committerAdrian Thurston <thurston@colm.net>2017-07-27 12:11:13 -0400
commit3f74fc17cee81774ddcc29c0a3560f81f7b60b7d (patch)
treedd3cc86a2cbc0b6eceb2755f084800718842fb1c /src/parsetree.h
parent1395ab646772f3c37e3fbad207d9f12a9d3f3140 (diff)
downloadcolm-3f74fc17cee81774ddcc29c0a3560f81f7b60b7d.tar.gz
added a read_reduce statement to call postfix reducer
Triggers the generation of the reducer. Accepts a stream.
Diffstat (limited to 'src/parsetree.h')
-rw-r--r--src/parsetree.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parsetree.h b/src/parsetree.h
index 4ebc8201..e8225fa1 100644
--- a/src/parsetree.h
+++ b/src/parsetree.h
@@ -1866,7 +1866,8 @@ struct ParserText
{
static ParserText *cons( const InputLoc &loc,
Namespace *nspace, ConsItemList *list,
- bool used, bool reduce, const String &reducer )
+ bool used, bool reduce, bool read,
+ const String &reducer )
{
ParserText *p = new ParserText;
p->loc = loc;
@@ -1878,6 +1879,7 @@ struct ParserText
p->parse = true;
p->used = used;
p->reduce = reduce;
+ p->read = read;
p->reducer = reducer;
p->reducerId = -1;
return p;
@@ -1892,6 +1894,7 @@ struct ParserText
bool parse;
bool used;
bool reduce;
+ bool read;
String reducer;
int reducerId;
@@ -3094,6 +3097,7 @@ struct LangTerm
UniqueType *evaluateConstruct( Compiler *pd, CodeVect &code ) const;
void parseFrag( Compiler *pd, CodeVect &code, int stopId ) const;
UniqueType *evaluateParse( Compiler *pd, CodeVect &code, bool tree, bool stop ) const;
+ UniqueType *evaluateReadReduce( Compiler *pd, CodeVect &code ) const;
void evaluateSendStream( Compiler *pd, CodeVect &code ) const;
void evaluateSendParser( Compiler *pd, CodeVect &code, bool strings ) const;
UniqueType *evaluateSend( Compiler *pd, CodeVect &code ) const;