binary.cc (ragel-7.0.0.11) | : | binary.cc (ragel-7.0.0.12) | ||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
void Binary::genAnalysis() | void Binary::genAnalysis() | |||
{ | { | |||
redFsm->sortByStateId(); | redFsm->sortByStateId(); | |||
/* Choose default transitions and the single transition. */ | /* Choose default transitions and the single transition. */ | |||
redFsm->chooseDefaultSpan(); | redFsm->chooseDefaultSpan(); | |||
/* Choose the singles. */ | /* Choose the singles. */ | |||
redFsm->moveSelectTransToSingle(); | redFsm->moveSelectTransToSingle(); | |||
if ( redFsm->errState != 0 ) | ||||
redFsm->getErrorCond(); | ||||
/* If any errors have occured in the input file then don't write anything . */ | /* If any errors have occured in the input file then don't write anything . */ | |||
if ( red->id->errorCount > 0 ) | if ( red->id->errorCount > 0 ) | |||
return; | return; | |||
/* Anlayze Machine will find the final action reference counts, among oth er | /* Anlayze Machine will find the final action reference counts, among oth er | |||
* things. We will use these in reporting the usage of fsm directives in | * things. We will use these in reporting the usage of fsm directives in | |||
* action code. */ | * action code. */ | |||
red->analyzeMachine(); | red->analyzeMachine(); | |||
setKeyType(); | setKeyType(); | |||
skipping to change at line 245 | skipping to change at line 248 | |||
} | } | |||
void Binary::taEofConds() | void Binary::taEofConds() | |||
{ | { | |||
/* | /* | |||
* EOF Cond Spaces | * EOF Cond Spaces | |||
*/ | */ | |||
eofCondSpaces.start(); | eofCondSpaces.start(); | |||
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | |||
if ( st->outCondSpace != 0 ) | if ( st->outCondSpace != 0 ) | |||
transCondSpaces.value( st->outCondSpace->condSpaceId ); | eofCondSpaces.value( st->outCondSpace->condSpaceId ); | |||
else | else | |||
transCondSpaces.value( -1 ); | eofCondSpaces.value( -1 ); | |||
} | } | |||
eofCondSpaces.finish(); | eofCondSpaces.finish(); | |||
/* | /* | |||
* EOF Cond Key Indixes | * EOF Cond Key Indixes | |||
*/ | */ | |||
eofCondKeyOffs.start(); | eofCondKeyOffs.start(); | |||
int curOffset = 0; | int curOffset = 0; | |||
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | |||
skipping to change at line 453 | skipping to change at line 456 | |||
/* Add any eof transitions that have not yet been written out above. */ | /* Add any eof transitions that have not yet been written out above. */ | |||
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | |||
if ( st->eofTrans != 0 ) { | if ( st->eofTrans != 0 ) { | |||
RedTransAp *trans = st->eofTrans; | RedTransAp *trans = st->eofTrans; | |||
transOffsets.value( curOffset ); | transOffsets.value( curOffset ); | |||
curOffset += trans->numConds(); | curOffset += trans->numConds(); | |||
} | } | |||
} | } | |||
errCondOffset = curOffset; | ||||
transOffsets.finish(); | transOffsets.finish(); | |||
} | } | |||
void Binary::taTransLengths() | void Binary::taTransLengths() | |||
{ | { | |||
transLengths.start(); | transLengths.start(); | |||
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | |||
/* Walk the singles. */ | /* Walk the singles. */ | |||
for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) { | for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) { | |||
skipping to change at line 628 | skipping to change at line 633 | |||
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | |||
if ( st->eofTrans != 0 ) { | if ( st->eofTrans != 0 ) { | |||
RedTransAp *trans = st->eofTrans; | RedTransAp *trans = st->eofTrans; | |||
for ( int c = 0; c < trans->numConds(); c++ ) { | for ( int c = 0; c < trans->numConds(); c++ ) { | |||
RedCondPair *cond = trans->outCond( c ); | RedCondPair *cond = trans->outCond( c ); | |||
condTargs.value( cond->targ->id ); | condTargs.value( cond->targ->id ); | |||
} | } | |||
} | } | |||
} | } | |||
if ( redFsm->errCond != 0 ) { | ||||
RedCondPair *cond = &redFsm->errCond->p; | ||||
condTargs.value( cond->targ->id ); | ||||
} | ||||
condTargs.finish(); | condTargs.finish(); | |||
} | } | |||
void Binary::taCondActions() | void Binary::taCondActions() | |||
{ | { | |||
condActions.start(); | condActions.start(); | |||
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | |||
/* Walk the singles. */ | /* Walk the singles. */ | |||
for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) { | for ( RedTransList::Iter stel = st->outSingle; stel.lte(); stel++ ) { | |||
skipping to change at line 675 | skipping to change at line 685 | |||
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) { | |||
if ( st->eofTrans != 0 ) { | if ( st->eofTrans != 0 ) { | |||
RedTransAp *trans = st->eofTrans; | RedTransAp *trans = st->eofTrans; | |||
for ( int c = 0; c < trans->numConds(); c++ ) { | for ( int c = 0; c < trans->numConds(); c++ ) { | |||
RedCondPair *cond = trans->outCond(c); | RedCondPair *cond = trans->outCond(c); | |||
COND_ACTION( cond ); | COND_ACTION( cond ); | |||
} | } | |||
} | } | |||
} | } | |||
if ( redFsm->errCond != 0 ) { | ||||
RedCondPair *cond = &redFsm->errCond->p; | ||||
COND_ACTION( cond ); | ||||
} | ||||
condActions.finish(); | condActions.finish(); | |||
} | } | |||
void Binary::taNfaTargs() | void Binary::taNfaTargs() | |||
{ | { | |||
nfaTargs.start(); | nfaTargs.start(); | |||
/* Offset of zero means no NFA targs, put a filler there. */ | /* Offset of zero means no NFA targs, put a filler there. */ | |||
nfaTargs.value( 0 ); | nfaTargs.value( 0 ); | |||
End of changes. 6 change blocks. | ||||
2 lines changed or deleted | 17 lines changed or added |