Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 . Consider the following LL (1) grammar with starting symbol S. S F S (S T) T T + F T F id

Question 1. Consider the following LL (1) grammar with starting symbol S.

S F

S (S T)

T

T + F T

F id

F num

a) Compute the First and Follow sets of all non

terminals

b) Construct the LL (1) parsing table for the grammar

c) Show step by step (content of stack and input string, as well as the production taken) how thfollowin string is parsed: ((20 + 30 + a))

Question 2. Write a grammar that recognizes a list of variable definition lines. Each line cotains a type (int or char) followed by a list of simple variables (identifiers) separated by comma (,). Each line ends with a semicolon (;). For example:

int a, b, d;

char aa;

int ccc, ddd;

char x, y;

Question 3. What is the language recognized byt he following grammar? You can either give the set representation of the language or describe the set in English. The starting symbol is S.

S A a | b

A A c |

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

What is meant by the term industrial relations?

Answered: 1 week ago