← Indietro
EsameEsame completoTesto d’esame

04 07 2024 E TS LAB

Esame completo 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 CompilersEsame completo

Informazioni sul documento

Cosa trovi in questo materiale

Esame completo 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

1 / 6 Formal Languages and Compilers Prof. Breveglieri, Morzenti, Agosta Written exam: laboratory question 04/07/2024 1 Time: 60 minutes.Textbooks and notes can be used. Pencil writing is allowed. Important:Write your name on any additional sheet. SURNAME (Cognome): . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NAME (Nome): . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Matricola: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . or Person Code: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Instructor: □ Prof. Breveglieri □ Prof. Morzenti □ Prof. Agosta The laboratory question must be answered taking into account the implementation of theAcse compiler given with the exam text. Triangular numbers are integers that count objects arranged in a triangle. The value of thenth triangular number is defined by the following equation: Tn = n(n+ 1) 2 The zero-th triangular number is defined equal to zero (T0 = 0) and there are no preceding triangular numbers (in other words,ncannot be less than zero). Examples of triangular numbers are shown in the following picture. T1 = 1 T2 = 3 T3 = 6 T4 = 10 T5 = 15 Modify the specification of the lexical analyser (flexinput) and the syntactic analyser (bisoninput) and any other source file required to extend theLancelanguage with the ability to compute thenth triangular number using a newexpression operator, calledtri, with the following syntax: tri(⟨exp.⟩) The onlyargumentto thetrioperator is anarbitrary expressionwhich specifies the index of the triangular number to compute. For example,tri(5)will…

Anteprima

Prima pagina del documento.

Prima pagina: 04 07 2024 E TS LAB