





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The lab 4 for the Compiler Design course, which aims to implement a complete compiler for the language L4. The syntax of L4 is defined by a grammar and lexical tokens, and extends L3 with pointers, arrays, and structs. The document also discusses the challenges of parsing L4 syntax, which is no longer context-free, and presents two approaches to handle the ambiguity. The lab includes test programs, a checkpoint, and a final compiler due on different dates in November 2020.
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!






ident ::= [A-Za-z_][A-Za-z0-9_]* num ::= 〈decnum〉 | 〈hexnum〉
〈decnum〉 ::= 0 | [1-9][0-9]* 〈hexnum〉 ::= 0[xX][0-9a-fA-F]+
〈special characters〉 ::=! ~ - + * / % << >> < > >= <= == != & ^ | && || = += -= *= /= %= <<= >>= &= |= ^= ->. -- ++ ( | ) [ ] , ;? :
〈reserved keywords〉 ::= struct typedef if else while for continue break return assert true false NULL alloc alloc_array int bool void char string
3 L4 Semantics
4 Project Requirements
Runtime Environment
What to Turn In
Checkpoint Scoring
Lab Scoring