Document information
- University
- Politecnico di Milano
- Degree programme
- Computer Engineering
- Subject
- Formal Languages and Compilers
- Academic year
- 2017-2018
- Classification
- Other study material
- Original format
- Text
- Searchable text
University study material for Formal Languages and Compilers in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Formal Languages and Compilers Proff. Breveglieri, Morzenti Written exam1: laboratory question 03/07/2018 SURNAME: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NAME: . . . . . .
University study material for Formal Languages and Compilers in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Formal Languages and Compilers Proff. Breveglieri, Morzenti Written exam1: laboratory question 03/07/2018 SURNAME: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NAME: . . . . . .
Import quality: text was extracted directly from the original document.
Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.
Formal Languages and Compilers Proff. Breveglieri, Morzenti Written exam1: laboratory question 03/07/2018 SURNAME: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NAME: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Student ID:. . . . . . . . . . . . . . . . Course: ◦ Laurea Specialistica ◦ V. O. ◦ Laurea Triennale ◦ Other: . . . . . . . . . . . . . Instructor: ◦ Prof. Breveglieri ◦ Prof Morzenti The laboratory question must be answered taking into account the implementation of the Acse compiler given with the exam text. Modify the specification of the lexical analyser ( flex input) and the syntactic analyser (bison input) and any other source file required to extend the Lance language with the new alias construct. The alias construct defines a code block where a variable acts as an alias for another one. Consider the following example. int a,b,c; a=3; b=5; c=7; alias a b { a=a+1-c; } write(a); write(b); The example at hand employs the alias construct to define a as an alias for b within the code block following b. This implies that any action (definition or use) of a in the code block indeed ends up acting on b. In the example the two write statements will cause the printout of 3 and −1 respectively, as a is not modified, while b is as an effect of the aliasing. The alias construct cannot be nested; such a syntax error should prevent the compilation of the program. 1Time 60’. Textbooks and notes can be used. Pencil writing is allowed. Write your name on any additional sheet. 1 1. Define the tokens (and the related declarations in Acse.lex and Acse.y). (3 points) 2. Define the syntactic rules or the modifications required to the…
First page of the document.