void OCamlTabCodeGen::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish ) { if ( prePushExpr != 0 ) { ret << "begin "; INLINE_LIST( ret, prePushExpr, 0, false ); } ret << "begin " << AT(STACK(), POST_INCR(TOP()) ) << " <- " << vCS() << "; " << vCS() << " <- ("; INLINE_LIST( ret, ilItem->children, targState, inFinish ); ret << "); " << CTRL_FLOW() << "raise Goto_again end "; if ( prePushExpr != 0 ) ret << "end"; }
void TabCodeGen::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish ) { if ( prePushExpr != 0 ) { ret << "{"; INLINE_LIST( ret, prePushExpr, 0, false, false ); } ret << "{" << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS() << " = ("; INLINE_LIST( ret, ilItem->children, targState, inFinish, false ); ret << "); " << CTRL_FLOW() << "goto _again;}"; if ( prePushExpr != 0 ) ret << "}"; }
void CSharpFlatCodeGen::RET( ostream &ret, bool inFinish ) { ret << "{" << vCS() << " = " << STACK() << "[--" << TOP() << "];"; if ( postPopExpr != 0 ) { ret << "{"; INLINE_LIST( ret, postPopExpr, 0, false ); ret << "}"; } ret << CTRL_FLOW() << "goto _again;}"; }
void OCamlTabCodeGen::RET( ostream &ret, bool inFinish ) { ret << "begin " << vCS() << " <- " << AT(STACK(), PRE_DECR(TOP()) ) << "; "; if ( postPopExpr != 0 ) { ret << "begin "; INLINE_LIST( ret, postPopExpr, 0, false ); ret << "end "; } ret << CTRL_FLOW() << "raise Goto_again end"; }
void TabCodeGen::CALL( ostream &ret, int callDest, int targState, bool inFinish ) { if ( prePushExpr != 0 ) { ret << "{"; INLINE_LIST( ret, prePushExpr, 0, false, false ); } ret << "{" << STACK() << "[" << TOP() << "++] = " << vCS() << "; " << vCS() << " = " << callDest << "; " << CTRL_FLOW() << "goto _again;}"; if ( prePushExpr != 0 ) ret << "}"; }
void OCamlTabCodeGen::CALL( ostream &ret, int callDest, int targState, bool inFinish ) { if ( prePushExpr != 0 ) { ret << "begin "; INLINE_LIST( ret, prePushExpr, 0, false ); } ret << "begin " << AT( STACK(), POST_INCR(TOP()) ) << " <- " << vCS() << "; "; ret << vCS() << " <- " << callDest << "; " << CTRL_FLOW() << "raise Goto_again end "; if ( prePushExpr != 0 ) ret << "end"; }
void TabCodeGen::NEXT_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish ) { ret << vCS() << " = ("; INLINE_LIST( ret, ilItem->children, 0, inFinish, false ); ret << ");"; }
void TabCodeGen::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish ) { ret << "{" << vCS() << " = ("; INLINE_LIST( ret, ilItem->children, 0, inFinish, false ); ret << "); " << CTRL_FLOW() << "goto _again;}"; }
void CSharpTabCodeGen::NEXT_EXPR( wostream &ret, GenInlineItem *ilItem, bool inFinish ) { ret << vCS() << L" = ("; INLINE_LIST( ret, ilItem->children, 0, inFinish ); ret << L");"; }
void CSharpGotoCodeGen::GOTO_EXPR( wostream &ret, GenInlineItem *ilItem, bool inFinish ) { ret << L"{" << vCS() << L" = ("; INLINE_LIST( ret, ilItem->children, 0, inFinish ); ret << L"); " << CTRL_FLOW() << L"goto _again;}"; }
void OCamlTabCodeGen::GOTO_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish ) { ret << "begin " << vCS() << " <- ("; INLINE_LIST( ret, ilItem->children, 0, inFinish ); ret << "); " << CTRL_FLOW() << "raise Goto_again end"; }