Hacker News new | past | comments | ask | show | jobs | submit login

But we have to jump through some hoops to convert expressions into statements/expressions (I work a bit on Hy[0] which does exactly this).

[0] https://github.com/hylang/hy




Yes, that's typically how it works -- at some point, the concrete syntax tree has to be converted to abstract syntax.

I wouldn't call it jumping through hoops though. Rather, for me, it's a natural consequence of separation of concerns. I try to build parsers that only know about concrete syntax. A later pass over the CST is responsible for building the AST, which prevents coupling of the parser to the abstract syntax.

YMMV. There's more than one way to skin this cat.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: