DEV Community

Discussion on: Writing a DSL parser using PegJS

Collapse
 
barryosull profile image
Barry O Sullivan

Thank you. Good point on the regexes and parsers, I'll update the article to fix that.

Great clarification on the difference between lexing and parsing, PEGs just mashes the two concepts together into a single file. It's fine for simple grammars but can quickly become problematic for more complex ones.

I've written my own parsers and found it quite tedious, would you have any tools you'd recommend for writing parsers? I've looked at YACC and ANTLR, but didn't get very far, might revisit them in future.

Collapse
 
dmfay profile image
Dian Fay

I've only looked into those two. The last time I tried to do any sort of language tinkering like this was years ago. I got halfway through building a grammar, realized I'd just invented a crappier LISP, and promptly gave up.