Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (15pt) Given the simple calculator (Syntax: slide 16; textbook: p.54), give an example of input code that produces exactly three errors from the scanner.

image text in transcribedimage text in transcribed

1. (15pt) Given the simple calculator (Syntax: slide 16; textbook: p.54), give an example of input code that produces exactly three errors from the scanner. The scanner encounters an error when reading an invalid token. When that happens, assume that the scanner skips everything until the next white space (,\t, ). Your three invalid tokens should start with three different characters. Your input code will be a string over the alphabet {a,b,...,2,0,1,...,9. ,,,),\,\t, . Explain in detail how the three errors are produced from the scanner. Example: simple calculator language - := assign (Algol style; C has =') plus -++ minus times * div / Iparen rparen ) id letter ( letter | digit)* (except for read and write) number digit digit* | digit* ( digit | digit . ) digit* comment /* (non-* | * non-/ )* * 7 11/ (non-newline)* newline +

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

Step: 3

blur-text-image

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago