Quizzes:

Semantics (attributes)


sch ppl ch3 CallStack


  • Associativity tells us that the operators in most languages group left to right, so that 10-4-3means (10- 4)- 3 rather than 10- (4- 3).
  • Precedencetells us that multiplication anddivision in mostlanguagesgroupmore tightly than addition andsubtraction, so that 3+45means 3+(45)rather than (3+4)*5.

https://cstheory.stackexchange.com/questions/4352/how-is-proving-a-context-free-language-to-be-ambiguous-undecidable

Context Left vs Right Trees


  • First(A): Set of all tokens that could come after A in some program
    • If the value could point to NULL, we can count the next value as a FIRST
  • Follow: Set of all tokens that can come after FIRST (if null)
  • Predict: Set union of First and Follow