Example #1
0
bool GeneralLexer::chkSig(Lexer &flex, const std::string &ctrl)
{
    // Pasar delimitadores
    flex.skipDelim();

    // Apuntar los iteradores a las cadenas correctas
    const std::string &line = flex.getLine();
    std::string::const_iterator it2 = line.begin();
    std::string::const_iterator it = ctrl.begin();

    std::advance( it2, flex.getCurrentPos() );

    // Comparar
    for(; it != ctrl.end() && it2 != line.end(); ++it, ++it2) {
        if ( *it != *it2 ) {
            break;
        }
    }

    return ( it == ctrl.end() );
}