Skip to content

A compiler for the fictitious language "ML" for project one of CITS2002 Systems Programming sem 2 2024.

Notifications You must be signed in to change notification settings

samjjacko/ML-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Description:

According to CSSE:

| means a choice [...] means zero or one (...)* means zero or more

Program lines commence at the left-hand margin (no indentation). Statements forming the body of a function are indented with a single tab.

program:
           ( program-item )*

program-item:
           statement
        |  function identifier ( identifier )*
           ←–tab–→ statement1
           ←–tab–→ statement2
           ....

statement:
           identifier "<-" expression
        |  print  expression
        |  return expression
        |  functioncall

expression:
          term   [ ("+" | "-")  expression ]

term:
          factor [ ("*" | "/")  term ]

factor:
          realconstant
        | identifier
        | functioncall
        | "(" expression ")"

functioncall:
          identifier "(" [ expression ( "," expression )* ] ")"

About

A compiler for the fictitious language "ML" for project one of CITS2002 Systems Programming sem 2 2024.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages