Re: Interactive Parsing

johnm@soda.CSUA.Berkeley.EDU (John D. Mitchell)
Tue, 8 Aug 1995 07:26:58 GMT

          From comp.compilers

Related articles
Interactive Parsing im99_foa@nada.kth.se (Marielle Fois) (2000-07-27)
Interactive Parsing yves.dufournaud@imag.fr (Yves Dufournaud) (1995-08-01)
Re: Interactive Parsing johnm@soda.CSUA.Berkeley.EDU (1995-08-08)
| List of all articles for this month |

Newsgroups: comp.compilers
From: johnm@soda.CSUA.Berkeley.EDU (John D. Mitchell)
Keywords: parse, syntax, PCCTS
Organization: Computer Science Undergrad Assoc., Univ. of Calif. Berkeley
References: 95-08-038
Date: Tue, 8 Aug 1995 07:26:58 GMT

Yves Dufournaud <yves.dufournaud@imag.fr> wrote:
>I'd like to do interactive parsing, ie you parse once, the user modify
>slightly the input, the goal is to reparse as few as possible the input
>text before rebuilding the abstract tree ( speed is important). I assume I
>know where the text was changed.


The parsers generated using the PCCTS parser generator, ANTLR, have a
function for each rule in the grammar. [ANTLR generates predicated-LL(k)
parsers.] So you can invoke any ol' rule you like at any time (any side
effect dependencies that are in you're grammar actions is your own problem
:-) by calling the appropriate function (there's no particular 'start' rule
distinction).


NeXT used this to great advantage in an editor which did some sort of
incremental compilation based on what you had changed. They gave a
demonstration of this at last year's PCCTS Workshop and it was very fast.


Also, note that ANTLR has a very helpful facility for building ASTs
automatically and/or manually.


Hope this helps,
John


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.