Hi PEG list,

Recently I tried writing some parsers using a refactoring tool (a meta-layer) of my own. Without a better name, I refer to the result -- imperative parser:

    http://hz2.org/blog/python_calc.html

I am not really been following up with academic computer science, so only afterwards (today) I learned about PEG. My imperative parser shares with PEG in that the order of parsing (rules) matters, no ambiguity (as a limit of method), and linear complexity. I refer to it imperative parser to contrast against traditional parser which starts with CFG, therefore fundamentally declarative.

With the help of MyDef (a meta-layer of my own invention), I was able to have the code well organized to achieve semantic separation and extensibility (IMHO).

The basic algorithm was certainly not new. It is essentially operator precedence based shift-reduce parsing for expression and top-down context dependent parsing for statements (I am not sure about the latter, but it is definitely top-down semantically). However, this mixed approach seems novel from my limited search.

Anyway, as I am not really been following academic, I am not exactly sure where it stands or whether this is anything new at all. Therefore this post to PEG list, seeking feedbacks.

Thanks for attention,

--
Hui Zhou
http://hz2.org/blog/


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

Reply via email to