/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, true );
+ ACTION( out, item->value, 0, true, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tgoto _again;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, true );
+ ACTION( out, item->value, 0, true, false );
out << "\tbreak;\n";
}
if ( act->numToStateRefs > 0 ) {
/* Write the case label, the action and the case break */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
if ( act->numFromStateRefs > 0 ) {
/* Write the case label, the action and the case break */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
if ( act->numEofRefs > 0 ) {
/* Write the case label, the action and the case break */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, true );
+ ACTION( out, act, 0, true, false );
out << "\tbreak;\n";
}
}
if ( act->numTransRefs > 0 ) {
/* Write the case label, the action and the case break */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
void FlatCodeGen::GOTO_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << "{" << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
}
void FlatCodeGen::NEXT_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << ");";
}
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << CS() << "; " << CS() << " = " <<
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << CS() << "; " << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, targState, inFinish );
+ INLINE_LIST( ret, ilItem->children, targState, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
if ( prePushExpr != 0 )
if ( postPopExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, postPopExpr, 0, false );
+ INLINE_LIST( ret, postPopExpr, 0, false, false );
ret << "}";
}
ret << CTRL_FLOW() << "goto _again;}";
}
-void FlatCodeGen::BREAK( ostream &ret, int targState )
+void FlatCodeGen::BREAK( ostream &ret, int targState, bool csForced )
{
outLabelUsed = true;
ret << "{" << P() << "++; " << CTRL_FLOW() << "goto _out; }";
void CURS( ostream &ret, bool inFinish );
void TARGS( ostream &ret, bool inFinish, int targState );
void RET( ostream &ret, bool inFinish );
- void BREAK( ostream &ret, int targState );
+ void BREAK( ostream &ret, int targState, bool csForced );
virtual std::ostream &TO_STATE_ACTION( RedStateAp *state );
virtual std::ostream &FROM_STATE_ACTION( RedStateAp *state );
{
ostringstream ret;
if ( accessExpr != 0 )
- INLINE_LIST( ret, accessExpr, 0, false );
+ INLINE_LIST( ret, accessExpr, 0, false, false );
return ret.str();
}
ret << "p";
else {
ret << "(";
- INLINE_LIST( ret, pExpr, 0, false );
+ INLINE_LIST( ret, pExpr, 0, false, false );
ret << ")";
}
return ret.str();
ret << "pe";
else {
ret << "(";
- INLINE_LIST( ret, peExpr, 0, false );
+ INLINE_LIST( ret, peExpr, 0, false, false );
ret << ")";
}
return ret.str();
ret << "eof";
else {
ret << "(";
- INLINE_LIST( ret, eofExpr, 0, false );
+ INLINE_LIST( ret, eofExpr, 0, false, false );
ret << ")";
}
return ret.str();
else {
/* Emit the user supplied method of retrieving the key. */
ret << "(";
- INLINE_LIST( ret, csExpr, 0, false );
+ INLINE_LIST( ret, csExpr, 0, false, false );
ret << ")";
}
return ret.str();
ret << ACCESS() + "top";
else {
ret << "(";
- INLINE_LIST( ret, topExpr, 0, false );
+ INLINE_LIST( ret, topExpr, 0, false, false );
ret << ")";
}
return ret.str();
ret << ACCESS() + "stack";
else {
ret << "(";
- INLINE_LIST( ret, stackExpr, 0, false );
+ INLINE_LIST( ret, stackExpr, 0, false, false );
ret << ")";
}
return ret.str();
ret << ACCESS() + "act";
else {
ret << "(";
- INLINE_LIST( ret, actExpr, 0, false );
+ INLINE_LIST( ret, actExpr, 0, false, false );
ret << ")";
}
return ret.str();
ret << ACCESS() + "ts";
else {
ret << "(";
- INLINE_LIST( ret, tokstartExpr, 0, false );
+ INLINE_LIST( ret, tokstartExpr, 0, false, false );
ret << ")";
}
return ret.str();
ret << ACCESS() + "te";
else {
ret << "(";
- INLINE_LIST( ret, tokendExpr, 0, false );
+ INLINE_LIST( ret, tokendExpr, 0, false, false );
ret << ")";
}
return ret.str();
if ( getKeyExpr != 0 ) {
/* Emit the user supplied method of retrieving the key. */
ret << "(";
- INLINE_LIST( ret, getKeyExpr, 0, false );
+ INLINE_LIST( ret, getKeyExpr, 0, false, false );
ret << ")";
}
else {
* code. If the inline list is a single word it will get interpreted as a
* C-style cast by the D compiler. */
ret << "{" << P() << " = ((";
- INLINE_LIST( ret, item->children, targState, inFinish );
+ INLINE_LIST( ret, item->children, targState, inFinish, false );
ret << "))-1;}";
}
/* Write the block and close it off. */
ret << " {";
- INLINE_LIST( ret, lma->children, targState, inFinish );
+ INLINE_LIST( ret, lma->children, targState, inFinish, false );
ret << "}\n";
ret << " break;\n";
if ( item->children->length() > 0 ) {
/* Write the block and close it off. */
ret << "{";
- INLINE_LIST( ret, item->children, targState, inFinish );
+ INLINE_LIST( ret, item->children, targState, inFinish, false );
ret << "}";
}
}
/* Write out an inline tree structure. Walks the list and possibly calls out
* to virtual functions than handle language specific items in the tree. */
void FsmCodeGen::INLINE_LIST( ostream &ret, InlineList *inlineList,
- int targState, bool inFinish )
+ int targState, bool inFinish, bool csForced )
{
for ( InlineList::Iter item = *inlineList; item.lte(); item++ ) {
switch ( item->type ) {
SUB_ACTION( ret, item, targState, inFinish );
break;
case InlineItem::Break:
- BREAK( ret, targState );
+ BREAK( ret, targState, csForced );
break;
}
}
return ret.str();
}
-void FsmCodeGen::ACTION( ostream &ret, Action *action, int targState, bool inFinish )
+void FsmCodeGen::ACTION( ostream &ret, Action *action, int targState,
+ bool inFinish, bool csForced )
{
/* Write the preprocessor line info for going into the source file. */
lineDirective( ret, sourceFileName, action->loc.line );
/* Write the block and close it off. */
ret << "\t{";
- INLINE_LIST( ret, action->inlineList, targState, inFinish );
+ INLINE_LIST( ret, action->inlineList, targState, inFinish, csForced );
ret << "}\n";
}
{
ret << "\n";
lineDirective( ret, sourceFileName, condition->loc.line );
- INLINE_LIST( ret, condition->inlineList, 0, false );
+ INLINE_LIST( ret, condition->inlineList, 0, false, false );
}
string FsmCodeGen::ERROR_STATE()
string TABS( int level );
string KEY( Key key );
string LDIR_PATH( char *path );
- void ACTION( ostream &ret, Action *action, int targState, bool inFinish );
+ void ACTION( ostream &ret, Action *action, int targState,
+ bool inFinish, bool csForced );
void CONDITION( ostream &ret, Action *condition );
string ALPH_TYPE();
string WIDE_ALPH_TYPE();
string FIRST_FINAL() { return DATA_PREFIX() + "first_final"; }
string CTXDATA() { return DATA_PREFIX() + "ctxdata"; }
- void INLINE_LIST( ostream &ret, InlineList *inlineList, int targState, bool inFinish );
+ void INLINE_LIST( ostream &ret, InlineList *inlineList,
+ int targState, bool inFinish, bool csForced );
virtual void GOTO( ostream &ret, int gotoDest, bool inFinish ) = 0;
virtual void CALL( ostream &ret, int callDest, int targState, bool inFinish ) = 0;
virtual void NEXT( ostream &ret, int nextDest, bool inFinish ) = 0;
virtual void CALL_EXPR( ostream &ret, InlineItem *ilItem,
int targState, bool inFinish ) = 0;
virtual void RET( ostream &ret, bool inFinish ) = 0;
- virtual void BREAK( ostream &ret, int targState ) = 0;
+ virtual void BREAK( ostream &ret, int targState, bool csForced ) = 0;
virtual void CURS( ostream &ret, bool inFinish ) = 0;
virtual void TARGS( ostream &ret, bool inFinish, int targState ) = 0;
void EXEC( ostream &ret, InlineItem *item, int targState, int inFinish );
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, true );
+ ACTION( out, item->value, 0, true, false );
out << "\tbreak;\n";
}
/* Write each action in the list of action items. */
for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
- ACTION( out, item->value, 0, false );
+ ACTION( out, item->value, 0, false, false );
out << "\tbreak;\n";
}
if ( act->numToStateRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
if ( act->numFromStateRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
if ( act->numEofRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, true );
+ ACTION( out, act, 0, true, false );
out << "\tbreak;\n";
}
}
if ( act->numTransRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
void GotoCodeGen::GOTO_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << "{" << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
}
void GotoCodeGen::NEXT_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << ");";
}
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << CS() << "; " << CS() << " = " <<
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << CS() << "; " << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, targState, inFinish );
+ INLINE_LIST( ret, ilItem->children, targState, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
if ( prePushExpr != 0 )
if ( postPopExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, postPopExpr, 0, false );
+ INLINE_LIST( ret, postPopExpr, 0, false, false );
ret << "}";
}
ret << CTRL_FLOW() << "goto _again;}";
}
-void GotoCodeGen::BREAK( ostream &ret, int targState )
+void GotoCodeGen::BREAK( ostream &ret, int targState, bool csForced )
{
outLabelUsed = true;
ret << "{" << P() << "++; " << CTRL_FLOW() << "goto _out; }";
void CURS( ostream &ret, bool inFinish );
void TARGS( ostream &ret, bool inFinish, int targState );
void RET( ostream &ret, bool inFinish );
- void BREAK( ostream &ret, int targState );
+ void BREAK( ostream &ret, int targState, bool csForced );
virtual unsigned int TO_STATE_ACTION( RedStateAp *state );
virtual unsigned int FROM_STATE_ACTION( RedStateAp *state );
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << targState <<
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << targState << "; " << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
if ( prePushExpr != 0 )
if ( postPopExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, postPopExpr, 0, false );
+ INLINE_LIST( ret, postPopExpr, 0, false, false );
ret << "}";
}
void IpGotoCodeGen::GOTO_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << "{" << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
}
void IpGotoCodeGen::NEXT_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << ");";
}
ret << targState;
}
-void IpGotoCodeGen::BREAK( ostream &ret, int targState )
+void IpGotoCodeGen::BREAK( ostream &ret, int targState, bool csForced )
{
outLabelUsed = true;
- ret << "{" << P() << "++; " << CS() << " = " << targState <<
- "; " << CTRL_FLOW() << "goto _out;}";
+ ret << "{" << P() << "++; ";
+ if ( !csForced )
+ ret << CS() << " = " << targState << "; ";
+ ret << CTRL_FLOW() << "goto _out;}";
}
bool IpGotoCodeGen::IN_TRANS_ACTIONS( RedStateAp *state )
out << " " << CS() << " = " << trans->targ->id << ";\n";
/* Write each action in the list. */
- for ( ActionTable::Iter item = trans->action->key; item.lte(); item++ )
- ACTION( out, item->value, trans->targ->id, false );
+ for ( ActionTable::Iter item = trans->action->key; item.lte(); item++ ) {
+ ACTION( out, item->value, trans->targ->id, false,
+ trans->action->anyNextStmt() );
+ }
/* If the action contains a next then we need to reload, otherwise
* jump directly to the target state. */
if ( state->toStateAction != 0 ) {
/* Remember that we wrote an action. Write every action in the list. */
anyWritten = true;
- for ( ActionTable::Iter item = state->toStateAction->key; item.lte(); item++ )
- ACTION( out, item->value, state->id, false );
+ for ( ActionTable::Iter item = state->toStateAction->key; item.lte(); item++ ) {
+ ACTION( out, item->value, state->id, false,
+ state->toStateAction->anyNextStmt() );
+ }
}
/* Advance and test buffer pos. */
if ( state->fromStateAction != 0 ) {
/* Remember that we wrote an action. Write every action in the list. */
anyWritten = true;
- for ( ActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ )
- ACTION( out, item->value, state->id, false );
+ for ( ActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ ) {
+ ACTION( out, item->value, state->id, false,
+ state->fromStateAction->anyNextStmt() );
+ }
}
if ( anyWritten )
/* Write each action in the eof action list. */
for ( ActionTable::Iter item = act->key; item.lte(); item++ )
- ACTION( out, item->value, STATE_ERR_STATE, true );
+ ACTION( out, item->value, STATE_ERR_STATE, true, false );
out << "\tbreak;\n";
}
}
void RET( ostream &ret, bool inFinish );
void CURS( ostream &ret, bool inFinish );
void TARGS( ostream &ret, bool inFinish, int targState );
- void BREAK( ostream &ret, int targState );
+ void BREAK( ostream &ret, int targState, bool csForced );
virtual void writeData();
virtual void writeExec();
if ( state->toStateAction != 0 ) {
/* Remember that we wrote an action. Write every action in the list. */
anyWritten = true;
- for ( ActionTable::Iter item = state->toStateAction->key; item.lte(); item++ )
- ACTION( out, item->value, state->id, false );
+ for ( ActionTable::Iter item = state->toStateAction->key; item.lte(); item++ ) {
+ ACTION( out, item->value, state->id, false,
+ state->toStateAction->anyNextStmt() );
+ }
}
/* Advance and test buffer pos. */
if ( state->fromStateAction != 0 ) {
/* Remember that we wrote an action. Write every action in the list. */
anyWritten = true;
- for ( ActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ )
- ACTION( out, item->value, state->id, false );
+ for ( ActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ ) {
+ ACTION( out, item->value, state->id, false,
+ state->fromStateAction->anyNextStmt() );
+ }
}
if ( anyWritten )
out << " " << CS() << " = " << trans->targ->id << ";\n";
/* Write each action in the list. */
- for ( ActionTable::Iter item = trans->action->key; item.lte(); item++ )
- ACTION( out, item->value, trans->targ->id, false );
+ for ( ActionTable::Iter item = trans->action->key; item.lte(); item++ ) {
+ ACTION( out, item->value, trans->targ->id, false,
+ trans->action->anyNextStmt() );
+ }
}
out <<
if ( st->toStateAction != 0 ) {
/* Remember that we wrote an action. Write every action in the list. */
- for ( ActionTable::Iter item = st->toStateAction->key; item.lte(); item++ )
- ACTION( out, item->value, st->id, false );
+ for ( ActionTable::Iter item = st->toStateAction->key; item.lte(); item++ ) {
+ ACTION( out, item->value, st->id, false,
+ st->toStateAction->anyNextStmt() );
+ }
genLineDirective( out );
}
if ( act->numToStateRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
if ( act->numFromStateRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
if ( act->numEofRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, true );
+ ACTION( out, act, 0, true, false );
out << "\tbreak;\n";
}
}
if ( act->numTransRefs > 0 ) {
/* Write the case label, the action and the case break. */
out << "\tcase " << act->actionId << ":\n";
- ACTION( out, act, 0, false );
+ ACTION( out, act, 0, false, false );
out << "\tbreak;\n";
}
}
void TabCodeGen::GOTO_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << "{" << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
}
void TabCodeGen::NEXT_EXPR( ostream &ret, InlineItem *ilItem, bool inFinish )
{
ret << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, 0, inFinish );
+ INLINE_LIST( ret, ilItem->children, 0, inFinish, false );
ret << ");";
}
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << CS() << "; " << CS() << " = " <<
{
if ( prePushExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, prePushExpr, 0, false );
+ INLINE_LIST( ret, prePushExpr, 0, false, false );
}
ret << "{" << STACK() << "[" << TOP() << "++] = " << CS() << "; " << CS() << " = (";
- INLINE_LIST( ret, ilItem->children, targState, inFinish );
+ INLINE_LIST( ret, ilItem->children, targState, inFinish, false );
ret << "); " << CTRL_FLOW() << "goto _again;}";
if ( prePushExpr != 0 )
if ( postPopExpr != 0 ) {
ret << "{";
- INLINE_LIST( ret, postPopExpr, 0, false );
+ INLINE_LIST( ret, postPopExpr, 0, false, false );
ret << "}";
}
ret << CTRL_FLOW() << "goto _again;}";
}
-void TabCodeGen::BREAK( ostream &ret, int targState )
+void TabCodeGen::BREAK( ostream &ret, int targState, bool csForced )
{
outLabelUsed = true;
ret << "{" << P() << "++; " << CTRL_FLOW() << "goto _out; }";
void CURS( ostream &ret, bool inFinish );
void TARGS( ostream &ret, bool inFinish, int targState );
void RET( ostream &ret, bool inFinish );
- void BREAK( ostream &ret, int targState );
+ void BREAK( ostream &ret, int targState, bool csForced );
virtual std::ostream &TO_STATE_ACTION( RedStateAp *state );
virtual std::ostream &FROM_STATE_ACTION( RedStateAp *state );
void CSharpIpGotoCodeGen::BREAK( ostream &ret, int targState )
{
+ /* FIXME: If this code generator is made active then BREAK generation
+ * needs to check csForced. */
outLabelUsed = true;
ret << "{" << P() << "++; " << CS() << " = " << targState <<
"; " << CTRL_FLOW() << "goto _out;}";