Skip to content

Commit

Permalink
implementations of the ncall/nret for existing (non basic) code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Thurston committed Jul 28, 2014
1 parent 177a48a commit 4d936c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ void Binary::NCALL( ostream &ret, int callDest, int targState, bool inFinish )

ret << STACK() << "[" << TOP() << "] = " <<
vCS() << "; " << TOP() << " += 1;" << vCS() << " = " <<
callDest << "; " << "goto _again;}$";
callDest << "; }$";
}

void Binary::NCALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish )
Expand All @@ -800,7 +800,7 @@ void Binary::NCALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, boo
vCS() << "; " << TOP() << " += 1;" << vCS() <<
" = host( \"-\", 1 ) ={";
INLINE_LIST( ret, ilItem->children, targState, inFinish, false );
ret << "}=; " << "goto _again;}$";
ret << "}=; }$";
}

void Binary::RET( ostream &ret, bool inFinish )
Expand All @@ -826,7 +826,7 @@ void Binary::NRET( ostream &ret, bool inFinish )
ret << "}$";
}

ret << "goto _again;}$";
ret << "}$";
}

void Binary::BREAK( ostream &ret, int targState, bool csForced )
Expand Down
6 changes: 3 additions & 3 deletions src/flat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ void Flat::NCALL( ostream &ret, int callDest, int targState, bool inFinish )
}

ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " << TOP() << " += 1;" << vCS() << " = " <<
callDest << "; " << "goto _again;}$";
callDest << "; }$";
}


Expand Down Expand Up @@ -519,7 +519,7 @@ void Flat::NCALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool
ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " << TOP() << " += 1;" << vCS() <<
" = host( \"-\", 1 ) ={";
INLINE_LIST( ret, ilItem->children, targState, inFinish, false );
ret << "}=; " << "goto _again;}$";
ret << "}=; }$";
}


Expand All @@ -546,7 +546,7 @@ void Flat::NRET( ostream &ret, bool inFinish )
ret << "}$";
}

ret << "goto _again;}$";
ret << " }$";
}

void Flat::BREAK( ostream &ret, int targState, bool csForced )
Expand Down
6 changes: 3 additions & 3 deletions src/goto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ void Goto::NCALL( ostream &ret, int callDest, int targState, bool inFinish )

ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " <<
TOP() << " += 1;" << vCS() << " = " <<
callDest << "; " << "goto _again;}$";
callDest << "; }$";
}

void Goto::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish )
Expand Down Expand Up @@ -692,7 +692,7 @@ void Goto::NCALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool
ret << STACK() << "[" << TOP() << "] = " << vCS() << "; " << TOP() << " += 1;" <<
vCS() << " = host( \"-\", 1 ) ={";
INLINE_LIST( ret, ilItem->children, targState, inFinish, false );
ret << "}=; goto _again;}$";
ret << "}=; }$";
}

void Goto::RET( ostream &ret, bool inFinish )
Expand All @@ -718,7 +718,7 @@ void Goto::NRET( ostream &ret, bool inFinish )
ret << "}$";
}

ret << "goto _again;}$";
ret << "}$";
}

void Goto::BREAK( ostream &ret, int targState, bool csForced )
Expand Down
6 changes: 3 additions & 3 deletions src/ipgoto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void IpGoto::NCALL( ostream &ret, int callDest, int targState, bool inFinish )
}

ret << STACK() << "[" << TOP() << "] = " << targState <<
"; " << TOP() << "+= 1; " << "goto st" << callDest << ";}$";
"; " << TOP() << "+= 1; " << vCS() << " = " << callDest << "; }$";
}

void IpGoto::CALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, bool inFinish )
Expand Down Expand Up @@ -135,7 +135,7 @@ void IpGoto::NCALL_EXPR( ostream &ret, GenInlineItem *ilItem, int targState, boo
ret << STACK() << "[" << TOP() << "] = " << targState << "; " << TOP() << "+= 1;" <<
vCS() << " = host( \"-\", 1 ) ={";
INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << "}=; goto _again;}$";
ret << "}=; }$";

if ( prePushExpr != 0 )
ret << "}";
Expand Down Expand Up @@ -164,7 +164,7 @@ void IpGoto::NRET( ostream &ret, bool inFinish )
ret << "}$";
}

ret << "goto _again;}$";
ret << "}$";
}

void IpGoto::NEXT( ostream &ret, int nextDest, bool inFinish )
Expand Down

0 comments on commit 4d936c9

Please sign in to comment.