Informazioni sul documento
- Università
- Politecnico di Milano
- Corso di laurea
- Computer Engineering
- Materia
- Formal Languages and Compilers
- Anno accademico
- 2016-2017
- 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 and Morzenti Written exam1: laboratory question 05/07/2017 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 domain of expressions of Lance language with the representation of positive and negative infinite values and the undefined value. At runtime, each expression is represented by means of a value and a descriptor inf : “value” is either the integer value of the expression, when the expression is defined and different from an infinite, or the sign of the infinite (+ /−). Value “inf” specifies if the expression is an integer or an infinite or if it is an undefined value. Two new constants are introduced in the language to represent infinite values (i.e., +infty and -infty) and one is added to represent the undefined value (NaN). The following example shows the use of infinite values in case of assignment in- structions and conditional expressions of the form exp == exp, the latter being defined according to the following semantics: • if an undefined is compared with an expression the resulting expression is undefined. • Otherwise, the resulting expression is defined and the value of the…
Prima pagina del documento.