An open API service indexing awesome lists of open source software.

https://github.com/rsarky/coberon

Compiler Frontend for Oberon-0 written in C with Flex and Bison.
https://github.com/rsarky/coberon

bison c compiler-frontend compilers flex

Last synced: 11 months ago
JSON representation

Compiler Frontend for Oberon-0 written in C with Flex and Bison.

Awesome Lists containing this project

README

          

# Coberon :sparkles:
A compiler front end for [Oberon-0](http://oberon07.com/).

**NOTE**: Coberon is an Academic Project and it is still WIP.

## Compilation

> $ make all

Where `in.txt` is the test input.

## Branches
`master` : A simple lexer and parser.

`implement-ast` : Adds on to `master` by implementing a basic AST for a subset of the grammar along with a Symbol Table.

## Usage
`master` branch:
> $ ./parser [-t] -f

`implement-ast`
> $ ./parser [-t] [-a] [-s] -f

### Options
- `-t` Print the tokens extracted from the input by the lexer.
- `-a` Print the Abstract Syntax Tree.
- `-s` Print the contents of the Symbol Table.
- **`-f`** Input File (Mandatory)

## Future Goals
The project has a lot of scope for enhancements, namely:
- Extending support for the AST and Symbol Table to the entire Oberon-0 grammar.
- Implementing a Symbol Table for multiple scopes.
- Including better Error Recovery methods.
- Implementing a backend for the Compiler using LLVM.

## Contributing
I intend to make Coberon into a fully functional Oberon-0 compiler and all contributions are welcome.