org.extendj.ast.ParameterDeclaration Maven / Gradle / Ivy
/* This file was generated with JastAdd2 (http://jastadd.org) version 2.3.0 */
package org.extendj.ast;
import java.util.ArrayList;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.IOException;
import java.util.Set;
import beaver.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.LinkedHashSet;
import java.util.*;
import org.jastadd.util.PrettyPrintable;
import org.jastadd.util.PrettyPrinter;
import java.util.zip.*;
import java.io.*;
import org.jastadd.util.*;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
/**
* A parameter declaration as used in either method parameter lists
* or as a catch clause parameter.
* @ast node
* @declaredat /home/jesper/git/extendj/java4/grammar/Java.ast:208
* @astdecl ParameterDeclaration : ASTNode ::= Modifiers TypeAccess:Access ;
* @production ParameterDeclaration : {@link ASTNode} ::= {@link Modifiers} TypeAccess:{@link Access} <ID:String>;
*/
public class ParameterDeclaration extends ASTNode implements Cloneable, SimpleSet, Variable {
/**
* @aspect Java4PrettyPrint
* @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd:533
*/
public void prettyPrint(PrettyPrinter out) {
out.print(getModifiers());
out.print(getTypeAccess());
out.print(" ");
out.print(getID());
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:335
*/
@Override
public int size() {
return 1;
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:340
*/
@Override
public boolean isEmpty() {
return false;
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:345
*/
@Override
public SimpleSet add(Variable o) {
return new SimpleSetImpl(this, o);
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:350
*/
@Override
public boolean contains(Object o) {
return this == o;
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:355
*/
@Override
public boolean isSingleton() {
return true;
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:360
*/
@Override
public boolean isSingleton(Variable o) {
return contains(o);
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:365
*/
@Override
public Variable singletonValue() {
return this;
}
/**
* @aspect DataStructures
* @declaredat /home/jesper/git/extendj/java4/frontend/DataStructures.jrag:370
*/
@Override
public Iterator iterator() {
return new SingleItemIterator(this);
}
/**
* @aspect PrettyPrintUtil
* @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:137
*/
@Override public String toString() {
return String.format("%s %s",
getTypeAccessNoTransform().toString(),
getID());
}
/**
* @aspect NodeConstructors
* @declaredat /home/jesper/git/extendj/java4/frontend/NodeConstructors.jrag:32
*/
public ParameterDeclaration(Access type, String name) {
this(new Modifiers(new List()), type, name);
}
/**
* @aspect NodeConstructors
* @declaredat /home/jesper/git/extendj/java4/frontend/NodeConstructors.jrag:36
*/
public ParameterDeclaration(TypeDecl type, String name) {
this(new Modifiers(new List()), type.createQualifiedAccess(), name);
}
/**
* Builds a copy of this ParameterDeclaration node where all occurrences
* of type variables in the original type parameter list have been replaced
* by the substitution type parameters.
*
* This should only be used to generate candidate methods for Diamond type
* inference.
*
* @return the substituted ParameterDeclaration node
* @aspect Diamond
* @declaredat /home/jesper/git/extendj/java7/frontend/Diamond.jrag:228
*/
public ParameterDeclaration substituted(Collection original,
List substitution) {
return new ParameterDeclaration(
(Modifiers) getModifiers().treeCopyNoTransform(),
getTypeAccess().substituted(original, substitution),
getID());
}
/**
* @aspect CreateBCode
* @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:610
*/
public void emitLoadVariable(CodeGeneration gen, Access access) {
if (hostType() == access.hostType()) {
type().emitLoadLocal(gen, localNum());
} else {
access.emitLoadLocalInNestedClass(gen, this);
}
}
/** Generate bytecode to load this field.
* @aspect CodeGeneration
* @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:208
*/
public void emitLoadField(CodeGeneration gen, TypeDecl hostType) {
if (hostType().isArrayDecl() && name().equals("length")) {
gen.ARRAYLENGTH();
return;
}
String classname = hostType.constantPoolName();
String name = name();
int index = gen.constantPool().addFieldref(classname, name, type());
if (isStatic()) {
gen.GETSTATIC(index, type());
} else {
gen.GETFIELD(index, type());
}
}
/** Generate bytecode to store a field in the given hostType.
* @aspect CodeGeneration
* @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:270
*/
public void emitStoreField(CodeGeneration gen, TypeDecl hostType) {
String classname = hostType.constantPoolName();
String name = name();
int index = gen.constantPool().addFieldref(classname, name, type());
if (isStatic()) {
gen.PUTSTATIC(index);
} else {
gen.PUTFIELD(index);
}
}
/**
* @declaredat ASTNode:1
*/
public ParameterDeclaration() {
super();
}
/**
* Initializes the child array to the correct size.
* Initializes List and Opt nta children.
* @apilevel internal
* @ast method
* @declaredat ASTNode:10
*/
public void init$Children() {
children = new ASTNode[2];
}
/**
* @declaredat ASTNode:13
*/
@ASTNodeAnnotation.Constructor(
name = {"Modifiers", "TypeAccess", "ID"},
type = {"Modifiers", "Access", "String"},
kind = {"Child", "Child", "Token"}
)
public ParameterDeclaration(Modifiers p0, Access p1, String p2) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
}
/**
* @declaredat ASTNode:23
*/
public ParameterDeclaration(Modifiers p0, Access p1, beaver.Symbol p2) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
}
/** @apilevel low-level
* @declaredat ASTNode:29
*/
protected int numChildren() {
return 2;
}
/**
* @apilevel internal
* @declaredat ASTNode:35
*/
public boolean mayHaveRewrite() {
return false;
}
/** @apilevel internal
* @declaredat ASTNode:39
*/
public void flushAttrCache() {
super.flushAttrCache();
type_reset();
throwTypes_reset();
inferredReferenceAccess_TypeAccess_reset();
enclosingLambda_reset();
localNum_reset();
}
/** @apilevel internal
* @declaredat ASTNode:48
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/** @apilevel internal
* @declaredat ASTNode:52
*/
public ParameterDeclaration clone() throws CloneNotSupportedException {
ParameterDeclaration node = (ParameterDeclaration) super.clone();
return node;
}
/** @apilevel internal
* @declaredat ASTNode:57
*/
public ParameterDeclaration copy() {
try {
ParameterDeclaration node = (ParameterDeclaration) clone();
node.parent = null;
if (children != null) {
node.children = (ASTNode[]) children.clone();
}
return node;
} catch (CloneNotSupportedException e) {
throw new Error("Error: clone not supported for " + getClass().getName());
}
}
/**
* Create a deep copy of the AST subtree at this node.
* The copy is dangling, i.e. has no parent.
* @return dangling copy of the subtree at this node
* @apilevel low-level
* @deprecated Please use treeCopy or treeCopyNoTransform instead
* @declaredat ASTNode:76
*/
@Deprecated
public ParameterDeclaration fullCopy() {
return treeCopyNoTransform();
}
/**
* Create a deep copy of the AST subtree at this node.
* The copy is dangling, i.e. has no parent.
* @return dangling copy of the subtree at this node
* @apilevel low-level
* @declaredat ASTNode:86
*/
public ParameterDeclaration treeCopyNoTransform() {
ParameterDeclaration tree = (ParameterDeclaration) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
ASTNode child = (ASTNode) children[i];
if (child != null) {
child = child.treeCopyNoTransform();
tree.setChild(child, i);
}
}
}
return tree;
}
/**
* Create a deep copy of the AST subtree at this node.
* The subtree of this node is traversed to trigger rewrites before copy.
* The copy is dangling, i.e. has no parent.
* @return dangling copy of the subtree at this node
* @apilevel low-level
* @declaredat ASTNode:106
*/
public ParameterDeclaration treeCopy() {
ParameterDeclaration tree = (ParameterDeclaration) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
ASTNode child = (ASTNode) getChild(i);
if (child != null) {
child = child.treeCopy();
tree.setChild(child, i);
}
}
}
return tree;
}
/** @apilevel internal
* @declaredat ASTNode:120
*/
protected boolean is$Equal(ASTNode node) {
return super.is$Equal(node) && (tokenString_ID == ((ParameterDeclaration) node).tokenString_ID);
}
/**
* Replaces the Modifiers child.
* @param node The new node to replace the Modifiers child.
* @apilevel high-level
*/
public void setModifiers(Modifiers node) {
setChild(node, 0);
}
/**
* Retrieves the Modifiers child.
* @return The current node used as the Modifiers child.
* @apilevel high-level
*/
@ASTNodeAnnotation.Child(name="Modifiers")
public Modifiers getModifiers() {
return (Modifiers) getChild(0);
}
/**
* Retrieves the Modifiers child.
* This method does not invoke AST transformations.
* @return The current node used as the Modifiers child.
* @apilevel low-level
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers) getChildNoTransform(0);
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
*/
public void setTypeAccess(Access node) {
setChild(node, 1);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
*/
@ASTNodeAnnotation.Child(name="TypeAccess")
public Access getTypeAccess() {
return (Access) getChild(1);
}
/**
* Retrieves the TypeAccess child.
* This method does not invoke AST transformations.
* @return The current node used as the TypeAccess child.
* @apilevel low-level
*/
public Access getTypeAccessNoTransform() {
return (Access) getChildNoTransform(1);
}
/**
* Replaces the lexeme ID.
* @param value The new value for the lexeme ID.
* @apilevel high-level
*/
public void setID(String value) {
tokenString_ID = value;
}
/** @apilevel internal
*/
protected String tokenString_ID;
/**
*/
public int IDstart;
/**
*/
public int IDend;
/**
* JastAdd-internal setter for lexeme ID using the Beaver parser.
* @param symbol Symbol containing the new value for the lexeme ID
* @apilevel internal
*/
public void setID(beaver.Symbol symbol) {
if (symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setID is only valid for String lexemes");
tokenString_ID = (String)symbol.value;
IDstart = symbol.getStart();
IDend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme ID.
* @return The value for the lexeme ID.
* @apilevel high-level
*/
@ASTNodeAnnotation.Token(name="ID")
public String getID() {
return tokenString_ID != null ? tokenString_ID : "";
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:73
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:73")
public boolean isParameter() {
boolean isParameter_value = true;
return isParameter_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:75
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:75")
public boolean isConstant() {
boolean isConstant_value = false;
return isConstant_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:76
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:76")
public boolean isPublic() {
boolean isPublic_value = false;
return isPublic_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:77
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:77")
public boolean accessibleFrom(TypeDecl type) {
boolean accessibleFrom_TypeDecl_value = false;
return accessibleFrom_TypeDecl_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:80
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:80")
public boolean isClassVariable() {
boolean isClassVariable_value = false;
return isClassVariable_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:81
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:81")
public boolean isInstanceVariable() {
boolean isInstanceVariable_value = false;
return isInstanceVariable_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:85
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:85")
public boolean isLocalVariable() {
boolean isLocalVariable_value = false;
return isLocalVariable_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:86
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:86")
public boolean isField() {
boolean isField_value = false;
return isField_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:104
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:104")
public boolean isFinal() {
boolean isFinal_value = getModifiers().isFinal();
return isFinal_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:105
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:105")
public boolean isVolatile() {
boolean isVolatile_value = getModifiers().isVolatile();
return isVolatile_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:106
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:106")
public boolean isBlank() {
boolean isBlank_value = true;
return isBlank_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:107
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:107")
public boolean isStatic() {
boolean isStatic_value = false;
return isStatic_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:109
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:109")
public String name() {
String name_value = getID();
return name_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:111
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:111")
public boolean hasInit() {
boolean hasInit_value = false;
return hasInit_value;
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:112
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:112")
public Expr getInit() {
{
throw new UnsupportedOperationException();
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:115
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:115")
public Constant constant() {
{
throw new UnsupportedOperationException();
}
}
/**
* @attribute syn
* @aspect PrettyPrintUtil
* @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:332
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="PrettyPrintUtil", declaredAt="/home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:332")
public boolean hasModifiers() {
boolean hasModifiers_value = getModifiers().getNumModifier() > 0;
return hasModifiers_value;
}
/** @apilevel internal */
private void type_reset() {
type_computed = null;
type_value = null;
}
/** @apilevel internal */
protected ASTState.Cycle type_computed = null;
/** @apilevel internal */
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:272
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="TypeAnalysis", declaredAt="/home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:272")
public TypeDecl type() {
ASTState state = state();
if (type_computed == ASTState.NON_CYCLE || type_computed == state().cycle()) {
return type_value;
}
type_value = getTypeAccess().type();
if (state().inCircle()) {
type_computed = state().cycle();
} else {
type_computed = ASTState.NON_CYCLE;
}
return type_value;
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:253
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:253")
public boolean isSynthetic() {
boolean isSynthetic_value = getModifiers().isSynthetic();
return isSynthetic_value;
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /home/jesper/git/extendj/java4/frontend/NameCheck.jrag:486
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="NameCheck", declaredAt="/home/jesper/git/extendj/java4/frontend/NameCheck.jrag:486")
public Collection nameProblems() {
{
Collection problems = new LinkedList();
SimpleSet decls = outerScope().lookupVariable(name());
for (Variable var : decls) {
if (var instanceof VariableDeclarator) {
VariableDeclarator decl = (VariableDeclarator) var;
if (decl.enclosingBodyDecl() == enclosingBodyDecl()) {
problems.add(errorf("duplicate declaration of parameter %s", name()));
}
} else if (var instanceof ParameterDeclaration) {
ParameterDeclaration decl = (ParameterDeclaration) var;
if (decl.enclosingBodyDecl() == enclosingBodyDecl()) {
problems.add(errorf("duplicate declaration of parameter %s", name()));
}
} else if (var instanceof InferredParameterDeclaration) {
InferredParameterDeclaration decl = (InferredParameterDeclaration) var;
if (decl.enclosingBodyDecl() == enclosingBodyDecl()) {
problems.add(errorf("duplicate declaration of parameter %s", name()));
}
} else if (var instanceof CatchParameterDeclaration) {
CatchParameterDeclaration decl = (CatchParameterDeclaration) var;
if (decl.enclosingBodyDecl() == enclosingBodyDecl()) {
problems.add(errorf("duplicate declaration of parameter %s", name()));
}
}
}
// 8.4.1
if (!lookupVariable(name()).contains(this)) {
problems.add(errorf("duplicate declaration of parameter %s", name()));
}
return problems;
}
}
/**
* @attribute syn
* @aspect VariableArityParameters
* @declaredat /home/jesper/git/extendj/java5/frontend/VariableArityParameters.jrag:59
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="VariableArityParameters", declaredAt="/home/jesper/git/extendj/java5/frontend/VariableArityParameters.jrag:59")
public boolean isVariableArity() {
boolean isVariableArity_value = false;
return isVariableArity_value;
}
/**
* Creates a copy of this parameter declaration where parameterized types have been erased.
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1625
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="LookupParTypeDecl", declaredAt="/home/jesper/git/extendj/java5/frontend/Generics.jrag:1625")
public ParameterDeclaration erasedCopy() {
ParameterDeclaration erasedCopy_value = new ParameterDeclaration(
getModifiers().treeCopyNoTransform(),
getTypeAccess().erasedCopy(),
getID());
return erasedCopy_value;
}
/** @apilevel internal */
private void throwTypes_reset() {
throwTypes_computed = null;
throwTypes_value = null;
}
/** @apilevel internal */
protected ASTState.Cycle throwTypes_computed = null;
/** @apilevel internal */
protected Collection throwTypes_value;
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:47
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="PreciseRethrow", declaredAt="/home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:47")
public Collection throwTypes() {
ASTState state = state();
if (throwTypes_computed == ASTState.NON_CYCLE || throwTypes_computed == state().cycle()) {
return throwTypes_value;
}
throwTypes_value = throwTypes_compute();
if (state().inCircle()) {
throwTypes_computed = state().cycle();
} else {
throwTypes_computed = ASTState.NON_CYCLE;
}
return throwTypes_value;
}
/** @apilevel internal */
private Collection throwTypes_compute() {
if (isCatchParam() && isEffectivelyFinal()) {
// The catch parameter must be final to refine the throw type.
return catchClause().caughtExceptions();
} else {
return Collections.singleton(type());
}
}
/**
* Note: this attribute deviates from what the JLS says about "effectively final",
* simply because the attribute name would be too confusing if it did not return true
* when the variable was explicitly declared final. The JLS considers declared final
* and effectively final to be mutually exclusive, we don't.
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:65
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="PreciseRethrow", declaredAt="/home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:65")
public boolean isEffectivelyFinal() {
boolean isEffectivelyFinal_value = isFinal() || !inhModifiedInScope(this);
return isEffectivelyFinal_value;
}
/** @apilevel internal */
private void inferredReferenceAccess_TypeAccess_reset() {
inferredReferenceAccess_TypeAccess_values = null;
inferredReferenceAccess_TypeAccess_proxy = null;
}
/** @apilevel internal */
protected ASTNode inferredReferenceAccess_TypeAccess_proxy;
/** @apilevel internal */
protected java.util.Map inferredReferenceAccess_TypeAccess_values;
/**
* @attribute syn
* @aspect MethodReference
* @declaredat /home/jesper/git/extendj/java8/frontend/MethodReference.jrag:116
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN, isNTA=true)
@ASTNodeAnnotation.Source(aspect="MethodReference", declaredAt="/home/jesper/git/extendj/java8/frontend/MethodReference.jrag:116")
public ParTypeAccess inferredReferenceAccess(TypeAccess typeAccess) {
Object _parameters = typeAccess;
if (inferredReferenceAccess_TypeAccess_values == null) inferredReferenceAccess_TypeAccess_values = new java.util.HashMap(4);
ASTState state = state();
if (inferredReferenceAccess_TypeAccess_values.containsKey(_parameters)) {
return (ParTypeAccess) inferredReferenceAccess_TypeAccess_values.get(_parameters);
}
state().enterLazyAttribute();
ParTypeAccess inferredReferenceAccess_TypeAccess_value = inferredReferenceAccess_compute(typeAccess);
if (inferredReferenceAccess_TypeAccess_proxy == null) {
inferredReferenceAccess_TypeAccess_proxy = new ASTNode();
inferredReferenceAccess_TypeAccess_proxy.setParent(this);
}
if (inferredReferenceAccess_TypeAccess_value != null) {
inferredReferenceAccess_TypeAccess_value.setParent(inferredReferenceAccess_TypeAccess_proxy);
if (inferredReferenceAccess_TypeAccess_value.mayHaveRewrite()) {
inferredReferenceAccess_TypeAccess_value = (ParTypeAccess) inferredReferenceAccess_TypeAccess_value.rewrittenNode();
inferredReferenceAccess_TypeAccess_value.setParent(inferredReferenceAccess_TypeAccess_proxy);
}
}
inferredReferenceAccess_TypeAccess_values.put(_parameters, inferredReferenceAccess_TypeAccess_value);
state().leaveLazyAttribute();
return inferredReferenceAccess_TypeAccess_value;
}
/** @apilevel internal */
private ParTypeAccess inferredReferenceAccess_compute(TypeAccess typeAccess) {
if (!(getTypeAccess() instanceof ParTypeAccess)) {
return new ParTypeAccess((TypeAccess) typeAccess.treeCopy(), new List());
}
ParTypeAccess parTypeAccess = (ParTypeAccess) getTypeAccess();
return new ParTypeAccess((TypeAccess) typeAccess.treeCopy(),
(List) parTypeAccess.getTypeArgumentList().treeCopy());
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:278
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:278")
public boolean isProtected() {
boolean isProtected_value = getModifiers().isProtected();
return isProtected_value;
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:280
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:280")
public boolean isPrivate() {
boolean isPrivate_value = getModifiers().isPrivate();
return isPrivate_value;
}
/**
* @attribute syn
* @aspect GenericsCodegen
* @declaredat /home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:157
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="GenericsCodegen", declaredAt="/home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:157")
public TypeDecl erasedType() {
TypeDecl erasedType_value = type();
return erasedType_value;
}
/**
* @attribute inh
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:82
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:82")
public boolean isMethodParameter() {
boolean isMethodParameter_value = getParent().Define_isMethodParameter(this, null);
return isMethodParameter_value;
}
/**
* @attribute inh
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:83
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:83")
public boolean isConstructorParameter() {
boolean isConstructorParameter_value = getParent().Define_isConstructorParameter(this, null);
return isConstructorParameter_value;
}
/**
* @attribute inh
* @aspect Variables
* @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:84
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="Variables", declaredAt="/home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:84")
public boolean isExceptionHandlerParameter() {
boolean isExceptionHandlerParameter_value = getParent().Define_isExceptionHandlerParameter(this, null);
return isExceptionHandlerParameter_value;
}
/**
* @attribute inh
* @aspect VariableScope
* @declaredat /home/jesper/git/extendj/java4/frontend/LookupVariable.jrag:46
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="VariableScope", declaredAt="/home/jesper/git/extendj/java4/frontend/LookupVariable.jrag:46")
public SimpleSet lookupVariable(String name) {
SimpleSet lookupVariable_String_value = getParent().Define_lookupVariable(this, null, name);
return lookupVariable_String_value;
}
/**
* @attribute inh
* @aspect NestedTypes
* @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:656
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="NestedTypes", declaredAt="/home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:656")
public TypeDecl hostType() {
TypeDecl hostType_value = getParent().Define_hostType(this, null);
return hostType_value;
}
/**
* @attribute inh
* @aspect NameCheck
* @declaredat /home/jesper/git/extendj/java4/frontend/NameCheck.jrag:441
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="NameCheck", declaredAt="/home/jesper/git/extendj/java4/frontend/NameCheck.jrag:441")
public VariableScope outerScope() {
VariableScope outerScope_value = getParent().Define_outerScope(this, null);
return outerScope_value;
}
/**
* @attribute inh
* @aspect NameCheck
* @declaredat /home/jesper/git/extendj/java4/frontend/NameCheck.jrag:510
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="NameCheck", declaredAt="/home/jesper/git/extendj/java4/frontend/NameCheck.jrag:510")
public BodyDecl enclosingBodyDecl() {
BodyDecl enclosingBodyDecl_value = getParent().Define_enclosingBodyDecl(this, null);
return enclosingBodyDecl_value;
}
/**
* @return true if the variable var is modified in the local scope
* @attribute inh
* @aspect PreciseRethrow
* @declaredat /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:70
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="PreciseRethrow", declaredAt="/home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:70")
public boolean inhModifiedInScope(Variable var) {
boolean inhModifiedInScope_Variable_value = getParent().Define_inhModifiedInScope(this, null, var);
return inhModifiedInScope_Variable_value;
}
/**
* @return true if this is the parameter declaration of a catch clause
* @attribute inh
* @aspect PreciseRethrow
* @declaredat /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:202
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="PreciseRethrow", declaredAt="/home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:202")
public boolean isCatchParam() {
boolean isCatchParam_value = getParent().Define_isCatchParam(this, null);
return isCatchParam_value;
}
/**
* @attribute inh
* @aspect PreciseRethrow
* @declaredat /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:208
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="PreciseRethrow", declaredAt="/home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:208")
public CatchClause catchClause() {
CatchClause catchClause_value = getParent().Define_catchClause(this, null);
return catchClause_value;
}
/**
* @attribute inh
* @aspect EnclosingLambda
* @declaredat /home/jesper/git/extendj/java8/frontend/EnclosingLambda.jrag:34
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="EnclosingLambda", declaredAt="/home/jesper/git/extendj/java8/frontend/EnclosingLambda.jrag:34")
public LambdaExpr enclosingLambda() {
ASTState state = state();
if (enclosingLambda_computed == ASTState.NON_CYCLE || enclosingLambda_computed == state().cycle()) {
return enclosingLambda_value;
}
enclosingLambda_value = getParent().Define_enclosingLambda(this, null);
if (state().inCircle()) {
enclosingLambda_computed = state().cycle();
} else {
enclosingLambda_computed = ASTState.NON_CYCLE;
}
return enclosingLambda_value;
}
/** @apilevel internal */
private void enclosingLambda_reset() {
enclosingLambda_computed = null;
enclosingLambda_value = null;
}
/** @apilevel internal */
protected ASTState.Cycle enclosingLambda_computed = null;
/** @apilevel internal */
protected LambdaExpr enclosingLambda_value;
/**
* @attribute inh
* @aspect LocalNum
* @declaredat /home/jesper/git/extendj/java4/backend/LocalNum.jrag:65
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="LocalNum", declaredAt="/home/jesper/git/extendj/java4/backend/LocalNum.jrag:65")
public int localNum() {
ASTState state = state();
if (localNum_computed == ASTState.NON_CYCLE || localNum_computed == state().cycle()) {
return localNum_value;
}
localNum_value = getParent().Define_localNum(this, null);
if (state().inCircle()) {
localNum_computed = state().cycle();
} else {
localNum_computed = ASTState.NON_CYCLE;
}
return localNum_value;
}
/** @apilevel internal */
private void localNum_reset() {
localNum_computed = null;
}
/** @apilevel internal */
protected ASTState.Cycle localNum_computed = null;
/** @apilevel internal */
protected int localNum_value;
/**
* @attribute inh
* @aspect NestedTypes
* @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:637
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="NestedTypes", declaredAt="/home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:637")
public String hostPackage() {
String hostPackage_value = getParent().Define_hostPackage(this, null);
return hostPackage_value;
}
/**
* @attribute inh
* @aspect LookupParTypeDecl
* @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1400
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.INH)
@ASTNodeAnnotation.Source(aspect="LookupParTypeDecl", declaredAt="/home/jesper/git/extendj/java5/frontend/Generics.jrag:1400")
public FieldDecl fieldDecl() {
FieldDecl fieldDecl_value = getParent().Define_fieldDecl(this, null);
return fieldDecl_value;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:434
* @apilevel internal
*/
public boolean Define_mayBeFinal(ASTNode _callerNode, ASTNode _childNode) {
if (getModifiersNoTransform() != null && _callerNode == getModifiers()) {
// @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:339
return true;
}
else {
return getParent().Define_mayBeFinal(this, _callerNode);
}
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:434
* @apilevel internal
* @return {@code true} if this node has an equation for the inherited attribute mayBeFinal
*/
protected boolean canDefine_mayBeFinal(ASTNode _callerNode, ASTNode _childNode) {
return true;
}
/**
* @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:131
* @apilevel internal
*/
public boolean Define_mayUseAnnotationTarget(ASTNode _callerNode, ASTNode _childNode, String name) {
if (getModifiersNoTransform() != null && _callerNode == getModifiers()) {
// @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:150
return name.equals("PARAMETER");
}
else {
return getParent().Define_mayUseAnnotationTarget(this, _callerNode, name);
}
}
/**
* @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:131
* @apilevel internal
* @return {@code true} if this node has an equation for the inherited attribute mayUseAnnotationTarget
*/
protected boolean canDefine_mayUseAnnotationTarget(ASTNode _callerNode, ASTNode _childNode, String name) {
return true;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/SyntacticClassification.jrag:36
* @apilevel internal
*/
public NameType Define_nameType(ASTNode _callerNode, ASTNode _childNode) {
if (getTypeAccessNoTransform() != null && _callerNode == getTypeAccess()) {
// @declaredat /home/jesper/git/extendj/java5/frontend/Enums.jrag:99
return NameType.TYPE_NAME;
}
else {
return getParent().Define_nameType(this, _callerNode);
}
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/SyntacticClassification.jrag:36
* @apilevel internal
* @return {@code true} if this node has an equation for the inherited attribute nameType
*/
protected boolean canDefine_nameType(ASTNode _callerNode, ASTNode _childNode) {
return true;
}
/** @apilevel internal */
public ASTNode rewriteTo() {
return super.rewriteTo();
}
/** @apilevel internal */
public boolean canRewrite() {
return false;
}
/** @apilevel internal */
protected void collect_contributors_CompilationUnit_problems(CompilationUnit _root, java.util.Map> _map) {
// @declaredat /home/jesper/git/extendj/java4/frontend/NameCheck.jrag:484
{
java.util.Set contributors = _map.get(_root);
if (contributors == null) {
contributors = new java.util.LinkedHashSet();
_map.put((ASTNode) _root, contributors);
}
contributors.add(this);
}
super.collect_contributors_CompilationUnit_problems(_root, _map);
}
/** @apilevel internal */
protected void contributeTo_CompilationUnit_problems(LinkedList collection) {
super.contributeTo_CompilationUnit_problems(collection);
for (Problem value : nameProblems()) {
collection.add(value);
}
}
}