subject
Engineering, 15.08.2021 01:50 maryd316

INTRODUCTION: JavaCup is a parser-generator, and works by creatinga shift-reduce parsing table using the theory and techniques youuse in question 1. In directory on Ouranos:/local/public/cas380/course work20 you will ?nd the speci?cation ofa simple programming language TLM. This comprises of a syntaxscanner and a JavaCup speci?cation with an interpreter in itsaction code. TLM is an extremely simple programming language: ithas 3 integer variable names (x, y and z), simple booleanexpressions, an assignment statement, a do while statement, a printstatement, and a simple user-de?ned function facility. Study thecommented speci?cation and make sure you understand fully how TLMworks. Use JavaCup to create an interpreter for TLM in the usualway. In that directory there is an example program “input program1”that can be run using the JavaCup-created interpreter, asfollows: start; function; do x = x-1; y = x*x; print(x, y); while x > 10 ;end; x = 23; call; x=15; call; finish;
TLM is very basic - its parser and interpreter are lacking in datatypes, structured code features etc. TLM only checks the ?rstletter of each keyword. ASSIGNMENT: create your own more advancedinterpreted programming language called MYPL. You must do thisusing the already written TLM as a base. In other words startingfrom the components of TLM, build up your own language and

interpreter. Your language must have the following enhancements.(*i*) Long variable names: rather than only x, y or z, your languageshould allow a range of variable names to be used. (*ii*)Declarations: your language must only allow variable names to beused if they have been previously declared (*iii*) Keywords:keywords such as while end etc should be parsed only if they arespelled properly (*iv*) Function: The function declarationstructure in TLM is extremely basic: e. g. only one function can bedeclared, it has no name, and it must be declared at the beginningof the program; and the function has no parameters or localvariables. Extend the function declaration to overcome some ofthese limitations. Rules: This coursework must be undertakenindividually. The deadline for handing in the work is 12 midnightTuesday 5th May, 2019.
You must hand in for question 1: The grammar, the derivationsequence, the syntax tree, the derived FSM, the derivedshift-reduce parsing table, and proof using a stack trace that thecorrect example is parse. n
You must hand in for question 2: i) the two ?les parser. cup andscanner. java de?ning your ?nal language. This must allow me togenerate an interpreter using JavaCup and validate your tests. ii)several test programs and screen shots of their execution showingthe use of ALL the new features in your language and showing thecorrectness of your code. If you do not include tests withassociated screen shots of the new features of MYPL, they will beassumed not to work, iii) A written report including the following:a statement of WHAT you have achieved in Question 2; anddocumentation describing HOW you have upgraded TLM for Question 2.Here you must explain in your own words how the code you have addedto TLM works, any de?ciencies of it, and any future extensions youcould achieve given more time

ansver
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, Talos02
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
image
Engineering, 04.07.2019 18:20, krojas015
Asolid cylinder is concentric with a straight pipe. the cylinder is 0.5 m long and has an outside diameter of 8 cm. the pipe has an inside diameter of 8.5 cm. the annulus between the cylinder ad the pipe contains stationary oil. the oil has a specific gravity of 0.92 and a kinematic viscosity of 5.57 x 10-4 m2/s. most nearly, what is the force needed to move the cylinder along the pipe at a constant velocity of 1 m/s?
Answers: 3
image
Engineering, 04.07.2019 18:20, karatsgrande3772
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10ä1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
Answers: 3
image
Engineering, 04.07.2019 18:20, cristykianpour
Describe one experiment in which the glass transition temperature and melting temperature of a totally amorphous thermoplastic material can be determined. show the relevant experimental results in a diagram which should be properly annotated with the two temperatures clearly marked. what is likely to happen to the curve in the diagram if the amorphous polymer is replaced by a thermosetting type?
Answers: 2
You know the right answer?
INTRODUCTION: JavaCup is a parser-generator, and works by creatinga shift-reduce parsing table using...

Questions in other subjects:

Konu
Mathematics, 22.08.2020 04:01
Konu
History, 22.08.2020 04:01