Skip to content

Latest commit

 

History

History
42 lines (35 loc) · 1.39 KB

README.md

File metadata and controls

42 lines (35 loc) · 1.39 KB

Cool Compiler (CC)

I wrote this project for Compiler course at Shahid Beheshti University Summer 2021. Java, PGen, ANTLR are the tools that I've leveraged to do this project. list of features is at the end of this document; It shows the current features of the compiler, and the features that need to be done. The syntax is fairly simple. here's a sample:

Syntax

How to Compiler

In Releases section, you can find the latest exe, jar, and probably bash scripts to compile.

Feature List

  • Binary Expression
  • Unary Expression
  • Comparators
  • Bool, Int, Real, Array data types.
  • If else conditional statement
  • For while loops
  • Single class
  • Main function
  • Id assignment
  • Array assignment
  • Output int and string
  • Input int
  • len function array
  • pre -- ++
  • post -- ++
  • break, continue
  • len function string
  • dynamic strings
  • print function for all data types
  • input function for all data types
  • function in the class no args no return
  • function in the class no args with return
  • function in the class with args
  • multiple class
  • class ref assignment
  • class function