CSC 533: Organization of Programming Languages
Fall 2000

HW2: EBNF Grammar

The following questions all refer to the EBNF of Oberon-2.

  1. Which of the following are legal numbers in Oberon-2? For each legal number, provide a parse tree. 00 -2.9 C 3AH 2E-4 0.01E12 5.5E+5.5
  2. Describe, in concise English, the format for identifiers in Oberon-2. That is, what characters may be used? What restrictions (if any) are there on order?

  3. What is the shortest possible module (i.e., program) in Oberon-2? Justify your answer.

  4. What is the order of precedence for the operators +, -, *, and / in Oberon-2? Justify your answers with parse trees.

  5. Does the dangling-else problem apply to Oberon-2? Justify your answer.