org.jawk.frontend
Interface AwkSyntaxTree


public interface AwkSyntaxTree

A Jawk abstract syntax tree node. This provides an appropriate public interface to the abstract syntax tree.


Method Summary
 void dump(java.io.PrintStream ps)
          Dump a meaningful text representation of this abstract syntax tree node to the output (print) stream.
 int populateTuples(AwkTuples tuples)
          Appends tuples to the AwkTuples list for this abstract syntax tree node.
 void semanticAnalysis()
          Apply semantic checks to this node.
 

Method Detail

dump

void dump(java.io.PrintStream ps)
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

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

int populateTuples(AwkTuples tuples)
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.