alavrik / erlson

Erlang Simple Object Notation - dynamic name-value dictionary data type and syntax for Erlang
MIT License
81 stars 17 forks source link

Why did you use a separate parser? #1

Open si14 opened 13 years ago

si14 commented 13 years ago

Why didn't use standard erl_parse/erl_syntax?

alavrik commented 13 years ago

I do extend the standard Erlang grammar by introducing several new erl_parse grammar productions: https://github.com/alavrik/erlson/blame/master/src/erl_parse.yrl

As for erl_syntax, there are two reasons. First, when I started working on Erlson, I wasn't sure I would get away with standard AST representation, and by doing everything manually I had more flexibility.Second, I had a working and tested AST traversal by the time I entered Spawnfest, and I decided to reuse in order to save some time.

It turned out that there were no need to introduce new AST elements. While erl_parse still has to remain custom, the parse transformation code can be rewritten to use Ulf Wiger's parse_trans and erl_syntax.