[antlr-interest] ANTLR3.0b2 - Best practice to end parsing ?

Terence Parr parrt at cs.usfca.edu
Wed Jul 19 17:28:48 PDT 2006


On Jul 18, 2006, at 8:24 AM, David CROSSON wrote:

> I'm looking for the best way to stop scanning
> a data stream which contains structured text
> data blocks; Do you thing that the following :
>
> SampleParser.all_return rc;
> while(true) {
>     rc=parser.all();
>     BaseTree tree = (BaseTree)rc.getTree();
>     if (tree.isNil()) break;
> }
>
> is the best way to end the scan once all the
> structured data blocsk have been found ?

Shouldn't the parser decide when it should finish?

Terence


More information about the antlr-interest mailing list