[antlr-interest] How do I set token type in ANTLR 3.1b1?
Gavin Lambert
antlr at mirality.co.nz
Mon Jun 9 01:31:11 PDT 2008
At 10:34 9/06/2008, Johannes Luber wrote:
>That isn't supposed to be necessary. I did explicitly test all
>cases and found that .text is sufficient then (I even changed
the
>wiki text afterwards). Does anyone else have this problem?
Really -
>is this an isolated problem? I once had to use .Text in 3.0.1,
too,
>which prompted my quest to undo this difference. But a search
where
>.Text would be translated failed to show up any result, a test
>grammar created to replicate this issue worked fine (for
whatever
>reason), and as the runtimes otherwise don't touch the action
>translation stuff, I doubt that the target choice does affect
>things. But you could test if Java gives the same problems. I'll
>test that myself this week, once I get my development workbook
back
>and can recreate my test environment. Due to an unforeseen
problem
>with wildlife it may not be Monday as planned...
I've used $x.text successfully in both a combined parser and tree
parser (build 2008-04-09.18, CSharp2 target).
One thing that I have noticed is that the attribute replacement
only works to one level -- eg. $a.token and $b.text both work, but
$a.token.text doesn't. But that's not a big deal.
More information about the antlr-interest
mailing list