[antlr-interest] Parsing Binary Files with ANTLR V3.x? Any examples?

jarrod roberson jarrod at vertigrated.com
Mon Aug 28 11:07:10 PDT 2006


On 8/9/06, Terence Parr <parrt at cs.usfca.edu> wrote:
>
> On Aug 9, 2006, at 11:08 AM, jarrod roberson wrote:
>
> > anyone have any examples on how to parse binary files with ANTLR V3?
> > I have looked everywhere and can't find anything substaintial.
>
> I have not tried yet, but you'll probably need a new stream other
> than CharStream.  ANTLRByteStream perhaps.
>
> Then, just use unicode '\u00xx' chars in your lexer.


thanks for the reply, but that really make any sense to me.

anyone have a concrete example, no matter how contrived?

my basic header I am trying to parse looks something like this

wfs!<byte><byte><unsigned long><unsigned long> . . . etc.


More information about the antlr-interest mailing list