src/grammar.cpp
MatchResult Grammar::match(std::string test) const {
    test = Grammar::trimString(test);
    test = Grammar::replaceAll(test, " {2,}", " ");
    for(shared_ptr<Rule> r : rules) {
        Matchvector m = matchesRule(r, test);
        if(m.size() != 0) {
            return MatchResult(r, m);
        }
    }
    return MatchResult();
}
/** Returns a MatchResult object that contains info about the rule that the test string matches. An empty MatchResult object is returned if no match is found.
  * \param string String to test against the Grammar's rules
  * \return MatchResult
  */
Returns a MatchResult object that contains info about the rule that the test string matches. An empty MatchResult object is returned if no match is found.
\param string String to test against the Grammar's rules
\return MatchResult
Returns a MatchResult object that contains info about the rule that the test string matches . An empty MatchResult object is returned if no match is found . \ param string String to test against the Grammar ' s rules \ return MatchResult
MatchResult Grammar::match(std::string test) const {
    test = Grammar::trimString(test);
    test = Grammar::replaceAll(test, " {2,}", " ");
    for(shared_ptr<Rule> r : rules) {
        Matchvector m = matchesRule(r, test);
        if(m.size() != 0) {
            return MatchResult(r, m);
        }
    }
    return MatchResult();
}
MatchResult Grammar :: match ( std :: string test ) const { test = Grammar :: trimString ( test ) ; test = Grammar :: replaceAll ( test , " " , " " ) ; for ( shared_ptr < Rule > r : rules ) { Matchvector m = matchesRule ( r , test ) ; if ( m . size ( ) != 0 ) { return MatchResult ( r , m ) ; } } return MatchResult ( ) ; }
Returns a MatchResult object that contains info about the rule that the test string matches.
Returns a MatchResult object that contains info about the rule that the test string matches .