pl.edu.pjwstk.yaod.yaql.abstractsyntaxtree
Class AbstractSyntaxTree

java.lang.Object
  |
  +--pl.edu.pjwstk.yaod.yaql.abstractsyntaxtree.AbstractSyntaxTree
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ActualParametersList, Expression, FormalParametersList, Statement, StatementList

public abstract class AbstractSyntaxTree
extends java.lang.Object
implements java.io.Serializable

The Expression class represents the abstract syntax tree.

Author:
Jakub Trzetrzelewski, jakub_trzetrzelewski@yahoo.com
See Also:
Serialized Form

Constructor Summary
AbstractSyntaxTree()
           
 
Method Summary
abstract  void accept(Visitor v)
          Method responsible for traversing the abstract syntax tree structure.
 java.lang.String getLongestTypeAsSpacesString()
          Returns the space string, which size is equal to the name of the longest type name.
 java.lang.String getPreparedTypeAsString()
          Returns the prepared type name for display.
abstract  java.lang.String getSpellingAndPosition()
          Returns the spelling and positions of all terminals in a node.
abstract  java.lang.String getTypeAsString()
          Returns the abstract syntax tree node type as a string value.
 void show()
          Method responsible for displaying the abstract syntax tree structure.
abstract  void show(java.lang.String st)
          Method responsible for displaying the abstract syntax tree structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSyntaxTree

public AbstractSyntaxTree()
Method Detail

getTypeAsString

public abstract java.lang.String getTypeAsString()
Returns the abstract syntax tree node type as a string value.
Returns:
the abstract syntax tree node type as string.

accept

public abstract void accept(Visitor v)
                     throws EvalException
Method responsible for traversing the abstract syntax tree structure.
Parameters:
v - the visitor.
Throws:
EvalException - if evaluation fails.
See Also:
Visitor

getSpellingAndPosition

public abstract java.lang.String getSpellingAndPosition()
Returns the spelling and positions of all terminals in a node.
Returns:
the spelling and positions of all terminals in a node.

getLongestTypeAsSpacesString

public java.lang.String getLongestTypeAsSpacesString()
Returns the space string, which size is equal to the name of the longest type name.
Returns:
the name of the longest type, replaced by spaces.

getPreparedTypeAsString

public java.lang.String getPreparedTypeAsString()
Returns the prepared type name for display.
Returns:
the prepared type name.

show

public abstract void show(java.lang.String st)
Method responsible for displaying the abstract syntax tree structure.
Parameters:
st - the string which is an auxiliary tabulator.

show

public void show()
Method responsible for displaying the abstract syntax tree structure.