gov.llnl.babel.ast
Class ASTNode
java.lang.Object
gov.llnl.babel.ast.ASTNode
public abstract class ASTNode
extends java.lang.Object
Base class for all AST nodes
ILLEGAL_NODEID
public static final long ILLEGAL_NODEID
ASTNode
public ASTNode(ParseTreeNode src,
ASTNode parent)
src
- the ParseTreeNode useful for debugging (or null) for generated
codeparent
- the parent ASTNode.
accept
public abstract Object accept(Visitor v,
Object data)
implements "Visitor Pattern"
v
- The visitor classdata
- Optional extra data
getFilename
public String getFilename()
If we have information about the sourcecode, traverse parent pointers until
we get to a node that knows its filename. Return null if information is not
available (or in the case of generated ASTs, not applicable)
getFirstToken
public Token getFirstToken()
getLastToken
public Token getLastToken()
getNodeId
public long getNodeId()
getParent
public ASTNode getParent()
getSymbolTableEntry
public Symbol getSymbolTableEntry()
setFirstToken
protected void setFirstToken(Token token)
setLastToken
protected void setLastToken(Token token)
setNodeId
public void setNodeId(long id)
setParent
public void setParent(ASTNode node)
setSymbolTableEntry
public void setSymbolTableEntry(Symbol symbol)