std::ostream &TabCodeGen::FROM_STATE_ACTIONS() { out << "\t"; int totalStateNum = 0; for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { /* Write any eof action. */ FROM_STATE_ACTION(st); if ( !st.last() ) { out << ", "; if ( ++totalStateNum % IALL == 0 ) out << "\n\t"; } } out << "\n"; return out; }
std::wostream &CSharpGotoCodeGen::FROM_STATE_ACTIONS() { /* Take one off for the psuedo start state. */ int numStates = redFsm->stateList.length(); unsigned int *vals = new unsigned int[numStates]; memset( vals, 0, sizeof(unsigned int)*numStates ); for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) vals[st->id] = FROM_STATE_ACTION(st); out << L"\t"; for ( int st = 0; st < redFsm->nextStateId; st++ ) { /* Write any eof action. */ out << vals[st]; if ( st < numStates-1 ) { out << L", "; if ( (st+1) % IALL == 0 ) out << L"\n\t"; } } out << L"\n"; delete[] vals; return out; }