Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

These are the lisp problems B. Do the following exercises on infix, prefix, and postfix syntax, and abstract syntax trees: 1. In a certain language

These are the lisp problems image text in transcribed
B. Do the following exercises on infix, prefix, and postfix syntax, and abstract syntax trees: 1. In a certain language expressions are written in infix syntax. The language has binary, prefix, and postfix operators that belong to the following precedence classes [none] none] binary ops prefix ops postfix ops associativity 1st Class: 2nd Class: 3rd Class: right left right [none] 1st class operators have highest precedence and 3rd class operators have lowest precedence (a) Say which operator is applied last in the following expression, and then draw the abstract synta:x tree of the expression. [To help you, subscripts have been attached to each operator to indicate its precedence class and whether that class is left-or right-associative, even though this information can also be obtained from the above table.] (@3R a #IR u) @2L w $2L %3R (5 ^3R b ~1R ) ^3R d (b) Rewrite the expression in prefix syntax (c) Rewrite the expression in postfix syntax 2. Draw the AST of the following postfix syntax expression, and rewrite the expression in prefix syntax. A subscript has been attached to each operator that shows the operator's arity. [The operators in this question and the next are not related to the operators in question 1.] ab$2 @1 3 u *1 v w $2 ~2 5 @1 ^3 #2 3. Draw the AST of the following prefix syntax expression, and rewrite the expression in postfix syntax. A subscript has been attached to each operator that shows the operator's arity

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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions