src/grammar.cpp
std::string Grammar::getMatchingPublicRule(std::string test) const {
    test = Grammar::trimString(test);
    test = Grammar::replaceAll(test, " {2,}", " ");
    for(shared_ptr<Rule> r : rules) {
        if(r->isPublic()) {
        Matchvector m = matchesRule(r, test);
            if(m.size() != 0) {
                return r->getRuleName();
            }
        }
    }
    return "";
}
/**
  * Returns the rule name of the public rule that matches the test string. If no matching public rule is found, an empty string is returned.
  * \param string String to test against public rules.
  * \return string
  */
Returns the rule name of the public rule that matches the test string. If no matching public rule is found, an empty string is returned.
\param string String to test against public rules.
\return string
Returns the rule name of the public rule that matches the test string . If no matching public rule is found an empty string is returned . \ param string String to test against public rules . \ return string
std::string Grammar::getMatchingPublicRule(std::string test) const {
    test = Grammar::trimString(test);
    test = Grammar::replaceAll(test, " {2,}", " ");
    for(shared_ptr<Rule> r : rules) {
        if(r->isPublic()) {
        Matchvector m = matchesRule(r, test);
            if(m.size() != 0) {
                return r->getRuleName();
            }
        }
    }
    return "";
}
std :: string Grammar :: getMatchingPublicRule ( std :: string test ) const { test = Grammar :: trimString ( test ) ; test = Grammar :: replaceAll ( test , " " , " " ) ; for ( shared_ptr < Rule > r : rules ) { if ( r -> isPublic ( ) ) { Matchvector m = matchesRule ( r , test ) ; if ( m . size ( ) != 0 ) { return r -> getRuleName ( ) ; } } } return " " ; }
Returns the rule name of the public rule that matches the test string.
Returns the rule name of the public rule that matches the test string .