Question: 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
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
Get step-by-step solutions from verified subject matter experts
