Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 1.27 KB

File metadata and controls

26 lines (19 loc) · 1.27 KB

TriangleExtension_Compiler

Triangle is a compiler in Java created by Watt & Brown. This project is an extension of the Triangle compiler.

We added new functionalities, implementing good compiler design techniques learned in the Compilers and Interpreters course at Instituto Tecnológico de Costa Rica.

Functionalities and Syntactic sugar

Those are the main syntaxis added:

  • if Expression then Command (elsif Expression then Command)* "else" Command "end")*
  • loop while Expression do Command end
  • loop until Expression do Command end
  • loop do Expression while Command end
  • loop do Expression until Command end
  • loop for Identifier from Expression to Expression do Command end
  • loop for Identifier from Expression to Expression while Expresssion do Command end
  • loop for Identifier from Expression to Expression until Expresssion do Command end
  • private Declaration in Declaration end
  • recursive Proc-Funcs end

Authors