src/Scanner/lex.cc
// At this point a rule has been matched.  The next character is not part of
// the matched rule and is sent back to the input.  The final match length
// is determined, the index of the matched rule is determined, and then
// d_atBOL is updated. Finally the rule's index is returned.
// The numbers behind the finalPtr assignments are explained in the 
// manual's `Run-time operations' section.
At this point a rule has been matched.  The next character is not part of
the matched rule and is sent back to the input.  The final match length
is determined, the index of the matched rule is determined, and then
d_atBOL is updated. Finally the rule's index is returned.
The numbers behind the finalPtr assignments are explained in the
manual's `Run-time operations' section.
At this point a rule has been matched . The next character is not part of the matched rule and is sent back to the input . The final match length is determined the index of the matched rule is determined and then d_atBOL is updated . Finally the rule ' s index is returned . The numbers behind the finalPtr assignments are explained in the manual ' s ` Run - time operations ' section .
size_t ScannerBase::matched_(size_t ch)
{
    d_input.reRead(ch);
    FinalData *finalPtr;
    if (not d_atBOL)                    
        finalPtr = &d_final.std;        
    else if (not available(d_final.std.rule))   
            finalPtr = &d_final.bol;            
    else if (not available(d_final.bol.rule)) 
        finalPtr = &d_final.std;        
    else if (                           
        d_final.bol.length !=           
        d_final.std.length              
    )                                   
        finalPtr =              
            d_final.bol.length > d_final.std.length ?
                &d_final.bol
            :
                &d_final.std;
    else                            
        finalPtr = 
            d_final.bol.rule < d_final.std.rule ?
                &d_final.bol
            :
                &d_final.std;
    setMatchedSize(finalPtr->length);
    d_atBOL = d_matched.back() == '\n';
    return finalPtr->rule;
}
size_t ScannerBase :: matched_ ( size_t ch ) { d_input . reRead ( ch ) ; FinalData * finalPtr ; if ( not d_atBOL ) finalPtr = & d_final . std ; else if ( not available ( d_final . std . rule ) ) finalPtr = & d_final . bol ; else if ( not available ( d_final . bol . rule ) ) finalPtr = & d_final . std ; else if ( d_final . bol . length != d_final . std . length ) finalPtr = d_final . bol . length > d_final . std . length ? & d_final . bol : & d_final . std ; else finalPtr = d_final . bol . rule < d_final . std . rule ? & d_final . bol : & d_final . std ; setMatchedSize ( finalPtr -> length ) ; d_atBOL = d_matched . back ( ) == ' \n ' ; return finalPtr -> rule ; }
At this point a rule has been matched.
At this point a rule has been matched .
// not at BOL // then use the std rule (3, 4) // at BOL // only a BOL rule avail. // use the BOL rule (6) // only a std rule is avail. // use the std rule (7) // Both are available (8) // check lengths of matched texts // unequal lengths, use the rule // having the longer match length // lengths are equal: use 1st rule