cdgoto.cpp (ragel-6.9) | : | cdgoto.cpp (ragel-6.10) | ||
---|---|---|---|---|
skipping to change at line 545 | skipping to change at line 545 | |||
/* Write the goto func. */ | /* Write the goto func. */ | |||
out << "goto f" << st->eofAction->actListId << ";\n"; | out << "goto f" << st->eofAction->actListId << ";\n"; | |||
} | } | |||
} | } | |||
return out; | return out; | |||
} | } | |||
void GotoCodeGen::GOTO( ostream &ret, int gotoDest, bool inFinish ) | void GotoCodeGen::GOTO( ostream &ret, int gotoDest, bool inFinish ) | |||
{ | { | |||
ret << "{" << vCS() << " = " << gotoDest << "; " << | ret << "{"; | |||
CTRL_FLOW() << "goto _again;}"; | ||||
ret << vCS() << " = " << gotoDest << ";"; | ||||
if ( inFinish && !noEnd ) | ||||
EOF_CHECK( ret ); | ||||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
} | } | |||
void GotoCodeGen::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish ) | void GotoCodeGen::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish ) | |||
{ | { | |||
ret << "{" << vCS() << " = ("; | ret << "{"; | |||
ret << vCS() << " = ("; | ||||
INLINE_LIST( ret, ilItem->children, 0, inFinish, false ); | INLINE_LIST( ret, ilItem->children, 0, inFinish, false ); | |||
ret << "); " << CTRL_FLOW() << "goto _again;}"; | ret << ");"; | |||
if ( inFinish && !noEnd ) | ||||
EOF_CHECK( ret ); | ||||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
} | } | |||
void GotoCodeGen::CURS( ostream &ret, bool inFinish ) | void GotoCodeGen::CURS( ostream &ret, bool inFinish ) | |||
{ | { | |||
ret << "(_ps)"; | ret << "(_ps)"; | |||
} | } | |||
void GotoCodeGen::TARGS( ostream &ret, bool inFinish, int targState ) | void GotoCodeGen::TARGS( ostream &ret, bool inFinish, int targState ) | |||
{ | { | |||
ret << "(" << vCS() << ")"; | ret << "(" << vCS() << ")"; | |||
skipping to change at line 585 | skipping to change at line 602 | |||
ret << ");"; | ret << ");"; | |||
} | } | |||
void GotoCodeGen::CALL( ostream &ret, int callDest, int targState, bool inFinish ) | void GotoCodeGen::CALL( ostream &ret, int callDest, int targState, bool inFinish ) | |||
{ | { | |||
if ( prePushExpr != 0 ) { | if ( prePushExpr != 0 ) { | |||
ret << "{"; | ret << "{"; | |||
INLINE_LIST( ret, prePushExpr, 0, false, false ); | INLINE_LIST( ret, prePushExpr, 0, false, false ); | |||
} | } | |||
ret << "{" << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS | ret << "{"; | |||
() << " = " << | ||||
callDest << "; " << CTRL_FLOW() << "goto _again;}"; | ret << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS() << " | |||
= " << callDest << ";"; | ||||
if ( inFinish && !noEnd ) | ||||
EOF_CHECK( ret ); | ||||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
if ( prePushExpr != 0 ) | if ( prePushExpr != 0 ) | |||
ret << "}"; | ret << "}"; | |||
} | } | |||
void GotoCodeGen::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish ) | void GotoCodeGen::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish ) | |||
{ | { | |||
if ( prePushExpr != 0 ) { | if ( prePushExpr != 0 ) { | |||
ret << "{"; | ret << "{"; | |||
INLINE_LIST( ret, prePushExpr, 0, false, false ); | INLINE_LIST( ret, prePushExpr, 0, false, false ); | |||
} | } | |||
ret << "{" << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS | ret << "{"; | |||
() << " = ("; | ||||
ret << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS() << " | ||||
= ("; | ||||
INLINE_LIST( ret, ilItem->children, targState, inFinish, false ); | INLINE_LIST( ret, ilItem->children, targState, inFinish, false ); | |||
ret << "); " << CTRL_FLOW() << "goto _again;}"; | ret << ");"; | |||
if ( inFinish && !noEnd ) | ||||
EOF_CHECK( ret ); | ||||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
if ( prePushExpr != 0 ) | if ( prePushExpr != 0 ) | |||
ret << "}"; | ret << "}"; | |||
} | } | |||
void GotoCodeGen::RET( ostream &ret, bool inFinish ) | void GotoCodeGen::RET( ostream &ret, bool inFinish ) | |||
{ | { | |||
ret << "{" << vCS() << " = " << STACK() << "[--" << TOP() << "];"; | ret << "{" << vCS() << " = " << STACK() << "[--" << TOP() << "];"; | |||
if ( postPopExpr != 0 ) { | if ( postPopExpr != 0 ) { | |||
ret << "{"; | ret << "{"; | |||
INLINE_LIST( ret, postPopExpr, 0, false, false ); | INLINE_LIST( ret, postPopExpr, 0, false, false ); | |||
ret << "}"; | ret << "}"; | |||
} | } | |||
ret << CTRL_FLOW() << "goto _again;}"; | if ( inFinish && !noEnd ) | |||
EOF_CHECK( ret ); | ||||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
} | } | |||
void GotoCodeGen::BREAK( ostream &ret, int targState, bool csForced ) | void GotoCodeGen::BREAK( ostream &ret, int targState, bool csForced ) | |||
{ | { | |||
outLabelUsed = true; | outLabelUsed = true; | |||
ret << "{" << P() << "++; " << CTRL_FLOW() << "goto _out; }"; | ret << "{" << P() << "++; " << CTRL_FLOW() << "goto _out; }"; | |||
} | } | |||
void GotoCodeGen::writeData() | void GotoCodeGen::writeData() | |||
{ | { | |||
End of changes. 7 change blocks. | ||||
11 lines changed or deleted | 49 lines changed or added |