//generated by abstract-syntax-gen package de.peeeq.wurstscript.ast; import java.util.*; @SuppressWarnings({"cast", "unused", "rawtypes"}) class AnnotationImpl implements Annotation{ AnnotationImpl(de.peeeq.wurstscript.parser.WPos source, Identifier funcNameId, Arguments args) { if (source == null) throw new IllegalArgumentException("Element source must not be null."); if (funcNameId == null) throw new IllegalArgumentException("Element funcNameId must not be null."); if (args == null) throw new IllegalArgumentException("Element args must not be null."); this.source = source; this.funcNameId = funcNameId; this.args = args; funcNameId.setParent(this); args.setParent(this); } private Element parent; public Element getParent() { return parent; } public void setParent(Element parent) { if (parent != null && this.parent != null) { throw new Error("Cannot change parent of element " + this.getClass().getSimpleName() + ", as it is already used in another tree." + "Use the copy method to create a new tree or remove the tree from its old parent or set the parent to null before moving the tree. "); } this.parent = parent; } public void replaceBy(Element other) { if (parent == null) throw new RuntimeException("Node not attached to tree."); for (int i=0; i action) { action.accept(this.funcNameId); action.accept(this.args); } public int size() { return 2; } @Override public Annotation copy() { Annotation result = new AnnotationImpl(source, (Identifier) this.funcNameId.copy(), (Arguments) this.args.copy()); return result; } @Override public Annotation copyWithRefs() { Annotation res = copy(); return res; } @Override public void clearAttributes() { funcNameId.clearAttributes(); args.clearAttributes(); clearAttributesLocal(); } @Override public void clearAttributesLocal() { zzattr_attrPossibleFuncDefs_state = 0; zzattr_attrFuncLink_state = 0; } @Override public void accept(Visitor v) { v.visit(this); } @Override public T match(Modifier.Matcher matcher) { return matcher.case_Annotation(this); } @Override public void match(Modifier.MatcherVoid matcher) { matcher.case_Annotation(this); } @Override public T match(FuncRef.Matcher matcher) { return matcher.case_Annotation(this); } @Override public void match(FuncRef.MatcherVoid matcher) { matcher.case_Annotation(this); } @Override public T match(AstElementWithSource.Matcher matcher) { return matcher.case_Annotation(this); } @Override public void match(AstElementWithSource.MatcherVoid matcher) { matcher.case_Annotation(this); } @Override public T match(Element.Matcher matcher) { return matcher.case_Annotation(this); } @Override public void match(Element.MatcherVoid matcher) { matcher.case_Annotation(this); } @Override public String toString() { return "Annotation(" + source + ", " +funcNameId + ", " +args+")"; } public boolean structuralEquals(Element e) { if (e instanceof Annotation) { Annotation o = (Annotation) e; return this.funcNameId.structuralEquals(o.getFuncNameId()) && this.args.structuralEquals(o.getArgs()); } else { return false; } } /** */ public boolean attrIsDynamicContext() { return de.peeeq.wurstscript.attributes.IsDynamicContext.calculate((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable PackageOrGlobal attrNearestPackage() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestPackage((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable NamedScope attrNearestNamedScope() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestNamedScope((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable WScope attrNearestScope() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestScope((Annotation)this); } /** */ public String attrPathDescription() { return de.peeeq.wurstscript.attributes.PathDescription.get((Annotation)this); } /** */ public CompilationUnit attrCompilationUnit() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestCompilationUnit((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable ClassDef attrNearestClassDef() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestClassDef((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable ClassOrInterface attrNearestClassOrInterface() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestClassOrInterface((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable ClassOrModule attrNearestClassOrModule() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestClassOrModule((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable StructureDef attrNearestStructureDef() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestStructureDef((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable FunctionImplementation attrNearestFuncDef() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestFuncDef((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable ExprClosure attrNearestExprClosure() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestExprClosure((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable ExprStatementsBlock attrNearestExprStatementsBlock() { return de.peeeq.wurstscript.attributes.AttrNearest.nearestExprStatementsBlock((Annotation)this); } /** "returns the element itself if it is a NameDef or returns the referenced NameDef if the elem is a reference or returns null otherwise "*/ public @org.eclipse.jdt.annotation.Nullable NameDef tryGetNameDef() { return de.peeeq.wurstscript.attributes.AttrNameDef.tryGetNameDef((Annotation)this); } /** */ public de.peeeq.wurstscript.parser.WPos attrSource() { return de.peeeq.wurstscript.attributes.AttrPos.getPos((Annotation)this); } /** "returns the position where errors are marked"*/ public de.peeeq.wurstscript.parser.WPos attrErrorPos() { return de.peeeq.wurstscript.attributes.AttrPos.getErrorPos((Annotation)this); } /** */ public WurstModel getModel() { return de.peeeq.wurstscript.attributes.AttrImportedPackage.getModel((Annotation)this); } /** */ public void addError(String msg) { de.peeeq.wurstscript.attributes.ErrorHandling.addError((Annotation)this, msg); } /** */ public void addWarning(String msg) { de.peeeq.wurstscript.attributes.ErrorHandling.addWarning((Annotation)this, msg); } /** */ public de.peeeq.wurstscript.attributes.ErrorHandler getErrorHandler() { return de.peeeq.wurstscript.attributes.ErrorHandling.getErrorHandler((Annotation)this); } // circular = null private int zzattr_attrPossibleFuncDefs_state = 0; private com.google.common.collect.ImmutableCollection zzattr_attrPossibleFuncDefs_cache; /** */ public com.google.common.collect.ImmutableCollection attrPossibleFuncDefs() { if (zzattr_attrPossibleFuncDefs_state == 0) { try { zzattr_attrPossibleFuncDefs_state = 1; zzattr_attrPossibleFuncDefs_cache = de.peeeq.wurstscript.attributes.PossibleFuncDefs.calculate((Annotation)this); } finally { zzattr_attrPossibleFuncDefs_state = 0; } zzattr_attrPossibleFuncDefs_state = 2; } else if (zzattr_attrPossibleFuncDefs_state == 1) { throw new CyclicDependencyError(this, "attrPossibleFuncDefs"); } return zzattr_attrPossibleFuncDefs_cache; } // circular = null private int zzattr_attrFuncLink_state = 0; private de.peeeq.wurstscript.attributes.names.FuncLink zzattr_attrFuncLink_cache; /** */ public de.peeeq.wurstscript.attributes.names.FuncLink attrFuncLink() { if (zzattr_attrFuncLink_state == 0) { try { zzattr_attrFuncLink_state = 1; zzattr_attrFuncLink_cache = de.peeeq.wurstscript.attributes.AttrFuncDef.calculate((Annotation)this); } finally { zzattr_attrFuncLink_state = 0; } zzattr_attrFuncLink_state = 2; } else if (zzattr_attrFuncLink_state == 1) { throw new CyclicDependencyError(this, "attrFuncLink"); } return zzattr_attrFuncLink_cache; } /** */ public FunctionDefinition attrFuncDef() { return de.peeeq.wurstscript.attributes.AttrFuncDef.calculateDef((Annotation)this); } /** */ public @org.eclipse.jdt.annotation.Nullable TypeDef lookupType(String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupType((Annotation)this, name, showErrors); } /** */ public de.peeeq.wurstscript.attributes.names.PackageLink lookupPackage(String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupPackage((Annotation)this, name, showErrors); } /** */ public de.peeeq.wurstscript.attributes.names.NameLink lookupVar(String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupVar((Annotation)this, name, showErrors); } /** */ public de.peeeq.wurstscript.attributes.names.NameLink lookupVarNoConfig(String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupVarNoConfig((Annotation)this, name, showErrors); } /** */ public de.peeeq.wurstscript.attributes.names.NameLink lookupMemberVar(de.peeeq.wurstscript.types.WurstType receiverType, String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupMemberVar((Annotation)this, receiverType, name, showErrors); } /** */ public com.google.common.collect.ImmutableCollection lookupFuncs(String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncs((Annotation)this, name, showErrors); } /** */ public com.google.common.collect.ImmutableCollection lookupFuncsNoConfig(String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncsNoConfig((Annotation)this, name, showErrors); } /** */ public com.google.common.collect.ImmutableCollection lookupMemberFuncs(de.peeeq.wurstscript.types.WurstType receiverType, String name, boolean showErrors) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupMemberFuncs((Annotation)this, receiverType, name, showErrors); } /** */ public @org.eclipse.jdt.annotation.Nullable TypeDef lookupType(String name) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupTypeShort((Annotation)this, name); } /** */ public de.peeeq.wurstscript.attributes.names.PackageLink lookupPackage(String name) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupPackageShort((Annotation)this, name); } /** */ public de.peeeq.wurstscript.attributes.names.NameLink lookupVar(String name) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupVarShort((Annotation)this, name); } /** */ public de.peeeq.wurstscript.attributes.names.NameLink lookupMemberVar(de.peeeq.wurstscript.types.WurstType receiverType, String name) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupMemberVarShort((Annotation)this, receiverType, name); } /** */ public com.google.common.collect.ImmutableCollection lookupFuncs(String name) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncsShort((Annotation)this, name); } /** */ public com.google.common.collect.ImmutableCollection lookupMemberFuncs(de.peeeq.wurstscript.types.WurstType receiverType, String name) { return de.peeeq.wurstscript.attributes.names.NameResolution.lookupMemberFuncsShort((Annotation)this, receiverType, name); } /** */ public com.google.common.collect.ImmutableCollection attrUsedPackages() { return de.peeeq.wurstscript.attributes.UsedPackages.usedPackages((Annotation)this); } /** */ public String description() { return de.peeeq.wurstscript.attributes.Description.description((Annotation)this); } /** */ public String descriptionHtml() { return de.peeeq.wurstscript.attributes.DescriptionHtml.description((Annotation)this); } /** */ public boolean isSubtreeOf(Element other) { return de.peeeq.wurstscript.attributes.SmallHelpers.isSubtreeOf((Annotation)this, other); } /** */ public void prettyPrint(de.peeeq.wurstscript.attributes.prettyPrint.Spacer spacer, StringBuilder sb, int indent) { de.peeeq.wurstscript.attributes.prettyPrint.PrettyPrinter.prettyPrint((Annotation)this, spacer, sb, indent); } /** */ public String getFuncName() { return de.peeeq.wurstscript.attributes.SmallHelpers.getFuncName((Annotation)this); } /** */ public String getAnnotationType() { return de.peeeq.wurstscript.attributes.Annotations.annotationType((Annotation)this); } /** */ public String getAnnotationMessage() { return de.peeeq.wurstscript.attributes.Annotations.annotationMessage((Annotation)this); } }