DEV Community

Discussion on: Any SMEs on JavaScript lexers and parsers?

Collapse
 
miketalbot profile image
Mike Talbot ⭐ • Edited

I have DSLs all over my code base written in PegJS (well I checked, 4 to be exact). Super easy to use. Not as powerful as others perhaps, not sure - this is all I've ever used in JS. C++ with Lex/Yacc back in the day.

This is the CSS.pegjs grammar

pegjs.org/

Collapse
 
jwp profile image
John Peters

Thanks for lead Mike.

Collapse
 
jwp profile image
John Peters

I downloaded it yesterday, I think I like it but don't yet get the syntax.

Collapse
 
miketalbot profile image
Mike Talbot ⭐ • Edited

Did you try the online version - really works for me. I try most things out in that and then just copy the code it builds. It is odd putting the JS in the grammar (you don't have to, but it really helps seeing what data structures you can get out).

Also, do feel free to reach out if I can help at all. Specifics etc.