_____________________________________________________________________________________


Proposed exercises:


Unit 1. Introduction to Language Processors

The proposed exercises are related to the main components in the architecture of a compiler.

EP 1. Unit 1. Exercises Introduction to Language Processors (PDF)

Units 2, 3 and 4. Lexical Analysis, Formal Grammars and Syntax Analysis

The proposed exercises are related to how to implement a scanner by means of the recognition of tokens using Regular Expressions and Deterministic Finite Automata, and the design of Formal Grammars for the syntax analyzer.

EP 2. Unit 2. Exercises Review of Regular Expressions - Part 1 (PDF)

EP 3. Unit 2. Exercises Review of Regular Expressions - Part 2 (PDF)

EP 4. Unit 2. Exercises Review of Finite Automata - Part 1 (PDF)

EP 5. Unit 2. Exercises Review of Finite Automata - Part 2 (PDF)

EP 6. Unit 2. Exercises Review of Finite Automata - Part 3 (PDF)

EP 7. Unit 3. Exercises Review Languages and Formal Grammars - Part 1 (PDF)

EP 8. Unit 3. Exercises Review Languages and Formal Grammars - Part 2 (PDF)

EP 9. Unit 3. Exercises Review Push Down Automata (PDF)

EP 10. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 1 (PDF)

EP 11. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 2 (PDF)

EP 12. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 3 (PDF)

EP 13. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 4 (PDF)

EP 14. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 5 (PDF)

EP 15. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 6 (PDF)


Unit 5. Top-Down Parsing

The proposed exercises are related to the development of a Top-Down predictive parser and the main alternatives for error detection and recovery using these parsing techniques.

EP 16. Unit 5 - Top-Down Parsing. Part 1 (PDF)

EP 17. Unit 5 - Top-Down Parsing. Part 2 (PDF)

EP 18. Unit 5 - Top-Down Parsing. Part 3 (PDF)

EP 19. Unit 5 - Top-Down Parsing. Part 4 (PDF)

EP 20. Unit 5 - Top-Down Parsing. Part 5 (PDF)

EP 21. Unit 5 - Top-Down Parsing. Part 6 (PDF)

EP 22. Unit 5 - Top-Down Parsing. Part 7 (PDF)

EP 23. Unit 5 - Top-Down Parsing. Part 8 (PDF)


Unit 6. Bottom-Up Parsing

The proposed exercises are related to shift-reduce parsing techniques and how to construct LR table-driven shift-reduce parsers.

EP 24. Unit 6 - Bottom-Up Parsing. Part 1 (PDF)

EP 25. Unit 6 - Bottom-Up Parsing. Part 2 (PDF)

EP 26. Unit 6 - Bottom-Up Parsing. Part 3 (PDF)

EP 27. Unit 6 - Bottom-Up Parsing. Part 4 (PDF)

EP 28. Unit 6 - Bottom-Up Parsing. Part 5 (PDF)

EP 29. Unit 6 - Bottom-Up Parsing. Part 6 (PDF)

EP 30. Unit 6 - Bottom-Up Parsing. Part 7 (PDF)

EP 31. Unit 6 - Bottom-Up Parsing. Part 8 (PDF)


Units 7 and 8. Semantic Analysis and Error Handling

The proposed exercises are focused on the main tasks that must be completed by a semantic analyzer and the main approaches to solve them. They also cover the main approaches for error detection and recovery in Top-Down predictive parsing and Bottom-Up parsing.

EP 32. Units 7 and 8 - Semantic Analysis and Error Handling. Part 1 (PDF)

EP 33. Units 7 and 8 - Semantic Analysis and Error Handling. Part 2 (PDF)

EP 34. Units 7 and 8 - Semantic Analysis and Error Handling. Part 3 (PDF)

EP 35. Units 7 and 8 - Semantic Analysis and Error Handling. Part 4 (PDF)

EP 36. Units 7 and 8 - Semantic Analysis and Error Handling. Part 5 (PDF)

EP 37. Units 7 and 8 - Semantic Analysis and Error Handling. Part 6 (PDF)

EP 38. Units 7 and 8 - Semantic Analysis and Error Handling. Part 7 (PDF)

EP 39. Units 7 and 8 - Semantic Analysis and Error Handling. Part 8 (PDF)


Units 9, 10 and 11. Intermediate Code Generation, Code Optimization, and Final Code Generation

