[antlr-interest] Parsing a Fixed length file

Gavin Lambert antlr at mirality.co.nz
Wed Aug 27 13:10:05 PDT 2008


At 07:09 28/08/2008, Manikandan Subramanian wrote:
>I am new to ANTLR. I would like to parse fixed length records. I 
>have gone through many documentation but I didnt get any idea how 
>to do.
>
>Basically, I want to define my token to a fixed length [something 
>like defining with starting positon and ending postion].

While it's possible to do this in ANTLR, I don't think it's really 
the right tool for this sort of job.

At the very least, you should probably write your own custom 
lexer.  It'd be much easier (and more readable) to do that than to 
try to build an ANTLR-only one, I think.



More information about the antlr-interest mailing list