[antlr-interest] Infinite lookahead/syntactic predicates

Anders Jacobsson anders.jacobsson at gmail.com
Thu Jun 23 15:25:33 PDT 2005


Hi!

I'm really sorry if I'm asking about something obvious or something
that is clearly stated in the documentation but I would really
appreciate in one or two hints that can guide me in my first attempts
of using ANTLR.

Anyway, I need to process things like the following:

'12345'D
'13AEF'H
'1A4'T
'1010101'B
'17853'

The first one should be matched to be a decimal constant, the second
one a hexadecimal constant, the third one a TBCD constant, the fourth
one a binary constant and the last to be a constant of unknown type.

It would have been nice to have the type indicator in front of the
constant but I guess I'm not that lucky... :) I have been trying to
use looping and syntactic predicates but so far no luck.

Has anyone any tips?

Cheers,
Anders


More information about the antlr-interest mailing list