[antlr-interest] A challenging question

Johannes Luber jaluber at gmx.de
Tue May 8 02:36:17 PDT 2007


丘成桐 wrote:
> Hi ,I have a challenging question to ask you .  There are ten binary
> data packets A,B,C,D,E,F.......
>         packet A: "this  is a te"
>         packet B: "st !"
>         ......
> I can not  put packets A and B together,what could I do to ask scanner
> to find the "test" coming from packet A and B?
> 
> I am looking froward to your early reply.

I suppose that the only possibility is to create another layer above the
packets which virtually combines the binary packets into a single one.
As tokens don't copy their text from the source but instead point to it,
you have to add some facility which allows the retrieval of substrings.
At least that is what gather from what I know about ANTLRs tokenizer.
Maybe you need to write an own scanner class, too.

Best regards,
Johannes Luber


More information about the antlr-interest mailing list