Skip to content

GoBigC/BigC

Repository files navigation

BigC

A simple C and Java inspired language for CS212 Programming Languages Paradigm

Warning

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:

  1. Stand at project root, this is important
  2. 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.

Build instruction

  1. Clone & Go into the project dir
git clone https://github.com/GoBigC/BigC.git
cd BigC
  1. Update Go module dependency
go mod tidy

(dont have to do this all the time, once in a while is okay)

  1. Rebuild grammar through Antlr

    • Stand at project root, this is important
    • Run the build script
  2. 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

About

A programming language that compiles to RISC-V assembly, totally smaller than C

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors