First page Back Continue Last page Summary Graphic

Example: Declarations

  • | FunDecl.
  • FunDecl = "void" ident "(" FormalOpt ")" ";"
  • | Type ident "(" FormalOpt ")" ";".
  • VarDecl = Type ident ";".
  • Type = "int" | "string" | Type "[" "]".
  • FormalOpt = Type ident | e.
  • What are the token classes?
  • What is the task of the scanner?
  • What is the task of the parser?
  • Which non-terminals are nullable?
  • What are the first and follow sets?
  • Is this Grammar LL(1)?