← Indietro
Altro

Tema 130716

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.

Formal Languages and CompilersAltro

Informazioni sul documento

Cosa trovi in questo materiale

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.

Contenuti estratti dal documento

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.

Pagina 1

Formal Languages and Compilers Proff. Breveglieri, Morzenti Written exam1: laboratory question 13/07/2016 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 if statement with initializer construct. The construct allows a programmer to specify, withing the round braces following theif keyword of a common if-statement both the condition which should be holding true, and an arbitrary statement. The entire statement, including its mandatory terminating semicolon is prefixed to the usual if-statement condition. The if statement with initializer construct is denoted by the iif keyword in place of the usual if. An example is provided in the following code snippet int i,j; i=5; j=7 iif (i=i+2; (j *5)>i){ j = i; } The computation of the initializing statement is always executed before the evaluation of the condition of the if statement is evaluated and its usual behaviour is followed, i.e., the code block is executed if the condition is true. 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…

Anteprima

Prima pagina del documento.

Prima pagina: Tema 130716