From 337d7d6d83c3c33a20c66d6f79744eb220c5979f Mon Sep 17 00:00:00 2001 From: thurston Date: Sun, 4 Jan 2009 20:39:52 +0000 Subject: [PATCH] Changed the names of the variables that represent the no* options. git-svn-id: http://svn.complang.org/ragel/trunk@659 052ea7fc-9027-0410-9066-f65837a77df0 --- ragel/cdcodegen.cpp | 8 ++++---- ragel/cdfflat.cpp | 4 ++-- ragel/cdfgoto.cpp | 4 ++-- ragel/cdflat.cpp | 4 ++-- ragel/cdftable.cpp | 4 ++-- ragel/cdgoto.cpp | 4 ++-- ragel/cdipgoto.cpp | 8 ++++---- ragel/cdsplit.cpp | 16 ++++++++-------- ragel/cdtable.cpp | 4 ++-- ragel/cscodegen.cpp | 8 ++++---- ragel/csfflat.cpp | 4 ++-- ragel/csfgoto.cpp | 4 ++-- ragel/csflat.cpp | 4 ++-- ragel/csftable.cpp | 4 ++-- ragel/csgoto.cpp | 4 ++-- ragel/csipgoto.cpp | 8 ++++---- ragel/cssplit.cpp | 16 ++++++++-------- ragel/cstable.cpp | 4 ++-- ragel/gendata.cpp | 20 ++++++++++---------- ragel/gendata.h | 10 +++++----- ragel/javacodegen.cpp | 12 ++++++------ ragel/rbxgoto.cpp | 4 ++-- ragel/rubycodegen.cpp | 10 +++++----- ragel/rubyfflat.cpp | 4 ++-- ragel/rubyflat.cpp | 4 ++-- ragel/rubyftable.cpp | 4 ++-- ragel/rubytable.cpp | 4 ++-- 27 files changed, 92 insertions(+), 92 deletions(-) diff --git a/ragel/cdcodegen.cpp b/ragel/cdcodegen.cpp index ec2ddb0..0a98469 100644 --- a/ragel/cdcodegen.cpp +++ b/ragel/cdcodegen.cpp @@ -700,7 +700,7 @@ void FsmCodeGen::writeInit() { out << " {\n"; - if ( writeCS ) + if ( !noCS ) out << "\t" << CS() << " = " << START() << ";\n"; /* If there are any calls, then the stack top needs initialization. */ @@ -718,7 +718,7 @@ void FsmCodeGen::writeInit() string FsmCodeGen::DATA_PREFIX() { - if ( dataPrefix ) + if ( !noPrefix ) return FSM_NAME() + "_"; return ""; } @@ -759,10 +759,10 @@ void FsmCodeGen::STATE_IDS() if ( redFsm->startState != 0 ) STATIC_VAR( "int", START() ) << " = " << START_STATE_ID() << ";\n"; - if ( writeFirstFinal ) + if ( !noFinal ) STATIC_VAR( "int" , FIRST_FINAL() ) << " = " << FIRST_FINAL_STATE() << ";\n"; - if ( writeErr ) + if ( !noError ) STATIC_VAR( "int", ERROR() ) << " = " << ERROR_STATE() << ";\n"; out << "\n"; diff --git a/ragel/cdfflat.cpp b/ragel/cdfflat.cpp index 46b3c1f..1617c2d 100644 --- a/ragel/cdfflat.cpp +++ b/ragel/cdfflat.cpp @@ -266,7 +266,7 @@ void FFlatCodeGen::writeExec() " " << WIDE_ALPH_TYPE() << " _widec;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -337,7 +337,7 @@ void FFlatCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/cdfgoto.cpp b/ragel/cdfgoto.cpp index c708280..7474533 100644 --- a/ragel/cdfgoto.cpp +++ b/ragel/cdfgoto.cpp @@ -189,7 +189,7 @@ void FGotoCodeGen::writeExec() if ( redFsm->anyConditions() ) out << " " << WIDE_ALPH_TYPE() << " _widec;\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -244,7 +244,7 @@ void FGotoCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/cdflat.cpp b/ragel/cdflat.cpp index ee8f19c..f171277 100644 --- a/ragel/cdflat.cpp +++ b/ragel/cdflat.cpp @@ -714,7 +714,7 @@ void FlatCodeGen::writeExec() out << "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -798,7 +798,7 @@ void FlatCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/cdftable.cpp b/ragel/cdftable.cpp index 2a2184e..f21c781 100644 --- a/ragel/cdftable.cpp +++ b/ragel/cdftable.cpp @@ -312,7 +312,7 @@ void FTabCodeGen::writeExec() out << "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -389,7 +389,7 @@ void FTabCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/cdgoto.cpp b/ragel/cdgoto.cpp index 9404bd0..a54ae0f 100644 --- a/ragel/cdgoto.cpp +++ b/ragel/cdgoto.cpp @@ -680,7 +680,7 @@ void GotoCodeGen::writeExec() out << "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -743,7 +743,7 @@ void GotoCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/cdipgoto.cpp b/ragel/cdipgoto.cpp index 35a1755..d44c240 100644 --- a/ragel/cdipgoto.cpp +++ b/ragel/cdipgoto.cpp @@ -177,7 +177,7 @@ void IpGotoCodeGen::GOTO_HEADER( RedStateAp *state ) /* Advance and test buffer pos. */ if ( state->labelNeeded ) { - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " == " << PE() << " )\n" " goto _test_eof" << state->id << ";\n"; @@ -352,7 +352,7 @@ void IpGotoCodeGen::setLabelsNeeded() } } - if ( hasEnd ) { + if ( !noEnd ) { for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { if ( st != redFsm->errState ) st->outNeeded = st->labelNeeded; @@ -381,7 +381,7 @@ void IpGotoCodeGen::writeExec() if ( redFsm->anyConditions() ) out << " " << WIDE_ALPH_TYPE() << " _widec;\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -399,7 +399,7 @@ void IpGotoCodeGen::writeExec() " }\n" "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( ++" << P() << " == " << PE() << " )\n" diff --git a/ragel/cdsplit.cpp b/ragel/cdsplit.cpp index 90e917b..443e761 100644 --- a/ragel/cdsplit.cpp +++ b/ragel/cdsplit.cpp @@ -76,7 +76,7 @@ void SplitCodeGen::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"; @@ -237,7 +237,7 @@ std::ostream &SplitCodeGen::PARTITION( int partition ) "\n"; - if ( hasEnd ) { + if ( !noEnd ) { outLabelUsed = true; out << " if ( ++" << P() << " == " << PE() << " )\n" @@ -309,13 +309,13 @@ void SplitCodeGen::writeData() "static const int " << START() << " = " << START_STATE_ID() << ";\n" "\n"; - if ( writeFirstFinal ) { + if ( !noFinal ) { out << "static const int " << FIRST_FINAL() << " = " << FIRST_FINAL_STATE() << ";\n" "\n"; } - if ( writeErr ) { + if ( !noError ) { out << "static const int " << ERROR() << " = " << ERROR_STATE() << ";\n" "\n"; @@ -388,7 +388,7 @@ void SplitCodeGen::writeExec() " {\n" " int _stat = 0;\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( " << P() << " == " << PE() << " )\n" " goto _out;\n"; @@ -400,7 +400,7 @@ void SplitCodeGen::writeExec() * partition-switch exit from the last partition. */ out << "_reenter:\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " == " << PE() << " )\n" " goto _out;\n"; @@ -425,7 +425,7 @@ void SplitCodeGen::writeExec() " if ( _stat )\n" " goto _reenter;\n"; - if ( hasEnd ) + if ( !noEnd ) out << " _out: {}\n"; out << @@ -507,7 +507,7 @@ void SplitCodeGen::setLabelsNeeded() } } - if ( hasEnd ) { + if ( !noEnd ) { for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) st->outNeeded = st->labelNeeded; } diff --git a/ragel/cdtable.cpp b/ragel/cdtable.cpp index b9d5361..4b455bc 100644 --- a/ragel/cdtable.cpp +++ b/ragel/cdtable.cpp @@ -954,7 +954,7 @@ void TabCodeGen::writeExec() " " << PTR_CONST() << WIDE_ALPH_TYPE() << POINTER() << "_keys;\n" "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -1043,7 +1043,7 @@ void TabCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/cscodegen.cpp b/ragel/cscodegen.cpp index e18969e..69c20bf 100644 --- a/ragel/cscodegen.cpp +++ b/ragel/cscodegen.cpp @@ -659,7 +659,7 @@ void CSharpFsmCodeGen::writeInit() { out << " {\n"; - if ( writeCS ) + if ( !noCS ) out << "\t" << CS() << " = " << START() << ";\n"; /* If there are any calls, then the stack top needs initialization. */ @@ -677,7 +677,7 @@ void CSharpFsmCodeGen::writeInit() string CSharpFsmCodeGen::DATA_PREFIX() { - if ( dataPrefix ) + if ( !noPrefix ) return FSM_NAME() + "_"; return ""; } @@ -718,10 +718,10 @@ void CSharpFsmCodeGen::STATE_IDS() if ( redFsm->startState != 0 ) STATIC_VAR( "int", START() ) << " = " << START_STATE_ID() << ";\n"; - if ( writeFirstFinal ) + if ( !noFinal ) STATIC_VAR( "int" , FIRST_FINAL() ) << " = " << FIRST_FINAL_STATE() << ";\n"; - if ( writeErr ) + if ( !noError ) STATIC_VAR( "int", ERROR() ) << " = " << ERROR_STATE() << ";\n"; out << "\n"; diff --git a/ragel/csfflat.cpp b/ragel/csfflat.cpp index f3dc864..0b9778a 100644 --- a/ragel/csfflat.cpp +++ b/ragel/csfflat.cpp @@ -270,7 +270,7 @@ void CSharpFFlatCodeGen::writeExec() " " << WIDE_ALPH_TYPE() << " _widec;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -341,7 +341,7 @@ void CSharpFFlatCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/csfgoto.cpp b/ragel/csfgoto.cpp index 3c19d44..0f9cee6 100644 --- a/ragel/csfgoto.cpp +++ b/ragel/csfgoto.cpp @@ -189,7 +189,7 @@ void CSharpFGotoCodeGen::writeExec() if ( redFsm->anyConditions() ) out << " " << WIDE_ALPH_TYPE() << " _widec;\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -244,7 +244,7 @@ void CSharpFGotoCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/csflat.cpp b/ragel/csflat.cpp index 65f5871..dc64cdd 100644 --- a/ragel/csflat.cpp +++ b/ragel/csflat.cpp @@ -735,7 +735,7 @@ void CSharpFlatCodeGen::writeExec() out << "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -819,7 +819,7 @@ void CSharpFlatCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/csftable.cpp b/ragel/csftable.cpp index 9d1a1fb..32dc19d 100644 --- a/ragel/csftable.cpp +++ b/ragel/csftable.cpp @@ -313,7 +313,7 @@ void CSharpFTabCodeGen::writeExec() out << "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -390,7 +390,7 @@ void CSharpFTabCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/csgoto.cpp b/ragel/csgoto.cpp index 70393f3..9f695db 100644 --- a/ragel/csgoto.cpp +++ b/ragel/csgoto.cpp @@ -680,7 +680,7 @@ void CSharpGotoCodeGen::writeExec() out << "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -743,7 +743,7 @@ void CSharpGotoCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/csipgoto.cpp b/ragel/csipgoto.cpp index d2bae23..26d3cd4 100644 --- a/ragel/csipgoto.cpp +++ b/ragel/csipgoto.cpp @@ -173,7 +173,7 @@ void CSharpIpGotoCodeGen::GOTO_HEADER( RedStateAp *state ) /* Advance and test buffer pos. */ if ( state->labelNeeded ) { - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " == " << PE() << " )\n" " goto _test_eof" << state->id << ";\n"; @@ -346,7 +346,7 @@ void CSharpIpGotoCodeGen::setLabelsNeeded() } } - if ( hasEnd ) { + if ( !noEnd ) { for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { if ( st != redFsm->errState ) st->outNeeded = st->labelNeeded; @@ -375,7 +375,7 @@ void CSharpIpGotoCodeGen::writeExec() if ( redFsm->anyConditions() ) out << " " << WIDE_ALPH_TYPE() << " _widec;\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -393,7 +393,7 @@ void CSharpIpGotoCodeGen::writeExec() " }\n" "\n"; - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( ++" << P() << " == " << PE() << " )\n" diff --git a/ragel/cssplit.cpp b/ragel/cssplit.cpp index d7bf9ca..c485b95 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"; @@ -229,7 +229,7 @@ std::ostream &CSharpSplitCodeGen::PARTITION( int partition ) "\n"; - if ( hasEnd ) { + if ( !noEnd ) { outLabelUsed = true; out << " if ( ++" << P() << " == " << PE() << " )\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"; @@ -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; } diff --git a/ragel/cstable.cpp b/ragel/cstable.cpp index d7dac7d..1193be3 100644 --- a/ragel/cstable.cpp +++ b/ragel/cstable.cpp @@ -958,7 +958,7 @@ void CSharpTabCodeGen::writeExec() "\n"; // " " << PTR_CONST() << WIDE_ALPH_TYPE() << POINTER() << "_keys;\n" - if ( hasEnd ) { + if ( !noEnd ) { testEofUsed = true; out << " if ( " << P() << " == " << PE() << " )\n" @@ -1047,7 +1047,7 @@ void CSharpTabCodeGen::writeExec() " goto _out;\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " )\n" " goto _resume;\n"; diff --git a/ragel/gendata.cpp b/ragel/gendata.cpp index cb6b62c..3cf1a35 100644 --- a/ragel/gendata.cpp +++ b/ragel/gendata.cpp @@ -101,11 +101,11 @@ CodeGenData::CodeGenData( ostream &out ) dataExpr(0), wantComplete(0), hasLongestMatch(false), - hasEnd(true), - dataPrefix(true), - writeFirstFinal(true), - writeErr(true), - writeCS(true) + noEnd(false), + noPrefix(false), + noFinal(false), + noError(false), + noCS(false) {} @@ -723,11 +723,11 @@ void CodeGenData::writeStatement( InputLoc &loc, int nargs, char **args ) if ( strcmp( args[0], "data" ) == 0 ) { for ( int i = 1; i < nargs; i++ ) { if ( strcmp( args[i], "noerror" ) == 0 ) - writeErr = false; + noError = true; else if ( strcmp( args[i], "noprefix" ) == 0 ) - dataPrefix = false; + noPrefix = true; else if ( strcmp( args[i], "nofinal" ) == 0 ) - writeFirstFinal = false; + noFinal = true; else { source_warning(loc) << "unrecognized write option \"" << args[i] << "\"" << endl; @@ -738,7 +738,7 @@ void CodeGenData::writeStatement( InputLoc &loc, int nargs, char **args ) else if ( strcmp( args[0], "init" ) == 0 ) { for ( int i = 1; i < nargs; i++ ) { if ( strcmp( args[i], "nocs" ) == 0 ) - writeCS = false; + noCS = true; else { source_warning(loc) << "unrecognized write option \"" << args[i] << "\"" << endl; @@ -749,7 +749,7 @@ void CodeGenData::writeStatement( InputLoc &loc, int nargs, char **args ) else if ( strcmp( args[0], "exec" ) == 0 ) { for ( int i = 1; i < nargs; i++ ) { if ( strcmp( args[i], "noend" ) == 0 ) - hasEnd = false; + noEnd = true; else { source_warning(loc) << "unrecognized write option \"" << args[i] << "\"" << endl; diff --git a/ragel/gendata.h b/ragel/gendata.h index ada3eb5..0439722 100644 --- a/ragel/gendata.h +++ b/ragel/gendata.h @@ -141,11 +141,11 @@ struct CodeGenData ExportList exportList; /* Write options. */ - bool hasEnd; - bool dataPrefix; - bool writeFirstFinal; - bool writeErr; - bool writeCS; + bool noEnd; + bool noPrefix; + bool noFinal; + bool noError; + bool noCS; void createMachine(); void initActionList( unsigned long length ); diff --git a/ragel/javacodegen.cpp b/ragel/javacodegen.cpp index edafdb3..1c3b09c 100644 --- a/ragel/javacodegen.cpp +++ b/ragel/javacodegen.cpp @@ -299,7 +299,7 @@ void JavaTabCodeGen::INLINE_LIST( ostream &ret, GenInlineList *inlineList, string JavaTabCodeGen::DATA_PREFIX() { - if ( dataPrefix ) + if ( !noPrefix ) return FSM_NAME() + "_"; return ""; } @@ -1016,10 +1016,10 @@ void JavaTabCodeGen::writeData() if ( redFsm->startState != 0 ) STATIC_VAR( "int", START() ) << " = " << START_STATE_ID() << ";\n"; - if ( writeFirstFinal ) + if ( !noFinal ) STATIC_VAR( "int" , FIRST_FINAL() ) << " = " << FIRST_FINAL_STATE() << ";\n"; - if ( writeErr ) + if ( !noError ) STATIC_VAR( "int", ERROR() ) << " = " << ERROR_STATE() << ";\n"; out << "\n"; @@ -1067,7 +1067,7 @@ void JavaTabCodeGen::writeExec() " switch ( _goto_targ ) {\n" " case 0:\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( " << P() << " == " << PE() << " ) {\n" " _goto_targ = " << _test_eof << ";\n" @@ -1152,7 +1152,7 @@ void JavaTabCodeGen::writeExec() " }\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " if ( ++" << P() << " != " << PE() << " ) {\n" " _goto_targ = " << _resume << ";\n" @@ -1666,7 +1666,7 @@ void JavaTabCodeGen::writeInit() { out << " {\n"; - if ( writeCS ) + if ( !noCS ) out << "\t" << CS() << " = " << START() << ";\n"; /* If there are any calls, then the stack top needs initialization. */ diff --git a/ragel/rbxgoto.cpp b/ragel/rbxgoto.cpp index 96a571d..dc9c6f8 100644 --- a/ragel/rbxgoto.cpp +++ b/ragel/rbxgoto.cpp @@ -717,7 +717,7 @@ void RbxGotoCodeGen::writeExec() out << "\n"; - if ( hasEnd ) { + if ( !noEnd ) { outLabelUsed = true; out << " if ( " << P() << " == " << PE() << " )\n"; @@ -785,7 +785,7 @@ void RbxGotoCodeGen::writeExec() " end" << "\n"; } - if ( hasEnd ) { + if ( !noEnd ) { out << " " << P() << " += 1\n" " if ( " << P() << " != " << PE() << " )\n"; rbxGoto(out << " ", "_resume") << "\n" << diff --git a/ragel/rubycodegen.cpp b/ragel/rubycodegen.cpp index ba189be..6842fe6 100644 --- a/ragel/rubycodegen.cpp +++ b/ragel/rubycodegen.cpp @@ -181,7 +181,7 @@ void RubyCodeGen::genLineDirective( ostream &out ) string RubyCodeGen::DATA_PREFIX() { - if ( dataPrefix ) + if ( !noPrefix ) return FSM_NAME() + "_"; return ""; } @@ -513,10 +513,10 @@ void RubyCodeGen::STATE_IDS() if ( redFsm->startState != 0 ) STATIC_VAR( "int", START() ) << " = " << START_STATE_ID() << ";\n"; - if ( writeFirstFinal ) + if ( !noFinal ) STATIC_VAR( "int" , FIRST_FINAL() ) << " = " << FIRST_FINAL_STATE() << ";\n"; - if ( writeErr ) + if ( !noError ) STATIC_VAR( "int", ERROR() ) << " = " << ERROR_STATE() << ";\n"; out << "\n"; @@ -867,10 +867,10 @@ void RubyCodeGen::writeInit() out << " " << P() << " ||= 0\n"; - if ( hasEnd ) + if ( !noEnd ) out << " " << PE() << " ||= " << DATA() << ".length\n"; - if ( writeCS ) + if ( !noCS ) out << " " << CS() << " = " << START() << "\n"; /* If there are any calls, then the stack top needs initialization. */ diff --git a/ragel/rubyfflat.cpp b/ragel/rubyfflat.cpp index 2d9f0a7..a206eec 100644 --- a/ragel/rubyfflat.cpp +++ b/ragel/rubyfflat.cpp @@ -347,7 +347,7 @@ void RubyFFlatCodeGen::writeExec() " while true\n" " if _goto_level <= 0\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " == " << PE() << "\n" " _goto_level = _test_eof\n" @@ -424,7 +424,7 @@ void RubyFFlatCodeGen::writeExec() out << " " << P() << " += 1\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " != " << PE() << "\n" " _goto_level = _resume\n" diff --git a/ragel/rubyflat.cpp b/ragel/rubyflat.cpp index ddbf394..4688fcc 100644 --- a/ragel/rubyflat.cpp +++ b/ragel/rubyflat.cpp @@ -685,7 +685,7 @@ void RubyFlatCodeGen::writeExec() " _trigger_goto = false\n" " if _goto_level <= 0\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " == " << PE() << "\n" " _goto_level = _test_eof\n" @@ -792,7 +792,7 @@ void RubyFlatCodeGen::writeExec() out << " " << P() << " += 1\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " != " << PE() << "\n" " _goto_level = _resume\n" diff --git a/ragel/rubyftable.cpp b/ragel/rubyftable.cpp index c8a0b36..2d95fc5 100644 --- a/ragel/rubyftable.cpp +++ b/ragel/rubyftable.cpp @@ -386,7 +386,7 @@ void RubyFTabCodeGen::writeExec() " while true\n" " if _goto_level <= 0\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " == " << PE() << "\n" " _goto_level = _test_eof\n" @@ -470,7 +470,7 @@ void RubyFTabCodeGen::writeExec() out << " " << P() << " += 1\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " != " << PE() << "\n" " _goto_level = _resume\n" diff --git a/ragel/rubytable.cpp b/ragel/rubytable.cpp index a945a53..653d738 100644 --- a/ragel/rubytable.cpp +++ b/ragel/rubytable.cpp @@ -263,7 +263,7 @@ void RubyTabCodeGen::writeExec() " _trigger_goto = false\n" " if _goto_level <= 0\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " == " << PE() << "\n" " _goto_level = _test_eof\n" @@ -374,7 +374,7 @@ void RubyTabCodeGen::writeExec() out << " " << P() << " += 1\n"; - if ( hasEnd ) { + if ( !noEnd ) { out << " if " << P() << " != " << PE() << "\n" " _goto_level = _resume\n" -- 2.7.4