Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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-z | A-Z

::= |

::= | < unsign integer>

::= |

::= |

::=

::= .

::=

::= e | E

::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

::= + | -

::= "" | ""

::=

::= .gt. | .lt. | .eq. | .ge. | .le. | .ne.

::= .or. | .and. | .not.

::= | |

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to the table in question

Answered: 1 week ago