[antlr-interest] Parsing a Fixed length file

Manikandan Subramanian vsmani.chrome at gmail.com
Wed Aug 27 19:12:19 PDT 2008


Hi,

This is one part of the bigger problem and just the startup. I need ANTLR
for sure, because I need to do data translation from one format to other
format. Source data structure could be fixed length data / delimited / some
cryptic data and Target data structure is XML.

As Gavin suggested, I think I may be need to some pre-processing to clean
the data and then give the cleaned data to ANTLR. But I am just wondering
whether is it good such things ANTLR itself instead of writing a framework
from the scratch.

Regards
Mani

On Wed, Aug 27, 2008 at 4:10 PM, Gavin Lambert <antlr at mirality.co.nz> wrote:

> 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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080827/265142b0/attachment.html 


More information about the antlr-interest mailing list