org.eclipse.palamedes.kif.core.ast
Class ASTNode
java.lang.Object
org.eclipse.palamedes.kif.core.ast.ASTNode
- Direct Known Subclasses:
- KIFForm, KIFOperator, KIFSent, KIFTerm
public abstract class ASTNode
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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
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