4. Mathematical Expressions: • Given the following Extended-BNF grammar of the basic mathematical expressions: ⇒ { ("+" | "-") } { ("*" | "/") } | "(" ")" [0-9]+ 1. Show the derivation steps for the expression: ( 2 + 3 ) * 6 - 20 (3 + 1) 2. Draw the parsing tree of this expression. • Deliverables: Derivation steps and parsing tree in the report.

CMPTR
3rd Edition
ISBN:9781337681872
Author:PINARD
Publisher:PINARD
Chapter20: Creating A Presentation
Section: Chapter Questions
Problem 5QY
icon
Related questions
Question

Given the following Extended-BNF grammar of the basic mathematical expressions: 

Show the derivation steps for the expression: ( 2 + 3 ) * 6 – 20 / ( 3 + 1 )

Draw the parsing tree of this expression.

SEE IMAGE

4. Mathematical Expressions:
•
Given the following Extended-BNF grammar of the basic mathematical expressions:
<expression> ⇒ <term> { ("+" | "-") <term> }
<term> <factor> { ("*" | "/") <factor> }
<factor> <number> | "(" <expression> ")"
<number>[0-9]+
1. Show the derivation steps for the expression: ( 2 + 3 ) * 6 - 20 (3 + 1)
2. Draw the parsing tree of this expression.
• Deliverables:
Derivation steps and parsing tree in the report.
Transcribed Image Text:4. Mathematical Expressions: • Given the following Extended-BNF grammar of the basic mathematical expressions: <expression> ⇒ <term> { ("+" | "-") <term> } <term> <factor> { ("*" | "/") <factor> } <factor> <number> | "(" <expression> ")" <number>[0-9]+ 1. Show the derivation steps for the expression: ( 2 + 3 ) * 6 - 20 (3 + 1) 2. Draw the parsing tree of this expression. • Deliverables: Derivation steps and parsing tree in the report.
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Recommended textbooks for you
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning