diff options
Diffstat (limited to 'colm/ctinput.cpp')
-rw-r--r-- | colm/ctinput.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/colm/ctinput.cpp b/colm/ctinput.cpp index 4c7de97b..9c24b301 100644 --- a/colm/ctinput.cpp +++ b/colm/ctinput.cpp @@ -269,5 +269,30 @@ void InputStreamRepl::pushBackNamed() offset = replItem->data.length(); } +void send_named_lang_el( Tree **sp, InputStream *inputStream, FsmRun *fsmRun, PdaRun *parser ) +{ + /* All three set by getLangEl. */ + long bindId; + char *data; + long length; + + KlangEl *klangEl = inputStream->getLangEl( bindId, data, length ); + if ( klangEl->termDup != 0 ) + klangEl = klangEl->termDup; + + #ifdef COLM_LOG_PARSE + if ( colm_log_parse ) { + cerr << "named langEl: " << parser->tables->rtd->lelInfo[klangEl->id].name << endl; + } + #endif + + /* Copy the token data. */ + Head *tokdata = 0; + if ( data != 0 ) + tokdata = string_alloc_new( fsmRun->prg, data, length ); + + Kid *input = make_token( fsmRun, parser, klangEl->id, tokdata, true, bindId ); + send_handle_error( sp, inputStream, fsmRun, parser, input ); +} |