Skip to content

mewmew/uc

Repository files navigation

µC Compiler

Build Status Coverage Status GoDoc

A compiler for the µC programming language.

Installation

  1. Install Go.
  2. Install Gocc go get github.com/goccmack/gocc.
$ go get -u github.com/mewmew/uc
$ cd ${GOPATH}/src/github.com/mewmew/uc/gocc
$ make gen
$ go get github.com/mewmew/uc/...
$ go install github.com/mewmew/uc/cmd/ulex
$ go install github.com/mewmew/uc/cmd/uparse
$ go install github.com/mewmew/uc/cmd/uclang
$ go install github.com/mewmew/uc/cmd/3rdpartycompile

Usage

  • ulex: a lexer for the µC language which pretty-prints tokens to standard output.
  • uparse: a parser for the µC language which pretty-prints abstract syntax trees to standard output.
  • usem: a static semantic checker for the µC language which validates the input and reports errors to standard error.
  • uclang: a compiler for the µC language which validates the input, and prints corresponding LLVM IR assembly to standard output.
  • 3rdpartycompile: a compiler for the µC language which through the uclang tool chain validates the input, compiles to LLVM and through the third party compiler clang links with the supplied lib uc.c and outputs the corresponding binary.

Public domain

The source code and any original content of this repository is hereby released into the public domain.