In a previous exercise, you wrote five different programs using the prefix notation of Arithlang and all
Question:
In a previous exercise, you wrote five different programs using the prefix notation of Arithlang and all four arithmetic operators +, −, *, and /, such that each expression produces the value 42. Draw the parse tree and the AST for these programs.
Previous exercise
Draw the parse tree of the following Arithlang programs.
Next, draw ASTs for the same programs. Finally, report on the compression ratio achieved by the AST representation. The compression ratio is defined as (the number of nodes in the parse tree –the number of nodes in the AST) / the number of nodes in the parse tree.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
An Experiential Introduction To Principles Of Programming Languages
ISBN: 9780262045452
1st Edition
Authors: Hridesh Rajan
Question Posted: