Question: Design and implement tokens and analyzer that executes the code written in LAO language. The statements in LAO language are: ::= REM | REM ::=
Design and implement tokens and analyzer that executes the code written in LAO language. The statements in LAO language are:
::= REM | REM ::= = ::= PRINT | PRINT | PRINT | PRINT ::= READ ::= IF THEN ::= END.
Where:
A conditional expression must include logical or relational operators. Examples:
- 3 .gt. 5
- .not. 3 .gt. 5
- 3 .gt. 5 .and. 3 .eq. var
- .not. 3 .gt. 5 .and. 3 .eq. var
The keywords are reserved words. They are: IF, THEN, READ, PRINT, and END. In addition, the language is not case sensitive. An instruction with only the keyword PRINT is equivalent to a new line when the instruction is executed by the interpreter. Moreover, the interpreter will ignore the comments statements.
The alphabet of the language is the characters in the ASCII table. Additionally, the type of a variable is determined by the first letter of the variable name. The following table shows the previous:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
