We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

# CS606 GDB No 01 Fall 2020 Solution / Discussion

CS606 GDB No 01 Fall 2020 Solution / Discussion

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Views: 293

### Replies to This Discussion

Share the GDB Question & Discuss Here....

CS606_Assignment_No_01_Solution_Fall_2020

CS606_Assignment_No_01_Solution_Fall_2020

Let Context- free syntax is specified with a grammar G=(S,N,T,P),
Where

• S is the start symbol
• N is a set of non-terminal symbols
• T is set of terminal symbols or words
• P is a set of productions or rewrite rules

Consider the following Context-Free Grammar
1. goal? expression
2. expression? expression op term
3. | term
4. Term? number
5. | id
6. Op? +
7. |-
8. |*
9. |^
For the above CFG,
S = goal
T = { number, id, +, -,*, ^}
N = { goal, expr, term, op}
P = { 1, 2, 3, 4, 5, 6, 7, 8, 9}
Derive the expression X *2-Y^3+Z [10 Marks]
Construct a parse tree for expression X *2-Y^3+Z [10 Marks]

# CS606 Assignment No.1 Solution Fall 2020

CS606 (Compiler Constrution) Assignment No.1 Solution Fall 2020

Problem Statement: Marks 20
Let Context- free syntax is specified with a grammar G=(S,N,T,P),
Where
•S is the start symbol
• N is a set of non-terminal symbols
• T is set of terminal symbols or words
• P is a set of productions or rewrite rules
Consider the following Context-Free Grammar
1. goal? expression
2. expression? expression op term
3. | term
4. Term? number
5. | id
6. Op? +
7. |-
8. |*
9. |^
For the above CFG,
S = goal
T = { number, id, +, -,*, ^}
N = { goal, expr, term, op}
P = { 1, 2, 3, 4, 5, 6, 7, 8, 9}
Derive the expression X *2-Y^3+Z [10 Marks]
Construct a parse tree for expression X *2-Y^3+Z [10 Marks]

CS606_Assignment_No_01_Solution_Fall_2020

CS606_Assignment_No_01_Solution_Fall_2020

## Latest Activity

3 hours ago
VU AHMED and Asad waqas joined + M.Tariq Malik's group

### ISL201 Islamic Studies

3 hours ago
Rabia is now a member of Virtual University of Pakistan
6 hours ago
+ !! Ήලᵯᵯℹ Ⲥⱨ !! + updated their profile
6 hours ago
6 hours ago
7 hours ago
7 hours ago
7 hours ago
★彡[ꜱʜʏɴᴀ]彡★ replied to ★彡[ꜱʜʏɴᴀ]彡★'s discussion Aksar
7 hours ago
8 hours ago
Asad waqas joined + M.Tariq Malik's group

8 hours ago
9 hours ago