From: thurston Date: Fri, 8 Jun 2007 16:45:24 +0000 (+0000) Subject: Put the scanner action generators together. X-Git-Tag: 2.0_alpha~287 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57cb26d46765f060331be6f86885e345e18c33c6;p=external%2Fragel.git Put the scanner action generators together. git-svn-id: http://svn.complang.org/ragel/trunk@234 052ea7fc-9027-0410-9066-f65837a77df0 --- diff --git a/ragel/xmlcodegen.cpp b/ragel/xmlcodegen.cpp index 94443f1..a12c56b 100644 --- a/ragel/xmlcodegen.cpp +++ b/ragel/xmlcodegen.cpp @@ -175,28 +175,6 @@ void XMLCodeGen::writeTransList( StateAp *state ) out << " \n"; } -void XMLCodeGen::writeLmSwitch( InlineItem *item ) -{ - LongestMatch *longestMatch = item->longestMatch; - - out << "lmSwitchHandlesError ) - out << " handles_error=\"t\""; - out << ">\n"; - - for ( LmPartList::Iter lmi = *longestMatch->longestMatchList; lmi.lte(); lmi++ ) { - if ( lmi->inLmSelect && lmi->action != 0 ) { - /* Open the action. Write it with the context that sets up _p - * when doing control flow changes from inside the machine. */ - out << " longestMatchId << "\">"; - writeInlineList( lmi->action->inlineList, item ); - out << "\n"; - } - } - - out << " "; -} - void XMLCodeGen::writeText( InlineItem *item ) { if ( item->prev == 0 || item->prev->type != InlineItem::Text ) @@ -388,6 +366,27 @@ void XMLCodeGen::writeLmOnLagBehind( InlineItem *item ) out << ""; } +void XMLCodeGen::writeLmSwitch( InlineItem *item ) +{ + LongestMatch *longestMatch = item->longestMatch; + + out << "lmSwitchHandlesError ) + out << " handles_error=\"t\""; + out << ">\n"; + + for ( LmPartList::Iter lmi = *longestMatch->longestMatchList; lmi.lte(); lmi++ ) { + if ( lmi->inLmSelect && lmi->action != 0 ) { + /* Open the action. Write it with the context that sets up _p + * when doing control flow changes from inside the machine. */ + out << " longestMatchId << "\">"; + writeInlineList( lmi->action->inlineList, item ); + out << "\n"; + } + } + + out << " "; +} void XMLCodeGen::writeInlineList( InlineList *inlineList, InlineItem *context ) { @@ -423,9 +422,6 @@ void XMLCodeGen::writeInlineList( InlineList *inlineList, InlineItem *context ) writePtrMod( item, context ); break; - case InlineItem::LmSwitch: - writeLmSwitch( item ); - break; case InlineItem::LmSetActId: out << "" << item->longestMatchPart->longestMatchId << @@ -434,6 +430,7 @@ void XMLCodeGen::writeInlineList( InlineList *inlineList, InlineItem *context ) case InlineItem::LmSetTokEnd: out << "1"; break; + case InlineItem::LmOnLast: writeLmOnLast( item ); break; @@ -443,6 +440,10 @@ void XMLCodeGen::writeInlineList( InlineList *inlineList, InlineItem *context ) case InlineItem::LmOnLagBehind: writeLmOnLagBehind( item ); break; + case InlineItem::LmSwitch: + writeLmSwitch( item ); + break; + case InlineItem::LmInitAct: out << ""; break;