cstable.cpp (ragel-6.9) | : | cstable.cpp (ragel-6.10) | ||
---|---|---|---|---|
skipping to change at line 613 | skipping to change at line 613 | |||
out << "\n\t"; | out << "\n\t"; | |||
} | } | |||
} | } | |||
out << "\n"; | out << "\n"; | |||
delete[] transPtrs; | delete[] transPtrs; | |||
return out; | return out; | |||
} | } | |||
void CSharpTabCodeGen::GOTO( ostream &ret, int gotoDest, bool inFinish ) | void CSharpTabCodeGen::GOTO( ostream &ret, int gotoDest, bool inFinish ) | |||
{ | { | |||
ret << "{" << vCS() << " = " << gotoDest << "; " << | ret << "{" << vCS() << " = " << gotoDest << ";"; | |||
CTRL_FLOW() << "goto _again;}"; | ||||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
} | } | |||
void CSharpTabCodeGen::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFi nish ) | void CSharpTabCodeGen::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFi nish ) | |||
{ | { | |||
ret << "{" << vCS() << " = ("; | ret << "{" << vCS() << " = ("; | |||
INLINE_LIST( ret, ilItem->children, 0, inFinish ); | INLINE_LIST( ret, ilItem->children, 0, inFinish ); | |||
ret << "); " << CTRL_FLOW() << "goto _again;}"; | ret << ");"; | |||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
} | } | |||
void CSharpTabCodeGen::CURS( ostream &ret, bool inFinish ) | void CSharpTabCodeGen::CURS( ostream &ret, bool inFinish ) | |||
{ | { | |||
ret << "(_ps)"; | ret << "(_ps)"; | |||
} | } | |||
void CSharpTabCodeGen::TARGS( ostream &ret, bool inFinish, int targState ) | void CSharpTabCodeGen::TARGS( ostream &ret, bool inFinish, int targState ) | |||
{ | { | |||
ret << "(" << vCS() << ")"; | ret << "(" << vCS() << ")"; | |||
skipping to change at line 653 | skipping to change at line 660 | |||
ret << ");"; | ret << ");"; | |||
} | } | |||
void CSharpTabCodeGen::CALL( ostream &ret, int callDest, int targState, bool inF inish ) | void CSharpTabCodeGen::CALL( ostream &ret, int callDest, int targState, bool inF inish ) | |||
{ | { | |||
if ( prePushExpr != 0 ) { | if ( prePushExpr != 0 ) { | |||
ret << "{"; | ret << "{"; | |||
INLINE_LIST( ret, prePushExpr, 0, false ); | INLINE_LIST( ret, prePushExpr, 0, false ); | |||
} | } | |||
ret << "{" << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS | ret << "{"; | |||
() << " = " << | ||||
callDest << "; " << CTRL_FLOW() << "goto _again;}"; | ret << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS() << " | |||
= " << callDest << ";"; | ||||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
if ( prePushExpr != 0 ) | if ( prePushExpr != 0 ) | |||
ret << "}"; | ret << "}"; | |||
} | } | |||
void CSharpTabCodeGen::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targS tate, bool inFinish ) | void CSharpTabCodeGen::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targS tate, bool inFinish ) | |||
{ | { | |||
if ( prePushExpr != 0 ) { | if ( prePushExpr != 0 ) { | |||
ret << "{"; | ret << "{"; | |||
INLINE_LIST( ret, prePushExpr, 0, false ); | INLINE_LIST( ret, prePushExpr, 0, false ); | |||
} | } | |||
ret << "{" << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS | ret << "{"; | |||
() << " = ("; | ||||
ret << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS() << " | ||||
= ("; | ||||
INLINE_LIST( ret, ilItem->children, targState, inFinish ); | INLINE_LIST( ret, ilItem->children, targState, inFinish ); | |||
ret << "); " << CTRL_FLOW() << "goto _again;}"; | ret << ");"; | |||
ret << CTRL_FLOW() << "goto _again;"; | ||||
ret << "}"; | ||||
if ( prePushExpr != 0 ) | if ( prePushExpr != 0 ) | |||
ret << "}"; | ret << "}"; | |||
} | } | |||
void CSharpTabCodeGen::RET( ostream &ret, bool inFinish ) | void CSharpTabCodeGen::RET( ostream &ret, bool inFinish ) | |||
{ | { | |||
ret << "{" << vCS() << " = " << STACK() << "[--" << | ret << "{"; | |||
TOP() << "]; "; | ||||
ret << vCS() << " = " << STACK() << "[--" << TOP() << "]; "; | ||||
if ( postPopExpr != 0 ) { | if ( postPopExpr != 0 ) { | |||
ret << "{"; | ret << "{"; | |||
INLINE_LIST( ret, postPopExpr, 0, false ); | INLINE_LIST( ret, postPopExpr, 0, false ); | |||
ret << "}"; | ret << "}"; | |||
} | } | |||
ret << CTRL_FLOW() << "goto _again;}"; | ret << CTRL_FLOW() << "goto _again;"; | |||
ret << "}"; | ||||
} | } | |||
void CSharpTabCodeGen::BREAK( ostream &ret, int targState ) | void CSharpTabCodeGen::BREAK( ostream &ret, int targState ) | |||
{ | { | |||
outLabelUsed = true; | outLabelUsed = true; | |||
ret << "{" << P() << "++; " << CTRL_FLOW() << "goto _out; }"; | ret << "{" << P() << "++; " << CTRL_FLOW() << "goto _out; }"; | |||
} | } | |||
void CSharpTabCodeGen::writeData() | void CSharpTabCodeGen::writeData() | |||
{ | { | |||
End of changes. 7 change blocks. | ||||
12 lines changed or deleted | 33 lines changed or added |