From b7bbc4afa85019ccddd4a8ecb297619a12930500 Mon Sep 17 00:00:00 2001 From: thurston Date: Mon, 1 Sep 2008 16:45:30 +0000 Subject: [PATCH] Renaming to avoid name conflicts following the merge of the frontend and backend. git-svn-id: http://svn.complang.org/ragel/trunk@466 052ea7fc-9027-0410-9066-f65837a77df0 --- ragel/Makefile.in | 2 +- ragel/main.cpp | 1 + redfsm/gendata.cpp | 42 ++++++++++++------------- redfsm/gendata.h | 12 ++++---- redfsm/redfsm.cpp | 8 ++--- redfsm/redfsm.h | 66 ++++++++++++++++++++-------------------- redfsm/xmlparse.kh | 41 ++++++++++++++++++++++--- redfsm/xmlparse.kl | 6 ++++ redfsm/xmlscan.rl | 62 +++++++++---------------------------- rlgen-cd/fflatcodegen.cpp | 8 ++--- rlgen-cd/fgotocodegen.cpp | 8 ++--- rlgen-cd/flatcodegen.cpp | 12 ++++---- rlgen-cd/fsmcodegen.cpp | 6 ++-- rlgen-cd/fsmcodegen.h | 6 ++-- rlgen-cd/ftabcodegen.cpp | 8 ++--- rlgen-cd/gotocodegen.cpp | 16 +++++----- rlgen-cd/gotocodegen.h | 4 +-- rlgen-cd/ipgotocodegen.cpp | 10 +++--- rlgen-cd/splitcodegen.cpp | 10 +++--- rlgen-cd/tabcodegen.cpp | 16 +++++----- rlgen-csharp/fflatcodegen.cpp | 8 ++--- rlgen-csharp/fgotocodegen.cpp | 8 ++--- rlgen-csharp/flatcodegen.cpp | 12 ++++---- rlgen-csharp/fsmcodegen.cpp | 6 ++-- rlgen-csharp/fsmcodegen.h | 6 ++-- rlgen-csharp/ftabcodegen.cpp | 8 ++--- rlgen-csharp/gotocodegen.cpp | 16 +++++----- rlgen-csharp/gotocodegen.h | 4 +-- rlgen-csharp/ipgotocodegen.cpp | 10 +++--- rlgen-csharp/splitcodegen.cpp | 10 +++--- rlgen-csharp/tabcodegen.cpp | 16 +++++----- rlgen-dot/gvdotgen.cpp | 12 ++++---- rlgen-dot/main.cpp | 2 -- rlgen-java/javacodegen.cpp | 22 +++++++------- rlgen-java/javacodegen.h | 4 +-- rlgen-ruby/rbx-gotocodegen.cpp | 16 +++++----- rlgen-ruby/rbx-gotocodegen.h | 2 +- rlgen-ruby/ruby-codegen.cpp | 6 ++-- rlgen-ruby/ruby-codegen.h | 4 +-- rlgen-ruby/ruby-fflatcodegen.cpp | 8 ++--- rlgen-ruby/ruby-flatcodegen.cpp | 12 ++++---- rlgen-ruby/ruby-ftabcodegen.cpp | 8 ++--- rlgen-ruby/ruby-tabcodegen.cpp | 16 +++++----- 43 files changed, 282 insertions(+), 278 deletions(-) diff --git a/ragel/Makefile.in b/ragel/Makefile.in index 5e54e57..6190a5f 100644 --- a/ragel/Makefile.in +++ b/ragel/Makefile.in @@ -18,7 +18,7 @@ # along with Ragel; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -INCS += -I../common -I../aapl +INCS += -I../common -I../aapl -I../redfsm DEFS += CFLAGS += -g -Wall diff --git a/ragel/main.cpp b/ragel/main.cpp index 3121420..1e11cef 100644 --- a/ragel/main.cpp +++ b/ragel/main.cpp @@ -54,6 +54,7 @@ #include "vector.h" #include "version.h" #include "common.h" +#include "xmlparse.h" using std::istream; using std::ostream; diff --git a/redfsm/gendata.cpp b/redfsm/gendata.cpp index 8598aaa..c4c503b 100644 --- a/redfsm/gendata.cpp +++ b/redfsm/gendata.cpp @@ -73,7 +73,7 @@ void CodeGenData::createMachine() void CodeGenData::initActionList( unsigned long length ) { - allActions = new Action[length]; + allActions = new GenAction[length]; for ( unsigned long a = 0; a < length; a++ ) actionList.append( allActions+a ); } @@ -274,7 +274,7 @@ void CodeGenData::resolveTargetStates( GenInlineList *inlineList ) void CodeGenData::closeMachine() { - for ( ActionList::Iter a = actionList; a.lte(); a++ ) + for ( GenActionList::Iter a = actionList; a.lte(); a++ ) resolveTargetStates( a->inlineList ); /* Note that even if we want a complete graph we do not give the error @@ -282,7 +282,7 @@ void CodeGenData::closeMachine() * loop when in the error state. */ for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { - for ( StateCondList::Iter sci = st->stateCondList; sci.lte(); sci++ ) + for ( GenStateCondList::Iter sci = st->stateCondList; sci.lte(); sci++ ) st->stateCondVect.append( sci ); } } @@ -300,21 +300,21 @@ bool CodeGenData::setAlphType( char *data ) void CodeGenData::initCondSpaceList( ulong length ) { - allCondSpaces = new CondSpace[length]; + allCondSpaces = new GenCondSpace[length]; for ( ulong c = 0; c < length; c++ ) condSpaceList.append( allCondSpaces + c ); } void CodeGenData::newCondSpace( int cnum, int condSpaceId, Key baseKey ) { - CondSpace *cond = allCondSpaces + cnum; + GenCondSpace *cond = allCondSpaces + cnum; cond->condSpaceId = condSpaceId; cond->baseKey = baseKey; } void CodeGenData::condSpaceItem( int cnum, long condActionId ) { - CondSpace *cond = allCondSpaces + cnum; + GenCondSpace *cond = allCondSpaces + cnum; cond->condSet.append( allActions + condActionId ); } @@ -328,19 +328,19 @@ void CodeGenData::addStateCond( int snum, Key lowKey, Key highKey, long condNum RedStateAp *curState = allStates + snum; /* Create the new state condition. */ - StateCond *stateCond = new StateCond; + GenStateCond *stateCond = new GenStateCond; stateCond->lowKey = lowKey; stateCond->highKey = highKey; /* Assign it a cond space. */ - CondSpace *condSpace = allCondSpaces + condNum; + GenCondSpace *condSpace = allCondSpaces + condNum; stateCond->condSpace = condSpace; curState->stateCondList.append( stateCond ); } -CondSpace *CodeGenData::findCondSpace( Key lowKey, Key highKey ) +GenCondSpace *CodeGenData::findCondSpace( Key lowKey, Key highKey ) { for ( CondSpaceList::Iter cs = condSpaceList; cs.lte(); cs++ ) { Key csHighKey = cs->baseKey; @@ -386,7 +386,7 @@ void CodeGenData::findFinalActionRefs() for ( RedTransList::Iter rtel = st->outSingle; rtel.lte(); rtel++ ) { if ( rtel->value->action != 0 ) { rtel->value->action->numTransRefs += 1; - for ( ActionTable::Iter item = rtel->value->action->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = rtel->value->action->key; item.lte(); item++ ) item->value->numTransRefs += 1; } } @@ -395,7 +395,7 @@ void CodeGenData::findFinalActionRefs() for ( RedTransList::Iter rtel = st->outRange; rtel.lte(); rtel++ ) { if ( rtel->value->action != 0 ) { rtel->value->action->numTransRefs += 1; - for ( ActionTable::Iter item = rtel->value->action->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = rtel->value->action->key; item.lte(); item++ ) item->value->numTransRefs += 1; } } @@ -403,41 +403,41 @@ void CodeGenData::findFinalActionRefs() /* Reference count default transition. */ if ( st->defTrans != 0 && st->defTrans->action != 0 ) { st->defTrans->action->numTransRefs += 1; - for ( ActionTable::Iter item = st->defTrans->action->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = st->defTrans->action->key; item.lte(); item++ ) item->value->numTransRefs += 1; } /* Reference count eof transitions. */ if ( st->eofTrans != 0 && st->eofTrans->action != 0 ) { st->eofTrans->action->numTransRefs += 1; - for ( ActionTable::Iter item = st->eofTrans->action->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = st->eofTrans->action->key; item.lte(); item++ ) item->value->numTransRefs += 1; } /* Reference count to state actions. */ if ( st->toStateAction != 0 ) { st->toStateAction->numToStateRefs += 1; - for ( ActionTable::Iter item = st->toStateAction->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = st->toStateAction->key; item.lte(); item++ ) item->value->numToStateRefs += 1; } /* Reference count from state actions. */ if ( st->fromStateAction != 0 ) { st->fromStateAction->numFromStateRefs += 1; - for ( ActionTable::Iter item = st->fromStateAction->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = st->fromStateAction->key; item.lte(); item++ ) item->value->numFromStateRefs += 1; } /* Reference count EOF actions. */ if ( st->eofAction != 0 ) { st->eofAction->numEofRefs += 1; - for ( ActionTable::Iter item = st->eofAction->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = st->eofAction->key; item.lte(); item++ ) item->value->numEofRefs += 1; } } } -void CodeGenData::analyzeAction( Action *act, GenInlineList *inlineList ) +void CodeGenData::analyzeAction( GenAction *act, GenInlineList *inlineList ) { for ( GenInlineList::Iter item = *inlineList; item.lte(); item++ ) { /* Only consider actions that are referenced. */ @@ -500,7 +500,7 @@ void CodeGenData::analyzeActionList( RedAction *redAct, GenInlineList *inlineLis void CodeGenData::assignActionIds() { int nextActionId = 0; - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Only ever interested in referenced actions. */ if ( act->numRefs() > 0 ) act->actionId = nextActionId++; @@ -597,7 +597,7 @@ void CodeGenData::setValueLimits() /* Maximum values going into the action array. */ if ( at->key.length() > redFsm->maxActArrItem ) redFsm->maxActArrItem = at->key.length(); - for ( ActionTable::Iter item = at->key; item.lte(); item++ ) { + for ( GenActionTable::Iter item = at->key; item.lte(); item++ ) { if ( item->value->actionId > redFsm->maxActArrItem ) redFsm->maxActArrItem = item->value->actionId; } @@ -613,7 +613,7 @@ void CodeGenData::analyzeMachine() findFinalActionRefs(); /* Check if there are any calls in action code. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Record the occurrence of various kinds of actions. */ if ( act->numToStateRefs > 0 ) redFsm->bAnyToStateActions = true; @@ -630,7 +630,7 @@ void CodeGenData::analyzeMachine() /* Analyze reduced action lists. */ for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) { - for ( ActionTable::Iter act = redAct->key; act.lte(); act++ ) + 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 b9ab577..f8c6d2f 100644 --- a/redfsm/gendata.h +++ b/redfsm/gendata.h @@ -32,7 +32,7 @@ using std::ostream; extern bool generateDot; struct NameInst; -typedef DList ActionList; +typedef DList GenActionList; typedef unsigned long ulong; @@ -105,15 +105,15 @@ struct CodeGenData char *fsmName; ostream &out; RedFsmAp *redFsm; - Action *allActions; + GenAction *allActions; RedAction *allActionTables; Condition *allConditions; - CondSpace *allCondSpaces; + GenCondSpace *allCondSpaces; RedStateAp *allStates; NameInst **nameIndex; int startState; int errState; - ActionList actionList; + GenActionList actionList; ConditionList conditionList; CondSpaceList condSpaceList; GenInlineList *getKeyExpr; @@ -175,7 +175,7 @@ struct CodeGenData void initStateCondList( int snum, ulong length ); void addStateCond( int snum, Key lowKey, Key highKey, long condNum ); - CondSpace *findCondSpace( Key lowKey, Key highKey ); + GenCondSpace *findCondSpace( Key lowKey, Key highKey ); Condition *findCondition( Key key ); bool setAlphType( char *data ); @@ -185,7 +185,7 @@ struct CodeGenData /* Gather various info on the machine. */ void analyzeActionList( RedAction *redAct, GenInlineList *inlineList ); - void analyzeAction( Action *act, GenInlineList *inlineList ); + void analyzeAction( GenAction *act, GenInlineList *inlineList ); void findFinalActionRefs(); void analyzeMachine(); diff --git a/redfsm/redfsm.cpp b/redfsm/redfsm.cpp index 72f7660..e02493e 100644 --- a/redfsm/redfsm.cpp +++ b/redfsm/redfsm.cpp @@ -29,7 +29,7 @@ using std::ostringstream; /* KeyOps *keyOps = 0; */ -string Action::nameOrLoc() +string GenAction::nameOrLoc() { if ( name != 0 ) return string(name); @@ -298,10 +298,10 @@ void RedFsmAp::makeFlat() st->condHighKey = st->stateCondList.tail->highKey; unsigned long long span = keyOps->span( st->condLowKey, st->condHighKey ); - st->condList = new CondSpace*[ span ]; - memset( st->condList, 0, sizeof(CondSpace*)*span ); + st->condList = new GenCondSpace*[ span ]; + memset( st->condList, 0, sizeof(GenCondSpace*)*span ); - for ( StateCondList::Iter sci = st->stateCondList; sci.lte(); sci++ ) { + for ( GenStateCondList::Iter sci = st->stateCondList; sci.lte(); sci++ ) { unsigned long long base, trSpan; base = keyOps->span( st->condLowKey, sci->lowKey )-1; trSpan = keyOps->span( sci->lowKey, sci->highKey ); diff --git a/redfsm/redfsm.h b/redfsm/redfsm.h index eb8d4d9..c53352a 100644 --- a/redfsm/redfsm.h +++ b/redfsm/redfsm.h @@ -48,7 +48,7 @@ using std::string; struct RedStateAp; struct GenInlineList; -struct Action; +struct GenAction; /* Location in an input file. */ struct GenInputLoc @@ -92,11 +92,11 @@ struct GenInlineItem struct GenInlineList : public DList { }; /* Element in list of actions. Contains the string for the code to exectute. */ -struct Action +struct GenAction : - public DListEl + public DListEl { - Action( ) + GenAction( ) : name(0), inlineList(0), @@ -130,23 +130,23 @@ struct Action struct RedStateAp; struct StateAp; -/* Transistion Action Element. */ -typedef SBstMapEl< int, Action* > ActionTableEl; +/* Transistion GenAction Element. */ +typedef SBstMapEl< int, GenAction* > GenActionTableEl; -/* Transition Action Table. */ -struct ActionTable - : public SBstMap< int, Action*, CmpOrd > +/* Transition GenAction Table. */ +struct GenActionTable + : public SBstMap< int, GenAction*, CmpOrd > { - void setAction( int ordering, Action *action ); - void setActions( int *orderings, Action **actions, int nActs ); - void setActions( const ActionTable &other ); + void setAction( int ordering, GenAction *action ); + void setActions( int *orderings, GenAction **actions, int nActs ); + void setActions( const GenActionTable &other ); }; /* Compare of a whole action table element (key & value). */ -struct CmpActionTableEl +struct CmpGenActionTableEl { - static int compare( const ActionTableEl &action1, - const ActionTableEl &action2 ) + static int compare( const GenActionTableEl &action1, + const GenActionTableEl &action2 ) { if ( action1.key < action2.key ) return -1; @@ -160,8 +160,8 @@ struct CmpActionTableEl } }; -/* Compare for ActionTable. */ -typedef CmpSTable< ActionTableEl, CmpActionTableEl > CmpActionTable; +/* Compare for GenActionTable. */ +typedef CmpSTable< GenActionTableEl, CmpGenActionTableEl > CmpGenActionTable; /* Set of states. */ typedef BstSet RedStateSet; @@ -185,10 +185,10 @@ struct RedAction bAnyBreakStmt(false) { } - const ActionTable &getKey() + const GenActionTable &getKey() { return key; } - ActionTable key; + GenActionTable key; int actListId; int location; IntSet *eofRefs; @@ -209,7 +209,7 @@ struct RedAction bool bAnyCurStateRef; bool bAnyBreakStmt; }; -typedef AvlTree ActionTableMap; +typedef AvlTree ActionTableMap; /* Reduced transition. */ struct RedTransAp @@ -287,7 +287,7 @@ typedef MergeSort RedSpanMapSort; typedef Vector EntryIdVect; typedef Vector EntryNameVect; -typedef Vector< Action* > CondSet; +typedef Vector< GenAction* > GenCondSet; struct Condition { @@ -296,33 +296,33 @@ struct Condition Key key; Key baseKey; - CondSet condSet; + GenCondSet condSet; Condition *next, *prev; }; typedef DList ConditionList; -struct CondSpace +struct GenCondSpace { Key baseKey; - CondSet condSet; + GenCondSet condSet; int condSpaceId; - CondSpace *next, *prev; + GenCondSpace *next, *prev; }; -typedef DList CondSpaceList; +typedef DList CondSpaceList; -struct StateCond +struct GenStateCond { Key lowKey; Key highKey; - CondSpace *condSpace; + GenCondSpace *condSpace; - StateCond *prev, *next; + GenStateCond *prev, *next; }; -typedef DList StateCondList; -typedef Vector StateCondVect; +typedef DList GenStateCondList; +typedef Vector StateCondVect; /* Reduced state. */ struct RedStateAp @@ -354,7 +354,7 @@ struct RedStateAp /* For flat conditions. */ Key condLowKey, condHighKey; - CondSpace **condList; + GenCondSpace **condList; /* For flat keys. */ Key lowKey, highKey; @@ -372,7 +372,7 @@ struct RedStateAp RedAction *eofAction; RedTransAp *eofTrans; int id; - StateCondList stateCondList; + GenStateCondList stateCondList; StateCondVect stateCondVect; /* Pointers for the list of states. */ diff --git a/redfsm/xmlparse.kh b/redfsm/xmlparse.kh index 431e329..8a5aff5 100644 --- a/redfsm/xmlparse.kh +++ b/redfsm/xmlparse.kh @@ -23,10 +23,14 @@ #include "vector.h" #include "gendata.h" +#include "buffer.h" #include +using std::istream; using std::ostream; +#define XML_BUFSIZE 4096 + struct AttrMarker { char *id; @@ -81,11 +85,7 @@ struct XMLTagHashPair int id; }; -struct Token -{ - XMLTag *tag; - GenInputLoc loc; -}; +struct Token; struct GenInlineItem; struct GenInlineList; @@ -93,6 +93,37 @@ struct GenInlineList; struct LmSwitchVect; struct LmSwitchAction; +struct XmlScanner +{ + XmlScanner( const char *fileName, istream &input ); + + int scan(); + void adjustAttrPointers( int distance ); + std::ostream &error(); + + const char *fileName; + istream &input; + + /* Scanner State. */ + int cs, act, have, curline, curcol; + char *ts, *te; + char *p, *pe; + int done; + + /* Token data */ + char *data; + int data_len; + int value; + AttrMkList attrMkList; + Buffer buffer; + char *tag_id_start; + int tag_id_len; + int token_col, token_line; + + char buf[XML_BUFSIZE]; +}; + + struct XmlParser { %%{ diff --git a/redfsm/xmlparse.kl b/redfsm/xmlparse.kl index 967f6ef..e725fcc 100644 --- a/redfsm/xmlparse.kl +++ b/redfsm/xmlparse.kl @@ -36,6 +36,12 @@ Key readKey( char *td, char **end ); long readOffsetPtr( char *td, char **end ); unsigned long readLength( char *td ); +struct Token +{ + XMLTag *tag; + GenInputLoc loc; +}; + CodeGenData *makeCodeGen( char *sourceFileName, char *fsmName, ostream &out, bool wantComplete ) { diff --git a/redfsm/xmlscan.rl b/redfsm/xmlscan.rl index 0835699..23dcaca 100644 --- a/redfsm/xmlscan.rl +++ b/redfsm/xmlscan.rl @@ -22,15 +22,12 @@ #include #include "vector.h" #include "xmlparse.h" -#include "buffer.h" using std::istream; using std::cout; using std::cerr; using std::endl; -#define BUFSIZE 4096 - %%{ machine XmlScanner; write data; @@ -45,50 +42,21 @@ public: static struct XMLTagHashPair *in_word_set (const char *str, unsigned int len); }; -struct XmlScanner +XmlScanner::XmlScanner( const char *fileName, istream &input ) : + fileName(fileName), + input(input), + curline(1), + curcol(1), + p(0), pe(0), + done(false), + data(0), data_len(0), + value(0) { - XmlScanner( const char *fileName, istream &input ) : - fileName(fileName), - input(input), - curline(1), - curcol(1), - p(0), pe(0), - done(false), - data(0), data_len(0), - value(0) - { - %%{ - machine XmlScanner; - write init; - }%% - } - - int scan(); - void adjustAttrPointers( int distance ); - std::ostream &error(); - - const char *fileName; - istream &input; - - /* Scanner State. */ - int cs, act, have, curline, curcol; - char *ts, *te; - char *p, *pe; - int done; - - /* Token data */ - char *data; - int data_len; - int value; - AttrMkList attrMkList; - Buffer buffer; - char *tag_id_start; - int tag_id_len; - int token_col, token_line; - - char buf[BUFSIZE]; -}; - + %%{ + machine XmlScanner; + write init; + }%% +} #define TK_NO_TOKEN (-1) #define TK_ERR 1 @@ -211,7 +179,7 @@ int XmlScanner::scan( ) } p = buf + have; - space = BUFSIZE - have; + space = XML_BUFSIZE - have; if ( space == 0 ) { /* We filled up the buffer trying to scan a token. */ diff --git a/rlgen-cd/fflatcodegen.cpp b/rlgen-cd/fflatcodegen.cpp index 56e6685..c76677f 100644 --- a/rlgen-cd/fflatcodegen.cpp +++ b/rlgen-cd/fflatcodegen.cpp @@ -74,7 +74,7 @@ std::ostream &FFlatCodeGen::TO_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; @@ -96,7 +96,7 @@ std::ostream &FFlatCodeGen::FROM_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; @@ -116,7 +116,7 @@ std::ostream &FFlatCodeGen::EOF_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true, false ); out << "\tbreak;\n"; @@ -138,7 +138,7 @@ std::ostream &FFlatCodeGen::ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; diff --git a/rlgen-cd/fgotocodegen.cpp b/rlgen-cd/fgotocodegen.cpp index 0a353f3..3988868 100644 --- a/rlgen-cd/fgotocodegen.cpp +++ b/rlgen-cd/fgotocodegen.cpp @@ -36,7 +36,7 @@ std::ostream &FGotoCodeGen::EXEC_ACTIONS() out << "f" << redAct->actListId << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tgoto _again;\n"; @@ -56,7 +56,7 @@ std::ostream &FGotoCodeGen::TO_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; @@ -78,7 +78,7 @@ std::ostream &FGotoCodeGen::FROM_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; @@ -98,7 +98,7 @@ std::ostream &FGotoCodeGen::EOF_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true, false ); out << "\tbreak;\n"; diff --git a/rlgen-cd/flatcodegen.cpp b/rlgen-cd/flatcodegen.cpp index b9cdfca..66dc07b 100644 --- a/rlgen-cd/flatcodegen.cpp +++ b/rlgen-cd/flatcodegen.cpp @@ -66,7 +66,7 @@ std::ostream &FlatCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &FlatCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -83,7 +83,7 @@ std::ostream &FlatCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &FlatCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -100,7 +100,7 @@ std::ostream &FlatCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &FlatCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -118,7 +118,7 @@ std::ostream &FlatCodeGen::EOF_ACTION_SWITCH() std::ostream &FlatCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -651,13 +651,13 @@ void FlatCodeGen::COND_TRANSLATE() out << " switch ( _cond ) {\n"; for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) { - CondSpace *condSpace = csi; + GenCondSpace *condSpace = csi; out << " case " << condSpace->condSpaceId + 1 << ": {\n"; out << TABS(2) << "_widec = " << CAST(WIDE_ALPH_TYPE()) << "(" << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << "));\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(2) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); diff --git a/rlgen-cd/fsmcodegen.cpp b/rlgen-cd/fsmcodegen.cpp index ab8f4ad..942769c 100644 --- a/rlgen-cd/fsmcodegen.cpp +++ b/rlgen-cd/fsmcodegen.cpp @@ -121,7 +121,7 @@ std::ostream &FsmCodeGen::ACTIONS_ARRAY() if ( totalActions++ % 8 == 7 ) out << "\n\t"; - for ( ActionTable::Iter item = act->key; item.lte(); item++ ) { + for ( GenActionTable::Iter item = act->key; item.lte(); item++ ) { out << item->value->actionId; if ( ! (act.last() && item.last()) ) out << ", "; @@ -500,7 +500,7 @@ string FsmCodeGen::LDIR_PATH( char *path ) return ret.str(); } -void FsmCodeGen::ACTION( ostream &ret, Action *action, int targState, +void FsmCodeGen::ACTION( ostream &ret, GenAction *action, int targState, bool inFinish, bool csForced ) { /* Write the preprocessor line info for going into the source file. */ @@ -512,7 +512,7 @@ void FsmCodeGen::ACTION( ostream &ret, Action *action, int targState, ret << "}\n"; } -void FsmCodeGen::CONDITION( ostream &ret, Action *condition ) +void FsmCodeGen::CONDITION( ostream &ret, GenAction *condition ) { ret << "\n"; cdLineDirective( ret, sourceFileName, condition->loc.line ); diff --git a/rlgen-cd/fsmcodegen.h b/rlgen-cd/fsmcodegen.h index 5fa9bfb..6e75772 100644 --- a/rlgen-cd/fsmcodegen.h +++ b/rlgen-cd/fsmcodegen.h @@ -40,7 +40,7 @@ using std::ostream; struct RedFsmAp; struct RedStateAp; struct CodeGenData; -struct Action; +struct GenAction; struct NameInst; struct GenInlineItem; struct GenInlineList; @@ -76,9 +76,9 @@ protected: string TABS( int level ); string KEY( Key key ); string LDIR_PATH( char *path ); - void ACTION( ostream &ret, Action *action, int targState, + void ACTION( ostream &ret, GenAction *action, int targState, bool inFinish, bool csForced ); - void CONDITION( ostream &ret, Action *condition ); + void CONDITION( ostream &ret, GenAction *condition ); string ALPH_TYPE(); string WIDE_ALPH_TYPE(); string ARRAY_TYPE( unsigned long maxVal ); diff --git a/rlgen-cd/ftabcodegen.cpp b/rlgen-cd/ftabcodegen.cpp index 3aac8af..6118b78 100644 --- a/rlgen-cd/ftabcodegen.cpp +++ b/rlgen-cd/ftabcodegen.cpp @@ -103,7 +103,7 @@ std::ostream &FTabCodeGen::TO_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; @@ -125,7 +125,7 @@ std::ostream &FTabCodeGen::FROM_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; @@ -145,7 +145,7 @@ std::ostream &FTabCodeGen::EOF_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true, false ); out << "\tbreak;\n"; @@ -167,7 +167,7 @@ std::ostream &FTabCodeGen::ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false, false ); out << "\tbreak;\n"; diff --git a/rlgen-cd/gotocodegen.cpp b/rlgen-cd/gotocodegen.cpp index 0309f76..e4999f0 100644 --- a/rlgen-cd/gotocodegen.cpp +++ b/rlgen-cd/gotocodegen.cpp @@ -37,7 +37,7 @@ std::ostream &GotoCodeGen::TRANS_GOTO( RedTransAp *trans, int level ) std::ostream &GotoCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -54,7 +54,7 @@ std::ostream &GotoCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &GotoCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -71,7 +71,7 @@ std::ostream &GotoCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &GotoCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -88,7 +88,7 @@ std::ostream &GotoCodeGen::EOF_ACTION_SWITCH() std::ostream &GotoCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -237,14 +237,14 @@ void GotoCodeGen::STATE_GOTO_ERROR() out << " goto _out;\n"; } -void GotoCodeGen::COND_TRANSLATE( StateCond *stateCond, int level ) +void GotoCodeGen::COND_TRANSLATE( GenStateCond *stateCond, int level ) { - CondSpace *condSpace = stateCond->condSpace; + GenCondSpace *condSpace = stateCond->condSpace; out << TABS(level) << "_widec = " << CAST(WIDE_ALPH_TYPE()) << "(" << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << "));\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(level) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); @@ -256,7 +256,7 @@ void GotoCodeGen::emitCondBSearch( RedStateAp *state, int level, int low, int hi { /* Get the mid position, staying on the lower end of the range. */ int mid = (low + high) >> 1; - StateCond **data = state->stateCondVect.data; + GenStateCond **data = state->stateCondVect.data; /* Determine if we need to look higher or lower. */ bool anyLower = mid > low; diff --git a/rlgen-cd/gotocodegen.h b/rlgen-cd/gotocodegen.h index dace568..7de21f1 100644 --- a/rlgen-cd/gotocodegen.h +++ b/rlgen-cd/gotocodegen.h @@ -32,7 +32,7 @@ struct CodeGenData; struct NameInst; struct RedTransAp; struct RedStateAp; -struct StateCond; +struct GenStateCond; /* * Goto driven fsm. @@ -69,7 +69,7 @@ public: std::ostream &FROM_STATE_ACTIONS(); std::ostream &EOF_ACTIONS(); - void COND_TRANSLATE( StateCond *stateCond, int level ); + void COND_TRANSLATE( GenStateCond *stateCond, int level ); void emitCondBSearch( RedStateAp *state, int level, int low, int high ); void STATE_CONDS( RedStateAp *state, bool genDefault ); diff --git a/rlgen-cd/ipgotocodegen.cpp b/rlgen-cd/ipgotocodegen.cpp index 220df53..9d10d9f 100644 --- a/rlgen-cd/ipgotocodegen.cpp +++ b/rlgen-cd/ipgotocodegen.cpp @@ -140,7 +140,7 @@ 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++ ) { + for ( GenActionTable::Iter item = trans->action->key; item.lte(); item++ ) { ACTION( out, item->value, trans->targ->id, false, trans->action->anyNextStmt() ); } @@ -169,7 +169,7 @@ void IpGotoCodeGen::GOTO_HEADER( RedStateAp *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++ ) { + for ( GenActionTable::Iter item = state->toStateAction->key; item.lte(); item++ ) { ACTION( out, item->value, state->id, false, state->toStateAction->anyNextStmt() ); } @@ -194,7 +194,7 @@ void IpGotoCodeGen::GOTO_HEADER( RedStateAp *state ) 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++ ) { + for ( GenActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ ) { ACTION( out, item->value, state->id, false, state->fromStateAction->anyNextStmt() ); } @@ -291,7 +291,7 @@ std::ostream &IpGotoCodeGen::FINISH_CASES() anyWritten = true; /* Write each action in the eof action list. */ - for ( ActionTable::Iter item = act->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = act->key; item.lte(); item++ ) ACTION( out, item->value, STATE_ERR_STATE, true, false ); out << "\tbreak;\n"; } @@ -344,7 +344,7 @@ void IpGotoCodeGen::setLabelsNeeded() * invoked on characters (ie, not from out action code). */ if ( trans->action != 0 ) { /* Loop the actions. */ - for ( ActionTable::Iter act = trans->action->key; act.lte(); act++ ) { + for ( GenActionTable::Iter act = trans->action->key; act.lte(); act++ ) { /* Get the action and walk it's tree. */ setLabelsNeeded( act->value->inlineList ); } diff --git a/rlgen-cd/splitcodegen.cpp b/rlgen-cd/splitcodegen.cpp index d4fc07d..5faf602 100644 --- a/rlgen-cd/splitcodegen.cpp +++ b/rlgen-cd/splitcodegen.cpp @@ -68,7 +68,7 @@ void SplitCodeGen::GOTO_HEADER( RedStateAp *state, bool stateInPartition ) 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++ ) { + for ( GenActionTable::Iter item = state->toStateAction->key; item.lte(); item++ ) { ACTION( out, item->value, state->id, false, state->toStateAction->anyNextStmt() ); } @@ -93,7 +93,7 @@ void SplitCodeGen::GOTO_HEADER( RedStateAp *state, bool stateInPartition ) 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++ ) { + for ( GenActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ ) { ACTION( out, item->value, state->id, false, state->fromStateAction->anyNextStmt() ); } @@ -158,7 +158,7 @@ std::ostream &SplitCodeGen::PART_TRANS( int partition ) out << " " << CS() << " = " << trans->targ->id << ";\n"; /* Write each action in the list. */ - for ( ActionTable::Iter item = trans->action->key; item.lte(); item++ ) { + for ( GenActionTable::Iter item = trans->action->key; item.lte(); item++ ) { ACTION( out, item->value, trans->targ->id, false, trans->action->anyNextStmt() ); } @@ -178,7 +178,7 @@ std::ostream &SplitCodeGen::PART_TRANS( int partition ) 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++ ) { + for ( GenActionTable::Iter item = st->toStateAction->key; item.lte(); item++ ) { ACTION( out, item->value, st->id, false, st->toStateAction->anyNextStmt() ); } @@ -471,7 +471,7 @@ void SplitCodeGen::setLabelsNeeded( RedStateAp *fromState, RedTransAp *trans ) * invoked on characters (ie, not from out action code). */ if ( trans->action != 0 ) { /* Loop the actions. */ - for ( ActionTable::Iter act = trans->action->key; act.lte(); act++ ) { + for ( GenActionTable::Iter act = trans->action->key; act.lte(); act++ ) { /* Get the action and walk it's tree. */ setLabelsNeeded( fromState, act->value->inlineList ); } diff --git a/rlgen-cd/tabcodegen.cpp b/rlgen-cd/tabcodegen.cpp index a46e997..82d9d43 100644 --- a/rlgen-cd/tabcodegen.cpp +++ b/rlgen-cd/tabcodegen.cpp @@ -95,7 +95,7 @@ std::ostream &TabCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &TabCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -112,7 +112,7 @@ std::ostream &TabCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &TabCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -129,7 +129,7 @@ std::ostream &TabCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &TabCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -147,7 +147,7 @@ std::ostream &TabCodeGen::EOF_ACTION_SWITCH() std::ostream &TabCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -357,7 +357,7 @@ std::ostream &TabCodeGen::COND_KEYS() int totalTrans = 0; for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Lower key. */ out << KEY( sc->lowKey ) << ", "; if ( ++totalTrans % IALL == 0 ) @@ -382,7 +382,7 @@ std::ostream &TabCodeGen::COND_SPACES() int totalTrans = 0; for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Cond Space id. */ out << sc->condSpace->condSpaceId << ", "; if ( ++totalTrans % IALL == 0 ) @@ -893,13 +893,13 @@ void TabCodeGen::COND_TRANSLATE() " + ((_mid - _keys)>>1)] ) {\n"; for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) { - CondSpace *condSpace = csi; + GenCondSpace *condSpace = csi; out << " case " << condSpace->condSpaceId << ": {\n"; out << TABS(2) << "_widec = " << CAST(WIDE_ALPH_TYPE()) << "(" << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << "));\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(2) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); diff --git a/rlgen-csharp/fflatcodegen.cpp b/rlgen-csharp/fflatcodegen.cpp index cbce95f..fbccbcd 100644 --- a/rlgen-csharp/fflatcodegen.cpp +++ b/rlgen-csharp/fflatcodegen.cpp @@ -74,7 +74,7 @@ std::ostream &CSharpFFlatCodeGen::TO_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; @@ -96,7 +96,7 @@ std::ostream &CSharpFFlatCodeGen::FROM_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; @@ -116,7 +116,7 @@ std::ostream &CSharpFFlatCodeGen::EOF_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true ); out << "\tbreak;\n"; @@ -138,7 +138,7 @@ std::ostream &CSharpFFlatCodeGen::ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; diff --git a/rlgen-csharp/fgotocodegen.cpp b/rlgen-csharp/fgotocodegen.cpp index c62ce14..a39289f 100644 --- a/rlgen-csharp/fgotocodegen.cpp +++ b/rlgen-csharp/fgotocodegen.cpp @@ -36,7 +36,7 @@ std::ostream &CSharpFGotoCodeGen::EXEC_ACTIONS() out << "f" << redAct->actListId << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tgoto _again;\n"; @@ -56,7 +56,7 @@ std::ostream &CSharpFGotoCodeGen::TO_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; @@ -78,7 +78,7 @@ std::ostream &CSharpFGotoCodeGen::FROM_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; @@ -98,7 +98,7 @@ std::ostream &CSharpFGotoCodeGen::EOF_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true ); out << "\tbreak;\n"; diff --git a/rlgen-csharp/flatcodegen.cpp b/rlgen-csharp/flatcodegen.cpp index bb25d17..10f9f36 100644 --- a/rlgen-csharp/flatcodegen.cpp +++ b/rlgen-csharp/flatcodegen.cpp @@ -66,7 +66,7 @@ std::ostream &CSharpFlatCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &CSharpFlatCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -83,7 +83,7 @@ std::ostream &CSharpFlatCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &CSharpFlatCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -100,7 +100,7 @@ std::ostream &CSharpFlatCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &CSharpFlatCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -118,7 +118,7 @@ std::ostream &CSharpFlatCodeGen::EOF_ACTION_SWITCH() std::ostream &CSharpFlatCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -668,13 +668,13 @@ void CSharpFlatCodeGen::COND_TRANSLATE() out << " switch ( _cond ) {\n"; for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) { - CondSpace *condSpace = csi; + GenCondSpace *condSpace = csi; out << " case " << condSpace->condSpaceId + 1 << ": {\n"; out << TABS(2) << "_widec = " << CAST(WIDE_ALPH_TYPE()) << "(" << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << "));\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(2) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); diff --git a/rlgen-csharp/fsmcodegen.cpp b/rlgen-csharp/fsmcodegen.cpp index 2dc8a2d..fd46865 100644 --- a/rlgen-csharp/fsmcodegen.cpp +++ b/rlgen-csharp/fsmcodegen.cpp @@ -130,7 +130,7 @@ std::ostream &CSharpFsmCodeGen::ACTIONS_ARRAY() if ( totalActions++ % 8 == 7 ) out << "\n\t"; - for ( ActionTable::Iter item = act->key; item.lte(); item++ ) { + for ( GenActionTable::Iter item = act->key; item.lte(); item++ ) { out << item->value->actionId; if ( ! (act.last() && item.last()) ) out << ", "; @@ -516,7 +516,7 @@ string CSharpFsmCodeGen::LDIR_PATH( char *path ) return ret.str(); } -void CSharpFsmCodeGen::ACTION( ostream &ret, Action *action, int targState, bool inFinish ) +void CSharpFsmCodeGen::ACTION( ostream &ret, GenAction *action, int targState, bool inFinish ) { /* Write the preprocessor line info for going into the source file. */ csharpLineDirective( ret, sourceFileName, action->loc.line ); @@ -527,7 +527,7 @@ void CSharpFsmCodeGen::ACTION( ostream &ret, Action *action, int targState, bool ret << "}\n"; } -void CSharpFsmCodeGen::CONDITION( ostream &ret, Action *condition ) +void CSharpFsmCodeGen::CONDITION( ostream &ret, GenAction *condition ) { ret << "\n"; csharpLineDirective( ret, sourceFileName, condition->loc.line ); diff --git a/rlgen-csharp/fsmcodegen.h b/rlgen-csharp/fsmcodegen.h index ab85679..0bd7e48 100644 --- a/rlgen-csharp/fsmcodegen.h +++ b/rlgen-csharp/fsmcodegen.h @@ -40,7 +40,7 @@ using std::ostream; struct RedFsmAp; struct RedStateAp; struct CodeGenData; -struct Action; +struct GenAction; struct NameInst; struct GenInlineItem; struct GenInlineList; @@ -77,8 +77,8 @@ protected: string KEY( Key key ); string ALPHA_KEY( Key key ); string LDIR_PATH( char *path ); - void ACTION( ostream &ret, Action *action, int targState, bool inFinish ); - void CONDITION( ostream &ret, Action *condition ); + void ACTION( ostream &ret, GenAction *action, int targState, bool inFinish ); + void CONDITION( ostream &ret, GenAction *condition ); string ALPH_TYPE(); string WIDE_ALPH_TYPE(); string ARRAY_TYPE( unsigned long maxVal ); diff --git a/rlgen-csharp/ftabcodegen.cpp b/rlgen-csharp/ftabcodegen.cpp index 421ee9b..4804a2d 100644 --- a/rlgen-csharp/ftabcodegen.cpp +++ b/rlgen-csharp/ftabcodegen.cpp @@ -103,7 +103,7 @@ std::ostream &CSharpFTabCodeGen::TO_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; @@ -125,7 +125,7 @@ std::ostream &CSharpFTabCodeGen::FROM_STATE_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; @@ -145,7 +145,7 @@ std::ostream &CSharpFTabCodeGen::EOF_ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true ); out << "\tbreak;\n"; @@ -167,7 +167,7 @@ std::ostream &CSharpFTabCodeGen::ACTION_SWITCH() out << "\tcase " << redAct->actListId+1 << ":\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); out << "\tbreak;\n"; diff --git a/rlgen-csharp/gotocodegen.cpp b/rlgen-csharp/gotocodegen.cpp index 0875aad..5172968 100644 --- a/rlgen-csharp/gotocodegen.cpp +++ b/rlgen-csharp/gotocodegen.cpp @@ -37,7 +37,7 @@ std::ostream &CSharpGotoCodeGen::TRANS_GOTO( RedTransAp *trans, int level ) std::ostream &CSharpGotoCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -54,7 +54,7 @@ std::ostream &CSharpGotoCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &CSharpGotoCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -71,7 +71,7 @@ std::ostream &CSharpGotoCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &CSharpGotoCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -88,7 +88,7 @@ std::ostream &CSharpGotoCodeGen::EOF_ACTION_SWITCH() std::ostream &CSharpGotoCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -237,14 +237,14 @@ void CSharpGotoCodeGen::STATE_GOTO_ERROR() out << " goto _out;\n"; } -void CSharpGotoCodeGen::COND_TRANSLATE( StateCond *stateCond, int level ) +void CSharpGotoCodeGen::COND_TRANSLATE( GenStateCond *stateCond, int level ) { - CondSpace *condSpace = stateCond->condSpace; + GenCondSpace *condSpace = stateCond->condSpace; out << TABS(level) << "_widec = " << CAST(WIDE_ALPH_TYPE()) << "(" << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << "));\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(level) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); @@ -256,7 +256,7 @@ void CSharpGotoCodeGen::emitCondBSearch( RedStateAp *state, int level, int low, { /* Get the mid position, staying on the lower end of the range. */ int mid = (low + high) >> 1; - StateCond **data = state->stateCondVect.data; + GenStateCond **data = state->stateCondVect.data; /* Determine if we need to look higher or lower. */ bool anyLower = mid > low; diff --git a/rlgen-csharp/gotocodegen.h b/rlgen-csharp/gotocodegen.h index 565627e..2839d0e 100644 --- a/rlgen-csharp/gotocodegen.h +++ b/rlgen-csharp/gotocodegen.h @@ -32,7 +32,7 @@ struct CodeGenData; struct NameInst; struct RedTransAp; struct RedStateAp; -struct StateCond; +struct GenStateCond; /* * Goto driven fsm. @@ -69,7 +69,7 @@ public: std::ostream &FROM_STATE_ACTIONS(); std::ostream &EOF_ACTIONS(); - void COND_TRANSLATE( StateCond *stateCond, int level ); + void COND_TRANSLATE( GenStateCond *stateCond, int level ); void emitCondBSearch( RedStateAp *state, int level, int low, int high ); void STATE_CONDS( RedStateAp *state, bool genDefault ); diff --git a/rlgen-csharp/ipgotocodegen.cpp b/rlgen-csharp/ipgotocodegen.cpp index 10413ac..259c752 100644 --- a/rlgen-csharp/ipgotocodegen.cpp +++ b/rlgen-csharp/ipgotocodegen.cpp @@ -140,7 +140,7 @@ bool CSharpIpGotoCodeGen::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++ ) + for ( GenActionTable::Iter item = trans->action->key; item.lte(); item++ ) ACTION( out, item->value, trans->targ->id, false ); /* If the action contains a next then we need to reload, otherwise @@ -167,7 +167,7 @@ void CSharpIpGotoCodeGen::GOTO_HEADER( RedStateAp *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++ ) + for ( GenActionTable::Iter item = state->toStateAction->key; item.lte(); item++ ) ACTION( out, item->value, state->id, false ); } @@ -190,7 +190,7 @@ void CSharpIpGotoCodeGen::GOTO_HEADER( RedStateAp *state ) 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++ ) + for ( GenActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ ) ACTION( out, item->value, state->id, false ); } @@ -285,7 +285,7 @@ std::ostream &CSharpIpGotoCodeGen::FINISH_CASES() anyWritten = true; /* Write each action in the eof action list. */ - for ( ActionTable::Iter item = act->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = act->key; item.lte(); item++ ) ACTION( out, item->value, STATE_ERR_STATE, true ); out << "\tbreak;\n"; } @@ -338,7 +338,7 @@ void CSharpIpGotoCodeGen::setLabelsNeeded() * invoked on characters (ie, not from out action code). */ if ( trans->action != 0 ) { /* Loop the actions. */ - for ( ActionTable::Iter act = trans->action->key; act.lte(); act++ ) { + for ( GenActionTable::Iter act = trans->action->key; act.lte(); act++ ) { /* Get the action and walk it's tree. */ setLabelsNeeded( act->value->inlineList ); } diff --git a/rlgen-csharp/splitcodegen.cpp b/rlgen-csharp/splitcodegen.cpp index 0c6444f..5aaee1e 100644 --- a/rlgen-csharp/splitcodegen.cpp +++ b/rlgen-csharp/splitcodegen.cpp @@ -68,7 +68,7 @@ void CSharpSplitCodeGen::GOTO_HEADER( RedStateAp *state, bool stateInPartition ) 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++ ) + for ( GenActionTable::Iter item = state->toStateAction->key; item.lte(); item++ ) ACTION( out, item->value, state->id, false ); } @@ -91,7 +91,7 @@ void CSharpSplitCodeGen::GOTO_HEADER( RedStateAp *state, bool stateInPartition ) 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++ ) + for ( GenActionTable::Iter item = state->fromStateAction->key; item.lte(); item++ ) ACTION( out, item->value, state->id, false ); } @@ -154,7 +154,7 @@ std::ostream &CSharpSplitCodeGen::PART_TRANS( int partition ) out << " " << CS() << " = " << trans->targ->id << ";\n"; /* Write each action in the list. */ - for ( ActionTable::Iter item = trans->action->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = trans->action->key; item.lte(); item++ ) ACTION( out, item->value, trans->targ->id, false ); } @@ -172,7 +172,7 @@ std::ostream &CSharpSplitCodeGen::PART_TRANS( int partition ) 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++ ) + for ( GenActionTable::Iter item = st->toStateAction->key; item.lte(); item++ ) ACTION( out, item->value, st->id, false ); genLineDirective( out ); } @@ -463,7 +463,7 @@ void CSharpSplitCodeGen::setLabelsNeeded( RedStateAp *fromState, RedTransAp *tra * invoked on characters (ie, not from out action code). */ if ( trans->action != 0 ) { /* Loop the actions. */ - for ( ActionTable::Iter act = trans->action->key; act.lte(); act++ ) { + for ( GenActionTable::Iter act = trans->action->key; act.lte(); act++ ) { /* Get the action and walk it's tree. */ setLabelsNeeded( fromState, act->value->inlineList ); } diff --git a/rlgen-csharp/tabcodegen.cpp b/rlgen-csharp/tabcodegen.cpp index c209d47..ab1a672 100644 --- a/rlgen-csharp/tabcodegen.cpp +++ b/rlgen-csharp/tabcodegen.cpp @@ -95,7 +95,7 @@ std::ostream &CSharpTabCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &CSharpTabCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -112,7 +112,7 @@ std::ostream &CSharpTabCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &CSharpTabCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -129,7 +129,7 @@ std::ostream &CSharpTabCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &CSharpTabCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -147,7 +147,7 @@ std::ostream &CSharpTabCodeGen::EOF_ACTION_SWITCH() std::ostream &CSharpTabCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -357,7 +357,7 @@ std::ostream &CSharpTabCodeGen::COND_KEYS() int totalTrans = 0; for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Lower key. */ out << ALPHA_KEY( sc->lowKey ) << ", "; if ( ++totalTrans % IALL == 0 ) @@ -382,7 +382,7 @@ std::ostream &CSharpTabCodeGen::COND_SPACES() int totalTrans = 0; for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Cond Space id. */ out << sc->condSpace->condSpaceId << ", "; if ( ++totalTrans % IALL == 0 ) @@ -896,13 +896,13 @@ void CSharpTabCodeGen::COND_TRANSLATE() " + ((_mid - _keys)>>1)] ) {\n"; for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) { - CondSpace *condSpace = csi; + GenCondSpace *condSpace = csi; out << " case " << condSpace->condSpaceId << ": {\n"; out << TABS(2) << "_widec = " << CAST(WIDE_ALPH_TYPE()) << "(" << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << "));\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(2) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); diff --git a/rlgen-dot/gvdotgen.cpp b/rlgen-dot/gvdotgen.cpp index bcce3a1..8f900e9 100644 --- a/rlgen-dot/gvdotgen.cpp +++ b/rlgen-dot/gvdotgen.cpp @@ -95,8 +95,8 @@ std::ostream &GraphvizDotGen::TRANS_ACTION( RedStateAp *fromState, RedTransAp *t /* Loop the existing actions and write out what's there. */ for ( int a = 0; a < n; a++ ) { - for ( ActionTable::Iter actIt = actions[a]->key.first(); actIt.lte(); actIt++ ) { - Action *action = actIt->value; + for ( GenActionTable::Iter actIt = actions[a]->key.first(); actIt.lte(); actIt++ ) { + GenAction *action = actIt->value; out << action->nameOrLoc(); if ( a < n-1 || !actIt.last() ) out << ", "; @@ -109,8 +109,8 @@ std::ostream &GraphvizDotGen::ACTION( RedAction *action ) { /* The action. */ out << " / "; - for ( ActionTable::Iter actIt = action->key.first(); actIt.lte(); actIt++ ) { - Action *action = actIt->value; + for ( GenActionTable::Iter actIt = action->key.first(); actIt.lte(); actIt++ ) { + GenAction *action = actIt->value; if ( action->name != 0 ) out << action->name; else @@ -124,7 +124,7 @@ std::ostream &GraphvizDotGen::ACTION( RedAction *action ) std::ostream &GraphvizDotGen::ONCHAR( Key lowKey, Key highKey ) { if ( lowKey > keyOps->maxKey ) { - CondSpace *condSpace = findCondSpace( lowKey, highKey ); + GenCondSpace *condSpace = findCondSpace( lowKey, highKey ); Key values = ( lowKey - condSpace->baseKey ) / keyOps->alphSize(); lowKey = keyOps->minKey + @@ -138,7 +138,7 @@ std::ostream &GraphvizDotGen::ONCHAR( Key lowKey, Key highKey ) } out << "("; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { bool set = values & (1 << csi.pos()); if ( !set ) out << "!"; diff --git a/rlgen-dot/main.cpp b/rlgen-dot/main.cpp index 20560c2..8004236 100644 --- a/rlgen-dot/main.cpp +++ b/rlgen-dot/main.cpp @@ -55,8 +55,6 @@ extern bool displayPrintables; extern int numSplitPartitions; -/* Print a summary of the options. */ - /* * Callbacks invoked by the XML data parser. */ diff --git a/rlgen-java/javacodegen.cpp b/rlgen-java/javacodegen.cpp index a5789f7..16c8f66 100644 --- a/rlgen-java/javacodegen.cpp +++ b/rlgen-java/javacodegen.cpp @@ -297,12 +297,12 @@ void JavaTabCodeGen::COND_TRANSLATE() ; for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) { - CondSpace *condSpace = csi; + GenCondSpace *condSpace = csi; out << " case " << condSpace->condSpaceId << ": {\n"; out << TABS(2) << "_widec = " << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << ");\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(2) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); @@ -443,7 +443,7 @@ int JavaTabCodeGen::TRANS_ACTION( RedTransAp *trans ) std::ostream &JavaTabCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -460,7 +460,7 @@ std::ostream &JavaTabCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &JavaTabCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -477,7 +477,7 @@ std::ostream &JavaTabCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &JavaTabCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -495,7 +495,7 @@ std::ostream &JavaTabCodeGen::EOF_ACTION_SWITCH() std::ostream &JavaTabCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -627,7 +627,7 @@ std::ostream &JavaTabCodeGen::COND_KEYS() { for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Lower key. */ ARRAY_ITEM( KEY( sc->lowKey ), false ); ARRAY_ITEM( KEY( sc->highKey ), false ); @@ -644,7 +644,7 @@ std::ostream &JavaTabCodeGen::COND_SPACES() { for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Cond Space id. */ ARRAY_ITEM( KEY( sc->condSpace->condSpaceId ), false ); } @@ -1298,7 +1298,7 @@ std::ostream &JavaTabCodeGen::ACTIONS_ARRAY() /* Write out the length, which will never be the last character. */ ARRAY_ITEM( INT(act->key.length()), false ); - for ( ActionTable::Iter item = act->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = act->key; item.lte(); item++ ) ARRAY_ITEM( INT(item->value->actionId), (act.last() && item.last()) ); } return out; @@ -1559,7 +1559,7 @@ void JavaTabCodeGen::SUB_ACTION( ostream &ret, GenInlineItem *item, } } -void JavaTabCodeGen::ACTION( ostream &ret, Action *action, int targState, bool inFinish ) +void JavaTabCodeGen::ACTION( ostream &ret, GenAction *action, int targState, bool inFinish ) { /* Write the preprocessor line info for going into the source file. */ javaLineDirective( ret, sourceFileName, action->loc.line ); @@ -1570,7 +1570,7 @@ void JavaTabCodeGen::ACTION( ostream &ret, Action *action, int targState, bool i ret << "}\n"; } -void JavaTabCodeGen::CONDITION( ostream &ret, Action *condition ) +void JavaTabCodeGen::CONDITION( ostream &ret, GenAction *condition ) { ret << "\n"; javaLineDirective( ret, sourceFileName, condition->loc.line ); diff --git a/rlgen-java/javacodegen.h b/rlgen-java/javacodegen.h index 1dd3a99..2e777be 100644 --- a/rlgen-java/javacodegen.h +++ b/rlgen-java/javacodegen.h @@ -117,8 +117,8 @@ public: string TABS( int level ); string KEY( Key key ); string INT( int i ); - void ACTION( ostream &ret, Action *action, int targState, bool inFinish ); - void CONDITION( ostream &ret, Action *condition ); + void ACTION( ostream &ret, GenAction *action, int targState, bool inFinish ); + void CONDITION( ostream &ret, GenAction *condition ); string ALPH_TYPE(); string WIDE_ALPH_TYPE(); string ARRAY_TYPE( unsigned long maxVal ); diff --git a/rlgen-ruby/rbx-gotocodegen.cpp b/rlgen-ruby/rbx-gotocodegen.cpp index 4bcf0df..c67aed3 100644 --- a/rlgen-ruby/rbx-gotocodegen.cpp +++ b/rlgen-ruby/rbx-gotocodegen.cpp @@ -58,7 +58,7 @@ std::ostream &RbxGotoCodeGen::TRANS_GOTO( RedTransAp *trans, int level ) std::ostream &RbxGotoCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -74,7 +74,7 @@ std::ostream &RbxGotoCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &RbxGotoCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -90,7 +90,7 @@ std::ostream &RbxGotoCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &RbxGotoCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -106,7 +106,7 @@ std::ostream &RbxGotoCodeGen::EOF_ACTION_SWITCH() std::ostream &RbxGotoCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -259,14 +259,14 @@ void RbxGotoCodeGen::STATE_GOTO_ERROR() rbxGoto(out << " ", "_out") << "\n"; } -void RbxGotoCodeGen::COND_TRANSLATE( StateCond *stateCond, int level ) +void RbxGotoCodeGen::COND_TRANSLATE( GenStateCond *stateCond, int level ) { - CondSpace *condSpace = stateCond->condSpace; + GenCondSpace *condSpace = stateCond->condSpace; out << TABS(level) << "_widec = " << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << ");\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(level) << "if "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); @@ -278,7 +278,7 @@ void RbxGotoCodeGen::emitCondBSearch( RedStateAp *state, int level, int low, int { /* Get the mid position, staying on the lower end of the range. */ int mid = (low + high) >> 1; - StateCond **data = state->stateCondVect.data; + GenStateCond **data = state->stateCondVect.data; /* Determine if we need to look higher or lower. */ bool anyLower = mid > low; diff --git a/rlgen-ruby/rbx-gotocodegen.h b/rlgen-ruby/rbx-gotocodegen.h index 5ec9f5c..e779f0a 100644 --- a/rlgen-ruby/rbx-gotocodegen.h +++ b/rlgen-ruby/rbx-gotocodegen.h @@ -59,7 +59,7 @@ public: int FROM_STATE_ACTION( RedStateAp *state ); int EOF_ACTION( RedStateAp *state ); - void COND_TRANSLATE( StateCond *stateCond, int level ); + void COND_TRANSLATE( GenStateCond *stateCond, int level ); void emitCondBSearch( RedStateAp *state, int level, int low, int high ); void STATE_CONDS( RedStateAp *state, bool genDefault ); diff --git a/rlgen-ruby/ruby-codegen.cpp b/rlgen-ruby/ruby-codegen.cpp index 1a8693c..1c7c674 100644 --- a/rlgen-ruby/ruby-codegen.cpp +++ b/rlgen-ruby/ruby-codegen.cpp @@ -238,7 +238,7 @@ string RubyCodeGen::FSM_NAME() } -void RubyCodeGen::ACTION( ostream &ret, Action *action, int targState, bool inFinish ) +void RubyCodeGen::ACTION( ostream &ret, GenAction *action, int targState, bool inFinish ) { /* Write the preprocessor line info for going into the source file. */ rubyLineDirective( ret, sourceFileName, action->loc.line ); @@ -312,7 +312,7 @@ string RubyCodeGen::INT( int i ) return ret.str(); } -void RubyCodeGen::CONDITION( ostream &ret, Action *condition ) +void RubyCodeGen::CONDITION( ostream &ret, GenAction *condition ) { ret << "\n"; rubyLineDirective( ret, sourceFileName, condition->loc.line ); @@ -375,7 +375,7 @@ std::ostream &RubyCodeGen::ACTIONS_ARRAY() /* Write out the length, which will never be the last character. */ ARRAY_ITEM( INT(act->key.length()), ++totalActions, false ); - for ( ActionTable::Iter item = act->key; item.lte(); item++ ) { + for ( GenActionTable::Iter item = act->key; item.lte(); item++ ) { ARRAY_ITEM( INT(item->value->actionId), ++totalActions, (act.last() && item.last()) ); } } diff --git a/rlgen-ruby/ruby-codegen.h b/rlgen-ruby/ruby-codegen.h index 5a7aae2..7516b67 100644 --- a/rlgen-ruby/ruby-codegen.h +++ b/rlgen-ruby/ruby-codegen.h @@ -56,14 +56,14 @@ protected: void INLINE_LIST(ostream &ret, GenInlineList *inlineList, int targState, bool inFinish); string ACCESS(); - void ACTION( ostream &ret, Action *action, int targState, bool inFinish ); + void ACTION( ostream &ret, GenAction *action, int targState, bool inFinish ); string GET_KEY(); string GET_WIDE_KEY(); string GET_WIDE_KEY( RedStateAp *state ); string KEY( Key key ); string TABS( int level ); string INT( int i ); - void CONDITION( ostream &ret, Action *condition ); + void CONDITION( ostream &ret, GenAction *condition ); string ALPH_TYPE(); string WIDE_ALPH_TYPE(); string ARRAY_TYPE( unsigned long maxVal ); diff --git a/rlgen-ruby/ruby-fflatcodegen.cpp b/rlgen-ruby/ruby-fflatcodegen.cpp index d2eca2e..e099071 100644 --- a/rlgen-ruby/ruby-fflatcodegen.cpp +++ b/rlgen-ruby/ruby-fflatcodegen.cpp @@ -164,7 +164,7 @@ std::ostream &RubyFFlatCodeGen::TO_STATE_ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); } } @@ -184,7 +184,7 @@ std::ostream &RubyFFlatCodeGen::FROM_STATE_ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); } } @@ -202,7 +202,7 @@ std::ostream &RubyFFlatCodeGen::EOF_ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true ); } } @@ -222,7 +222,7 @@ std::ostream &RubyFFlatCodeGen::ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); } diff --git a/rlgen-ruby/ruby-flatcodegen.cpp b/rlgen-ruby/ruby-flatcodegen.cpp index d95ddac..5adc20c 100644 --- a/rlgen-ruby/ruby-flatcodegen.cpp +++ b/rlgen-ruby/ruby-flatcodegen.cpp @@ -31,7 +31,7 @@ using std::string; std::ostream &RubyFlatCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -47,7 +47,7 @@ std::ostream &RubyFlatCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &RubyFlatCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -63,7 +63,7 @@ std::ostream &RubyFlatCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &RubyFlatCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -79,7 +79,7 @@ std::ostream &RubyFlatCodeGen::EOF_ACTION_SWITCH() std::ostream &RubyFlatCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break */ @@ -324,13 +324,13 @@ void RubyFlatCodeGen::COND_TRANSLATE() out << " case _cond \n"; for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) { - CondSpace *condSpace = csi; + GenCondSpace *condSpace = csi; out << " when " << condSpace->condSpaceId + 1 << " then\n"; out << TABS(2) << "_widec = " << "(" << KEY(condSpace->baseKey) << " + (" << GET_KEY() << " - " << KEY(keyOps->minKey) << "))\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { out << TABS(2) << "if ( "; CONDITION( out, *csi ); Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); diff --git a/rlgen-ruby/ruby-ftabcodegen.cpp b/rlgen-ruby/ruby-ftabcodegen.cpp index 61eba5d..63caa27 100644 --- a/rlgen-ruby/ruby-ftabcodegen.cpp +++ b/rlgen-ruby/ruby-ftabcodegen.cpp @@ -140,7 +140,7 @@ std::ostream &RubyFTabCodeGen::TO_STATE_ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); } @@ -161,7 +161,7 @@ std::ostream &RubyFTabCodeGen::FROM_STATE_ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); } @@ -180,7 +180,7 @@ std::ostream &RubyFTabCodeGen::EOF_ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, true ); } @@ -201,7 +201,7 @@ std::ostream &RubyFTabCodeGen::ACTION_SWITCH() out << "\twhen " << redAct->actListId+1 << " then\n"; /* Write each action in the list of action items. */ - for ( ActionTable::Iter item = redAct->key; item.lte(); item++ ) + for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ ) ACTION( out, item->value, 0, false ); } diff --git a/rlgen-ruby/ruby-tabcodegen.cpp b/rlgen-ruby/ruby-tabcodegen.cpp index 3d39ae1..c1fef8a 100644 --- a/rlgen-ruby/ruby-tabcodegen.cpp +++ b/rlgen-ruby/ruby-tabcodegen.cpp @@ -158,12 +158,12 @@ void RubyTabCodeGen::COND_TRANSLATE() " + ((_mid - _keys)>>1)]\n"; for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) { - CondSpace *condSpace = csi; + GenCondSpace *condSpace = csi; out << " when " << condSpace->condSpaceId << " then" ; out << " _widec = " << KEY(condSpace->baseKey) << "+ (" << GET_KEY() << " - " << KEY(keyOps->minKey) << ")\n"; - for ( CondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { + for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) { Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize()); out << " _widec += " << condValOffset << " if ( "; CONDITION( out, *csi ); @@ -444,7 +444,7 @@ void RubyTabCodeGen::writeExec() std::ostream &RubyTabCodeGen::FROM_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numFromStateRefs > 0 ) { /* Write the case label, the action */ @@ -461,7 +461,7 @@ std::ostream &RubyTabCodeGen::FROM_STATE_ACTION_SWITCH() std::ostream &RubyTabCodeGen::TO_STATE_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numToStateRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -477,7 +477,7 @@ std::ostream &RubyTabCodeGen::TO_STATE_ACTION_SWITCH() std::ostream &RubyTabCodeGen::EOF_ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numEofRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -493,7 +493,7 @@ std::ostream &RubyTabCodeGen::EOF_ACTION_SWITCH() std::ostream &RubyTabCodeGen::ACTION_SWITCH() { /* Walk the list of functions, printing the cases. */ - for ( ActionList::Iter act = actionList; act.lte(); act++ ) { + for ( GenActionList::Iter act = actionList; act.lte(); act++ ) { /* Write out referenced actions. */ if ( act->numTransRefs > 0 ) { /* Write the case label, the action and the case break. */ @@ -691,7 +691,7 @@ std::ostream &RubyTabCodeGen::COND_KEYS() int totalTrans = 0; for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Lower key. */ ARRAY_ITEM( KEY( sc->lowKey ), ++totalTrans, false ); ARRAY_ITEM( KEY( sc->highKey ), ++totalTrans, false ); @@ -711,7 +711,7 @@ std::ostream &RubyTabCodeGen::COND_SPACES() int totalTrans = 0; for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Loop the state's transitions. */ - for ( StateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { + for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) { /* Cond Space id. */ ARRAY_ITEM( KEY( sc->condSpace->condSpaceId ), ++totalTrans, false ); } -- 2.7.4