diff options
author | Adrian Thurston <thurston@complang.org> | 2013-02-09 20:58:45 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2013-02-09 20:58:45 -0500 |
commit | f5fc6b33201cf16c47f713f5b5572e787e556e94 (patch) | |
tree | 509b7f78d0c1273f864e8ee3250e6091867313b9 | |
parent | 3b1f71094782b21c0c8da0cd12c1fe97adcecd30 (diff) | |
download | colm-f5fc6b33201cf16c47f713f5b5572e787e556e94.tar.gz |
removed FsmRun arg from getData and getParseBlock input interfaces
-rw-r--r-- | colm/ctinput.cc | 9 | ||||
-rw-r--r-- | colm/input.c | 14 | ||||
-rw-r--r-- | colm/input.h | 6 | ||||
-rw-r--r-- | colm/pdarun.c | 8 |
4 files changed, 16 insertions, 21 deletions
diff --git a/colm/ctinput.cc b/colm/ctinput.cc index c2d74fc1..1bf6097f 100644 --- a/colm/ctinput.cc +++ b/colm/ctinput.cc @@ -59,8 +59,7 @@ LangEl *inputStreamPatternGetLangEl( StreamImpl *ss, long *bindId, char **data, return klangEl; } -int inputStreamPatternGetParseBlock( FsmRun *fsmRun, StreamImpl *ss, - int skip, char **pdp, int *copied ) +int inputStreamPatternGetParseBlock( StreamImpl *ss, int skip, char **pdp, int *copied ) { *copied = 0; @@ -107,7 +106,7 @@ int inputStreamPatternGetParseBlock( FsmRun *fsmRun, StreamImpl *ss, return INPUT_DATA; } -int inputStreamPatternGetData( FsmRun *fsmRun, StreamImpl *ss, char *dest, int length ) +int inputStreamPatternGetData( StreamImpl *ss, char *dest, int length ) { int copied = 0; @@ -273,7 +272,7 @@ LangEl *inputStreamConsGetLangEl( StreamImpl *ss, long *bindId, char **data, lon return klangEl; } -int inputStreamConsGetParseBlock( FsmRun *fsmRun, StreamImpl *ss, +int inputStreamConsGetParseBlock( StreamImpl *ss, int skip, char **pdp, int *copied ) { *copied = 0; @@ -321,7 +320,7 @@ int inputStreamConsGetParseBlock( FsmRun *fsmRun, StreamImpl *ss, return INPUT_DATA; } -int inputStreamConsGetData( FsmRun *fsmRun, StreamImpl *ss, char *dest, int length ) +int inputStreamConsGetData( StreamImpl *ss, char *dest, int length ) { int copied = 0; diff --git a/colm/input.c b/colm/input.c index 532170ee..959940c6 100644 --- a/colm/input.c +++ b/colm/input.c @@ -147,8 +147,7 @@ void initInputFuncs() * Base run-time input streams. */ -int fdGetParseBlock( FsmRun *fsmRun, StreamImpl *ss, - int skip, char **pdp, int *copied ) +int fdGetParseBlock( StreamImpl *ss, int skip, char **pdp, int *copied ) { int ret = 0; *copied = 0; @@ -207,7 +206,7 @@ int fdGetParseBlock( FsmRun *fsmRun, StreamImpl *ss, return ret; } -int fdGetData( FsmRun *fsmRun, StreamImpl *ss, char *dest, int length ) +int fdGetData( StreamImpl *ss, char *dest, int length ) { int copied = 0; @@ -461,8 +460,7 @@ static void _unsetEof( StreamImpl *is ) } } -static int _getParseBlock( FsmRun *fsmRun, StreamImpl *is, - int skip, char **pdp, int *copied ) +static int _getParseBlock( StreamImpl *is, int skip, char **pdp, int *copied ) { int ret = 0; *copied = 0; @@ -478,7 +476,7 @@ static int _getParseBlock( FsmRun *fsmRun, StreamImpl *is, if ( buf->type == RunBufSourceType ) { Stream *stream = (Stream*)buf->tree; - int type = stream->in->funcs->getParseBlock( fsmRun, stream->in, skip, pdp, copied ); + int type = stream->in->funcs->getParseBlock( stream->in, skip, pdp, copied ); // if ( type == INPUT_EOD && !stream->in->eosSent ) { // stream->in->eosSent = 1; @@ -561,7 +559,7 @@ static int _getParseBlock( FsmRun *fsmRun, StreamImpl *is, return ret; } -static int _getData( FsmRun *fsmRun, StreamImpl *is, char *dest, int length ) +static int _getData( StreamImpl *is, char *dest, int length ) { int copied = 0; @@ -575,7 +573,7 @@ static int _getData( FsmRun *fsmRun, StreamImpl *is, char *dest, int length ) if ( buf->type == RunBufSourceType ) { Stream *stream = (Stream*)buf->tree; - int glen = stream->in->funcs->getData( fsmRun, stream->in, dest+copied, length ); + int glen = stream->in->funcs->getData( stream->in, dest+copied, length ); if ( glen == 0 ) { debug( REALM_INPUT, "skipping over input\n" ); diff --git a/colm/input.h b/colm/input.h index af76f31c..3b426a50 100644 --- a/colm/input.h +++ b/colm/input.h @@ -88,11 +88,9 @@ typedef struct _StreamImpl StreamImpl; struct StreamFuncs { - int (*getParseBlock)( struct _FsmRun *fsmRun, StreamImpl *ss, - int skip, char **pdp, int *copied ); + int (*getParseBlock)( StreamImpl *ss, int skip, char **pdp, int *copied ); - int (*getData)( struct _FsmRun *fsmRun, StreamImpl *ss, - char *dest, int length ); + int (*getData)( StreamImpl *ss, char *dest, int length ); int (*consumeData)( StreamImpl *ss, int length ); int (*undoConsumeData)( struct _FsmRun *fsmRun, StreamImpl *ss, const char *data, int length ); diff --git a/colm/pdarun.c b/colm/pdarun.c index e789c8e3..8362e14d 100644 --- a/colm/pdarun.c +++ b/colm/pdarun.c @@ -140,7 +140,7 @@ Head *extractMatch( Program *prg, FsmRun *fsmRun, StreamImpl *is ) char *dest = runBuf->data + runBuf->length; - is->funcs->getData( fsmRun, is, dest, length ); + is->funcs->getData( is, dest, length ); is->funcs->consumeData( is, length ); runBuf->length += length; @@ -174,7 +174,7 @@ Head *peekMatch( Program *prg, FsmRun *fsmRun, StreamImpl *is ) char *dest = runBuf->data + runBuf->length; - is->funcs->getData( fsmRun, is, dest, length ); + is->funcs->getData( is, dest, length ); fsmRun->p = fsmRun->pe = 0; fsmRun->toklen = 0; @@ -202,7 +202,7 @@ Head *streamPull( Program *prg, FsmRun *fsmRun, StreamImpl *is, long length ) char *dest = runBuf->data + runBuf->length; - is->funcs->getData( fsmRun, is, dest, length ); + is->funcs->getData( is, dest, length ); is->funcs->consumeData( is, length ); runBuf->length += length; @@ -1012,7 +1012,7 @@ long scanToken( Program *prg, PdaRun *pdaRun, FsmRun *fsmRun, StreamImpl *is ) while ( true ) { char *pd = 0; int len = 0; - int type = is->funcs->getParseBlock( fsmRun, is, fsmRun->toklen, &pd, &len ); + int type = is->funcs->getParseBlock( is, fsmRun->toklen, &pd, &len ); switch ( type ) { case INPUT_DATA: |