A simple C and Java inspired language for CS212 Programming Languages Paradigm
In pkg/syntax/parser, parser.go is the only file human-written, all other files are machine-generated by Antlr. Do not modify those Antlr files.
Always build the grammar/ after pulling new code (and pulling should be done regularly), but in case you do:
- Stand at project root, this is important
- Run the build script
bash grammar/run.sh grammar/BigC.g4
This script ensures that you get the right files to build, and the result is put into the right directory.
- Clone & Go into the project dir
git clone https://github.com/GoBigC/BigC.git
cd BigC
- Update Go module dependency
go mod tidy
(dont have to do this all the time, once in a while is okay)
-
Rebuild grammar through Antlr
- Stand at project root, this is important
- Run the build script
-
Build and run Go module Stand at project root and run:
go build .
go run . test/sample.uia
After this, find the concrete syntax tree at artifact/cst.txt, and abstract syntax tree at artifact/ast.txt