ch.uzh.ifi.attempto.chartparser
Class ParseTreeNode

java.lang.Object
  extended by ch.uzh.ifi.attempto.chartparser.ParseTreeNode

public class ParseTreeNode
extends java.lang.Object

This class represents a node of the parse tree. Each node has a category and an annotation object that are carried over from the edge in the chart parser and originate from the respective grammar rule. Additionally, each parse node has start and end positions denoting the covered part of the input text.

Author:
Tobias Kuhn

Method Summary
 Annotation getAnnotation()
          Returns the annotation object of this node.
 java.lang.Object getAnnotationItem(java.lang.String name)
          Returns the annotation item for the given annotation item name.
 Category getCategory()
          Returns the category of this node.
 ParseTreeNode getChild(int i)
          Returns the child at the given position.
 java.util.List<ParseTreeNode> getChildren()
          Returns the children of this node.
 int getEndPos()
          Returns the end position.
 int getStartPos()
          Returns the start position.
 java.util.List<Terminal> getTerminals()
          Returns the list of terminals that are descendants of this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCategory

public Category getCategory()
Returns the category of this node.

Returns:
The category.

getStartPos

public int getStartPos()
Returns the start position. 0 is the position before the first token, 1 the position after the first token, 2 the position after the second token, and so on.

Returns:
The start position.

getEndPos

public int getEndPos()
Returns the end position. 0 is the position before the first token, 1 the position after the first token, 2 the position after the second token, and so on.

Returns:
The end position.

getAnnotation

public Annotation getAnnotation()
Returns the annotation object of this node.

Returns:
The annotation object.

getAnnotationItem

public java.lang.Object getAnnotationItem(java.lang.String name)
Returns the annotation item for the given annotation item name.

Parameters:
name - The name of the annotation item.
Returns:
The value of the annotation item.

getChildren

public java.util.List<ParseTreeNode> getChildren()
Returns the children of this node.

Returns:
The children.

getChild

public ParseTreeNode getChild(int i)
Returns the child at the given position.

Parameters:
i - The position.
Returns:
The child.

getTerminals

public java.util.List<Terminal> getTerminals()
Returns the list of terminals that are descendants of this node.

Returns:
The list of terminals.


Copyright 2008-2012, AceWiki developers