org.eclipse.palamedes.kif.core.ast
Class ASTNode

java.lang.Object
  extended by org.eclipse.palamedes.kif.core.ast.ASTNode
Direct Known Subclasses:
KIFForm, KIFOperator, KIFSent, KIFTerm

public abstract class ASTNode
extends java.lang.Object


Field Summary
static int COMMENT
           
static int CONJUNCTION
           
static int DISJUNCTION
           
static int FORM
           
static int FUNTERM
           
static int HORNSENT
           
static int IMPLICATION
           
static int INDVAR
           
static int LOGCONST
           
static int NEGATION
           
static int OBJCONST
           
static int OPERATOR
           
static int RELSENT
           
static int SEQUENCE
           
 
Method Summary
 ASTNode clone(AST baseAST)
           
protected  void copyMembers(ASTNode node)
          This method is for internal use!
 boolean equals(java.lang.Object obj)
          The ASTNode implementation of this Object method uses object identity (==).
 AST getAST()
           
 java.lang.String getInfixNotation()
           
 int getNodeType()
          Returns an integer value identifying the type of this concrete AST node.
 java.lang.String getPrefixNotation()
           
 int getSourceLength()
           
 int getSourceStart()
           
 int hashCode()
           
 void setSourceLength(int sourceLength)
           
 void setSourceStart(int sourceStart)
           
 java.lang.String toString()
           
abstract  void traverse(ASTVisitor visitor)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONJUNCTION

public static final int CONJUNCTION
See Also:
Constant Field Values

DISJUNCTION

public static final int DISJUNCTION
See Also:
Constant Field Values

FORM

public static final int FORM
See Also:
Constant Field Values

FUNTERM

public static final int FUNTERM
See Also:
Constant Field Values

HORNSENT

public static final int HORNSENT
See Also:
Constant Field Values

IMPLICATION

public static final int IMPLICATION
See Also:
Constant Field Values

INDVAR

public static final int INDVAR
See Also:
Constant Field Values

LOGCONST

public static final int LOGCONST
See Also:
Constant Field Values

NEGATION

public static final int NEGATION
See Also:
Constant Field Values

OBJCONST

public static final int OBJCONST
See Also:
Constant Field Values

OPERATOR

public static final int OPERATOR
See Also:
Constant Field Values

RELSENT

public static final int RELSENT
See Also:
Constant Field Values

SEQUENCE

public static final int SEQUENCE
See Also:
Constant Field Values

COMMENT

public static final int COMMENT
See Also:
Constant Field Values
Method Detail

setSourceStart

public void setSourceStart(int sourceStart)

setSourceLength

public void setSourceLength(int sourceLength)

getSourceStart

public final int getSourceStart()

getSourceLength

public final int getSourceLength()

getAST

public final AST getAST()

getNodeType

public final int getNodeType()
Returns an integer value identifying the type of this concrete AST node. The values are small positive integers, suitable for use in switch statements.

For each concrete node type there is a unique node type constant (name and value). The unique node type constant for a concrete node type such as CastExpression is ASTNode.CAST_EXPRESSION.

Returns:
one of the node type constants

clone

public final ASTNode clone(AST baseAST)

equals

public final boolean equals(java.lang.Object obj)
The ASTNode implementation of this Object method uses object identity (==). Use subtreeMatch to compare two subtrees for equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

copyMembers

protected final void copyMembers(ASTNode node)
This method is for internal use! It is assumed that the current node contains no own information and should be a clone of the given node. If you are looking for a copy/clone method to get a deep copy of a ASTNode use clone() instead.


traverse

public abstract void traverse(ASTVisitor visitor)

getPrefixNotation

public final java.lang.String getPrefixNotation()
Returns:
the prefix form of this term e.g., "f(a,g(1,2))"

getInfixNotation

public final java.lang.String getInfixNotation()
Returns:
the infix KIF form of this term e.g., "(f a (g 1 2))"

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object