Informazioni sul documento
- Università
- Politecnico di Milano
- Corso di laurea
- Computer Engineering
- Materia
- Formal Languages and Compilers
- Anno accademico
- 2018-2019
- Classificazione
- Altro materiale
- Formato originale
- Testo
- Testo ricercabile
Altro di Formal Languages and Compilers per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.
Altro di Formal Languages and Compilers per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.
Qualità dell’importazione: il testo è stato estratto direttamente dal documento originale.
Passaggi rappresentativi riconosciuti nelle diverse parti del materiale. Il testo completo resta presente nella pagina per la ricerca, mentre l’anteprima compatta rende più semplice la lettura.
Formal Languages and Compilers Proff. Breveglieri, Morzenti Written exam1: laboratory question 14/06/2019 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 support for the combined sum-assignment operator +=. The semantics of the += binary operator state that the left hand side operand should be updated with the sum of the left and right hand side operands. The operators shares the precedence with the usual assignment operator =, and, as it is the case with the assignment operator =, must have a single scalar as its first (left) operand. int a; int b; read(a); read(b); a += b; b += a; write(a); 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). (2 points) 2. Define the syntactic rules or the modifications required to the existing ones. (4 points) 3. Define the semantic actions needed to implement the required functionality. (18 points) The solution is in the attached patch. 2 3 4 4. Given the following Lance code snippet: while(1); write down the syntactic tree generated…
Prima pagina del documento.