Please use the given grammar and the string to build a parse tree and an abstract syntax tree (refer to 05-01-abstract-syntax-trees.pdf page 4 and 5)(10 points) Given Grammar: E -> int | (E) | E+E Given String: 5+ (2+ (3+4)) E 1 ints LU E E E E • • • A parse tree: Traces the operation of the parser Captures nesting structu But too much informatic - Parentheses -Single-successor nodes E | int₂ int3 PLUS 5 PLUS Abstract Syntax 2 3 • Also captures the nesting structure • • But abstracts from the concrete syntax => more compact and easier to use An important data structure in a compiler
Please use the given grammar and the string to build a parse tree and an abstract syntax tree (refer to 05-01-abstract-syntax-trees.pdf page 4 and 5)(10 points) Given Grammar: E -> int | (E) | E+E Given String: 5+ (2+ (3+4)) E 1 ints LU E E E E • • • A parse tree: Traces the operation of the parser Captures nesting structu But too much informatic - Parentheses -Single-successor nodes E | int₂ int3 PLUS 5 PLUS Abstract Syntax 2 3 • Also captures the nesting structure • • But abstracts from the concrete syntax => more compact and easier to use An important data structure in a compiler
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section13.4: Linked Lists
Problem 4E
Related questions
Question
Compilers. use the given grammar and the string to build a parse tree and an abstract syntax tree

Transcribed Image Text:Please use the given grammar and the string to build a parse tree and an abstract
syntax tree (refer to 05-01-abstract-syntax-trees.pdf page 4 and 5)(10 points)
Given Grammar: E -> int | (E) | E+E
Given String: 5+ (2+ (3+4))

Transcribed Image Text:E
1
ints
LU
E
E
E
E
•
•
•
A parse tree:
Traces the operation of
the parser
Captures nesting structu
But too much informatic
- Parentheses
-Single-successor nodes
E
|
int₂
int3
PLUS
5
PLUS
Abstract Syntax
2
3
• Also captures the nesting structure
•
•
But abstracts from the concrete syntax
=> more compact and easier to use
An important data structure in a compiler
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage