Yuki is a context-free grammar, lexer and predictive recursive descent parser for a C-like language in Go.
- gographviz, to generate the DOT specification
- Graphviz, to generate the image from the DOT specification
Please run $ go run . [file]
where [file]
represents an optional argument (which defaults to test.txt
) to parse the file. If the parser accepts the program, it will generate a DOT specification of the parse tree depicting the leftmost derivation in out.dot
. This specification can be run through Graphviz to generate the parse tree. We recommend doing $ dot -Tpng -Gdpi=300 out.dot -o out.png
.
Input files for our lexer's test suite can be found in src/tests/
. Please do go test
to run the tests.