postPopExpr(0),
pExpr(0),
peExpr(0),
+ eofExpr(0),
csExpr(0),
topExpr(0),
stackExpr(0),
pExpr = inlineList;
else if ( strcmp( var, "pe" ) == 0 )
peExpr = inlineList;
+ else if ( strcmp( var, "eof" ) == 0 )
+ eofExpr = inlineList;
else if ( strcmp( var, "cs" ) == 0 )
csExpr = inlineList;
else if ( strcmp( var, "data" ) == 0 )
/* Overriding variables. */
InlineList *pExpr;
InlineList *peExpr;
+ InlineList *eofExpr;
InlineList *csExpr;
InlineList *topExpr;
InlineList *stackExpr;
writeInlineList( pd->peExpr );
out << "</pe_expr>\n";
}
+
+ if ( pd->eofExpr != 0 ) {
+ out << " <eof_expr>";
+ writeInlineList( pd->eofExpr );
+ out << "</eof_expr>\n";
+ }
if ( pd->csExpr != 0 ) {
out << " <cs_expr>";
postPopExpr(0),
pExpr(0),
peExpr(0),
+ eofExpr(0),
csExpr(0),
topExpr(0),
stackExpr(0),
/* Overriding variables. */
InlineList *pExpr;
InlineList *peExpr;
+ InlineList *eofExpr;
InlineList *csExpr;
InlineList *topExpr;
InlineList *stackExpr;
token TAG_write, TAG_access, TAG_break, TAG_arg, TAG_cs_expr;
- token TAG_p_expr, TAG_pe_expr, TAG_cs_expr, TAG_top_expr,
+ token TAG_p_expr, TAG_pe_expr, TAG_eof_expr, TAG_cs_expr, TAG_top_expr,
TAG_stack_expr, TAG_act_expr, TAG_tokstart_expr, TAG_tokend_expr,
TAG_data_expr, TAG_prepush, TAG_postpop;
}%%
ragel_def_item: tag_machine;
ragel_def_item: tag_p_expr;
ragel_def_item: tag_pe_expr;
+ragel_def_item: tag_eof_expr;
ragel_def_item: tag_cs_expr;
ragel_def_item: tag_top_expr;
ragel_def_item: tag_stack_expr;
final { cgd->pExpr = $2->inlineList; };
tag_pe_expr: TAG_pe_expr inline_list '/' TAG_pe_expr
final { cgd->peExpr = $2->inlineList; };
+tag_eof_expr: TAG_eof_expr inline_list '/' TAG_eof_expr
+ final { cgd->eofExpr = $2->inlineList; };
tag_cs_expr: TAG_cs_expr inline_list '/' TAG_cs_expr
final { cgd->csExpr = $2->inlineList; };
tag_top_expr: TAG_top_expr inline_list '/' TAG_top_expr
ex, TAG_ex
p_expr, TAG_p_expr
pe_expr, TAG_pe_expr
+eof_expr, TAG_eof_expr
cs_expr, TAG_cs_expr
top_expr, TAG_top_expr
stack_expr, TAG_stack_expr
string FsmCodeGen::EOFV()
{
ostringstream ret;
-// if ( peExpr == 0 )
+ if ( eofExpr == 0 )
ret << "eof";
-// else {
-// ret << "(";
-// INLINE_LIST( ret, peExpr, 0, false );
-// ret << ")";
-// }
+ else {
+ ret << "(";
+ INLINE_LIST( ret, eofExpr, 0, false );
+ ret << ")";
+ }
return ret.str();
}
string JavaTabCodeGen::EOFV()
{
ostringstream ret;
-// if ( peExpr == 0 )
+ if ( eofExpr == 0 )
ret << "eof";
-// else {
-// ret << "(";
-// INLINE_LIST( ret, peExpr, 0, false );
-// ret << ")";
-// }
+ else {
+ ret << "(";
+ INLINE_LIST( ret, eofExpr, 0, false );
+ ret << ")";
+ }
return ret.str();
}
string RubyCodeGen::EOFV()
{
ostringstream ret;
-// if ( peExpr == 0 )
+ if ( eofExpr == 0 )
ret << "eof";
-// else {
-// //ret << "(";
-// INLINE_LIST( ret, peExpr, 0, false );
-// //ret << ")";
-// }
+ else {
+ //ret << "(";
+ INLINE_LIST( ret, eofExpr, 0, false );
+ //ret << ")";
+ }
return ret.str();
}
alphtype int;
getkey fpc->key;
+ variable eof eof_marker;
action a1 {}
action a2 {}
{
LangEl *p = data;
LangEl *pe = data + len;
- LangEl *eof = pe;
+ LangEl *eof_marker = pe;
%% write exec;
if ( cs == Fsm_error )