
Joel de Guzman wrote:
An alternative scheme is to let the user switch strategies (possibly using spirit directives).
Another scheme, used by PCCTS, is to make the parser predictive by default, and allow the user to use syntactic and semantic predicates with arbitrary lookahead on specific points in the grammar.
Eewww, I smell a kludge ;-)
Not really. There's a big problem with backtracking in general: backtracking and semantic actions do not mix well (e.g. false triggering). In a syntactic and semantic predicate, all actions are intentionally inhibited.
Thats up to now the only problem I had, when using spirit. Are there plans, to allow defering of semantic actions? E.g like the phrase and character level directives that can be used switch the parsers behaviour at certain positions within rules, maybe that could be done for semantic actions too. Such that all semantic actions are triggered after the rules within the directive returned sucess. Maybe there are better solutions. Regards, Andreas Pokorny -- Psssst! Mit GMX Handyrechnung senken: http://www.gmx.net/de/go/mail 100 FreeSMS/Monat (GMX TopMail), 50 (GMX ProMail), 10 (GMX FreeMail)