edu.mit.ai.psg.jeva
Interface IJevaNode

All Known Subinterfaces:
IClassBodyDeclaration, IDeclarationNode, IExpressionNode, IExpressionStoreNode, IStatementNode
All Known Implementing Classes:
JevaNode

public interface IJevaNode
extends Node

IJevaNode: extends Node with methods for accessing the tokens and for printing out the token stream for this node.


Method Summary
 Token getBeginToken()
           
 Token getEndToken()
           
 void insertNewChildAfter(IJevaNode newChild, IJevaNode oldChild)
          Insert new child, linking in token stream just after old child.
 void insertNewChildAt(IJevaNode newChild, int position, Token beginHole)
          insert new child, linking in token stream just after beginHole.
 void insertNewChildBefore(IJevaNode newChild, IJevaNode oldChild)
          Insert new child, linking in token stream just before old child.
 Object jjtAccept(IJevaVisitor visitor, Object data)
          Accept a visitor.
 IJevaNode jnGetChild(int i)
          jnGetChild is like Node.jjtGetChild except it returns an IJevaNode
 IJevaNode jnGetParent()
          jnGetParent is like Node.jjtGetParent except it returns an IJevaNode
 void print(PrintWriter stream)
          Print tokens of parsed node's syntax, including children, to stream.
 void print(PrintWriter stream, boolean includeSpecialTokens)
           
 String printToString()
          Print tokens of parsed node's syntax, including children, to string.
 String printToString(boolean includeSpecialTokens)
           
 void removeChild(IJevaNode child)
          remove a child node and remove its tokens from token chain.
 void replaceChild(IJevaNode oldChild, IJevaNode newChild)
          remove a child node and replace it with new child; also in token chain
 void replaceChild(int index, IJevaNode oldChild, IJevaNode newChild)
           
 void setBeginToken(Token t)
          Called by the parser to set the first token of the parsed syntax
 void setEndToken(Token t)
          Called by the parser to set the last+1 token of the parsed syntax
 
Methods inherited from interface edu.mit.ai.psg.jeva.Node
jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
 

Method Detail

getBeginToken

public Token getBeginToken()
Returns:
the first token (in token chain) of the parsed syntax

getEndToken

public Token getEndToken()
Returns:
the token after the last token of the parsed syntax

setBeginToken

public void setBeginToken(Token t)
Called by the parser to set the first token of the parsed syntax

setEndToken

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

print

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

print

public void print(PrintWriter stream,
                  boolean includeSpecialTokens)

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

printToString

public String printToString(boolean includeSpecialTokens)

jjtAccept

public Object jjtAccept(IJevaVisitor visitor,
                        Object data)
Accept a visitor. For visitor design pattern: jjtAccept must simply
  return visitor.visit(this, data);  
which dispatches on the type of this to appropriate method of visitor

jnGetChild

public IJevaNode jnGetChild(int i)
jnGetChild is like Node.jjtGetChild except it returns an IJevaNode

jnGetParent

public IJevaNode jnGetParent()
jnGetParent is like Node.jjtGetParent except it returns an IJevaNode

removeChild

public void removeChild(IJevaNode child)
remove a child node and remove its tokens from token chain.

replaceChild

public void replaceChild(IJevaNode oldChild,
                         IJevaNode newChild)
remove a child node and replace it with new child; also in token chain

replaceChild

public void replaceChild(int index,
                         IJevaNode oldChild,
                         IJevaNode newChild)

insertNewChildAfter

public void insertNewChildAfter(IJevaNode newChild,
                                IJevaNode oldChild)
Insert new child, linking in token stream just after old child.

insertNewChildBefore

public void insertNewChildBefore(IJevaNode newChild,
                                 IJevaNode oldChild)
Insert new child, linking in token stream just before old child.

insertNewChildAt

public void insertNewChildAt(IJevaNode newChild,
                             int position,
                             Token beginHole)
insert new child, linking in token stream just after beginHole.

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu