CECS 524 Lab 6 Adding LET and Comments and BEGIN ... END
In Lab 5 we added expression evaluation but didn't do any variables. Today we are adding the "LET" statement rule to our grammar. LET is essentially an assignment statement similar to that of BASIC. Sample LET statements:
Use the same project from Lab 5 and just add to the ANTLR grammar the rules or edit the rules as needed. Your SIL interpreter should be able to run this program after the changes:
LET A = 4
LET B = 5
LET C = A * B + 7
PRINT " * "
PRINT " + 7 = "
which makes this output : 4 * 5 + 7 = 27
Submit the grammar to BB Dropbox Lab 6.