WL Intermediate (.wli) Format

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

Sample .wli 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 INT ID
INT int
ID foo
COMMA ,
dcl INT ID
INT int
ID bar
RPAREN )
LBRACE {
dcls
statements
RETURN return
expr term
term factor
factor NUM
NUM 42
SEMI ;
RBRACE }
EOF EOF

Output of WLICheck on Sample

Derivation Steps:
   S ->  BOF procedure EOF
   procedure ->  INT WAIN LPAREN dcl COMMA dcl RPAREN LBRACE dcls statements RETURN expr SEMI RBRACE
   dcl ->  INT ID
   dcl ->  INT ID
   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