← Back
ExamFull examExam paper onlyItalian

17 03 12

Study material for Formal Languages and Compilers, shared by the Studwiz community and reviewed by moderators.

Formal Languages and CompilersFull exam

Document information

What's included in this study material

Study material for Formal Languages and Compilers, shared by the Studwiz community and reviewed by moderators.

Import quality: text was extracted directly from the original document.

Extracted content from the 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.

Page 1

Linguaggi Formali e Compilatori (Formal Languages and Compilers) prof. S. Crespi Reghizzi, prof. Angelo Morzenti (prof. Luca Breveglieri) Prova scritta - 17 marzo 2012 - Parte I: Teoria CON SOLUZIONI - A SCOPO DIDA TTICO LE SOLUZIONI SONO MOL TO ESTESE E COM- MENT A TE V ARIAMENTE - NON SI RICHIEDE CHE IL CANDIDA TO SVOLGA IL COMPITO IN MODO AL- TRETT ANTO AMPIO, BENS `I CHE RISPONDA IN MODO APPROPRIA TO E A SUO GIUDIZIO RAGIONEVO LE NOME: MATRICOLA: FIRMA: ISTRUZIONI - LEGGERE CON ATTENZIONE: •L’esame si compone di due parti: – I (80%) Teoria: 1. espressioni regolari e automi finiti 2. grammatiche libere e automi a pila 3. analisi sintattica e parsificatori 4. traduzione sintattica e analisi semantica – II (20%) Esercitazioni Flex e Bison •Per superare l’esame l’allievo deve sostenere con successo entrambe le parti (I e II), in un solo appello oppure in appelli diversi, ma entro un anno . •Per superare la parte I (teoria) occorre dimostrare di posse dere conoscenza sufficiente di tutte le quattro sezioni (1-4), rispondendo alle domande obbligatorie. •`E permesso consultare libri e appunti personali. •Per scrivere si utilizzi lo spazio libero e se occorre anche i l tergo del foglio; ` e vietato allegare nuovi fogli o sostituirne di esistenti. •Tempo: Parte I (teoria): 2h.30m - Parte II (esercitazioni): 45m 1 Espressioni regolari e automi finiti 20% 1. Si consideri il linguaggio libero L⊂Σ∗, di alfabeto Σ = {a, b }, costituito dalle stringhe che non contengono due caratteri consecutivi uguali. Per esempio s i ha: ε, b, b a b a ∈L mentre si ha: a b b, b a a ̸∈L Si risponda alle domande seguenti: (a) Si elenchino le prime sei stringhe del linguaggio L in ordine lessicografico (sup- ponendo a < b ossia l’ordine alfabetico usuale). (b) Si scriva un’espressione regolare R in forma…

Preview

First page of the document.

First page: 17 03 12