[antlr-interest] How to get the inner ${identifier}.text
Gavin Lambert
antlr at mirality.co.nz
Fri Jul 10 20:27:39 PDT 2009
At 14:54 11/07/2009, Ha Luong wrote:
>q1_1a_bk
> (time_phrase)?
> {
> System.out.println($prep_time.text);
> }
> '\?';
>
>time_phrase
> : prep_time time;
You can either use a scope or return values for this. Here's an
example for using return values:
q1_1a_bk
: (t=time_phrase { System.out.println($t.prep); })?
'\?'
;
time_phrase returns [String prep]
: prep_time time { $prep = $prep_time.text; }
;
More information about the antlr-interest
mailing list