Package org.eclipse.epsilon.common.parse
Class AST
- java.lang.Object
-
- org.antlr.runtime.tree.BaseTree
-
- org.antlr.runtime.tree.CommonTree
-
- org.eclipse.epsilon.common.parse.AST
-
- All Implemented Interfaces:
org.antlr.runtime.tree.Tree
public class AST extends org.antlr.runtime.tree.CommonTree
-
-
Field Summary
Fields Modifier and Type Field Description protected AST
annotations
protected java.lang.Integer
column
protected java.util.List<org.antlr.runtime.Token>
commentTokens
protected java.util.List<AST>
descendants
protected java.util.List<org.antlr.runtime.Token>
extraTokens
protected boolean
imaginary
protected java.lang.Integer
line
protected IModule
module
protected java.util.HashMap<java.lang.String,java.lang.Object>
properties
protected Region
region
protected java.net.URI
uri
-
Constructor Summary
Constructors Constructor Description AST()
AST(org.antlr.runtime.Token token)
AST(org.antlr.runtime.Token token, java.net.URI uri)
AST(org.antlr.runtime.Token token, java.net.URI uri, IModule module)
AST(org.antlr.runtime.Token token, AST real)
AST(org.antlr.runtime.tree.CommonTree commontree)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
build()
protected void
collectDescendants(AST ast, java.util.List<AST> descendants, boolean addAst)
AST
getAnnotationsAst()
java.lang.String
getBasename()
Returns the basename of the URI of this AST, which is the last segment of its URI.AST
getChild(int i)
java.util.List<AST>
getChildren()
int
getColumn()
java.util.List<org.antlr.runtime.Token>
getCommentTokens()
java.util.List<AST>
getDescendants()
java.util.List<org.antlr.runtime.Token>
getExtraTokens()
java.io.File
getFile()
AST
getFirstChild()
AST
getFourthChild()
int
getLine()
IModule
getModule()
AST
getNextSibling()
int
getNumberOfChildren()
AST
getParent()
java.util.HashMap<java.lang.String,java.lang.Object>
getProperties()
Region
getRegion()
AST
getSecondChild()
AST
getThirdChild()
java.net.URI
getUri()
boolean
hasChildren()
boolean
isImaginary()
AST
setAnnotationsAst(AST annotations)
AST
setColumn(int column)
void
setCommentTokens(java.util.List<org.antlr.runtime.Token> comments)
void
setExtraTokens(java.util.List<org.antlr.runtime.Token> extraTokens)
AST
setFirstChild(AST child)
void
setImaginary(boolean imaginary)
AST
setLine(int line)
void
setModule(IModule module)
AST
setNextSibling(AST sibling)
void
setRegion(Region region)
void
setToken(org.antlr.runtime.Token token)
void
setUri(java.net.URI uri)
java.lang.String
toExtendedStringTree()
protected java.lang.String
toExtendedStringTree(int indent)
java.lang.String
toExtendedStringTreeItem()
-
Methods inherited from class org.antlr.runtime.tree.CommonTree
dupNode, getCharPositionInLine, getChildIndex, getText, getToken, getTokenStartIndex, getTokenStopIndex, getType, isNil, setChildIndex, setParent, setTokenStartIndex, setTokenStopIndex, setUnknownTokenBoundaries, toString
-
Methods inherited from class org.antlr.runtime.tree.BaseTree
addChild, addChildren, createChildrenList, deleteChild, freshenParentAndChildIndexes, freshenParentAndChildIndexes, freshenParentAndChildIndexesDeeply, freshenParentAndChildIndexesDeeply, getAncestor, getAncestors, getChildCount, getFirstChildWithType, hasAncestor, insertChild, replaceChildren, sanityCheckParentAndChildIndexes, sanityCheckParentAndChildIndexes, setChild, toStringTree
-
-
-
-
Field Detail
-
uri
protected java.net.URI uri
-
line
protected java.lang.Integer line
-
column
protected java.lang.Integer column
-
region
protected Region region
-
annotations
protected AST annotations
-
imaginary
protected boolean imaginary
-
extraTokens
protected java.util.List<org.antlr.runtime.Token> extraTokens
-
commentTokens
protected java.util.List<org.antlr.runtime.Token> commentTokens
-
descendants
protected java.util.List<AST> descendants
-
module
protected IModule module
-
properties
protected java.util.HashMap<java.lang.String,java.lang.Object> properties
-
-
Constructor Detail
-
AST
public AST()
-
AST
public AST(org.antlr.runtime.tree.CommonTree commontree)
-
AST
public AST(org.antlr.runtime.Token token, AST real)
-
AST
public AST(org.antlr.runtime.Token token)
-
AST
public AST(org.antlr.runtime.Token token, java.net.URI uri)
-
AST
public AST(org.antlr.runtime.Token token, java.net.URI uri, IModule module)
-
-
Method Detail
-
build
public void build()
-
getModule
public IModule getModule()
-
setModule
public void setModule(IModule module)
-
setUri
public void setUri(java.net.URI uri)
-
getAnnotationsAst
public AST getAnnotationsAst()
-
getProperties
public java.util.HashMap<java.lang.String,java.lang.Object> getProperties()
-
getBasename
public java.lang.String getBasename()
Returns the basename of the URI of this AST, which is the last segment of its URI.getFile()
returnsnull
for non-file:///
URIs, which is correct in its own regard, but may produce NPEs in our case.
-
getFile
public java.io.File getFile()
-
getUri
public java.net.URI getUri()
-
getChildren
public java.util.List<AST> getChildren()
- Overrides:
getChildren
in classorg.antlr.runtime.tree.BaseTree
-
getParent
public AST getParent()
- Specified by:
getParent
in interfaceorg.antlr.runtime.tree.Tree
- Overrides:
getParent
in classorg.antlr.runtime.tree.CommonTree
-
setLine
public AST setLine(int line)
-
getLine
public int getLine()
- Specified by:
getLine
in interfaceorg.antlr.runtime.tree.Tree
- Overrides:
getLine
in classorg.antlr.runtime.tree.CommonTree
-
setColumn
public AST setColumn(int column)
-
getColumn
public int getColumn()
-
getNextSibling
public AST getNextSibling()
-
hasChildren
public boolean hasChildren()
-
getChild
public AST getChild(int i)
- Specified by:
getChild
in interfaceorg.antlr.runtime.tree.Tree
- Overrides:
getChild
in classorg.antlr.runtime.tree.BaseTree
-
getNumberOfChildren
public int getNumberOfChildren()
-
getFirstChild
public AST getFirstChild()
-
getSecondChild
public AST getSecondChild()
-
getThirdChild
public AST getThirdChild()
-
getFourthChild
public AST getFourthChild()
-
getRegion
public Region getRegion()
-
setToken
public void setToken(org.antlr.runtime.Token token)
-
getDescendants
public java.util.List<AST> getDescendants()
-
collectDescendants
protected void collectDescendants(AST ast, java.util.List<AST> descendants, boolean addAst)
-
setRegion
public void setRegion(Region region)
-
setImaginary
public void setImaginary(boolean imaginary)
-
isImaginary
public boolean isImaginary()
-
getExtraTokens
public java.util.List<org.antlr.runtime.Token> getExtraTokens()
-
setExtraTokens
public void setExtraTokens(java.util.List<org.antlr.runtime.Token> extraTokens)
-
getCommentTokens
public java.util.List<org.antlr.runtime.Token> getCommentTokens()
-
setCommentTokens
public void setCommentTokens(java.util.List<org.antlr.runtime.Token> comments)
-
toExtendedStringTreeItem
public java.lang.String toExtendedStringTreeItem()
-
toExtendedStringTree
public java.lang.String toExtendedStringTree()
-
toExtendedStringTree
protected java.lang.String toExtendedStringTree(int indent)
-
-