Compiler Construction WS 10/11 Solution -Exam 01.02.2011 Summary: 2 Compiler Construction WS 10/11 Solution - Exam 01.02.2011 aaPriv.-Doz. Dr. T. Noll, C. Jansen Aufgabe 1 (Lexical Analysis): (3+7+4+2 = 16 Points) Assume you would like to automatically tag your audio files with information extracted from their filenames. You decide to categorise the extracted information into three classes: · TY PE {AB, MU}, tells whether your file contains an audiobook (AB) or a piece of music (MU) · DESC, an arbitrary non-empty string of letters and numbers, which contains the description of the file, i.e. title, artist etc. · EXT {MP3, AAC} indicating the audio format of the file Example: The file "MP3-Compiler-AB.MP3" should be tagged with TY PE = AB, DESC = Compiler, EXT = MP3. a) Construct regular expressions T Y P E, DESC, EXT and give corresponding DFAs AT Y P E, ADESC, AEXT such that L(AT Y P E) = T Y P E , L(ADESC) = DESC , L(AEXT ) = EXT . b) Construct the backtracking automaton A accepting 1 := T Y P E, 2 := EXT , 3 := DESC and additionally 4 := SEP = -, 5 := DOT = . c) Compute the run of A for the input word w = MU - MUH.MP3. Collections: Computer Technologies and Information Sciences