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 21/02/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 Lance language with the count- when-into construct. An instance of the count-when-into construct is provided in the following code snippet: int a,b; count { when (3){ write(2); }, when (b-5){ if(a+b==7){ b=b+1; } }, when (b<0){ } } into a; The count-when-into construct has the following semantics: the curly braces following the count keyword enclose a comma separated list of when statements which are executed in program order. Each when statement executes the contents enclosed in the curly braces in program order if and only if the expression enclosed in the round braces is true (i.e. different from zero). Finally, when the contents of the curly braces have been executed, the count-when-into statement stores the number of times a when statement has executed the content between his curly braces in the variable following the into keyword. The count-when-into statements may be arbitrarily nested; the statements enclosed between the curly braces of the when statement can be any…
Prima pagina del documento.