Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am posting two photo.First photo will be for understanding and the question is about yacc and lex ASSUMPTIONS AND CONSTRAINTS FOR THE PROJECT You

I am posting two photo.First photo will be for understanding and the question is about yacc and lex

image text in transcribed

image text in transcribed

ASSUMPTIONS AND CONSTRAINTS FOR THE PROJECT You can assume that the nonterminals start with a single uppercase letter following any alphabetical characters in the input grammar. Such as , etc... You can assume that the terminals start with a single lowercase letter following any alphabetical characters. Such as a, b, etc... For the removal of a left recursion, you need to generate new nonterminals, and you can add 2" after the nonterminal name which has left recursion for this purpose. Such as , etc... In your project, you should consider three cases for grammar inputs. a) The first one simply includes grammar rules which do not need left recursion b) In the second one, there will be a combination of non-terminals with only one left recursion. c) In the third, you should consider the case with multiple lines of rutes which can have one left recursion in each. Output Format For the Project 4. The order of branches in each rule should not change. Input Output Keert T- E>T> sa 72 2E2> -> epsilon > t pa 5. The epsilon branch of the newly created rule should come before the other new branches. Input Output -> ket > -> epsilon CE2>st E2> 6. If there is more than one left recursion in a rule, then order of left recursion should be preserved in the output grammar. Input Output -> a -> b C -> c -> epsilon a .> b S:25

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions