Name: Anonymous 2019-01-29 18:13
Implement a simple language with two operations, VAR and PRINT, with strings are its only data-type. Here’s a program in that language:
Running this program on a correct implementation of our spec should output "Hack My Anii".
Here's a spec for the operations:
VAR <identifier> <value> variable assignment - after this runs, references to identifier will evaluate to value
PRINT <value> ... <value> prints the values of previously assigned variables, or string literals, space separated
Program will input a VARPRINT program and output the result of running it.
VAR name "Anii"
VAR name2 name
VAR name "My"
PRINT "Hack" name name2
Running this program on a correct implementation of our spec should output "Hack My Anii".
Here's a spec for the operations:
VAR <identifier> <value> variable assignment - after this runs, references to identifier will evaluate to value
PRINT <value> ... <value> prints the values of previously assigned variables, or string literals, space separated
Program will input a VARPRINT program and output the result of running it.