Answered step by step
Verified Expert Solution
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 ::=
suppose to look like this, this is the example, psudeo
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 errorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started