Compiler Project template
Compiler Project template
Input/oututp
Conditional Statements:
If: when(condition)
Else: otherwise
Body of conditions:
when (#variable_name > 10) {
// body
} otherwise {
// else body
}
Switch Statement
evalute #variable_name {
case 1:
// body
case 2:
// body
default:
// default body
}
Arrays :
Loops:
For Loop:
repeat (start=0; start < 10; start++) {
// body
}
While Loop:
as_long_as (#variable_name < 10) {
// body
}
Functions:
Declaration:
function <type> functionName() {
// body
}
Calling a Function:
invoke functionName();
Classes:
Syntax: create class <className> {}
Example: create class Car {}