print "Start of CST 8152 Interpreter Test.\n" ; print "First, some very simple integer tests.\n"; a = 1 ; b = 2 ; c = 3 ; d = 4 ; e = 5 ; a = 0 + b ; a = 1 + a ; a = a ; a = a + 0 ; print "a should be 3 three times here: " ; print a ; print " " ; print a + 0 ; print " " ; print a * a / a ; print "\n" ; print "Next, some chain assignments from 12300 to 12325.\n" ; a = 12300 ; b = a + 1; c = b + 1; d = c + 1; e=d+1;f=e+1;g=f+1;h=g+1;i=h+1;j=i+1;k=j+1;l=k+1;m=l+1;n=m+1;o=n+1; p=1+o;q=1+p;r=1+q;s=1+r;t=1+s;u=1+t;v=1+u;w=1+v;x=1+w;y=1+x;z=1+y ; print "a is \"", a, "\" m is \"", m, "\" and z is \"", z, "\".\n" ; print "A nested expression (will probably overflow).\n"; nested = (a+(b+(c+(d+(e+(f+(g+(h+(i+(j+(k+(l+(m+(n+(o+(p+(q+(r+(s+ (t+(u+(v+(w+(x+(y+(z)))))))))))))))))))))))))) ; print "Nested is \"", nested, "\"\n"; print "\nSymbol Table Dump:\n" ; dump; print "\n"; print "Change a to 11111, m to 21111, z to 31111.\n"; a = 11111; m = ( a + 0 ) + 10000; z = ( 10000 + ( 0 + ( 0 + m ) ) ) ; print "New a is \"", a, "\" m is \"", m, "\" and z is \"", z, "\".\n" ; print "Calculate a new value for netsted (will probably overflow).\n"; nested = (a+(b+(c+(d+(e+(f+(g+(h+(i+(j+(k+(l+(m+(n+(o+(p+(q+(r+(s+ (t+(u+(v+(w+(x+(y+(z)))))))))))))))))))))))))); print "New nested is \"", nested, "\"\n"; print "\nSymbol Table Dump:\n" ; dump; print "\n"; print "Now try to change integers a,m,z to be strings:\n" ; a = "A Changed to be a string A END"; m = "M Changed to be a string M END"; z = "Z Changed to be a string Z END"; print "End of changes to a,m,z integers into strings.\n"; print "Now define 3 strings and try to change them to be big integers:\n"; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1 = "a1 END"; bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb1 = "b1 END"; ccccccccccccccccccccccccccccccccccccccccccc1 = "c1 END"; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1 = 32767; bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb1 = 32768; ccccccccccccccccccccccccccccccccccccccccccc1 = -32769; print "Here they are: "; print aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1 ; print " " ; print bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb1 ; print " " ; print ccccccccccccccccccccccccccccccccccccccccccc1 ; print "\n"; print "End of changes of strings to integers.\n"; print "\nSymbol Table Dump:\n" ; dump; print "\n"; print "Define some long string variables.\n"; astringvariable = "A string A string A string A string A string A string A string A string A string A string A string A string A string A string A string A string A string A string A string A string A string END" ; bstringvariable = "B string B string B string B string B string B string B string B string B string B string B string B string B string B string B string B string B string B string B string B string B string END" ; cstringvariable = "C string C string C string C string C string C string C string C string C string C string C string C string C string C string C string C string C string C string C string C string C string END" ; dstringvariable="D string END";estringvariable="E string END";fstringvariable="F string END"; adupstring=astringvariable; bdupstring=bstringvariable; cdupstring=cstringvariable; ddupstring=dstringvariable; edupstring=estringvariable; fdupstring=fstringvariable; print "\nSymbol Table Dump:\n" ; dump; print "\n"; print "Change the a b and c strings.\n"; astringvariable = "Changed the A string END"; bstringvariable = "Changed the B string END"; cstringvariable = "Changed the C string END"; print "adupstring is unchanged: \""; print adupstring, "\"\n"; print "bdupstring is unchanged: \""; print bdupstring, "\"\n"; print "cdupstring is unchanged: \""; print cdupstring, "\"\n"; print "\nSymbol Table Dump:\n" ; dump; print "\n"; print "Arithmetic on strings may not be allowed.\nLet's try it.\n"; a = astringvariable * bstringvariable; m = cstringvariable + ""; z = "" - ""; z = 2 / estringvariable; print "End of arithmetic on strings.\n"; print "\nSymbol Table Dump:\n" ; dump; print "\n"; print "No such variable: ", nosuchvariable, "\n" ; print "Set a very long variable name to be 12345:\n"; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab = 12345 ; print "Is the value of the long variable 12345?\n", "Long Variable = "; print aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab ; print "\n"; print "\nSymbol Table Dump:\n" ; dump; print "\n"; print "Unterminated string constant follows\n", "Start of unterm