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.
- Host: GitHub
- URL: https://github.com/rsarky/coberon
- Owner: rsarky
- License: mit
- Created: 2019-03-16T17:14:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-05T06:20:02.000Z (about 7 years ago)
- Last Synced: 2025-01-19T09:43:15.552Z (over 1 year ago)
- Topics: bison, c, compiler-frontend, compilers, flex
- Language: Yacc
- Homepage:
- Size: 40 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.