Document information
- University
- Politecnico di Milano
- Degree programme
- Computer Engineering
- Subject
- Formal Languages and Compilers
- Academic year
- 2023-2024
- Classification
- Exam · Full exam
- Content
- Exam paper only
- Original format
- Text
- Searchable text
Full exam for Formal Languages and Compilers in the Computer Engineering degree programme at Politecnico di Milano. The document covers: 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): . . . . . .
Full exam for Formal Languages and Compilers in the Computer Engineering degree programme at Politecnico di Milano. The document covers: 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): . . . . . .
Import quality: text was extracted directly from the original document.
Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.
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…
First page of the document.