Replacing parser technology: COP4020/compiler/parser.c) with a parser generated by the Lemon parser generator.
Replacing parser technology =========================== Your project is to replace Pleasant’s recursive descent parser (found in the accompanying tarfile in language-COP4020/compiler/parser.c) with a parser generated by the Lemon parser generator. While the canonical reference is the recursive descent parser in the tar file distributed with this assignment (it’s in language-COP4020/compiler/parser.c), a rough BNF-like grammar for Pleasant is also given below: “BNF-like” grammar for Pleasant ===============================
::=
|
::= “exports” “{”
“`”
::= “imports” “{”
“`”
::= “declarations” “{”
“`”
::= “functions “{”
“`”
::= “{”
“`”
::= ( <> |
“;” |
|
|
|
“;” |
)
::= “var”
::= (IDENTIFIER | identifier_list) “=”
“;”
::= “if” “(”
“)”
“else”
::= “while” “(”
“)”
::= IDENTIFIER
::= NUMBER | STRING | IDENTIFIER |
::= <> | “(” (
, )* “)”
::= <> | ( IDENTIFIER , )* IDENTIFIER
::= ( IDENTIFIER “;” )*
::= (
)*
