Parsing Programs

Grammar

  • program = decl*
  • statements + functions

Statements

  • var/const, assignment, expr
  • if/else, while, return
  • blocks

AST

  • one Stmt type + Kind
  • explicit fields

Errors

  • short, specific messages
  • help the learner recover
1 / 1
Use arrow keys or click edges to navigate. Press H to toggle help, F for fullscreen.