X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=ragel%2Fcssplit.cpp;h=8c7464f09ee0d8cc24ee5b826f0abc5f0d3ad950;hb=refs%2Fheads%2Ftizen_2.4;hp=d7bf9caf5609388959ac72c82e64e535929c13c4;hpb=36359bd16b6a6f75872923f2497fd01fc722b11d;p=external%2Fragel.git diff --git a/ragel/cssplit.cpp b/ragel/cssplit.cpp index d7bf9ca..8c7464f 100644 --- a/ragel/cssplit.cpp +++ b/ragel/cssplit.cpp @@ -74,7 +74,7 @@ void CSharpSplitCodeGen::GOTO_HEADER( RedStateAp *state, bool stateInPartition ) /* Advance and test buffer pos. */ if ( state->labelNeeded ) { - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " == " << PE() << " )\n" " goto _out" << state->id << ";\n"; @@ -151,7 +151,7 @@ std::ostream &CSharpSplitCodeGen::PART_TRANS( int partition ) /* If the action contains a next, then we must preload the current * state since the action may or may not set it. */ if ( trans->action->anyNextStmt() ) - out << " " << CS() << " = " << trans->targ->id << ";\n"; + out << " " << vCS() << " = " << trans->targ->id << ";\n"; /* Write each action in the list. */ for ( GenActionTable::Iter item = trans->action->key; item.lte(); item++ ) @@ -168,7 +168,7 @@ std::ostream &CSharpSplitCodeGen::PART_TRANS( int partition ) if ( st->partitionBoundary ) { out << " pst" << st->id << ":\n" - " " << CS() << " = " << st->id << ";\n"; + " " << vCS() << " = " << st->id << ";\n"; if ( st->toStateAction != 0 ) { /* Remember that we wrote an action. Write every action in the list. */ @@ -189,7 +189,7 @@ std::ostream &CSharpSplitCodeGen::EXIT_STATES( int partition ) for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { if ( st->partition == partition && st->outNeeded ) { outLabelUsed = true; - out << " _out" << st->id << ": " << CS() << " = " << + out << " _out" << st->id << ": " << vCS() << " = " << st->id << "; goto _out; \n"; } } @@ -222,14 +222,14 @@ std::ostream &CSharpSplitCodeGen::PARTITION( int partition ) " goto _resume;\n" "\n" "_again:\n" - " switch ( " << CS() << " ) {\n"; + " switch ( " << vCS() << " ) {\n"; AGAIN_CASES() << " default: break;\n" " }\n" "\n"; - if ( hasEnd ) { + if ( !noEnd ) { outLabelUsed = true; out << " if ( ++" << P() << " == " << PE() << " )\n" @@ -246,7 +246,7 @@ std::ostream &CSharpSplitCodeGen::PARTITION( int partition ) } out << - " switch ( " << CS() << " )\n {\n"; + " switch ( " << vCS() << " )\n {\n"; STATE_GOTOS( partition ); SWITCH_DEFAULT() << " }\n"; @@ -301,13 +301,13 @@ void CSharpSplitCodeGen::writeData() "const int " << START() << " = " << START_STATE_ID() << ";\n" "\n"; - if ( writeFirstFinal ) { + if ( !noFinal ) { out << "const int " << FIRST_FINAL() << " = " << FIRST_FINAL_STATE() << ";\n" "\n"; } - if ( writeErr ) { + if ( !noError ) { out << "const int " << ERROR() << " = " << ERROR_STATE() << ";\n" "\n"; @@ -380,7 +380,7 @@ void CSharpSplitCodeGen::writeExec() " {\n" " int _stat = 0;\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( " << P() << " == " << PE() << " )\n" " goto _out;\n"; @@ -392,7 +392,7 @@ void CSharpSplitCodeGen::writeExec() * partition-switch exit from the last partition. */ out << "_reenter:\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " == " << PE() << " )\n" " goto _out;\n"; @@ -405,7 +405,7 @@ void CSharpSplitCodeGen::writeExec() out << "_resume:\n"; out << - " switch ( " << PM() << "[" << CS() << "] ) {\n"; + " switch ( " << PM() << "[" << vCS() << "] ) {\n"; for ( int p = 0; p < redFsm->nParts; p++ ) { out << " case " << p << ":\n" @@ -417,7 +417,7 @@ void CSharpSplitCodeGen::writeExec() " if ( _stat )\n" " goto _reenter;\n"; - if ( hasEnd ) + if ( !noEnd ) out << " _out: {}\n"; out << @@ -499,7 +499,7 @@ void CSharpSplitCodeGen::setLabelsNeeded() } } - if ( hasEnd ) { + if ( !noEnd ) { for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) st->outNeeded = st->labelNeeded; }