Package org.metricshub.jawk.frontend
Class AstNode
java.lang.Object
org.metricshub.jawk.frontend.AstNode
A Jawk abstract syntax tree node. This provides an appropriate public
interface to the abstract syntax tree.
- Author:
- Danny Daglas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddump(PrintStream ps) Dump a meaningful text representation of this abstract syntax tree node to the output (print) stream.abstract intpopulateTuples(AwkTuples tuples) Appends tuples to the AwkTuples list for this abstract syntax tree node.abstract voidApply semantic checks to this node.
-
Constructor Details
-
AstNode
public AstNode()
-
-
Method Details
-
dump
Dump a meaningful text representation of this abstract syntax tree node to the output (print) stream. Either it is called directly by the application program, or it is called by the parent node of this tree node.- Parameters:
ps- The print stream to dump the text representation.
-
semanticAnalysis
public abstract void semanticAnalysis()Apply semantic checks to this node. The default implementation is to simply call semanticAnalysis() on all the children of this abstract syntax tree node. Therefore, this method must be overridden to provide meaningful semantic analysis / checks. -
populateTuples
Appends tuples to the AwkTuples list for this abstract syntax tree node. Subclasses must implement this method.This is called either by the main program to generate a full list of tuples for the abstract syntax tree, or it is called by other abstract syntax tree nodes in response to their attempt at populating tuples.
- Parameters:
tuples- The tuples to populate.- Returns:
- The number of items left on the operand stack after these tuples have executed.
-