A demo project from the http://greatcodeclub.com/ to play with parsing and Jison.
Shows how to use states in the lexer.
You need:
- A recent version of node.
make
. You probably have it already.
To install Node modules and start the test:
$ npm install
$ make watch
Then modify any file, the parser will be recompiled and the file test.js
will be executed.
Here are the files you should take a look at, in logical order:
tokens.jisonlex
defines the tokens produced by the lexer.grammar.jison
is the grammar defining the syntax. It is compiled toparser.js
.test.js
uses the parser to parser and output to the console. Modify this file.
Copyright 2014 Coded Inc.
marc@codedinc.com
You are free to modify and distribute this however you want. Except for teaching purposes.