Replacing parser technology: COP4020/compiler/parser.c) with a parser generated by the Lemon parser generator.

computer science

Description

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 =============================== ::= "main" ::= | ::= "exports" "{" "`" ::= "imports" "{" "`" ::= "declarations" "{" "`" ::= "program" ::= "functions "{" "`" ::= "{" "`" ::= ( <> | ";" | | | | ";" | ) ::= "var" ::= (IDENTIFIER | identifier_list) "=" ";" ::= "if" "(" ")" "else" ::= "while" "(" ")" ::= IDENTIFIER ::= NUMBER | STRING | IDENTIFIER | ::= <> | "(" ( , )* ")" ::= <> | ( IDENTIFIER , )* IDENTIFIER ::= ( IDENTIFIER ";" )* ::= ( )*


Related Questions in computer science category