kmy.jint.tree
Class BasicNode

java.lang.Object
  |
  +--kmy.jint.tree.BasicNode
Direct Known Subclasses:
CaseNode, CatchNode, ExpressionNode, ParameterNode, StatementNode

public abstract class BasicNode
extends java.lang.Object

This is a base class representing parsing tree node; all other nodes are derived from it.


Field Summary
 java.lang.Object attachment
          Attachment is a general-purpose field that can hold some useful information generated by some kind of parsing tree processing (like semantic analysis).
private  int filePos
           
 
Constructor Summary
BasicNode(int filePos)
          Initialize BasicNode that represents something at position filePos is the input file.
 
Method Summary
abstract  java.lang.Object eval(Context context)
          Calls corresponding eval* method in the given Context.
 java.lang.Object getAttachment()
          Returns this node attachment.
 int getFilePos()
          Returns file position where the element what this node represents was located.
 int getLine()
          Returns line where the element what this node represents was located.
 void setAttachment(java.lang.Object obj)
          Assigns this node attachment.
 void setFilePos(int filePos)
          Returns line's column where the element what this node represents was located.
 java.lang.String toString()
          Returns string representation of this node.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

filePos

private int filePos

attachment

public java.lang.Object attachment
Attachment is a general-purpose field that can hold some useful information generated by some kind of parsing tree processing (like semantic analysis). This is somewhat sloppy design, but that's how it is.
Constructor Detail

BasicNode

public BasicNode(int filePos)
Initialize BasicNode that represents something at position filePos is the input file.
Method Detail

getFilePos

public int getFilePos()
Returns file position where the element what this node represents was located.

getLine

public int getLine()
Returns line where the element what this node represents was located.

setFilePos

public void setFilePos(int filePos)
Returns line's column where the element what this node represents was located.

setAttachment

public void setAttachment(java.lang.Object obj)
Assigns this node attachment.

getAttachment

public java.lang.Object getAttachment()
Returns this node attachment.

toString

public java.lang.String toString()
Returns string representation of this node.
Overrides:
toString in class java.lang.Object

eval

public abstract java.lang.Object eval(Context context)
Calls corresponding eval* method in the given Context.