Add compiler support for followings (unless otherwise stated, all applicable only to int type):
local variable declaration
arithmetic expression involving only binary operators
println method that takes String or int type argument
(nested) ifelse statements
while and do while loops
for loop with the form for (init; cond; update) {}
condition expression involved in if/else if/while/for can only have int or boolean literal, and can support all logical operators except logical not (!)
Tests will be added in another PR to avoid huge PR and ease process of reviewing
int
type):println
method that takesString
orint
type argumentif
else
statementswhile
anddo while
loopsfor
loop with the formfor (init; cond; update) {}
if
/else if
/while
/for
can only haveint
or boolean literal, and can support all logical operators except logical not (!
)