Package examples
Class ASTExample
java.lang.Object
examples.ASTExample
Shows how to use Introspector to represent an Abstract Syntax Tree (AST) used in most compilers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ASTNodeThis method creates the AST for the following program:static voidExample main program
-
Constructor Details
-
ASTExample
public ASTExample()
-
-
Method Details
-
createTree
This method creates the AST for the following program:
read a,b; a = (-b+3)*c; write a,c*2;
- Returns:
- the root of the AST
-
main
Example main program- Parameters:
args- no params are required
-