[antlr-interest] Extracting match

Andrew Bell andrew.bell.ia at gmail.com
Mon Mar 6 16:34:55 PST 2006


Hi,

I've got a grammar that looks something like:

rule1 : "foo" | "bar" | "baz"
   ;

rule2 : x  rule1  y rule1
  ;

I want to know in rule2 which of the strings "foo", "bar" or "baz"
were matched.  Can someone show me the preferred way to do this?

Thanks,

--
Andrew Bell
andrew.bell.ia at gmail.com


More information about the antlr-interest mailing list