2 * Copyright 2007 Victor Hugo Borja <vic@rubyforge.org>
3 * 2007 Adrian Thurston <thurston@complang.org>
6 /* This file is part of Ragel.
8 * Ragel is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * Ragel is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Ragel; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "rubytable.h"
31 using std::ostringstream;
38 void RubyTabCodeGen::GOTO( ostream &out, int gotoDest, bool inFinish )
42 " " << CS() << " = " << gotoDest << "\n"
43 " _trigger_goto = true\n"
44 " _goto_level = _again\n"
49 void RubyTabCodeGen::GOTO_EXPR( ostream &out, GenInlineItem *ilItem, bool inFinish )
53 " " << CS() << " = (";
54 INLINE_LIST( out, ilItem->children, 0, inFinish );
57 " _trigger_goto = true\n"
58 " _goto_level = _again\n"
63 void RubyTabCodeGen::CALL( ostream &out, int callDest, int targState, bool inFinish )
65 if ( prePushExpr != 0 ) {
67 INLINE_LIST( out, prePushExpr, 0, false );
72 " " << STACK() << "[" << TOP() << "] = " << CS() << "\n"
73 " " << TOP() << "+= 1\n"
74 " " << CS() << " = " << callDest << "\n"
75 " _trigger_goto = true\n"
76 " _goto_level = _again\n"
80 if ( prePushExpr != 0 )
84 void RubyTabCodeGen::CALL_EXPR(ostream &out, GenInlineItem *ilItem, int targState, bool inFinish )
86 if ( prePushExpr != 0 ) {
88 INLINE_LIST( out, prePushExpr, 0, false );
93 " " << STACK() << "[" << TOP() << "] = " << CS() << "\n"
94 " " << TOP() << " += 1\n"
95 " " << CS() << " = (";
96 INLINE_LIST( out, ilItem->children, targState, inFinish );
100 " _trigger_goto = true\n"
101 " _goto_level = _again\n"
105 if ( prePushExpr != 0 )
109 void RubyTabCodeGen::RET( ostream &out, bool inFinish )
113 " " << TOP() << " -= 1\n"
114 " " << CS() << " = " << STACK() << "[" << TOP() << "]\n";
116 if ( postPopExpr != 0 ) {
118 INLINE_LIST( out, postPopExpr, 0, false );
123 " _trigger_goto = true\n"
124 " _goto_level = _again\n"
129 void RubyTabCodeGen::BREAK( ostream &out, int targState )
133 " " << P() << " += 1\n"
134 " _trigger_goto = true\n"
135 " _goto_level = _out\n"
140 void RubyTabCodeGen::COND_TRANSLATE()
143 " _widec = " << GET_KEY() << "\n"
144 " _keys = " << CO() << "[" << CS() << "]*2\n"
145 " _klen = " << CL() << "[" << CS() << "]\n"
148 " _upper = _keys + (_klen<<1) - 2\n"
150 " break if _upper < _lower\n"
151 " _mid = _lower + (((_upper-_lower) >> 1) & ~1)\n"
152 " if " << GET_WIDE_KEY() << " < " << CK() << "[_mid]\n"
153 " _upper = _mid - 2\n"
154 " elsif " << GET_WIDE_KEY() << " > " << CK() << "[_mid+1]\n"
155 " _lower = _mid + 2\n"
157 " case " << C() << "[" << CO() << "[" << CS() << "]"
158 " + ((_mid - _keys)>>1)]\n";
160 for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) {
161 GenCondSpace *condSpace = csi;
162 out << " when " << condSpace->condSpaceId << " then" ;
163 out << " _widec = " << KEY(condSpace->baseKey) <<
164 "+ (" << GET_KEY() << " - " << KEY(keyOps->minKey) << ")\n";
166 for ( GenCondSet::Iter csi = condSpace->condSet; csi.lte(); csi++ ) {
167 Size condValOffset = ((1 << csi.pos()) * keyOps->alphSize());
168 out << " _widec += " << condValOffset << " if ( ";
169 CONDITION( out, *csi );
182 void RubyTabCodeGen::LOCATE_TRANS()
185 " _keys = " << KO() << "[" << CS() << "]\n"
186 " _trans = " << IO() << "[" << CS() << "]\n"
187 " _klen = " << SL() << "[" << CS() << "]\n"
188 " _break_match = false\n"
193 " _upper = _keys + _klen - 1\n"
196 " break if _upper < _lower\n"
197 " _mid = _lower + ( (_upper - _lower) >> 1 )\n"
199 " if " << GET_WIDE_KEY() << " < " << K() << "[_mid]\n"
200 " _upper = _mid - 1\n"
201 " elsif " << GET_WIDE_KEY() << " > " << K() << "[_mid]\n"
202 " _lower = _mid + 1\n"
204 " _trans += (_mid - _keys)\n"
205 " _break_match = true\n"
209 " break if _break_match\n"
214 " _klen = " << RL() << "[" << CS() << "]\n"
217 " _upper = _keys + (_klen << 1) - 2\n"
219 " break if _upper < _lower\n"
220 " _mid = _lower + (((_upper-_lower) >> 1) & ~1)\n"
221 " if " << GET_WIDE_KEY() << " < " << K() << "[_mid]\n"
222 " _upper = _mid - 2\n"
223 " elsif " << GET_WIDE_KEY() << " > " << K() << "[_mid+1]\n"
224 " _lower = _mid + 2\n"
226 " _trans += ((_mid - _keys) >> 1)\n"
227 " _break_match = true\n"
231 " break if _break_match\n"
234 " end while false\n";
237 void RubyTabCodeGen::writeExec()
241 " _klen, _trans, _keys";
243 if ( redFsm->anyRegCurStateRef() )
245 if ( redFsm->anyConditions() )
247 if ( redFsm->anyToStateActions() || redFsm->anyRegActions()
248 || redFsm->anyFromStateActions() )
249 out << ", _acts, _nacts";
263 " _trigger_goto = false\n"
264 " if _goto_level <= 0\n";
268 " if " << P() << " == " << PE() << "\n"
269 " _goto_level = _test_eof\n"
274 if ( redFsm->errState != 0 ) {
276 " if " << CS() << " == " << redFsm->errState->id << "\n"
277 " _goto_level = _out\n"
282 /* The resume label. */
285 " if _goto_level <= _resume\n";
287 if ( redFsm->anyFromStateActions() ) {
289 " _acts = " << FSA() << "[" << CS() << "]\n"
290 " _nacts = " << A() << "[_acts]\n"
292 " while _nacts > 0\n"
295 " case " << A() << "[_acts - 1]\n";
296 FROM_STATE_ACTION_SWITCH();
298 " end # from state action switch\n"
300 " if _trigger_goto\n"
305 if ( redFsm->anyConditions() )
311 out << " _trans = " << I() << "[_trans]\n";
313 if ( redFsm->anyEofTrans() ) {
316 " if _goto_level <= _eof_trans\n";
319 if ( redFsm->anyRegCurStateRef() )
320 out << " _ps = " << CS() << "\n";
322 out << " " << CS() << " = " << TT() << "[_trans]\n";
324 if ( redFsm->anyRegActions() ) {
326 " if " << TA() << "[_trans] != 0\n"
327 " _acts = " << TA() << "[_trans]\n"
328 " _nacts = " << A() << "[_acts]\n"
330 " while _nacts > 0\n"
333 " case " << A() << "[_acts - 1]\n";
336 " end # action switch\n"
339 " if _trigger_goto\n"
344 /* The again label. */
347 " if _goto_level <= _again\n";
349 if ( redFsm->anyToStateActions() ) {
351 " _acts = " << TSA() << "[" << CS() << "]\n"
352 " _nacts = " << A() << "[_acts]\n"
354 " while _nacts > 0\n"
357 " case " << A() << "[_acts - 1]\n";
358 TO_STATE_ACTION_SWITCH();
360 " end # to state action switch\n"
362 " if _trigger_goto\n"
367 if ( redFsm->errState != 0 ) {
369 " if " << CS() << " == " << redFsm->errState->id << "\n"
370 " _goto_level = _out\n"
375 out << " " << P() << " += 1\n";
379 " if " << P() << " != " << PE() << "\n"
380 " _goto_level = _resume\n"
386 " _goto_level = _resume\n"
390 /* The test_eof label. */
393 " if _goto_level <= _test_eof\n";
395 if ( redFsm->anyEofTrans() || redFsm->anyEofActions() ) {
397 " if " << P() << " == " << EOFV() << "\n";
399 if ( redFsm->anyEofTrans() ) {
401 " if " << ET() << "[" << CS() << "] > 0\n"
402 " _trans = " << ET() << "[" << CS() << "] - 1;\n"
403 " _goto_level = _eof_trans\n"
408 if ( redFsm->anyEofActions() ) {
410 " __acts = " << EA() << "[" << CS() << "]\n"
411 " __nacts = " << " " << A() << "[__acts]\n"
413 " while __nacts > 0\n"
416 " case " << A() << "[__acts - 1]\n";
417 EOF_ACTION_SWITCH() <<
418 " end # eof action switch\n"
420 " if _trigger_goto\n"
431 " if _goto_level <= _out\n"
435 /* The loop for next. */
439 /* Wrapping the execute block. */
444 std::ostream &RubyTabCodeGen::FROM_STATE_ACTION_SWITCH()
446 /* Walk the list of functions, printing the cases. */
447 for ( GenActionList::Iter act = actionList; act.lte(); act++ ) {
448 /* Write out referenced actions. */
449 if ( act->numFromStateRefs > 0 ) {
450 /* Write the case label, the action */
451 out << " when " << act->actionId << " then\n";
452 ACTION( out, act, 0, false );
456 genLineDirective( out );
461 std::ostream &RubyTabCodeGen::TO_STATE_ACTION_SWITCH()
463 /* Walk the list of functions, printing the cases. */
464 for ( GenActionList::Iter act = actionList; act.lte(); act++ ) {
465 /* Write out referenced actions. */
466 if ( act->numToStateRefs > 0 ) {
467 /* Write the case label, the action and the case break. */
468 out << "when " << act->actionId << " then\n";
469 ACTION( out, act, 0, false );
473 genLineDirective( out );
477 std::ostream &RubyTabCodeGen::EOF_ACTION_SWITCH()
479 /* Walk the list of functions, printing the cases. */
480 for ( GenActionList::Iter act = actionList; act.lte(); act++ ) {
481 /* Write out referenced actions. */
482 if ( act->numEofRefs > 0 ) {
483 /* Write the case label, the action and the case break. */
484 out << "when " << act->actionId << " then\n";
485 ACTION( out, act, 0, true );
489 genLineDirective( out );
493 std::ostream &RubyTabCodeGen::ACTION_SWITCH()
495 /* Walk the list of functions, printing the cases. */
496 for ( GenActionList::Iter act = actionList; act.lte(); act++ ) {
497 /* Write out referenced actions. */
498 if ( act->numTransRefs > 0 ) {
499 /* Write the case label, the action and the case break. */
500 out << "when " << act->actionId << " then\n";
501 ACTION( out, act, 0, false );
505 genLineDirective( out );
510 void RubyTabCodeGen::NEXT( ostream &ret, int nextDest, bool inFinish )
512 ret << CS() << " = " << nextDest << ";";
515 void RubyTabCodeGen::NEXT_EXPR( ostream &ret, GenInlineItem *ilItem, bool inFinish )
517 ret << CS() << " = (";
518 INLINE_LIST( ret, ilItem->children, 0, inFinish );
523 int RubyTabCodeGen::TO_STATE_ACTION( RedStateAp *state )
526 if ( state->toStateAction != 0 )
527 act = state->toStateAction->location+1;
531 int RubyTabCodeGen::FROM_STATE_ACTION( RedStateAp *state )
534 if ( state->fromStateAction != 0 )
535 act = state->fromStateAction->location+1;
539 int RubyTabCodeGen::EOF_ACTION( RedStateAp *state )
542 if ( state->eofAction != 0 )
543 act = state->eofAction->location+1;
548 std::ostream &RubyTabCodeGen::COND_OFFSETS()
551 int totalStateNum = 0, curKeyOffset = 0;
552 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
553 /* Write the key offset. */
554 ARRAY_ITEM( INT(curKeyOffset), ++totalStateNum, st.last() );
556 /* Move the key offset ahead. */
557 curKeyOffset += st->stateCondList.length();
563 std::ostream &RubyTabCodeGen::KEY_OFFSETS()
566 int totalStateNum = 0, curKeyOffset = 0;
567 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
568 /* Write the key offset. */
569 ARRAY_ITEM( INT(curKeyOffset), ++totalStateNum, st.last() );
571 /* Move the key offset ahead. */
572 curKeyOffset += st->outSingle.length() + st->outRange.length()*2;
579 std::ostream &RubyTabCodeGen::INDEX_OFFSETS()
582 int totalStateNum = 0, curIndOffset = 0;
583 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
584 /* Write the index offset. */
585 ARRAY_ITEM( INT(curIndOffset), ++totalStateNum, st.last() );
587 /* Move the index offset ahead. */
588 curIndOffset += st->outSingle.length() + st->outRange.length();
589 if ( st->defTrans != 0 )
596 std::ostream &RubyTabCodeGen::COND_LENS()
599 int totalStateNum = 0;
600 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
601 /* Write singles length. */
602 ARRAY_ITEM( INT(st->stateCondList.length()), ++totalStateNum, st.last() );
609 std::ostream &RubyTabCodeGen::SINGLE_LENS()
612 int totalStateNum = 0;
613 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
614 /* Write singles length. */
615 ARRAY_ITEM( INT(st->outSingle.length()), ++totalStateNum, st.last() );
621 std::ostream &RubyTabCodeGen::RANGE_LENS()
624 int totalStateNum = 0;
625 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
626 /* Emit length of range index. */
627 ARRAY_ITEM( INT(st->outRange.length()), ++totalStateNum, st.last() );
633 std::ostream &RubyTabCodeGen::TO_STATE_ACTIONS()
636 int totalStateNum = 0;
637 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
638 /* Write any eof action. */
639 ARRAY_ITEM( INT(TO_STATE_ACTION(st)), ++totalStateNum, st.last() );
645 std::ostream &RubyTabCodeGen::FROM_STATE_ACTIONS()
648 int totalStateNum = 0;
649 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
650 /* Write any eof action. */
651 ARRAY_ITEM( INT(FROM_STATE_ACTION(st)), ++totalStateNum, st.last() );
657 std::ostream &RubyTabCodeGen::EOF_ACTIONS()
660 int totalStateNum = 0;
661 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
662 /* Write any eof action. */
663 ARRAY_ITEM( INT(EOF_ACTION(st)), ++totalStateNum, st.last() );
669 std::ostream &RubyTabCodeGen::EOF_TRANS()
672 int totalStateNum = 0;
673 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
674 /* Write any eof action. */
676 if ( st->eofTrans != 0 ) {
677 assert( st->eofTrans->pos >= 0 );
678 trans = st->eofTrans->pos+1;
681 /* Write any eof action. */
682 ARRAY_ITEM( INT(trans), ++totalStateNum, st.last() );
688 std::ostream &RubyTabCodeGen::COND_KEYS()
692 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
693 /* Loop the state's transitions. */
694 for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) {
696 ARRAY_ITEM( KEY( sc->lowKey ), ++totalTrans, false );
697 ARRAY_ITEM( KEY( sc->highKey ), ++totalTrans, false );
701 /* Output one last number so we don't have to figure out when the last
702 * entry is and avoid writing a comma. */
703 ARRAY_ITEM( INT(0), ++totalTrans, true );
708 std::ostream &RubyTabCodeGen::COND_SPACES()
712 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
713 /* Loop the state's transitions. */
714 for ( GenStateCondList::Iter sc = st->stateCondList; sc.lte(); sc++ ) {
716 ARRAY_ITEM( KEY( sc->condSpace->condSpaceId ), ++totalTrans, false );
720 /* Output one last number so we don't have to figure out when the last
721 * entry is and avoid writing a comma. */
722 ARRAY_ITEM( INT(0), ++totalTrans, true );
727 std::ostream &RubyTabCodeGen::KEYS()
731 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
732 /* Loop the singles. */
733 for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) {
734 ARRAY_ITEM( KEY( stel->lowKey ), ++totalTrans, false );
737 /* Loop the state's transitions. */
738 for ( RedTransList::Iter rtel = st->outRange; rtel.lte(); rtel++ ) {
740 ARRAY_ITEM( KEY( rtel->lowKey ), ++totalTrans, false );
743 ARRAY_ITEM( KEY( rtel->highKey ), ++totalTrans, false );
747 /* Output one last number so we don't have to figure out when the last
748 * entry is and avoid writing a comma. */
749 ARRAY_ITEM( INT(0), ++totalTrans, true );
754 std::ostream &RubyTabCodeGen::INDICIES()
758 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
759 /* Walk the singles. */
760 for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) {
761 ARRAY_ITEM( KEY( stel->value->id ), ++totalTrans, false );
764 /* Walk the ranges. */
765 for ( RedTransList::Iter rtel = st->outRange; rtel.lte(); rtel++ ) {
766 ARRAY_ITEM( KEY( rtel->value->id ), ++totalTrans, false );
769 /* The state's default index goes next. */
770 if ( st->defTrans != 0 ) {
771 ARRAY_ITEM( KEY( st->defTrans->id ), ++totalTrans, false );
775 /* Output one last number so we don't have to figure out when the last
776 * entry is and avoid writing a comma. */
777 ARRAY_ITEM( INT(0), ++totalTrans, true );
782 std::ostream &RubyTabCodeGen::TRANS_TARGS()
786 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
787 /* Walk the singles. */
788 for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) {
789 RedTransAp *trans = stel->value;
790 ARRAY_ITEM( KEY( trans->targ->id ), ++totalTrans, false );
793 /* Walk the ranges. */
794 for ( RedTransList::Iter rtel = st->outRange; rtel.lte(); rtel++ ) {
795 RedTransAp *trans = rtel->value;
796 ARRAY_ITEM( KEY( trans->targ->id ), ++totalTrans, false );
799 /* The state's default target state. */
800 if ( st->defTrans != 0 ) {
801 RedTransAp *trans = st->defTrans;
802 ARRAY_ITEM( KEY( trans->targ->id ), ++totalTrans, false );
806 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
807 if ( st->eofTrans != 0 ) {
808 RedTransAp *trans = st->eofTrans;
809 trans->pos = totalTrans;
810 ARRAY_ITEM( KEY( trans->targ->id ), ++totalTrans, false );
814 /* Output one last number so we don't have to figure out when the last
815 * entry is and avoid writing a comma. */
816 ARRAY_ITEM( INT(0), ++totalTrans, true );
822 std::ostream &RubyTabCodeGen::TRANS_ACTIONS()
826 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
827 /* Walk the singles. */
828 for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) {
829 RedTransAp *trans = stel->value;
830 ARRAY_ITEM( INT(TRANS_ACTION( trans )), ++totalTrans, false );
833 /* Walk the ranges. */
834 for ( RedTransList::Iter rtel = st->outRange; rtel.lte(); rtel++ ) {
835 RedTransAp *trans = rtel->value;
836 ARRAY_ITEM( INT(TRANS_ACTION( trans )), ++totalTrans, false );
839 /* The state's default index goes next. */
840 if ( st->defTrans != 0 ) {
841 RedTransAp *trans = st->defTrans;
842 ARRAY_ITEM( INT(TRANS_ACTION( trans )), ++totalTrans, false );
846 for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
847 if ( st->eofTrans != 0 ) {
848 RedTransAp *trans = st->eofTrans;
849 ARRAY_ITEM( INT(TRANS_ACTION( trans )), ++totalTrans, false );
853 /* Output one last number so we don't have to figure out when the last
854 * entry is and avoid writing a comma. */
855 ARRAY_ITEM( INT(0), ++totalTrans, true );
860 std::ostream &RubyTabCodeGen::TRANS_TARGS_WI()
862 /* Transitions must be written ordered by their id. */
863 RedTransAp **transPtrs = new RedTransAp*[redFsm->transSet.length()];
864 for ( TransApSet::Iter trans = redFsm->transSet; trans.lte(); trans++ )
865 transPtrs[trans->id] = trans;
867 /* Keep a count of the num of items in the array written. */
870 for ( int t = 0; t < redFsm->transSet.length(); t++ ) {
871 /* Save the position. Needed for eofTargs. */
872 RedTransAp *trans = transPtrs[t];
875 /* Write out the target state. */
876 ARRAY_ITEM( INT(trans->targ->id), ++totalStates, ( t >= redFsm->transSet.length()-1 ) );
884 std::ostream &RubyTabCodeGen::TRANS_ACTIONS_WI()
886 /* Transitions must be written ordered by their id. */
887 RedTransAp **transPtrs = new RedTransAp*[redFsm->transSet.length()];
888 for ( TransApSet::Iter trans = redFsm->transSet; trans.lte(); trans++ )
889 transPtrs[trans->id] = trans;
891 /* Keep a count of the num of items in the array written. */
894 for ( int t = 0; t < redFsm->transSet.length(); t++ ) {
895 /* Write the function for the transition. */
896 RedTransAp *trans = transPtrs[t];
897 ARRAY_ITEM( INT(TRANS_ACTION( trans )), ++totalAct,
898 ( t >= redFsm->transSet.length()-1 ) );
906 void RubyTabCodeGen::writeData()
908 /* If there are any transtion functions then output the array. If there
909 * are none, don't bother emitting an empty array that won't be used. */
910 if ( redFsm->anyActions() ) {
911 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxActArrItem), A() );
917 if ( redFsm->anyConditions() ) {
918 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxCondOffset), CO() );
923 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxCondLen), CL() );
928 OPEN_ARRAY( WIDE_ALPH_TYPE(), CK() );
933 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxCondSpaceId), C() );
939 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxKeyOffset), KO() );
944 OPEN_ARRAY( WIDE_ALPH_TYPE(), K() );
949 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxSingleLen), SL() );
954 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxRangeLen), RL() );
959 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxIndexOffset), IO() );
965 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxIndex), I() );
970 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxState), TT() );
975 if ( redFsm->anyActions() ) {
976 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxActionLoc), TA() );
983 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxState), TT() );
988 if ( redFsm->anyActions() ) {
989 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxActionLoc), TA() );
996 if ( redFsm->anyToStateActions() ) {
997 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxActionLoc), TSA() );
1003 if ( redFsm->anyFromStateActions() ) {
1004 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxActionLoc), FSA() );
1005 FROM_STATE_ACTIONS();
1010 if ( redFsm->anyEofActions() ) {
1011 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxActionLoc), EA() );
1017 if ( redFsm->anyEofTrans() ) {
1018 OPEN_ARRAY( ARRAY_TYPE(redFsm->maxIndexOffset+1), ET() );