I feel like I'm being denser than usual so any clue will do... Suppose I have a legacy configuration file with an ad hoc grammar and now I need to write a clean parser for it. The parser is trivial if the lexing is done cleanly. The 'language' has easily detected and disambiguated 'clauses' but each clause has its own dialect and some dialects are in syntactic conflict. For example a reserved word in one dialect is legal freeform text in another and no (elegant) predicate can handle all ambiguous contexts.
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. Seems like a lot of work to fake out 'sublexing'. There must be a better way to think about this. Thanks for reading! ~Carlos 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 -~----------~----~----~----~------~----~------~--~---