The proposed exercises are related to the main types of intermediate languages (graphical and linear intermediate representations) and the role of final code generation in the architecture of a language processor.


EP 40. Units 9,10 and 11 - Code Generation and Optimization. Part 1 (PDF)

EP 41. Units 9,10 and 11 - Code Generation and Optimization. Part 2 (PDF)


Solutions for the proposed exercises:


Unit 1. Introduction to Language Processors

SEP 1. Unit 1. Exercises Introduction to Language Processors - Solution (PDF)


Units 2, 3 and 4. Lexical Analysis, Formal Grammars and Syntax Analysis

SEP 2. Unit 2. Exercises Review of Regular Expressions - Solution (PDF)

SEP 3. Unit 2. Exercises Review of Finite Automata - Solution (PDF)

SEP 4. Unit 3. Exercises Review Languages and Formal Grammars - Solution (PDF)

SEP 5. Unit 3. Exercises Review Push Down Automata - Solution (PDF)

SEP 10. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 1 - Solution (PDF)

SEP 11. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 2 - Solution (PDF)

SEP 12. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 3 - Solution (PDF)

SEP 13. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 4 - Solution (PDF)

SEP 14. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 5 - Solution (PDF)

SEP 15. Units 2, 3 and 4 - Lexical analysis and grammar definition. Part 6 - Solution (PDF)


Unit 5. Top-Down Parsing

SEP 16. Unit 5 - Top-Down Parsing. Part 1 - Solution (PDF)

SEP 17. Unit 5 - Top-Down Parsing. Part 2 - Solution (PDF)

SEP 18. Unit 5 - Top-Down Parsing. Part 3 - Solution (PDF)

SEP 19. Unit 5 - Top-Down Parsing. Part 4 - Solution (PDF)

SEP 20. Unit 5 - Top-Down Parsing. Part 5 - Solution (PDF)

SEP 21. Unit 5 - Top-Down Parsing. Part 6 - Solution (PDF)

SEP 22. Unit 5 - Top-Down Parsing. Part 7 - Solution (PDF)

SEP 23. Unit 5 - Top-Down Parsing. Part 8 - Solution (PDF)


Unit 6. Bottom-Up Parsing

SEP 24. Unit 6 - Bottom-Up Parsing. Part 1 - Solution (PDF)

SEP 25. Unit 6 - Bottom-Up Parsing. Part 2 - Solution (PDF)

SEP 26. Unit 6 - Bottom-Up Parsing. Part 3 - Solution (PDF)

SEP 27. Unit 6 - Bottom-Up Parsing. Part 4 - Solution (PDF)

SEP 28. Unit 6 - Bottom-Up Parsing. Part 5 - Solution (PDF)

SEP 29. Unit 6 - Bottom-Up Parsing. Part 6 - Solution (PDF)

SEP 30. Unit 6 - Bottom-Up Parsing. Part 7 - Solution (PDF)

SEP 31. Unit 6 - Bottom-Up Parsing. Part 8 - Solution (PDF)


Units 7 and 8. Semantic Analysis and Error Handling

SEP 32. Units 7 and 8 - Semantic Analysis and Error Handling. Part 1 - Solution (PDF)

SEP 33. Units 7 and 8 - Semantic Analysis and Error Handling. Part 2 - Solution (PDF)

SEP 34. Units 7 and 8 - Semantic Analysis and Error Handling. Part 3 - Solution (PDF)

SEP 35. Units 7 and 8 - Semantic Analysis and Error Handling. Part 4 - Solution (PDF)

SEP 36. Units 7 and 8 - Semantic Analysis and Error Handling. Part 5 - Solution (PDF)

SEP 37. Units 7 and 8 - Semantic Analysis and Error Handling. Part 6 - Solution (PDF)

SEP 38. Units 7 and 8 - Semantic Analysis and Error Handling. Part 7 - Solution (PDF)

SEP 39. Units 7 and 8 - Semantic Analysis and Error Handling. Part 8 - Solution (PDF)


Units 9, 10 and 11. Intermediate Code Generation, Code Optimization, and Final Code Generation

SEP 40. Units 9,10 and 11 - Code Generation and Optimization. Part 1 - Solution (PDF)

SEP 41. Units 9,10 and 11 - Code Generation and Optimization. Part 1 - Code (PDF)

Last modified: Monday, 16 May 2022, 3:20 PM