Spirit-Qi: How can I write a nonterminal parser?
I want to write a parser (as a qi extension) which can be used via my_parser(p1, p2, ...) where p1, p2, ... are qi parser expressions. Actually, I want to implement a best_match parser which works like qi alternative, but selects not the first matching rule but the rule which 'explains' most of the input. Given two rules simple_id = +(qi::alpha) and complex_id = simple_id >> *(qi::string("::") > simple_id) it would select complex_id on the input willy::anton . And it would not produce intermediate attributes while doing so. These benefits get payed for with runtime because lookahead parsing is