[antlr-interest] [Antlr3 grammar] how to specify alpha token, numeric token and mix of both

Kaleb Pederson kaleb.pederson at gmail.com
Wed Oct 21 08:36:07 PDT 2009


On Wednesday 21 October 2009 03:23:47 am Hieu Phung wrote:
> My grammar has 3 kinds of tokens:
> 1) number: contain numeric character
> 2) alpha: contain alphabetic character;
> 3) mix: contain number and alpha and hyphen, full stop or space
> 
> For example:
> 1/VEC305/03MAR/PTY
> => in the above input data, 03MAR should be interpreted as a number of
> length 2 followed by alpha of length 3. But VEC305 is a mix of length 6.

Hieu,

How do you know that VEC305 is a mix of length six?  It sure looks like an alpha followed by a number to me... so what makes it special or different than 03MAR?

--
Kaleb Pederson

Twitter - http://twitter.com/kalebpederson
Blog - http://kalebpederson.com


More information about the antlr-interest mailing list