C. Mundi wrote: > What I'm thinking is a lexer which finds the clauses followed by a > parser which does a trivial rewrite which embeds actions to invoke > specialized lexers for each clause type. All of the specialized > levers target a single AST which is handled by a unified parser. > I once found this in the wiki while looking for ways to parse placeholders in strings:
http://www.antlr.org/wiki/display/ANTLR3/Island+Grammars+Under+Parser+Control But in my case I found this to be too complicated for my needs, and I choose to create a new filter lexer, and do the parsing later in the code in a method. I just needed some info for replacements, so I created a method in the AST node that did the lexing and return a collection of objects for me. I see that in your case, you are looking for a full grammar, but anyway, it helps to remember you don't need to do everything in one step. If the grammars are that much different, you can do a 2 step pass in the code: parse the basics and divide the grammars like they were really different files, and then get the list from the parser and call a different parser depending on the input. Of course, someone here with more experience may have a better solution. =) []'s List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/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 -~----------~----~----~----~------~----~------~--~---
