ast
Class ASTNode

java.lang.Object
  extended by ast.ASTNode
Direct Known Subclasses:
Class_, Expr, Formal, ListNode, Member, Program, Stmt

public abstract class ASTNode
extends java.lang.Object

The abstract ASTNode class represents a generic AST node. It contains a line number (lineNumber).

AST Summary

ASTNode
An ASTNode is an abstract class that represents a generic node in the AST. It contains a line number indicating where the original source code (represented by the node) was scanned. All nodes in the AST extend ASTNode.


Field Summary
protected  int charNum
          The source starting character number (within line) corresponding to this AST node
protected  int lineNum
          The source line number corresponding to this AST node
protected  java.lang.String lineStr
          The source starting line corresponding to this AST node
 
Constructor Summary
protected ASTNode(int lineNum)
          ASTNode constructor
 
Method Summary
abstract  java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 int getLineNum()
          Get the line number corresponding to this AST node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineNum

protected int lineNum
The source line number corresponding to this AST node


charNum

protected int charNum
The source starting character number (within line) corresponding to this AST node


lineStr

protected java.lang.String lineStr
The source starting line corresponding to this AST node

Constructor Detail

ASTNode

protected ASTNode(int lineNum)
ASTNode constructor

Parameters:
lineNum - source line number corresponding to this AST node
Method Detail

getLineNum

public int getLineNum()
Get the line number corresponding to this AST node

Returns:
line number

accept

public abstract java.lang.Object accept(visitor.Visitor v,
                                        java.lang.Object o)
Visitor method

Parameters:
v - visitor object
o - object to pass down
Returns:
result of visiting this node
See Also:
Visitor