Consider the following Ada code, based on the parser of Project 1.
procedure Parse_Term is
begin
if Token.Category = Ident then
Chomp(Ident);
else
Chomp(Num);
end if;
end Parse_Term;
procedure Parse_Expr is
begin
if Token.Category = Semi then
Chomp(Semi);
else
Parse_Term;
Chomp(Plus);
Parse_Expr;
end if;
end Parse_Expr;
Give an BNF grammar that describes the language that
Parse_Expr accepts. The terminals of the language are
PLUS, SEMI, IDENT, and NUM.
expr -> SEMI | term PLUS expr
term -> IDENT | NUM