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, Crespi Reghizzi, Morzenti Written exam1: laboratory question 04/09/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 push- into and pop-from instructions that realize, respectively, the insertion and the extraction of a value into and from a stack, implemented by means of an array. Both the operators have two parameters: the array identifier and either an expression defining the value that is added to the stack in the push-into instruction or an identifier of a variable in the pop-from instruction. Beside the previous instructions, two operators are introduced for managing a stack: is-empty and is-full, both followed by the array identifier, return a boolean value indicating if the stack is empty of full, respectively. All the instructions raise an error if the array has not been declared or the identifier refers to a scalar. Assume that only one array identifier per program occurs as argument of a push-into and a pop-from and that the bottom of the stack is the position 0. Define a reasonable semantics for the instructions in case of misuse (e.g., pop with…
Prima pagina del documento.