[antlr-interest] "dynamic" whitespace?

Nick Vlassopoulos nvlassopoulos at gmail.com
Wed Dec 9 15:41:22 PST 2009


Hi,

Just a quick idea (on the previously proposed approach)
You could perhaps "escape" the non-delimiting characters and add a special
lexer rule for these?

Nikos

On Thu, Dec 10, 2009 at 12:37 AM, Skip Sailors <ssailors at wpc-edi.com> wrote:

> Well, interesting thought, thanks.  That defers the problem a bit, but I'm
> not sure it solves.  I can't pick a static character that will never be used
> in the message.  If, for instance, I pick '|' as the static line delimiter,
> and replace all the dynamic ones with this, but there is already a '|' in
> the message somewhere I am going to find an extra line in the message and my
> parser trips.  If I first look for all the places where '|' occurs and
> replace it with a '<' and then replace the delimiter with a '|' I have the
> same problem with '<', and that strategy seems to spin out of control.
>
> -----Original Message-----
> From: Peter Boughton [mailto:boughtonp at gmail.com]
> Sent: Wednesday, December 09, 2009 3:22 PM
> To: Skip Sailors; antlr-interest at antlr.org
> Subject: Re: [antlr-interest] "dynamic" whitespace?
>
> I'm not an ANTLR expert, but it seems that if you've got fixed width
> data like this, then it's best to use regular string processing on the
> data first, to extract and convert the dynamic delimiters to static
> ones, and after that pass the processed result into ANTLR to do the
> rest with?
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091210/be273f85/attachment.html 


More information about the antlr-interest mailing list