net.obsearch.example.ted
Class SliceAST

java.lang.Object
  extended by antlr.BaseAST
      extended by net.obsearch.example.ted.SliceAST
All Implemented Interfaces:
antlr.collections.AST, java.io.Serializable
Direct Known Subclasses:
FSliceAST, SliceASTIds

public class SliceAST
extends antlr.BaseAST

SliceAST This class provides extra functionality required by tree edit distance algorithms and the like

Author:
Arnoldo Jose Muller Molina
See Also:
Serialized Form

Field Summary
protected  int decendants
           
protected  java.lang.String text
           
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
SliceAST()
           
SliceAST(int t, java.lang.String txt)
           
SliceAST(SliceAST t)
           
SliceAST(antlr.Token tok)
           
 
Method Summary
 boolean containsNode(int i)
           
 java.util.List<SliceAST> depthFirst()
           
protected  void depthFirstAux(java.util.LinkedList<SliceAST> res)
           
protected  int detailedTreeAux(antlr.collections.AST t)
          Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.
 int detailedTreeComparison(antlr.collections.AST t)
           
 boolean equalsTree(antlr.collections.AST t)
           
 SliceAST findFirstNodeThatMatches(java.lang.String label)
           
 int getDescendants()
           
 int getId()
           
 SliceAST getLeftmostChild()
           
 int getSize()
           
 java.lang.String getText()
          Get the token text for this node
 int getType()
          Get the token type for this node
 void initialize(antlr.collections.AST t)
           
 void initialize(int t, java.lang.String txt)
           
 void initialize(antlr.Token tok)
           
 java.lang.String prettyPrint()
          Print out a child-sibling tree in LISP notation
 void setText(java.lang.String text_)
          Set the token text for this node
 void setType(int ttype_)
          Set the token type for this node
 void toFuriaChanTreeAux(java.lang.StringBuilder ts)
           
 java.lang.String toQ()
          Print out a child-sibling tree in Q notation
 void updateContains()
           
 int updateDecendantInformation()
           
 void updateIdInfo()
          public int updateDecendantInformation(){ assert false; return -1; }
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTreePartial, findAll, findAllPartial, getColumn, getFirstChild, getLine, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

decendants

protected int decendants

text

protected java.lang.String text
Constructor Detail

SliceAST

public SliceAST()

SliceAST

public SliceAST(int t,
                java.lang.String txt)

SliceAST

public SliceAST(antlr.Token tok)

SliceAST

public SliceAST(SliceAST t)
Method Detail

updateDecendantInformation

public int updateDecendantInformation()

getDescendants

public int getDescendants()

getSize

public int getSize()

findFirstNodeThatMatches

public SliceAST findFirstNodeThatMatches(java.lang.String label)

getText

public java.lang.String getText()
Get the token text for this node

Specified by:
getText in interface antlr.collections.AST
Overrides:
getText in class antlr.BaseAST

getType

public int getType()
Get the token type for this node

Specified by:
getType in interface antlr.collections.AST
Overrides:
getType in class antlr.BaseAST

initialize

public void initialize(int t,
                       java.lang.String txt)
Specified by:
initialize in interface antlr.collections.AST
Specified by:
initialize in class antlr.BaseAST

initialize

public void initialize(antlr.collections.AST t)
Specified by:
initialize in interface antlr.collections.AST
Specified by:
initialize in class antlr.BaseAST

initialize

public void initialize(antlr.Token tok)
Specified by:
initialize in interface antlr.collections.AST
Specified by:
initialize in class antlr.BaseAST

setText

public void setText(java.lang.String text_)
Set the token text for this node

Specified by:
setText in interface antlr.collections.AST
Overrides:
setText in class antlr.BaseAST

setType

public void setType(int ttype_)
Set the token type for this node

Specified by:
setType in interface antlr.collections.AST
Overrides:
setType in class antlr.BaseAST

getLeftmostChild

public SliceAST getLeftmostChild()

prettyPrint

public java.lang.String prettyPrint()
Print out a child-sibling tree in LISP notation


toQ

public java.lang.String toQ()
Print out a child-sibling tree in Q notation


equalsTree

public boolean equalsTree(antlr.collections.AST t)
Specified by:
equalsTree in interface antlr.collections.AST
Overrides:
equalsTree in class antlr.BaseAST

detailedTreeComparison

public int detailedTreeComparison(antlr.collections.AST t)

detailedTreeAux

protected int detailedTreeAux(antlr.collections.AST t)
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.


depthFirst

public java.util.List<SliceAST> depthFirst()

depthFirstAux

protected void depthFirstAux(java.util.LinkedList<SliceAST> res)

updateIdInfo

public void updateIdInfo()
public int updateDecendantInformation(){ assert false; return -1; }


updateContains

public void updateContains()

getId

public int getId()

containsNode

public boolean containsNode(int i)

toFuriaChanTreeAux

public final void toFuriaChanTreeAux(java.lang.StringBuilder ts)


Copyright © 2007-2008 Arnoldo Jose Muller Molina. All Rights Reserved.