> 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?
I'm also interested in this. After doing some experiments parsing the constructed language lojban with a PEG grammar I thought it would great to have a 'grammar-aware' editor that could take advantage of the structural information available. My own cl-peg parser is batch based and I haven't thought much about ways to efficiently do incremental parsing. The whole parsing model is also wrong for something like interactive editing, because the parser greedily builds a parse tree and never tries to do error correction or "fill-in" something missing to achieve a full parse. > 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. As a "syntax-less" language like LISP should be easy to parse, but I was quite surprised to see how complex SBCL's reader code is: http://sbcl.cvs.sourceforge.net/sbcl/sbcl/src/code/reader.lisp?revision=1.48&view=markup For editing LISP, I have been using http://mumble.net/~campbell/emacs/paredit.el for a while now and I find it much better than other lisp modes. John Leuner _______________________________________________ PEG mailing list PEG@lists.csail.mit.edu https://lists.csail.mit.edu/mailman/listinfo/peg