COP 4620/5625 - Programming Language Translators Project Three - More Extensions to Tiny Add the following constructs to Tiny: 1) The 'char' data type. 2) Constant definitions, a la Pascal, e.g., const Three = 3; F = 'f'; T = true; 3) The user enumerated type definition. Example: type Color = (red,white,blue); The intrinsic type 'boolean' should also be re- implemented, as if it were an enumerated type. Also, allow for 'synonym' definitions, so that one type name is synonymous with another. If used in conjunction with scopes, type name swapping can take place: type A = integer; integer = boolean; boolean = A; 4) For enumerated types, use the LIMIT instruction to produce run-time errors if a value is out of range. The LIMIT instruction has no operands, and it operates as indicated in the C code shown below. In fact, this IS the code for LIMIT, in the interpreter. case LIMITOP : temp2 = PopLf(); /* U */ temp1 = PopLf(); /* L */ temp = PopLf(); /* X */ if ((temp >= temp1) && (temp <= temp2)) PushLf(temp); else { fprintf(output,"<<< MACHINE ERROR >>>: "); fprintf(output,"VALUE OUT OF RANGE0); DumpMemory(output); FatalError(); } break; 5) The intrinsic functions "succ", "pred" and "ord" (for integers and characters and enumerated types), and "chr" to move from integers to charac- ters. 6) Change the way input is done in Tiny, from the intrinsic, parameterless function "read", to the "read" statement, a la Pascal. In other words, input is to be done with statements such as read(a,b,c,x,y,z) Each of the arguments of "read" must be a vari- able, of type integer or character. Each of the variables is read from a separate line on the input. Two new machine instructions are available for this: SOS INPUTC SOS OUTPUTC 7) Allow output of both integers and characters, as in output('a','=',' ',a,' ',b,3,'x') Also, allow string literals, but only in the out- put statement. For example, output ("a's value is ", a) For this assignment, you will implement identifier "modes". Details in class. DUE DATE: Friday, November 16.