WLPP Intermediate (.wlppi) Format

A .wlppi file (pronounced woolpy) is a text file containing the context-free parse of a WLPP program combined with scanner output. The format of a .wlppi file is essentially that of the deriviation component of a .cfg file for the WLPP grammar, with additional lines representing terminals, and no indentation:

Sample .wlppi file

S BOF procedure EOF
BOF BOF
procedure INT WAIN LPAREN dcl COMMA dcl RPAREN LBRACE dcls statements RETURN expr SEMI RBRACE
INT int
WAIN wain
LPAREN (
dcl type ID
type INT
INT int
ID foo
COMMA ,
dcl type ID
type INT
INT int
ID bar
RPAREN )
LBRACE {
dcls
statements
RETURN return
expr term
term factor
factor NUM
NUM 42
SEMI ;
RBRACE }
EOF EOF

Output of cs241.WLPPICheck on Sample

Derivation Steps:
   S ->  BOF procedure EOF
   procedure ->  INT WAIN LPAREN dcl COMMA dcl RPAREN LBRACE dcls statements RETURN expr SEMI RBRACE
   dcl ->  type ID
   type -> INT
   dcl ->  type ID
   type -> INT
   dcls -> 
   statements -> 
   expr ->  term
   term ->  factor
   factor ->  NUM

Terminal String:
   BOF INT WAIN LPAREN INT ID COMMA INT ID RPAREN LBRACE RETURN NUM SEMI RBRACE EOF