All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.mit.ai.psg.jevaES.SimpleNode

java.lang.Object
   |
   +----edu.mit.ai.psg.jevaES.SimpleNode

public class SimpleNode
extends Object
implements Node
Root class for all parse tree nodes. Contains an array of child nodes. Amended to contain first and last+1 token of the parsed syntax, so the syntax can be regenerated. Additions:

Author:
CarlManning, caroma@ai.mit.edu
Copyright (c) 1997 Massachusetts Institute of Technology

Constructor Index

 o SimpleNode(int)

Method Index

 o dump(String)
 o getBeginToken()
 o getEndToken()
 o jjtAddChild(Node, int)
 o jjtClose()
 o jjtGetChild(int)
 o jjtGetNumChildren()
 o jjtGetParent()
 o jjtOpen()
 o jjtSetParent(Node)
 o print(PrintWriter)
Print tokens of parsed node's syntax, including children, to stream.
 o print(PrintWriter, boolean)
 o printToString()
Print tokens of parsed node's syntax, including children, to string.
 o printToString(boolean)
 o setBeginToken(Token)
Called by the parser to set the first token of the parsed syntax
 o setEndToken(Token)
Called by the parser to set the last+1 token of the parsed syntax
 o toString()
 o toString(String)

Constructors

 o SimpleNode
 public SimpleNode(int i)

Methods

 o jjtOpen
 public void jjtOpen()
 o jjtClose
 public void jjtClose()
 o jjtSetParent
 public void jjtSetParent(Node n)
 o jjtGetParent
 public Node jjtGetParent()
 o jjtAddChild
 public void jjtAddChild(Node n,
                         int i)
 o jjtGetChild
 public Node jjtGetChild(int i)
 o jjtGetNumChildren
 public int jjtGetNumChildren()
 o toString
 public String toString()
Overrides:
toString in class Object
 o toString
 public String toString(String prefix)
 o dump
 public void dump(String prefix)
 o getBeginToken
 public Token getBeginToken()
Returns:
the first token (in token chain) of the parsed syntax
 o getEndToken
 public Token getEndToken()
Returns:
the token after the last token of the parsed syntax
 o setBeginToken
 public void setBeginToken(Token t)
Called by the parser to set the first token of the parsed syntax

 o setEndToken
 public void setEndToken(Token t)
Called by the parser to set the last+1 token of the parsed syntax

 o print
 public void print(PrintWriter stream)
Print tokens of parsed node's syntax, including children, to stream. also prints special tokens (whitespace and comments)

 o print
 public void print(PrintWriter stream,
                   boolean includeSpecialTokens)
 o printToString
 public String printToString()
Print tokens of parsed node's syntax, including children, to string. Includes special tokens (whitespace and comments).

Returns:
a string recreating node's syntax
 o printToString
 public String printToString(boolean includeSpecialTokens)

All Packages  Class Hierarchy  This Package  Previous  Next  Index