public class AnnotationElem_c extends Term_c implements AnnotationElem
Term.Instance
Modifier and Type | Field and Description |
---|---|
protected java.util.List<ElementValuePair> |
elements |
protected TypeNode |
typeName |
exceptions, reachable
Constructor and Description |
---|
AnnotationElem_c(Position pos,
TypeNode typeName,
java.util.List<ElementValuePair> elements) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.List<T> |
acceptCFG(CFGBuilder<?> v,
java.util.List<T> succs)
Visit this term in evaluation order, calling v.edge() for each successor
in succs, if data flows on that edge.
|
java.util.List<ElementValuePair> |
elements() |
protected <N extends AnnotationElem_c> |
elements(N n,
java.util.List<ElementValuePair> elements) |
Term |
entry() |
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
boolean |
isMarkerAnnotation()
An annotation is a marker annotation if it has no elements
|
boolean |
isSingleElementAnnotation()
An annotation is a single-element annotation if it has one element named "value"
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter pp)
Pretty-print the AST using the given
CodeWriter . |
protected <N extends AnnotationElem_c> |
reconstruct(N n,
TypeNode typeName,
java.util.List<ElementValuePair> elements) |
java.util.Map<java.lang.String,AnnotationElementValue> |
toAnnotationElementValues(Lang lang,
JL5TypeSystem ts)
Convert this AST representation into a suitable type annotation.
|
java.lang.String |
toString() |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
TypeNode |
typeName() |
protected <N extends AnnotationElem_c> |
typeName(N n,
TypeNode typeName) |
AnnotationElem |
typeName(TypeNode typeName) |
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
exceptionCheck, exceptions, exceptions, exceptions, extRewrite, listChild, reachable, reachable, reachable
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, enterScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
exceptions, exceptions, reachable, reachable
del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdge
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitList
protected TypeNode typeName
protected java.util.List<ElementValuePair> elements
public AnnotationElem_c(Position pos, TypeNode typeName, java.util.List<ElementValuePair> elements)
public TypeNode typeName()
typeName
in interface AnnotationElem
public AnnotationElem typeName(TypeNode typeName)
typeName
in interface AnnotationElem
protected <N extends AnnotationElem_c> N typeName(N n, TypeNode typeName)
public java.util.List<ElementValuePair> elements()
elements
in interface AnnotationElem
protected <N extends AnnotationElem_c> N elements(N n, java.util.List<ElementValuePair> elements)
protected <N extends AnnotationElem_c> N reconstruct(N n, TypeNode typeName, java.util.List<ElementValuePair> elements)
public Node visitChildren(NodeVisitor v)
NodeOps
visitChildren
in interface NodeOps
visitChildren
in class Node_c
v
- The visitor that will traverse/rewrite the AST.this
.public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOps
leave()
method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this
or a new copy of the node which will be
installed as a child of the node's parent.typeCheck
in interface NodeOps
typeCheck
in class Node_c
tc
- The type checking visitor.SemanticException
public void prettyPrint(CodeWriter w, PrettyPrinter pp)
Node_c
CodeWriter
.prettyPrint
in interface NodeOps
prettyPrint
in class Node_c
w
- The code writer to which to write.pp
- The pretty printer. This is not a visitor.public Term entry()
public <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOps
public Term firstChild()
TermOps
firstChild
in interface TermOps
firstChild
in class Term_c
public boolean isMarkerAnnotation()
AnnotationElem
isMarkerAnnotation
in interface AnnotationElem
public boolean isSingleElementAnnotation()
AnnotationElem
isSingleElementAnnotation
in interface AnnotationElem
public java.util.Map<java.lang.String,AnnotationElementValue> toAnnotationElementValues(Lang lang, JL5TypeSystem ts) throws SemanticException
AnnotationElem
toAnnotationElementValues
in interface AnnotationElem
SemanticException