diff options
author | Adrian Thurston <thurston@complang.org> | 2012-05-16 19:38:27 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-05-16 19:38:27 -0400 |
commit | d8e71f126d6484ab30b17e265b1da583f7e97778 (patch) | |
tree | bdf103d5d4f2e3de5dc1d9b0e72d08c32355381a | |
parent | f460d2d4e799384da0151684968501675e959dd4 (diff) | |
download | colm-d8e71f126d6484ab30b17e265b1da583f7e97778.tar.gz |
Took the args specific to compile-time out of makeTokenWithData. Those
operations effected afterwards in ctinput.cc.
-rw-r--r-- | colm/ctinput.cc | 7 | ||||
-rw-r--r-- | colm/pdarun.c | 11 | ||||
-rw-r--r-- | colm/pdarun.h | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/colm/ctinput.cc b/colm/ctinput.cc index 40e80f29..60b97ad5 100644 --- a/colm/ctinput.cc +++ b/colm/ctinput.cc @@ -403,7 +403,12 @@ void sendNamedLangEl( Program *prg, Tree **sp, PdaRun *pdaRun, FsmRun *fsmRun, I if ( data != 0 ) tokdata = stringAllocFull( prg, data, length ); - Kid *input = makeTokenWithData( prg, pdaRun, fsmRun, inputStream, klangEl->id, tokdata, true, bindId ); + Kid *input = makeTokenWithData( prg, pdaRun, fsmRun, inputStream, klangEl->id, tokdata ); + + input->tree->flags |= AF_NAMED; + + if ( bindId > 0 ) + makeTokenPushBinding( pdaRun, bindId, input->tree ); incrementSteps( pdaRun ); diff --git a/colm/pdarun.c b/colm/pdarun.c index af52cef0..549139c7 100644 --- a/colm/pdarun.c +++ b/colm/pdarun.c @@ -428,8 +428,8 @@ void ignoreTree( Program *prg, PdaRun *pdaRun, Tree *tree ) setRegion( pdaRun, emptyIgnore, pdaRun->accumIgnore ); } -Kid *makeTokenWithData( Program *prg, PdaRun *pdaRun, FsmRun *fsmRun, InputStream *inputStream, int id, - Head *tokdata, int namedLangEl, int bindId ) +Kid *makeTokenWithData( Program *prg, PdaRun *pdaRun, FsmRun *fsmRun, + InputStream *inputStream, int id, Head *tokdata ) { /* Make the token object. */ long objectLength = prg->rtd->lelInfo[id].objectLength; @@ -441,9 +441,6 @@ Kid *makeTokenWithData( Program *prg, PdaRun *pdaRun, FsmRun *fsmRun, InputStrea debug( REALM_PARSE, "made token %p\n", input->tree ); - if ( namedLangEl ) - input->tree->flags |= AF_NAMED; - input->tree->refs = 1; input->tree->id = id; input->tree->tokdata = tokdata; @@ -465,8 +462,6 @@ Kid *makeTokenWithData( Program *prg, PdaRun *pdaRun, FsmRun *fsmRun, InputStrea } } - makeTokenPushBinding( pdaRun, bindId, input->tree ); - return input; } @@ -837,7 +832,7 @@ static void sendToken( Program *prg, Tree **sp, InputStream *inputStream, FsmRun updatePosition( inputStream, fsmRun->tokstart, tokdata->length ); - Kid *input = makeTokenWithData( prg, pdaRun, fsmRun, inputStream, id, tokdata, false, 0 ); + Kid *input = makeTokenWithData( prg, pdaRun, fsmRun, inputStream, id, tokdata ); incrementSteps( pdaRun ); diff --git a/colm/pdarun.h b/colm/pdarun.h index f9c8aee1..a1dc9555 100644 --- a/colm/pdarun.h +++ b/colm/pdarun.h @@ -428,7 +428,7 @@ void undoStreamPush( struct ColmProgram *prg, Tree **sp, FsmRun *fsmRun, InputSt void undoStreamAppend( struct ColmProgram *prg, Tree **sp, FsmRun *fsmRun, InputStream *inputStream, struct ColmTree *tree, long length ); void unbind( struct ColmProgram *prg, Tree **sp, PdaRun *pdaRun, Tree *tree ); Kid *makeTokenWithData( struct ColmProgram *prg, PdaRun *pdaRun, FsmRun *fsmRun, - InputStream *inputStream, int id, Head *tokdata, int namedLangEl, int bindId ); + InputStream *inputStream, int id, Head *tokdata ); void makeTokenPushBinding( PdaRun *pdaRun, int bindId, Tree *tree ); void executeGenerationAction( struct ColmProgram *prg, Tree **sp, FsmRun *fsmRun, PdaRun *pdaRun, InputStream *inputStream, int frameId, Code *code, long id, Head *tokdata ); |