← Indietro
EsameEsame completoTesto d’esame

07 02 18

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

FORMAL LANGUAGES AND COMPILERS prof.s Luca Breveglieri and Angelo Morzenti Exam of Wed 7 FEBRUARY 2018 - Part Theory WITH SOLUTIONS - FOR TEACHING PURPOSES HERE THE SOLUTIONS ARE WIDEL Y COMMENTED LAST + FIRST NAME: (capital letters please) MATRICOLA: SIGNATURE: (or PERSON CODE) INSTRUCTIONS - READ CAREFULLY: • The exam is in written form and consists of two parts: 1. Theory (80%): Syntax and Semantics of Languages – regular expressions and finite automata – free grammars and pushdown automata – syntax analysis and parsing methodologies – language translation and semantic analysis 2. Lab (20%): Compiler Design by Flex and Bison • To pass the exam, the candidate must succeed in both parts (th eory and lab), in one call or more calls separately, but within one year (12 months ) between the two parts. • To pass part theory, the candidate must answer the mandatory (not optional) ques- tions; notice that the full grade is achieved by answering th e optional questions. • The exam is open book: textbooks and personal notes are permi tted. • Please write in the free space left and if necessary continue on the back side of the sheet; do not attach new sheets and do not replace the existin g ones. • Time: part lab 60m - part theory 2h.15m 1 Regular Expressions and Finite Automata 20% 1. Consider the following right uni-linear grammar G, over the two-letter terminal alpha- bet Σ = { a, b } and the three-letter nonterminal alphabet V = { S, T, W } (axiom S), which generates a regular language L = L (G): G      S → a T T → b T | a W | a W → a T | ε Answer the following questions (use the space on the next pag es): (a) By using a systematic method, transform the grammar G above into a finite-state automaton A1 (not necessarily deterministic) that accepts language L. (b) By using…

Anteprima

Prima pagina del documento.

Prima pagina: 07 02 18