Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

suppose to look like this, this is the example, psudeo I dont understadn how to write this in a recursive descent recognizer pseudocode EXP ::=

image text in transcribed

suppose to look like this, this is the example, psudeo

image text in transcribedimage text in transcribedimage text in transcribed

I dont understadn how to write this in a recursive descent recognizer pseudocode EXP ::= EXP + TERM EXP - TERM TERM TERM ::= TERM FACTOR TERM/FACTOR FACTOR FACTOR ::= (EXP DIGIT DIGIT ::=0|1|23 needs these requirements - Ask the user for an input stream. - Report "legal" or "errors found" (not both!). - Assume the input stream is the token stream. - Assume the input stream terminates with a $. - Assume there is no white space. - Use a form to collect input and return the output. - Test your recognizer with illegal and legal strings. - Give a brief description of this recognizer for the user on how to use and what method that it based on. end of stream marker must add start lexpo because Texp> (the object of our parser) appears on the rhs of a rule. incorrect exp Chaton - (why? now, follow (exp) = {0,1,2,3,4,5,6, (,),$}. ist procedure list if token =( Lex else error Procedure start it taken $error Procedure exp if token in {0,1,2,3, a, b,c} atom else if token al list else error expr-list if token - hex ) else error . I Procedure atom if token in {0,1,2,3} - digit else if token in {a,b,c} string else error procedue expolist while tohon in {0,1,2,3,9,6, exp procedure digit if token in {0, 1, 2,3} sucht Lex else error procedure string if token in {a,b,c} Lex else error I dont understadn how to write this in a recursive descent recognizer pseudocode EXP ::= EXP + TERM EXP - TERM TERM TERM ::= TERM FACTOR TERM/FACTOR FACTOR FACTOR ::= (EXP DIGIT DIGIT ::=0|1|23 needs these requirements - Ask the user for an input stream. - Report "legal" or "errors found" (not both!). - Assume the input stream is the token stream. - Assume the input stream terminates with a $. - Assume there is no white space. - Use a form to collect input and return the output. - Test your recognizer with illegal and legal strings. - Give a brief description of this recognizer for the user on how to use and what method that it based on. end of stream marker must add start lexpo because Texp> (the object of our parser) appears on the rhs of a rule. incorrect exp Chaton - (why? now, follow (exp) = {0,1,2,3,4,5,6, (,),$}. ist procedure list if token =( Lex else error Procedure start it taken $error Procedure exp if token in {0,1,2,3, a, b,c} atom else if token al list else error expr-list if token - hex ) else error . I Procedure atom if token in {0,1,2,3} - digit else if token in {a,b,c} string else error procedue expolist while tohon in {0,1,2,3,9,6, exp procedure digit if token in {0, 1, 2,3} sucht Lex else error procedure string if token in {a,b,c} Lex else error

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

=+Differentiate the key characteristics of a personal brand

Answered: 1 week ago