4
Quiz 7: Tuesday, Oct 20 pt What are the main steps of your MJ Driver for PA3? pts) Show the JavaCup action for a given gr rule for building part of the AS pts) Show the typical action of the Checking Visitor at a given node in your PA3 : Name one new feature added to PA2 grammar t PA3 grammar.

Quiz 7: Tuesday, Oct 20 1.(1 pt What are the main steps of your MJ Driver for PA3? 1.(2 pts) Show the JavaCup action for a given grammar rule for building

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

Page 1: Quiz 7: Tuesday, Oct 20 1.(1 pt What are the main steps of your MJ Driver for PA3? 1.(2 pts) Show the JavaCup action for a given grammar rule for building

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.

Page 2: Quiz 7: Tuesday, Oct 20 1.(1 pt What are the main steps of your MJ Driver for PA3? 1.(2 pts) Show the JavaCup action for a given grammar rule for building

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.

Page 3: Quiz 7: Tuesday, Oct 20 1.(1 pt What are the main steps of your MJ Driver for PA3? 1.(2 pts) Show the JavaCup action for a given grammar rule for building

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

Page 4: Quiz 7: Tuesday, Oct 20 1.(1 pt What are the main steps of your MJ Driver for PA3? 1.(2 pts) Show the JavaCup action for a given grammar rule for building

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?