LM_ACTION and SUB_ACTION need to propagate csForced. Really should overhaul the
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sun, 13 Apr 2008 21:57:30 +0000 (21:57 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sun, 13 Apr 2008 21:57:30 +0000 (21:57 +0000)
action traversal and store these properties in some traversal descriptor.

git-svn-id: http://svn.complang.org/ragel/trunk@430 052ea7fc-9027-0410-9066-f65837a77df0

rlgen-cd/fsmcodegen.cpp
rlgen-cd/fsmcodegen.h

index c45be49..9508120 100644 (file)
@@ -328,7 +328,7 @@ void FsmCodeGen::EXEC( ostream &ret, InlineItem *item, int targState, int inFini
 }
 
 void FsmCodeGen::LM_SWITCH( ostream &ret, InlineItem *item, 
-               int targState, int inFinish )
+               int targState, int inFinish, bool csForced )
 {
        ret << 
                "       switch( " << ACT() << " ) {\n";
@@ -339,7 +339,7 @@ void FsmCodeGen::LM_SWITCH( ostream &ret, InlineItem *item,
 
                /* Write the block and close it off. */
                ret << "        {";
-               INLINE_LIST( ret, lma->children, targState, inFinish, false );
+               INLINE_LIST( ret, lma->children, targState, inFinish, csForced );
                ret << "}\n";
 
                ret << "        break;\n";
@@ -386,12 +386,12 @@ void FsmCodeGen::SET_TOKSTART( ostream &ret, InlineItem *item )
 }
 
 void FsmCodeGen::SUB_ACTION( ostream &ret, InlineItem *item, 
-               int targState, bool inFinish )
+               int targState, bool inFinish, bool csForced )
 {
        if ( item->children->length() > 0 ) {
                /* Write the block and close it off. */
                ret << "{";
-               INLINE_LIST( ret, item->children, targState, inFinish, false );
+               INLINE_LIST( ret, item->children, targState, inFinish, csForced );
                ret << "}";
        }
 }
@@ -450,7 +450,7 @@ void FsmCodeGen::INLINE_LIST( ostream &ret, InlineList *inlineList,
                        NEXT_EXPR( ret, item, inFinish );
                        break;
                case InlineItem::LmSwitch:
-                       LM_SWITCH( ret, item, targState, inFinish );
+                       LM_SWITCH( ret, item, targState, inFinish, csForced );
                        break;
                case InlineItem::LmSetActId:
                        SET_ACT( ret, item );
@@ -471,7 +471,7 @@ void FsmCodeGen::INLINE_LIST( ostream &ret, InlineList *inlineList,
                        SET_TOKSTART( ret, item );
                        break;
                case InlineItem::SubAction:
-                       SUB_ACTION( ret, item, targState, inFinish );
+                       SUB_ACTION( ret, item, targState, inFinish, csForced );
                        break;
                case InlineItem::Break:
                        BREAK( ret, targState, csForced );
index a7d2244..7390448 100644 (file)
@@ -143,7 +143,8 @@ protected:
        virtual void CURS( ostream &ret, bool inFinish ) = 0;
        virtual void TARGS( ostream &ret, bool inFinish, int targState ) = 0;
        void EXEC( ostream &ret, InlineItem *item, int targState, int inFinish );
-       void LM_SWITCH( ostream &ret, InlineItem *item, int targState, int inFinish );
+       void LM_SWITCH( ostream &ret, InlineItem *item, int targState, 
+                       int inFinish, bool csForced );
        void SET_ACT( ostream &ret, InlineItem *item );
        void INIT_TOKSTART( ostream &ret, InlineItem *item );
        void INIT_ACT( ostream &ret, InlineItem *item );
@@ -151,7 +152,7 @@ protected:
        void SET_TOKEND( ostream &ret, InlineItem *item );
        void GET_TOKEND( ostream &ret, InlineItem *item );
        void SUB_ACTION( ostream &ret, InlineItem *item, 
-                       int targState, bool inFinish );
+                       int targState, bool inFinish, bool csForced );
        void STATE_IDS();
 
        string ERROR_STATE();