"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/actloop.cc" between
ragel-7.0.0.11.tar.gz and ragel-7.0.0.12.tar.gz

About: Ragel compiles executable finite state machines from regular languages (C, C++, Obj-C, C#, D, Java, Go and Ruby). Development version.

actloop.cc  (ragel-7.0.0.11):actloop.cc  (ragel-7.0.0.12)
skipping to change at line 84 skipping to change at line 84
std::ostream &ActLoop::FROM_STATE_ACTION_SWITCH() std::ostream &ActLoop::FROM_STATE_ACTION_SWITCH()
{ {
/* Walk the list of functions, printing the cases. */ /* Walk the list of functions, printing the cases. */
for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) { for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) {
/* Write out referenced actions. */ /* Write out referenced actions. */
if ( act->numFromStateRefs > 0 ) { if ( act->numFromStateRefs > 0 ) {
/* Write the case label, the action and the case break. * / /* Write the case label, the action and the case break. * /
out << "\t " << CASE( STR( act->actionId ) ) << " {\n"; out << "\t " << CASE( STR( act->actionId ) ) << " {\n";
ACTION( out, act, IlOpts( 0, false, false ) ); ACTION( out, act, IlOpts( 0, false, false ) );
out << "\n\t" << CEND() << "}\n"; out << "\n\t" << CEND() << "\n}\n";
} }
} }
return out; return out;
} }
std::ostream &ActLoop::ACTION_SWITCH() std::ostream &ActLoop::ACTION_SWITCH()
{ {
/* Walk the list of functions, printing the cases. */ /* Walk the list of functions, printing the cases. */
for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) { for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) {
/* Write out referenced actions. */ /* Write out referenced actions. */
if ( act->numTransRefs > 0 ) { if ( act->numTransRefs > 0 ) {
/* Write the case label, the action and the case break. * / /* Write the case label, the action and the case break. * /
out << "\t " << CASE( STR( act->actionId ) ) << " {\n"; out << "\t " << CASE( STR( act->actionId ) ) << " {\n";
ACTION( out, act, IlOpts( 0, false, false ) ); ACTION( out, act, IlOpts( 0, false, false ) );
out << "\n\t" << CEND() << "}\n"; out << "\n\t" << CEND() << "\n}\n";
} }
} }
return out; return out;
} }
std::ostream &ActLoop::TO_STATE_ACTION_SWITCH() std::ostream &ActLoop::TO_STATE_ACTION_SWITCH()
{ {
/* Walk the list of functions, printing the cases. */ /* Walk the list of functions, printing the cases. */
for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) { for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) {
/* Write out referenced actions. */ /* Write out referenced actions. */
if ( act->numToStateRefs > 0 ) { if ( act->numToStateRefs > 0 ) {
/* Write the case label, the action and the case break. * / /* Write the case label, the action and the case break. * /
out << "\t " << CASE( STR( act->actionId ) ) << " {\n"; out << "\t " << CASE( STR( act->actionId ) ) << " {\n";
ACTION( out, act, IlOpts( 0, false, false ) ); ACTION( out, act, IlOpts( 0, false, false ) );
out << "\n\t" << CEND() << "}\n"; out << "\n\t" << CEND() << "\n}\n";
} }
} }
return out; return out;
} }
std::ostream &ActLoop::EOF_ACTION_SWITCH() std::ostream &ActLoop::EOF_ACTION_SWITCH()
{ {
/* Walk the list of functions, printing the cases. */ /* Walk the list of functions, printing the cases. */
for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) { for ( GenActionList::Iter act = red->actionList; act.lte(); act++ ) {
/* Write out referenced actions. */ /* Write out referenced actions. */
if ( act->numEofRefs > 0 ) { if ( act->numEofRefs > 0 ) {
/* Write the case label, the action and the case break. * / /* Write the case label, the action and the case break. * /
out << "\t " << CASE( STR( act->actionId ) ) << " {\n"; out << "\t " << CASE( STR( act->actionId ) ) << " {\n";
ACTION( out, act, IlOpts( 0, true, false ) ); ACTION( out, act, IlOpts( 0, true, false ) );
out << "\n\t" << CEND() << "}\n"; out << "\n\t" << CEND() << "\n}\n";
} }
} }
return out; return out;
} }
void ActLoop::FROM_STATE_ACTIONS() void ActLoop::FROM_STATE_ACTIONS()
{ {
if ( redFsm->anyFromStateActions() ) { if ( redFsm->anyFromStateActions() ) {
out << out <<
skipping to change at line 179 skipping to change at line 179
" " << acts << " += 1;\n" " " << acts << " += 1;\n"
" }\n" " }\n"
"\n"; "\n";
} }
void ActLoop::TO_STATE_ACTIONS() void ActLoop::TO_STATE_ACTIONS()
{ {
if ( redFsm->anyToStateActions() ) { if ( redFsm->anyToStateActions() ) {
out << out <<
" " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( toStateActions ) + "[" + vCS() + "]" ) << ";\n" " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( toStateActions ) + "[" + vCS() + "]" ) << ";\n"
" " << nacts << " = " << CAST(UINT()) << DEREF( ARR _REF( actions ), "" + string(acts) + "" ) << ";\n" " " << nacts << " = " << CAST(UINT()) << DEREF( ARR _REF( actions ), string(acts) ) << ";\n"
" " << acts << " += 1;\n" " " << acts << " += 1;\n"
" while ( " << nacts << " > 0 ) {\n" " while ( " << nacts << " > 0 ) {\n"
" switch ( " << DEREF( ARR_REF( actions ), "" + string(acts) + "" ) << " ) {\n"; " switch ( " << DEREF( ARR_REF( actions ), string(acts) ) << " ) {\n";
TO_STATE_ACTION_SWITCH() << TO_STATE_ACTION_SWITCH() <<
" }\n" " }\n"
" " << nacts << " -= 1;\n" " " << nacts << " -= 1;\n"
" " << acts << " += 1;\n" " " << acts << " += 1;\n"
" }\n" " }\n"
"\n"; "\n";
} }
} }
void ActLoop::EOF_ACTIONS() void ActLoop::EOF_ACTIONS()
{ {
if ( redFsm->anyEofActions() ) { if ( redFsm->anyEofActions() ) {
out << out <<
" " << INDEX( ARR_TYPE( actions ), "__acts" ) << "; " " << acts << " = " << OFFSET( ARR_REF( actions ),
\n" ARR_REF( eofActions ) + "[" + vCS() + "]" ) << ";\n"
" " << UINT() << " __nacts;\n" " " << nacts << " = " << CAST(UINT()) << DEREF( ARR
" __acts = " << OFFSET( ARR_REF( actions ), ARR_REF _REF( actions ), string(acts) ) << ";\n"
( eofActions ) + "[" + vCS() + "]" ) << ";\n" " " << acts << " += 1;\n"
" __nacts = " << CAST(UINT()) << DEREF( ARR_REF( ac " while ( " << nacts << " > 0 ) {\n"
tions ), "__acts" ) << ";\n" " switch ( " << DEREF( ARR_REF( actions ),
" __acts += 1;\n" string(acts) ) << " ) {\n";
" while ( __nacts > 0 ) {\n"
" switch ( " << DEREF( ARR_REF( actions ),
"__acts" ) << " ) {\n";
EOF_ACTION_SWITCH() << EOF_ACTION_SWITCH() <<
" }\n" " }\n"
" __nacts -= 1;\n" " " << nacts << " -= 1;\n"
" __acts += 1;\n" " " << acts << " += 1;\n"
" }\n"; " }\n";
} }
} }
void ActLoop::NFA_FROM_STATE_ACTION_EXEC() void ActLoop::NFA_FROM_STATE_ACTION_EXEC()
{ {
if ( redFsm->anyFromStateActions() ) { if ( redFsm->anyFromStateActions() ) {
out << out <<
" " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( fromStateActions ) + "[nfa_bp[nfa_len].state]" ) << ";\n" " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( fromStateActions ) + "[nfa_bp[nfa_len].state]" ) << ";\n"
" " << nacts << " = " << CAST( UINT() ) << DEREF( A RR_REF( actions ), "" + string(acts) + "" ) << ";\n" " " << nacts << " = " << CAST( UINT() ) << DEREF( A RR_REF( actions ), string(acts) ) << ";\n"
" " << acts << " += 1;\n" " " << acts << " += 1;\n"
" while ( " << nacts << " > 0 ) {\n" " while ( " << nacts << " > 0 ) {\n"
" switch ( " << DEREF( ARR_REF( actions ), "" + string(acts) + "" ) << " ) {\n"; " switch ( " << DEREF( ARR_REF( actions ), string(acts) ) << " ) {\n";
FROM_STATE_ACTION_SWITCH() << FROM_STATE_ACTION_SWITCH() <<
" }\n" " }\n"
" " << nacts << " -= 1;\n" " " << nacts << " -= 1;\n"
" " << acts << " += 1;\n" " " << acts << " += 1;\n"
" }\n" " }\n"
"\n"; "\n";
} }
} }
 End of changes. 10 change blocks. 
21 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)