Upload
christal-harris
View
216
Download
0
Embed Size (px)
DESCRIPTION
Quiz 9: Tuesday, Nov 10 1.What extra information is used in resolving conflicts in SLR(1) parsing versus LR(0) parsing? 2. Show the LR(0) closure(E->. E – T) for the grammar: 3.Show the SLR(1) table entries for state 7. Extra Credit: What day is PA4 due? S-> E E-> E-T | T T-> F ↑ T | F F-> (E) | i : E->E-.T T->.F ↑ T T->.F F->.( F->.i F T ( i
Citation preview
Quiz 7: Tuesday, Oct 20
1. (1 pt What are the main steps of your MJ Driver for PA3?2. (2 pts) Show the JavaCup action for a given grammar rule for building part of the AST.
3. (2 pts) Show the typical action of the Type Checking Visitor at a given node in your PA3.
Bonus: Name one new feature added to PA2 grammarto get PA3 grammar.
Quiz 8: Tuesday, Nov 31. Demonstrate that you know what a function activation is.
2. How is the frame pointer used during execution?
3. Why do we maintain a separate stack pointer and frame pointer during execution of a program?
4. At what points in the program do we need to generate codeto manage the runtime stack storage allocation/deallocation?
Extra Credit: Name one MeggyJava feature that is added fromPA3 to PA4.
Quiz 9: Tuesday, Nov 101. What extra information is used in resolving conflicts inSLR(1) parsing versus LR(0) parsing?
2. Show the LR(0) closure(E-> . E – T) for the grammar:
3. Show the SLR(1) table entriesfor state 7.
Extra Credit: What day is PA4 due?
S-> EE-> E-T | TT-> F↑T | F F-> (E) | i
8
5
43
7: E->E-.T T->.F↑T
T->.F F->.(
F->.iF
T
(
i
Quiz 10: Tuesday, Nov 171. Explain how a reduce-reduce conflict can be created by making an LALR(1) DFA from an LR(1) DFA.
2. What entries do you need to insert for a given method scope in MeggyJava?
3. What are the typical actions when creating a symbol tableduring AST traversal for a part of the program that creates a new scope (e.g., method declaration)?
Extra Credit: What day is the last day of classes this semester?