From: thurston Date: Tue, 7 Oct 2008 20:45:56 +0000 (+0000) Subject: Starting to elminated the XML intermediate file. Removed the outter X-Git-Tag: 2.0_alpha~102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bb985882931077bb74daac604f5d4b41d10dde7;p=external%2Fragel.git Starting to elminated the XML intermediate file. Removed the outter tag. This required including xmlparse into the frontend files. One name clash of ActionTableMap had to be fixed. It also required fixing some const correctness problems. git-svn-id: http://svn.complang.org/ragel/trunk@484 052ea7fc-9027-0410-9066-f65837a77df0 --- diff --git a/common/common.cpp b/common/common.cpp index e8971ac..7030b44 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -296,9 +296,9 @@ std::streamsize output_filter::xsputn( const char *s, std::streamsize n ) /* Scans a string looking for the file extension. If there is a file * extension then pointer returned points to inside the string * passed in. Otherwise returns null. */ -char *findFileExtension( char *stemFile ) +const char *findFileExtension( const char *stemFile ) { - char *ppos = stemFile + strlen(stemFile) - 1; + const char *ppos = stemFile + strlen(stemFile) - 1; /* Scan backwards from the end looking for the first dot. * If we encounter a '/' before the first dot, then stop the scan. */ @@ -326,13 +326,13 @@ char *findFileExtension( char *stemFile ) /* Make a file name from a stem. Removes the old filename suffix and * replaces it with a new one. Returns a newed up string. */ -char *fileNameFromStem( char *stemFile, const char *suffix ) +const char *fileNameFromStem( const char *stemFile, const char *suffix ) { long len = strlen( stemFile ); assert( len > 0 ); /* Get the extension. */ - char *ppos = findFileExtension( stemFile ); + const char *ppos = findFileExtension( stemFile ); /* If an extension was found, then shorten what we think the len is. */ if ( ppos != 0 ) diff --git a/common/common.h b/common/common.h index e313d41..5370d02 100644 --- a/common/common.h +++ b/common/common.h @@ -346,8 +346,8 @@ public: }; -char *findFileExtension( char *stemFile ); -char *fileNameFromStem( char *stemFile, const char *suffix ); +const char *findFileExtension( const char *stemFile ); +const char *fileNameFromStem( const char *stemFile, const char *suffix ); struct Export { diff --git a/ragel/parsedata.cpp b/ragel/parsedata.cpp index a815e1c..436d09b 100644 --- a/ragel/parsedata.cpp +++ b/ragel/parsedata.cpp @@ -32,6 +32,7 @@ #include "mergesort.h" #include "xmlcodegen.h" #include "version.h" +#include "xmlparse.h" using namespace std; @@ -1456,18 +1457,17 @@ void terminateAllParsers( ) pdel->value->token( loc, Parser_tk_eof, 0, 0 ); } -void writeLanguage( std::ostream &out ) +const char *getLang() { - out << " lang=\""; + const char *lang = 0; switch ( hostLang->lang ) { - case HostLang::C: out << "C"; break; - case HostLang::D: out << "D"; break; - case HostLang::Java: out << "Java"; break; - case HostLang::Ruby: out << "Ruby"; break; - case HostLang::CSharp: out << "C#"; break; + case HostLang::C: lang = "C"; break; + case HostLang::D: lang = "D"; break; + case HostLang::Java: lang = "Java"; break; + case HostLang::Ruby: lang = "Ruby"; break; + case HostLang::CSharp: lang = "C#"; break; } - out << "\""; - + return lang; } void writeMachines( std::ostream &out, std::string hostData, @@ -1482,16 +1482,13 @@ void writeMachines( std::ostream &out, std::string hostData, } if ( gblErrorCount == 0 ) { - out << "\n"; + xmlParser.ragel( VERSION, inputFileName, getLang() ); for ( ParserDict::Iter parser = parserDict; parser.lte(); parser++ ) { ParseData *pd = parser->value->pd; if ( pd->instanceList.length() > 0 ) pd->generateXML( out ); } out << hostData; - out << "\n"; } } else if ( parserDict.length() > 0 ) { @@ -1523,12 +1520,9 @@ void writeMachines( std::ostream &out, std::string hostData, /* Section/Machine to emit was found. Prepare and emit it. */ parseData->prepareMachineGen( graphDictEl ); if ( gblErrorCount == 0 ) { - out << "\n"; + xmlParser.ragel( VERSION, inputFileName, getLang() ); parseData->generateXML( out ); out << hostData; - out << "\n"; } } } diff --git a/redfsm/gendata.cpp b/redfsm/gendata.cpp index 99065de..bff07a3 100644 --- a/redfsm/gendata.cpp +++ b/redfsm/gendata.cpp @@ -585,7 +585,7 @@ void CodeGenData::setValueLimits() } } - for ( ActionTableMap::Iter at = redFsm->actionMap; at.lte(); at++ ) { + for ( GenActionTableMap::Iter at = redFsm->actionMap; at.lte(); at++ ) { /* Maximum id of action lists. */ if ( at->actListId+1 > redFsm->maxActListId ) redFsm->maxActListId = at->actListId+1; @@ -629,7 +629,7 @@ void CodeGenData::analyzeMachine() } /* Analyze reduced action lists. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { for ( GenActionTable::Iter act = redAct->key; act.lte(); act++ ) analyzeActionList( redAct, act->value->inlineList ); } diff --git a/redfsm/gendata.h b/redfsm/gendata.h index 206f019..13a12ac 100644 --- a/redfsm/gendata.h +++ b/redfsm/gendata.h @@ -50,22 +50,22 @@ typedef AvlMapEl CodeGenMapEl; /* These functions must be implemented by the code generation executable. * The openOutput function is invoked when the root element is opened. The * makeCodeGen function is invoked when a ragel_def element is opened. */ -std::ostream *cdOpenOutput( char *inputFile ); -std::ostream *javaOpenOutput( char *inputFile ); -std::ostream *rubyOpenOutput( char *inputFile ); -std::ostream *csharpOpenOutput( char *inputFile ); -std::ostream *dotOpenOutput( char *inputFile ); - -CodeGenData *cdMakeCodeGen( char *sourceFileName, - char *fsmName, ostream &out, bool wantComplete ); -CodeGenData *javaMakeCodeGen( char *sourceFileName, - char *fsmName, ostream &out, bool wantComplete ); -CodeGenData *rubyMakeCodeGen( char *sourceFileName, - char *fsmName, ostream &out, bool wantComplete ); -CodeGenData *csharpMakeCodeGen( char *sourceFileName, - char *fsmName, ostream &out, bool wantComplete ); -CodeGenData *dotMakeCodeGen( char *sourceFileName, - char *fsmName, ostream &out, bool wantComplete ); +std::ostream *cdOpenOutput( const char *inputFile ); +std::ostream *javaOpenOutput( const char *inputFile ); +std::ostream *rubyOpenOutput( const char *inputFile ); +std::ostream *csharpOpenOutput( const char *inputFile ); +std::ostream *dotOpenOutput( const char *inputFile ); + +CodeGenData *cdMakeCodeGen( const char *sourceFileName, + const char *fsmName, ostream &out, bool wantComplete ); +CodeGenData *javaMakeCodeGen( const char *sourceFileName, + const char *fsmName, ostream &out, bool wantComplete ); +CodeGenData *rubyMakeCodeGen( const char *sourceFileName, + const char *fsmName, ostream &out, bool wantComplete ); +CodeGenData *csharpMakeCodeGen( const char *sourceFileName, + const char *fsmName, ostream &out, bool wantComplete ); +CodeGenData *dotMakeCodeGen( const char *sourceFileName, + const char *fsmName, ostream &out, bool wantComplete ); void cdLineDirective( ostream &out, const char *fileName, int line ); void javaLineDirective( ostream &out, const char *fileName, int line ); @@ -101,8 +101,8 @@ struct CodeGenData * Collecting the machine. */ - char *sourceFileName; - char *fsmName; + const char *sourceFileName; + const char *fsmName; ostream &out; RedFsmAp *redFsm; GenAction *allActions; diff --git a/redfsm/redfsm.cpp b/redfsm/redfsm.cpp index a8d05c5..2182648 100644 --- a/redfsm/redfsm.cpp +++ b/redfsm/redfsm.cpp @@ -209,7 +209,7 @@ void RedFsmAp::findFirstFinState() void RedFsmAp::assignActionLocs() { int nextLocation = 0; - for ( ActionTableMap::Iter act = actionMap; act.lte(); act++ ) { + for ( GenActionTableMap::Iter act = actionMap; act.lte(); act++ ) { /* Store the loc, skip over the array and a null terminator. */ act->location = nextLocation; nextLocation += act->key.length() + 1; diff --git a/redfsm/redfsm.h b/redfsm/redfsm.h index 341c7b7..654cafb 100644 --- a/redfsm/redfsm.h +++ b/redfsm/redfsm.h @@ -209,7 +209,7 @@ struct RedAction bool bAnyCurStateRef; bool bAnyBreakStmt; }; -typedef AvlTree ActionTableMap; +typedef AvlTree GenActionTableMap; /* Reduced transition. */ struct RedTransAp @@ -408,7 +408,7 @@ struct RedFsmAp int nextStateId; TransApSet transSet; - ActionTableMap actionMap; + GenActionTableMap actionMap; RedStateList stateList; RedStateSet entryPoints; RedStateAp *startState; diff --git a/redfsm/xmlparse.kh b/redfsm/xmlparse.kh index 0296982..1f4b209 100644 --- a/redfsm/xmlparse.kh +++ b/redfsm/xmlparse.kh @@ -165,6 +165,8 @@ struct XmlParser int token( int tokenId, int col, int line ); int token( XMLTag *tag, int col, int line ); + void ragel( const char *version, const char *fileName, const char *lang ); + /* Report an error encountered by the parser. */ ostream &warning( const GenInputLoc &loc ); ostream &error(); @@ -174,7 +176,7 @@ struct XmlParser /* The name of the root section, this does not change during an include. */ const char *fileName; - char *sourceFileName; + const char *sourceFileName; ostream *outStream; bool outputActive; bool wantComplete; diff --git a/redfsm/xmlparse.kl b/redfsm/xmlparse.kl index 74389b0..a5239d9 100644 --- a/redfsm/xmlparse.kl +++ b/redfsm/xmlparse.kl @@ -42,7 +42,7 @@ struct Token GenInputLoc loc; }; -CodeGenData *makeCodeGen( char *sourceFileName, char *fsmName, +CodeGenData *makeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out, bool wantComplete ) { CodeGenData *cgd = 0; @@ -63,7 +63,6 @@ CodeGenData *makeCodeGen( char *sourceFileName, char *fsmName, void lineDirective( ostream &out, const char *fileName, int line ) { - CodeGenData *cgd = 0; if ( !generateDot ) { if ( hostLang == &hostLangC ) cdLineDirective( out, fileName, line ); @@ -85,70 +84,44 @@ void genLineDirective( ostream &out ) lineDirective( out, filter->fileName, filter->line + 1 ); } +void XmlParser::ragel( const char *version, const char *fileName, const char *lang ) +{ + /* Check for file name attribute. */ + sourceFileName = fileName; + + if ( generateDot ) + outStream = dotOpenOutput( sourceFileName ); + else if ( strcmp( lang, "C" ) == 0 ) { + hostLang = &hostLangC; + outStream = cdOpenOutput( sourceFileName ); + } + else if ( strcmp( lang, "D" ) == 0 ) { + hostLang = &hostLangD; + outStream = cdOpenOutput( sourceFileName ); + } + else if ( strcmp( lang, "Java" ) == 0 ) { + hostLang = &hostLangJava; + outStream = javaOpenOutput( sourceFileName ); + } + else if ( strcmp( lang, "Ruby" ) == 0 ) { + hostLang = &hostLangRuby; + outStream = rubyOpenOutput( sourceFileName ); + } + else if ( strcmp( lang, "C#" ) == 0 ) { + hostLang = &hostLangCSharp; + outStream = csharpOpenOutput( sourceFileName ); + } + else { + assert( false ); + } +} %%{ parser XmlParser; include "xmlparse.kh"; -start: tag_ragel; -start: - final { - /* If we get no input the assumption is that the frontend died and - * emitted an error. This forces the backend to return a non-zero - * exit status, but does not print an error. */ - gblErrorCount += 1; - }; - -tag_ragel: tag_ragel_head ragel_def_list host_or_write_list '/' TAG_ragel; - -tag_ragel_head: TAG_ragel - final { - /* Check version used to generated the intermediate file. */ - Attribute *versionAttr = $1->tag->findAttr( "version" ); - if ( versionAttr == 0 ) - error($1->loc) << "tag requires a version attribute" << endp; - if ( strcmp( versionAttr->value, VERSION ) != 0 ) - error($1->loc) << "version mismatch between frontend and backend" << endp; - - /* Check for file name attribute. */ - Attribute *fileNameAttr = $1->tag->findAttr( "filename" ); - if ( fileNameAttr == 0 ) - error($1->loc) << "tag requires a filename attribute" << endp; - sourceFileName = fileNameAttr->value; - - /* Check for language attribute. */ - Attribute *langAttr = $1->tag->findAttr( "lang" ); - if ( langAttr == 0 ) - error($1->loc) << "tag requires a lang attribute" << endp; - - if ( generateDot ) - outStream = dotOpenOutput( sourceFileName ); - else if ( strcmp( langAttr->value, "C" ) == 0 ) { - hostLang = &hostLangC; - outStream = cdOpenOutput( sourceFileName ); - } - else if ( strcmp( langAttr->value, "D" ) == 0 ) { - hostLang = &hostLangD; - outStream = cdOpenOutput( sourceFileName ); - } - else if ( strcmp( langAttr->value, "Java" ) == 0 ) { - hostLang = &hostLangJava; - outStream = javaOpenOutput( sourceFileName ); - } - else if ( strcmp( langAttr->value, "Ruby" ) == 0 ) { - hostLang = &hostLangRuby; - outStream = rubyOpenOutput( sourceFileName ); - } - else if ( strcmp( langAttr->value, "C#" ) == 0 ) { - hostLang = &hostLangCSharp; - outStream = csharpOpenOutput( sourceFileName ); - } - else { - error($1->loc) << "expecting lang attribute to be " - "one of C, D, Java, Ruby or C#" << endp; - } - }; +start: ragel_def_list host_or_write_list; ragel_def_list: ragel_def_list ragel_def; ragel_def_list: ; diff --git a/rlgen-cd/fflatcodegen.cpp b/rlgen-cd/fflatcodegen.cpp index 733cfcb..0401c49 100644 --- a/rlgen-cd/fflatcodegen.cpp +++ b/rlgen-cd/fflatcodegen.cpp @@ -68,7 +68,7 @@ std::ostream &FFlatCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &FFlatCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -90,7 +90,7 @@ std::ostream &FFlatCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &FFlatCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -110,7 +110,7 @@ std::ostream &FFlatCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &FFlatCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -132,7 +132,7 @@ std::ostream &FFlatCodeGen::EOF_ACTION_SWITCH() std::ostream &FFlatCodeGen::ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; diff --git a/rlgen-cd/fgotocodegen.cpp b/rlgen-cd/fgotocodegen.cpp index 41ad2cd..443b416 100644 --- a/rlgen-cd/fgotocodegen.cpp +++ b/rlgen-cd/fgotocodegen.cpp @@ -30,7 +30,7 @@ std::ostream &FGotoCodeGen::EXEC_ACTIONS() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* We are at the start of a glob, write the case. */ out << "f" << redAct->actListId << ":\n"; @@ -50,7 +50,7 @@ std::ostream &FGotoCodeGen::EXEC_ACTIONS() std::ostream &FGotoCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -72,7 +72,7 @@ std::ostream &FGotoCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &FGotoCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -92,7 +92,7 @@ std::ostream &FGotoCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &FGotoCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; diff --git a/rlgen-cd/fsmcodegen.cpp b/rlgen-cd/fsmcodegen.cpp index f4de4f6..2e28e0c 100644 --- a/rlgen-cd/fsmcodegen.cpp +++ b/rlgen-cd/fsmcodegen.cpp @@ -114,7 +114,7 @@ std::ostream &FsmCodeGen::ACTIONS_ARRAY() { out << "\t0, "; int totalActions = 1; - for ( ActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { + for ( GenActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { /* Write out the length, which will never be the last character. */ out << act->key.length() << ", "; /* Put in a line break every 8 */ diff --git a/rlgen-cd/ftabcodegen.cpp b/rlgen-cd/ftabcodegen.cpp index e1f383b..a1d0a21 100644 --- a/rlgen-cd/ftabcodegen.cpp +++ b/rlgen-cd/ftabcodegen.cpp @@ -97,7 +97,7 @@ std::ostream &FTabCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &FTabCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -119,7 +119,7 @@ std::ostream &FTabCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &FTabCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -139,7 +139,7 @@ std::ostream &FTabCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &FTabCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -161,7 +161,7 @@ std::ostream &FTabCodeGen::EOF_ACTION_SWITCH() std::ostream &FTabCodeGen::ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; diff --git a/rlgen-cd/gotocodegen.cpp b/rlgen-cd/gotocodegen.cpp index e7c1685..943a089 100644 --- a/rlgen-cd/gotocodegen.cpp +++ b/rlgen-cd/gotocodegen.cpp @@ -404,7 +404,7 @@ std::ostream &GotoCodeGen::TRANSITIONS() std::ostream &GotoCodeGen::EXEC_FUNCS() { /* Make labels that set acts and jump to execFuncs. Loop func indicies. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { out << " f" << redAct->actListId << ": " << "_acts = " << ARR_OFF(A(), itoa( redAct->location+1 ) ) << ";" diff --git a/rlgen-cd/ipgotocodegen.cpp b/rlgen-cd/ipgotocodegen.cpp index c756111..0a2b019 100644 --- a/rlgen-cd/ipgotocodegen.cpp +++ b/rlgen-cd/ipgotocodegen.cpp @@ -281,7 +281,7 @@ std::ostream &IpGotoCodeGen::FINISH_CASES() out << " case " << st->id << ": goto tr" << st->eofTrans->id << ";\n"; } - for ( ActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { + for ( GenActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { if ( act->eofRefs != 0 ) { for ( IntSet::Iter pst = *act->eofRefs; pst.lte(); pst++ ) out << " case " << *pst << ": \n"; diff --git a/rlgen-cd/main.cpp b/rlgen-cd/main.cpp index 1cea4f8..c1542eb 100644 --- a/rlgen-cd/main.cpp +++ b/rlgen-cd/main.cpp @@ -73,7 +73,7 @@ extern bool noLineDirectives; */ /* Invoked by the parser when the root element is opened. */ -ostream *cdOpenOutput( char *inputFile ) +ostream *cdOpenOutput( const char *inputFile ) { if ( hostLang->lang != HostLang::C && hostLang->lang != HostLang::D ) { error() << "this code generator is for C and D only" << endl; @@ -83,7 +83,7 @@ ostream *cdOpenOutput( char *inputFile ) /* If the output format is code and no output file name is given, then * make a default. */ if ( outputFileName == 0 ) { - char *ext = findFileExtension( inputFile ); + const char *ext = findFileExtension( inputFile ); if ( ext != 0 && strcmp( ext, ".rh" ) == 0 ) outputFileName = fileNameFromStem( inputFile, ".h" ); else { @@ -123,7 +123,7 @@ ostream *cdOpenOutput( char *inputFile ) } /* Invoked by the parser when a ragel definition is opened. */ -CodeGenData *cdMakeCodeGen( char *sourceFileName, char *fsmName, +CodeGenData *cdMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out, bool wantComplete ) { CodeGenData *codeGen = 0; diff --git a/rlgen-cd/splitcodegen.cpp b/rlgen-cd/splitcodegen.cpp index 59e8ac0..aa9ce5c 100644 --- a/rlgen-cd/splitcodegen.cpp +++ b/rlgen-cd/splitcodegen.cpp @@ -349,8 +349,8 @@ std::ostream &SplitCodeGen::ALL_PARTITIONS() for ( int p = 0; p < redFsm->nParts; p++ ) { char suffix[10]; sprintf( suffix, suffFormat, p ); - char *fn = fileNameFromStem( sourceFileName, suffix ); - char *include = fileNameFromStem( sourceFileName, ".h" ); + const char *fn = fileNameFromStem( sourceFileName, suffix ); + const char *include = fileNameFromStem( sourceFileName, ".h" ); /* Create the filter on the output and open it. */ output_filter *partFilter = new output_filter( fn ); diff --git a/rlgen-csharp/fflatcodegen.cpp b/rlgen-csharp/fflatcodegen.cpp index 2d48380..0edd7cf 100644 --- a/rlgen-csharp/fflatcodegen.cpp +++ b/rlgen-csharp/fflatcodegen.cpp @@ -68,7 +68,7 @@ std::ostream &CSharpFFlatCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &CSharpFFlatCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -90,7 +90,7 @@ std::ostream &CSharpFFlatCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &CSharpFFlatCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -110,7 +110,7 @@ std::ostream &CSharpFFlatCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &CSharpFFlatCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -132,7 +132,7 @@ std::ostream &CSharpFFlatCodeGen::EOF_ACTION_SWITCH() std::ostream &CSharpFFlatCodeGen::ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; diff --git a/rlgen-csharp/fgotocodegen.cpp b/rlgen-csharp/fgotocodegen.cpp index cf62083..f19684a 100644 --- a/rlgen-csharp/fgotocodegen.cpp +++ b/rlgen-csharp/fgotocodegen.cpp @@ -30,7 +30,7 @@ std::ostream &CSharpFGotoCodeGen::EXEC_ACTIONS() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* We are at the start of a glob, write the case. */ out << "f" << redAct->actListId << ":\n"; @@ -50,7 +50,7 @@ std::ostream &CSharpFGotoCodeGen::EXEC_ACTIONS() std::ostream &CSharpFGotoCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -72,7 +72,7 @@ std::ostream &CSharpFGotoCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &CSharpFGotoCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -92,7 +92,7 @@ std::ostream &CSharpFGotoCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &CSharpFGotoCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; diff --git a/rlgen-csharp/fsmcodegen.cpp b/rlgen-csharp/fsmcodegen.cpp index be36a77..32e2e6f 100644 --- a/rlgen-csharp/fsmcodegen.cpp +++ b/rlgen-csharp/fsmcodegen.cpp @@ -123,7 +123,7 @@ std::ostream &CSharpFsmCodeGen::ACTIONS_ARRAY() { out << "\t0, "; int totalActions = 1; - for ( ActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { + for ( GenActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { /* Write out the length, which will never be the last character. */ out << act->key.length() << ", "; /* Put in a line break every 8 */ diff --git a/rlgen-csharp/ftabcodegen.cpp b/rlgen-csharp/ftabcodegen.cpp index f7da6bd..9ca8ce1 100644 --- a/rlgen-csharp/ftabcodegen.cpp +++ b/rlgen-csharp/ftabcodegen.cpp @@ -97,7 +97,7 @@ std::ostream &CSharpFTabCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &CSharpFTabCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -119,7 +119,7 @@ std::ostream &CSharpFTabCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &CSharpFTabCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -139,7 +139,7 @@ std::ostream &CSharpFTabCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &CSharpFTabCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; @@ -161,7 +161,7 @@ std::ostream &CSharpFTabCodeGen::EOF_ACTION_SWITCH() std::ostream &CSharpFTabCodeGen::ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* Write the entry label. */ out << "\tcase " << redAct->actListId+1 << ":\n"; diff --git a/rlgen-csharp/gotocodegen.cpp b/rlgen-csharp/gotocodegen.cpp index 810b5f5..2fcf67b 100644 --- a/rlgen-csharp/gotocodegen.cpp +++ b/rlgen-csharp/gotocodegen.cpp @@ -404,7 +404,7 @@ std::ostream &CSharpGotoCodeGen::TRANSITIONS() std::ostream &CSharpGotoCodeGen::EXEC_FUNCS() { /* Make labels that set acts and jump to execFuncs. Loop func indicies. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { out << " f" << redAct->actListId << ": " << "_acts = " << itoa( redAct->location+1 ) << ";" diff --git a/rlgen-csharp/ipgotocodegen.cpp b/rlgen-csharp/ipgotocodegen.cpp index 5c2fae3..aa3f36d 100644 --- a/rlgen-csharp/ipgotocodegen.cpp +++ b/rlgen-csharp/ipgotocodegen.cpp @@ -275,7 +275,7 @@ std::ostream &CSharpIpGotoCodeGen::FINISH_CASES() out << " case " << st->id << ": goto tr" << st->eofTrans->id << ";\n"; } - for ( ActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { + for ( GenActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { if ( act->eofRefs != 0 ) { for ( IntSet::Iter pst = *act->eofRefs; pst.lte(); pst++ ) out << " case " << *pst << ": \n"; diff --git a/rlgen-csharp/main.cpp b/rlgen-csharp/main.cpp index 7f3970e..cad29b2 100644 --- a/rlgen-csharp/main.cpp +++ b/rlgen-csharp/main.cpp @@ -108,7 +108,7 @@ ostream &csharp_error() */ /* Invoked by the parser when the root element is opened. */ -ostream *csharpOpenOutput( char *inputFile ) +ostream *csharpOpenOutput( const char *inputFile ) { if ( hostLang->lang != HostLang::CSharp ) { csharp_error() << "this code generator is for C# only" << endl; @@ -118,7 +118,7 @@ ostream *csharpOpenOutput( char *inputFile ) /* If the output format is code and no output file name is given, then * make a default. */ if ( outputFileName == 0 ) { - char *ext = findFileExtension( inputFile ); + const char *ext = findFileExtension( inputFile ); if ( ext != 0 && strcmp( ext, ".rh" ) == 0 ) outputFileName = fileNameFromStem( inputFile, ".h" ); else @@ -151,7 +151,7 @@ ostream *csharpOpenOutput( char *inputFile ) } /* Invoked by the parser when a ragel definition is opened. */ -CodeGenData *csharpMakeCodeGen( char *sourceFileName, char *fsmName, +CodeGenData *csharpMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out, bool wantComplete ) { CodeGenData *codeGen = 0; diff --git a/rlgen-csharp/splitcodegen.cpp b/rlgen-csharp/splitcodegen.cpp index 63ac299..169f0a4 100644 --- a/rlgen-csharp/splitcodegen.cpp +++ b/rlgen-csharp/splitcodegen.cpp @@ -341,8 +341,8 @@ std::ostream &CSharpSplitCodeGen::ALL_PARTITIONS() for ( int p = 0; p < redFsm->nParts; p++ ) { char suffix[10]; sprintf( suffix, suffFormat, p ); - char *fn = fileNameFromStem( sourceFileName, suffix ); - char *include = fileNameFromStem( sourceFileName, ".h" ); + const char *fn = fileNameFromStem( sourceFileName, suffix ); + const char *include = fileNameFromStem( sourceFileName, ".h" ); /* Create the filter on the output and open it. */ output_filter *partFilter = new output_filter( fn ); diff --git a/rlgen-dot/main.cpp b/rlgen-dot/main.cpp index 5b6ede6..849d123 100644 --- a/rlgen-dot/main.cpp +++ b/rlgen-dot/main.cpp @@ -60,7 +60,7 @@ extern int numSplitPartitions; */ /* Invoked by the parser when the root element is opened. */ -ostream *dotOpenOutput( char *inputFile ) +ostream *dotOpenOutput( const char *inputFile ) { /* Make sure we are not writing to the same file as the input file. */ if ( outputFileName != 0 && strcmp( inputFile, outputFileName ) == 0 ) { @@ -88,7 +88,7 @@ ostream *dotOpenOutput( char *inputFile ) } /* Invoked by the parser when a ragel definition is opened. */ -CodeGenData *dotMakeCodeGen( char *sourceFileName, char *fsmName, +CodeGenData *dotMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out, bool wantComplete ) { CodeGenData *codeGen = new GraphvizDotGen(out); diff --git a/rlgen-java/javacodegen.cpp b/rlgen-java/javacodegen.cpp index b8713a3..7f68ae7 100644 --- a/rlgen-java/javacodegen.cpp +++ b/rlgen-java/javacodegen.cpp @@ -1294,7 +1294,7 @@ string JavaTabCodeGen::START_STATE_ID() std::ostream &JavaTabCodeGen::ACTIONS_ARRAY() { ARRAY_ITEM( INT(0), false ); - for ( ActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { + for ( GenActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { /* Write out the length, which will never be the last character. */ ARRAY_ITEM( INT(act->key.length()), false ); diff --git a/rlgen-java/main.cpp b/rlgen-java/main.cpp index bbde367..6bbe7b2 100644 --- a/rlgen-java/main.cpp +++ b/rlgen-java/main.cpp @@ -56,7 +56,7 @@ extern int numSplitPartitions; */ /* Invoked by the parser when the root element is opened. */ -ostream *javaOpenOutput( char *inputFile ) +ostream *javaOpenOutput( const char *inputFile ) { if ( hostLang->lang != HostLang::Java ) { error() << "this code generator is for Java only" << endl; @@ -66,7 +66,7 @@ ostream *javaOpenOutput( char *inputFile ) /* If the output format is code and no output file name is given, then * make a default. */ if ( outputFileName == 0 ) { - char *ext = findFileExtension( inputFile ); + const char *ext = findFileExtension( inputFile ); if ( ext != 0 && strcmp( ext, ".rh" ) == 0 ) outputFileName = fileNameFromStem( inputFile, ".h" ); else @@ -99,7 +99,7 @@ ostream *javaOpenOutput( char *inputFile ) } /* Invoked by the parser when a ragel definition is opened. */ -CodeGenData *javaMakeCodeGen( char *sourceFileName, char *fsmName, +CodeGenData *javaMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out, bool wantComplete ) { CodeGenData *codeGen = new JavaTabCodeGen(out); diff --git a/rlgen-ruby/main.cpp b/rlgen-ruby/main.cpp index 7ea5476..08786cd 100644 --- a/rlgen-ruby/main.cpp +++ b/rlgen-ruby/main.cpp @@ -70,7 +70,7 @@ extern int numSplitPartitions; */ /* Invoked by the parser when the root element is opened. */ -ostream *rubyOpenOutput( char *inputFile ) +ostream *rubyOpenOutput( const char *inputFile ) { if ( hostLang->lang != HostLang::Ruby ) { error() << "this code generator is for Ruby only" << endl; @@ -80,7 +80,7 @@ ostream *rubyOpenOutput( char *inputFile ) /* If the output format is code and no output file name is given, then * make a default. */ if ( outputFileName == 0 ) { - char *ext = findFileExtension( inputFile ); + const char *ext = findFileExtension( inputFile ); if ( ext != 0 && strcmp( ext, ".rh" ) == 0 ) outputFileName = fileNameFromStem( inputFile, ".h" ); else @@ -113,7 +113,7 @@ ostream *rubyOpenOutput( char *inputFile ) } /* Invoked by the parser when a ragel definition is opened. */ -CodeGenData *rubyMakeCodeGen( char *sourceFileName, char *fsmName, +CodeGenData *rubyMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out, bool wantComplete ) { CodeGenData *codeGen = 0; diff --git a/rlgen-ruby/rbx-gotocodegen.cpp b/rlgen-ruby/rbx-gotocodegen.cpp index f826d11..06e6184 100644 --- a/rlgen-ruby/rbx-gotocodegen.cpp +++ b/rlgen-ruby/rbx-gotocodegen.cpp @@ -425,7 +425,7 @@ std::ostream &RbxGotoCodeGen::TRANSITIONS() std::ostream &RbxGotoCodeGen::EXEC_FUNCS() { /* Make labels that set acts and jump to execFuncs. Loop func indicies. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { rbxLabel(out, label("f", redAct->actListId)) << "\n" << "_acts = " << itoa( redAct->location+1 ) << "\n"; diff --git a/rlgen-ruby/ruby-codegen.cpp b/rlgen-ruby/ruby-codegen.cpp index 197f101..f69606e 100644 --- a/rlgen-ruby/ruby-codegen.cpp +++ b/rlgen-ruby/ruby-codegen.cpp @@ -371,7 +371,7 @@ std::ostream &RubyCodeGen::ACTIONS_ARRAY() START_ARRAY_LINE(); int totalActions = 0; ARRAY_ITEM( INT(0), ++totalActions, false ); - for ( ActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { + for ( GenActionTableMap::Iter act = redFsm->actionMap; act.lte(); act++ ) { /* Write out the length, which will never be the last character. */ ARRAY_ITEM( INT(act->key.length()), ++totalActions, false ); diff --git a/rlgen-ruby/ruby-fflatcodegen.cpp b/rlgen-ruby/ruby-fflatcodegen.cpp index f30ffdf..0b726c2 100644 --- a/rlgen-ruby/ruby-fflatcodegen.cpp +++ b/rlgen-ruby/ruby-fflatcodegen.cpp @@ -158,7 +158,7 @@ int RubyFFlatCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &RubyFFlatCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n"; @@ -178,7 +178,7 @@ std::ostream &RubyFFlatCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &RubyFFlatCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n"; @@ -196,7 +196,7 @@ std::ostream &RubyFFlatCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &RubyFFlatCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n"; @@ -216,7 +216,7 @@ std::ostream &RubyFFlatCodeGen::EOF_ACTION_SWITCH() std::ostream &RubyFFlatCodeGen::ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n"; diff --git a/rlgen-ruby/ruby-ftabcodegen.cpp b/rlgen-ruby/ruby-ftabcodegen.cpp index 3e60b75..ffb65af 100644 --- a/rlgen-ruby/ruby-ftabcodegen.cpp +++ b/rlgen-ruby/ruby-ftabcodegen.cpp @@ -134,7 +134,7 @@ void RubyFTabCodeGen::BREAK( ostream &out, int targState ) std::ostream &RubyFTabCodeGen::TO_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numToStateRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n"; @@ -155,7 +155,7 @@ std::ostream &RubyFTabCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &RubyFTabCodeGen::FROM_STATE_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numFromStateRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n"; @@ -174,7 +174,7 @@ std::ostream &RubyFTabCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &RubyFTabCodeGen::EOF_ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numEofRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n"; @@ -195,7 +195,7 @@ std::ostream &RubyFTabCodeGen::EOF_ACTION_SWITCH() std::ostream &RubyFTabCodeGen::ACTION_SWITCH() { /* Loop the actions. */ - for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { + for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { if ( redAct->numTransRefs > 0 ) { /* Write the entry label. */ out << "\twhen " << redAct->actListId+1 << " then\n";