Derek,
Rats! does support incremental parsing, in the sense that it does not
require the entire input to be available at parsing time. I.e., you
can parse some production, process the result, and then parse the
next production. Whether that helps in implementing text editors, I'm
not sure. It does help with reducing the resource requirements for
very large inputs and with processing interactive input one
expression at a time.
Robert
On Feb 2, 2007, at 7:40 PM, Derek Peschel wrote:
Hi everybody,
Has anyone tried incremental parsing algorithms (the only one I
know about
is Earley's) with PEGs? And has anyone defined a set of data
structures and
functions that make it easy to hook incremental parsers to editors?
The PEG-based parser generators I've seen are interesting, but
geared toward
generating batch parsers. As you may be able to tell from my
questions, I'm
looking for an editor, or some tool to create one. Specifically
I'm looking
for an editor (or editor generator) that can work with programs in
different
languages. From that point of view, PEGs are a clear and powerful
way to
write language modules for the editor, but another abstraction
(CFGs or
something) might address my desires too.
By "work with", I mean "highlight the complete syntax of", "allow
the user
to move through and edit the parse tree of", "pass the parse tree
directly
to a compiler", "mark errors returned by the compiler", and other
interesting
things like that. Correctness is important -- many popular editors
cheat
too much to qualify.
Another quality I'm looking for is self-awareness or self-hosting.
So the
editor should work with files containing language modules, and the
editor
should also have built-in modules for the specialized languages it
executes
(macros, search patterns, system commands, etc.) and should use
highlighting
at prompts as well as in file buffers.
Interrestingly, the editors I've found (Climacs and DrScheme/MrEd) are
written in LISP dialects and work with LISP programs. LISP is
amazingly
easy to parse and manipulate. But I haven't gotten very far yet at
expanding those editors, so I thought I'd ask for more ideas.
Thanks!
-- Derek
_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg
_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg