[antlr-interest] Incremental parsing using ANTLR
Nigel Sheridan-Smith
nbsherid at secsme.org.au
Wed Mar 2 13:15:04 PST 2005
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Prashant Deva
> Sent: Thursday, 3 March 2005 7:16 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Incremental parsing using ANTLR
>
> Anybody has any ideas on doing incremental parsing in ides using antlr.
>
> All the papers I have found talk only about LR parsers. Havent found one
> for LL.
>
> Eclipse also uses a hand coded LR parser for its incremental parsing.
>
> What I can think of right now is to determine the 'context' the user
> is in, say in a method, then tell the parser to parse only the rule
> for 'method'.
Can't you call the parsing method for any non-protected parser rules?
x: y z;
y: a B;
protected a: C;
protected z: D;
With this simple grammar, I can call method x() to parse "C B D", or method
y() to parse "C B", but I cannot call a() or z().
As long as your rules aren't using ()* or ()+ then it should stop parsing
once enough input is obtained. Right?
Nigel
--
Nigel Sheridan-Smith
PhD research student
Faculty of Engineering
University of Technology, Sydney
Phone: 02 9514 7946
Fax: 02 9514 2435
More information about the antlr-interest
mailing list