Hi All, I have been working with ANTLR for about 3.5 months on a domain-specific language for a very constrained domain in natural language, English. I have created a fairly complex EBNF grammar for this. Thus far I have been able to solve most of my questions through documentation and looking at the mailing list archives.
One of the requirements for this parser is that it goes through any English sentence and extract only the phrases that match the parsing rules, while skipping others. The problem I have found with this, is that when the rules (parser or lexer), do not match anything in an sentence and then encounter something that matches, it works great with the automatic error recovery strategy in ANTLR, however, when there is a partial match of a parser rule, I get an "required (..)+ loop did not match anything at input" exception. Is there anyway to throw away the token that caused this exception and continue with the rest of the input? Currently I am handling most of these problems by creating an additional rule where all the alternatives are the single tokens at the beginning of the rules that cause the problem above. This works fine, but increases the complexity of the DFA and causes munch unwanted ambiguities. There has got to be a better way. I am using ANTLR 3.1.1 and my target language is Java. Any help is very much appreciated. Yuri Tijerino List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
