[antlr-interest] Getting names of lexer/parser rules from a Runtime

Jim Idle jimi at temporal-wave.com
Fri Oct 21 10:00:23 PDT 2011


Again, why do you want the NAMES of the rules? But there is no automated
way to program this.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Udo Weik
> Sent: Friday, October 21, 2011 4:45 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Getting names of lexer/parser rules from a
> Runtime
>
> Hello,
>
> I already asked Jim that question concerning the C-Runtime.
> His answer:
>  > No - you have to code that. But they are rarely useful. If you want
> them  > as indicators for error refinement, then implement a global
> scope and add  > it to each rule, in the rule set a scope member
> variable to a predefined  > value for each rule, then access the scope
> stack in the error reporting  > method.
>
> So my question is - what is the simplest way to get these names? I'm
> working with complex grammars, so at least I want to automate adding
> necessary (action) code snippets (e. g. via Regex search and replace).
> Any other/better ideas?
>
>
> Many thanks and greetings
> Udo
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list