A glance on PEG.js

It really reminds my course "automata" in the university.

https://pegjs.org/online

How to read the online sample:

  • {var name}: {matching rule} { return ... // you can use var name } , var name is an array containing all the matched tokens in the rule
  • the engine will try to match each expression

This is really-really cool.

You can probably use it to implement something like https://github.com/jquery/esprima with less effort

你可能感兴趣的:(A glance on PEG.js)