Skip to content
/ Yuki Public

Handwritten lexer and recursive descent parser in Go. Parse tree visualizations using Graphviz.

License

Notifications You must be signed in to change notification settings

pyshx/Yuki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yuki

Yuki is a context-free grammar, lexer and predictive recursive descent parser for a C-like language in Go.

Dependencies

  • gographviz, to generate the DOT specification
  • Graphviz, to generate the image from the DOT specification

Usage

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.

Lexer Testing

Input files for our lexer's test suite can be found in src/tests/. Please do go test to run the tests.

References

About

Handwritten lexer and recursive descent parser in Go. Parse tree visualizations using Graphviz.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages