tizen 2.3.1 release
[external/ragel.git] / ragel / cdftable.cpp
index 2a2184e..cb5a4ff 100644 (file)
@@ -312,7 +312,7 @@ void FTabCodeGen::writeExec()
 
        out << "\n";
 
-       if ( hasEnd ) {
+       if ( !noEnd ) {
                testEofUsed = true;
                out <<
                        "       if ( " << P() << " == " << PE() << " )\n"
@@ -322,7 +322,7 @@ void FTabCodeGen::writeExec()
        if ( redFsm->errState != 0 ) {
                outLabelUsed = true;
                out << 
-                       "       if ( " << CS() << " == " << redFsm->errState->id << " )\n"
+                       "       if ( " << vCS() << " == " << redFsm->errState->id << " )\n"
                        "               goto _out;\n";
        }
 
@@ -330,7 +330,7 @@ void FTabCodeGen::writeExec()
 
        if ( redFsm->anyFromStateActions() ) {
                out <<
-                       "       switch ( " << FSA() << "[" << CS() << "] ) {\n";
+                       "       switch ( " << FSA() << "[" << vCS() << "] ) {\n";
                        FROM_STATE_ACTION_SWITCH();
                        SWITCH_DEFAULT() <<
                        "       }\n"
@@ -351,10 +351,10 @@ void FTabCodeGen::writeExec()
                out << "_eof_trans:\n";
 
        if ( redFsm->anyRegCurStateRef() )
-               out << "        _ps = " << CS() << ";\n";
+               out << "        _ps = " << vCS() << ";\n";
 
        out <<
-               "       " << CS() << " = " << TT() << "[_trans];\n"
+               "       " << vCS() << " = " << TT() << "[_trans];\n"
                "\n";
 
        if ( redFsm->anyRegActions() ) {
@@ -375,7 +375,7 @@ void FTabCodeGen::writeExec()
 
        if ( redFsm->anyToStateActions() ) {
                out <<
-                       "       switch ( " << TSA() << "[" << CS() << "] ) {\n";
+                       "       switch ( " << TSA() << "[" << vCS() << "] ) {\n";
                        TO_STATE_ACTION_SWITCH();
                        SWITCH_DEFAULT() <<
                        "       }\n"
@@ -385,11 +385,11 @@ void FTabCodeGen::writeExec()
        if ( redFsm->errState != 0 ) {
                outLabelUsed = true;
                out << 
-                       "       if ( " << CS() << " == " << redFsm->errState->id << " )\n"
+                       "       if ( " << vCS() << " == " << redFsm->errState->id << " )\n"
                        "               goto _out;\n";
        }
 
-       if ( hasEnd ) {
+       if ( !noEnd ) {
                out << 
                        "       if ( ++" << P() << " != " << PE() << " )\n"
                        "               goto _resume;\n";
@@ -405,20 +405,20 @@ void FTabCodeGen::writeExec()
 
        if ( redFsm->anyEofTrans() || redFsm->anyEofActions() ) {
                out <<
-                       "       if ( " << P() << " == " << EOFV() << " )\n"
+                       "       if ( " << P() << " == " << vEOF() << " )\n"
                        "       {\n";
 
                if ( redFsm->anyEofTrans() ) {
                        out <<
-                               "       if ( " << ET() << "[" << CS() << "] > 0 ) {\n"
-                               "               _trans = " << ET() << "[" << CS() << "] - 1;\n"
+                               "       if ( " << ET() << "[" << vCS() << "] > 0 ) {\n"
+                               "               _trans = " << ET() << "[" << vCS() << "] - 1;\n"
                                "               goto _eof_trans;\n"
                                "       }\n";
                }
 
                if ( redFsm->anyEofActions() ) {
                        out <<
-                               "       switch ( " << EA() << "[" << CS() << "] ) {\n";
+                               "       switch ( " << EA() << "[" << vCS() << "] ) {\n";
                                EOF_ACTION_SWITCH();
                                SWITCH_DEFAULT() <<
                                "       }\n";