A simple Pascal like language has only three statements.
- assignment statement e.g. x:=expression
- loop construct e.g. for i:=expression to expression do statement
- sequencing e.g. begin statement ;…; statement end
- Write a context-free grammar (CFG) for statements in the above language. Assume that expression has already been defined. Do not use optional parenthesis and * operator in CFG.
- Show the parse tree for the following statements:
for j:=2 to 10 do