Question: 2. How many token types are needed in a lexer to parse strings in the language? Please list all the token types needed in a

2. How many token types are needed in a lexer to parse strings in the language? Please list all the token types needed in a lexer to parser strings in the language specified by the grammar above.
You are given a grammar, called SimpleExpr (see below). grammar SimpleExpr; expr : expr '+' expr | expr **? expr | ID | Number; // allow add or mult ID :('a' ... 'z' 'A'... 'Z'); // ID is Seq of > 1 letter Number : (0'... '9'); // Number is seq of> 1 digit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
