Le 2011-08-02 à 03:22, Alek Paunov a écrit :
> I am using Cloud 9 IDE [1] locally and probably will try to achieve the same 
> next year (if the core team not have accomplished the task in the following 
> months :-)) using XML documents as parse trees, LPEG based parser and LPEG VM 
> stacks recovery as I tried to outline in the previous thread:
> 
> http://www.mail-archive.com/peg@lists.csail.mit.edu/msg00379.html

Do you plan to use XML documents in memory or only for persistence? I think 
that keeping everything in XML would not be very efficient in my case. My goal 
is to provide a suitable replacement for building a custom AST in semantic 
actions (à la Yacc).

I use hash tables that maps the start location of nonterminals to their end 
location. I have one such table for every "node" which are nonterminals marked 
with a "fat arrow" in the grammar (<= instead of <-). This is the only 
annotation allowed in my PEG grammar (the rest is identical to the ASCII 
grammar in Bryan Ford's paper). I may also add "skip" tables to speed up the 
traversal of "non-nodes".

One interesting property that I maintain is that even if I drop entries in the 
table to save memory (or if I don't memoize at all), I can still traverse the 
tree with the same interface (triggering a reparse under the hood).

> [1] https://github.com/ajaxorg/cloud9, http://cloud9ide.com


_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg

Reply via email to