Construct a tree printer class for the ast3 package that


Question: Construct a Tree Printer class for the ast3 package that lays out the structure of the tree using text in the console window. Each node should have a method of the form public void tree Print (String indent) that print the subtree rooted at this node indented by the given amount. The tree Print method should print the String returned by the node's to String () method (that you'll need to write), which should include the name of the class of the node (e.g., IntLiteral) and any other instance information that distinguishes it (e.g., the integer value stored in the IntLiteral node). Then it should recursively call tree Print on each of its children, using a larger indentation, for example, four more spaces than its indentation.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Construct a tree printer class for the ast3 package that
Reference No:- TGS02580396

Expected delivery within 24 Hours