All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.extendj.ast.FieldDecl Maven / Gradle / Ivy

The newest version!
/* 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;
/**
 * @ast node
 * @declaredat /home/jesper/git/extendj/java4/grammar/Java.ast:194
 * @astdecl FieldDecl : MemberDecl ::= Modifiers TypeAccess:Access Declarator:FieldDeclarator*;
 * @production FieldDecl : {@link MemberDecl} ::= {@link Modifiers} TypeAccess:{@link Access} Declarator:{@link FieldDeclarator}*;

 */
public class FieldDecl extends MemberDecl implements Cloneable {
  /**
   * @aspect Java4PrettyPrint
   * @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd:363
   */
  public void prettyPrint(PrettyPrinter out) {
    if (!isSynthetic()) {
      if (hasDocComment()) {
        out.print(docComment());
      }
      if (!out.isNewLine()) {
        out.println();
      }
      out.print(getModifiers());
      out.print(getTypeAccess());
      out.print(" ");
      out.join(getDeclarators(), new PrettyPrinter.Joiner() {
        @Override
        public void printSeparator(PrettyPrinter out) {
          out.print(", ");
        }
      });
      out.print(";");
    }
  }
  /**
   * @aspect LookupParTypeDecl
   * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1487
   */
  public BodyDecl signatureCopy() {
    List decls = new List();
    for (FieldDeclarator decl : getDeclaratorList()) {
      decls.add(decl.signatureCopy());
    }
    return new FieldDeclSubstituted(
        getModifiers().treeCopyNoTransform(),
        getTypeAccessNoTransform().treeCopyNoTransform(),
        decls,
        this);
  }
  /**
   * @aspect LookupParTypeDecl
   * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1584
   */
  public BodyDecl erasedCopy() {
    List decls = new List();
    for (FieldDeclarator decl : getDeclaratorList()) {
      decls.add(decl.signatureCopy());
    }
    return new FieldDeclSubstituted(
        getModifiers().treeCopyNoTransform(),
        getTypeAccess().erasedCopy(),
        decls,
        this);
  }
  /**
   * @declaredat ASTNode:1
   */
  public FieldDecl() {
    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[3];
    setChild(new List(), 2);
  }
  /**
   * @declaredat ASTNode:14
   */
  @ASTNodeAnnotation.Constructor(
    name = {"Modifiers", "TypeAccess", "Declarator"},
    type = {"Modifiers", "Access", "List"},
    kind = {"Child", "Child", "List"}
  )
  public FieldDecl(Modifiers p0, Access p1, List p2) {
    setChild(p0, 0);
    setChild(p1, 1);
    setChild(p2, 2);
  }
  /** @apilevel low-level 
   * @declaredat ASTNode:25
   */
  protected int numChildren() {
    return 3;
  }
  /**
   * @apilevel internal
   * @declaredat ASTNode:31
   */
  public boolean mayHaveRewrite() {
    return false;
  }
  /** @apilevel internal 
   * @declaredat ASTNode:35
   */
  public void flushAttrCache() {
    super.flushAttrCache();
    assignedAfter_Variable_reset();
    unassignedAfter_Variable_reset();
    usesTypeVariable_reset();
    hasInit_reset();
  }
  /** @apilevel internal 
   * @declaredat ASTNode:43
   */
  public void flushCollectionCache() {
    super.flushCollectionCache();
  }
  /** @apilevel internal 
   * @declaredat ASTNode:47
   */
  public FieldDecl clone() throws CloneNotSupportedException {
    FieldDecl node = (FieldDecl) super.clone();
    return node;
  }
  /** @apilevel internal 
   * @declaredat ASTNode:52
   */
  public FieldDecl copy() {
    try {
      FieldDecl node = (FieldDecl) 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:71
   */
  @Deprecated
  public FieldDecl 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:81
   */
  public FieldDecl treeCopyNoTransform() {
    FieldDecl tree = (FieldDecl) 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:101
   */
  public FieldDecl treeCopy() {
    FieldDecl tree = (FieldDecl) 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:115
   */
  protected boolean is$Equal(ASTNode node) {
    return super.is$Equal(node);    
  }
  /**
   * 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 Declarator list. * @param list The new list node to be used as the Declarator list. * @apilevel high-level */ public void setDeclaratorList(List list) { setChild(list, 2); } /** * Retrieves the number of children in the Declarator list. * @return Number of children in the Declarator list. * @apilevel high-level */ public int getNumDeclarator() { return getDeclaratorList().getNumChild(); } /** * Retrieves the number of children in the Declarator list. * Calling this method will not trigger rewrites. * @return Number of children in the Declarator list. * @apilevel low-level */ public int getNumDeclaratorNoTransform() { return getDeclaratorListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Declarator list. * @param i Index of the element to return. * @return The element at position {@code i} in the Declarator list. * @apilevel high-level */ public FieldDeclarator getDeclarator(int i) { return (FieldDeclarator) getDeclaratorList().getChild(i); } /** * Check whether the Declarator list has any children. * @return {@code true} if it has at least one child, {@code false} otherwise. * @apilevel high-level */ public boolean hasDeclarator() { return getDeclaratorList().getNumChild() != 0; } /** * Append an element to the Declarator list. * @param node The element to append to the Declarator list. * @apilevel high-level */ public void addDeclarator(FieldDeclarator node) { List list = (parent == null) ? getDeclaratorListNoTransform() : getDeclaratorList(); list.addChild(node); } /** @apilevel low-level */ public void addDeclaratorNoTransform(FieldDeclarator node) { List list = getDeclaratorListNoTransform(); list.addChild(node); } /** * Replaces the Declarator list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level */ public void setDeclarator(FieldDeclarator node, int i) { List list = getDeclaratorList(); list.setChild(node, i); } /** * Retrieves the Declarator list. * @return The node representing the Declarator list. * @apilevel high-level */ @ASTNodeAnnotation.ListChild(name="Declarator") public List getDeclaratorList() { List list = (List) getChild(2); return list; } /** * Retrieves the Declarator list. *

This method does not invoke AST transformations.

* @return The node representing the Declarator list. * @apilevel low-level */ public List getDeclaratorListNoTransform() { return (List) getChildNoTransform(2); } /** * @return the element at index {@code i} in the Declarator list without * triggering rewrites. */ public FieldDeclarator getDeclaratorNoTransform(int i) { return (FieldDeclarator) getDeclaratorListNoTransform().getChildNoTransform(i); } /** * Retrieves the Declarator list. * @return The node representing the Declarator list. * @apilevel high-level */ public List getDeclarators() { return getDeclaratorList(); } /** * Retrieves the Declarator list. *

This method does not invoke AST transformations.

* @return The node representing the Declarator list. * @apilevel low-level */ public List getDeclaratorsNoTransform() { return getDeclaratorListNoTransform(); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:358 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="ConstantExpression", declaredAt="/home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:358") public boolean isConstant() { { if (!isFinal()) { return false; } for (FieldDeclarator decl : getDeclaratorList()) { TypeDecl type = decl.type(); if (!decl.hasInit() || !decl.getInit().isConstant() || !(decl.type() instanceof PrimitiveType || decl.type().isString())) { return false; } } return true; } } /** @return {@code true} if the field declaration is inside this node. * @attribute syn * @aspect DeclareBeforeUse * @declaredat /home/jesper/git/extendj/java4/frontend/DeclareBeforeUse.jrag:46 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="DeclareBeforeUse", declaredAt="/home/jesper/git/extendj/java4/frontend/DeclareBeforeUse.jrag:46") public boolean declaredIn(Variable decl) { { for (FieldDeclarator field : getDeclaratorList()) { if (field == decl) { return true; } } return declaredBefore(decl); } } /** * @attribute syn * @aspect PrettyPrintUtil * @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:328 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="PrettyPrintUtil", declaredAt="/home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:328") public boolean hasModifiers() { boolean hasModifiers_value = getModifiers().getNumModifier() > 0; return hasModifiers_value; } /** * @attribute syn * @aspect TypeAnalysis * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:268 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="TypeAnalysis", declaredAt="/home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:268") public TypeDecl type() { TypeDecl type_value = getTypeAccess().type(); return type_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:128 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:128") public Collection modifierProblems() { { Collection problems = new LinkedList(); if (hostType().isInterfaceDecl()) { if (isProtected()) { problems.add(error("an interface field may not be protected")); } if (isPrivate()) { problems.add(error("an interface field may not be private")); } if (isTransient()) { problems.add(error("an interface field may not be transient")); } if (isVolatile()) { problems.add(error("an interface field may not be volatile")); } } return problems; } } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:247 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:247") public boolean isSynthetic() { boolean isSynthetic_value = getModifiers().isSynthetic(); return isSynthetic_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:282 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:282") public boolean isPublic() { boolean isPublic_value = getModifiers().isPublic() || hostType().isInterfaceDecl(); return isPublic_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:284 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:284") public boolean isPrivate() { boolean isPrivate_value = getModifiers().isPrivate(); return isPrivate_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:285 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:285") public boolean isProtected() { boolean isProtected_value = getModifiers().isProtected(); return isProtected_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:286 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:286") public boolean isStatic() { boolean isStatic_value = getModifiers().isStatic() || hostType().isInterfaceDecl(); return isStatic_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:288 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:288") public boolean isFinal() { boolean isFinal_value = getModifiers().isFinal() || hostType().isInterfaceDecl(); return isFinal_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:289 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:289") public boolean isTransient() { boolean isTransient_value = getModifiers().isTransient(); return isTransient_value; } /** * @attribute syn * @aspect Modifiers * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:290 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Modifiers", declaredAt="/home/jesper/git/extendj/java4/frontend/Modifiers.jrag:290") public boolean isVolatile() { boolean isVolatile_value = getModifiers().isVolatile(); return isVolatile_value; } /** @apilevel internal */ private void assignedAfter_Variable_reset() { assignedAfter_Variable_values = null; } protected java.util.Map assignedAfter_Variable_values; @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN, isCircular=true) @ASTNodeAnnotation.Source(aspect="DefiniteAssignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:272") public boolean assignedAfter(Variable v) { Object _parameters = v; if (assignedAfter_Variable_values == null) assignedAfter_Variable_values = new java.util.HashMap(4); ASTState.CircularValue _value; if (assignedAfter_Variable_values.containsKey(_parameters)) { Object _cache = assignedAfter_Variable_values.get(_parameters); if (!(_cache instanceof ASTState.CircularValue)) { return (Boolean) _cache; } else { _value = (ASTState.CircularValue) _cache; } } else { _value = new ASTState.CircularValue(); assignedAfter_Variable_values.put(_parameters, _value); _value.value = true; } ASTState state = state(); if (!state.inCircle() || state.calledByLazyAttribute()) { state.enterCircle(); boolean new_assignedAfter_Variable_value; do { _value.cycle = state.nextCycle(); new_assignedAfter_Variable_value = getDeclarator(getNumDeclarator() - 1).assignedAfter(v); if (((Boolean)_value.value) != new_assignedAfter_Variable_value) { state.setChangeInCycle(); _value.value = new_assignedAfter_Variable_value; } } while (state.testAndClearChangeInCycle()); assignedAfter_Variable_values.put(_parameters, new_assignedAfter_Variable_value); state.leaveCircle(); return new_assignedAfter_Variable_value; } else if (_value.cycle != state.cycle()) { _value.cycle = state.cycle(); boolean new_assignedAfter_Variable_value = getDeclarator(getNumDeclarator() - 1).assignedAfter(v); if (((Boolean)_value.value) != new_assignedAfter_Variable_value) { state.setChangeInCycle(); _value.value = new_assignedAfter_Variable_value; } return new_assignedAfter_Variable_value; } else { return (Boolean) _value.value; } } /** @apilevel internal */ private void unassignedAfter_Variable_reset() { unassignedAfter_Variable_values = null; } protected java.util.Map unassignedAfter_Variable_values; @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN, isCircular=true) @ASTNodeAnnotation.Source(aspect="DefiniteUnassignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:911") public boolean unassignedAfter(Variable v) { Object _parameters = v; if (unassignedAfter_Variable_values == null) unassignedAfter_Variable_values = new java.util.HashMap(4); ASTState.CircularValue _value; if (unassignedAfter_Variable_values.containsKey(_parameters)) { Object _cache = unassignedAfter_Variable_values.get(_parameters); if (!(_cache instanceof ASTState.CircularValue)) { return (Boolean) _cache; } else { _value = (ASTState.CircularValue) _cache; } } else { _value = new ASTState.CircularValue(); unassignedAfter_Variable_values.put(_parameters, _value); _value.value = true; } ASTState state = state(); if (!state.inCircle() || state.calledByLazyAttribute()) { state.enterCircle(); boolean new_unassignedAfter_Variable_value; do { _value.cycle = state.nextCycle(); new_unassignedAfter_Variable_value = getDeclarator(getNumDeclarator() - 1).unassignedAfter(v); if (((Boolean)_value.value) != new_unassignedAfter_Variable_value) { state.setChangeInCycle(); _value.value = new_unassignedAfter_Variable_value; } } while (state.testAndClearChangeInCycle()); unassignedAfter_Variable_values.put(_parameters, new_unassignedAfter_Variable_value); state.leaveCircle(); return new_unassignedAfter_Variable_value; } else if (_value.cycle != state.cycle()) { _value.cycle = state.cycle(); boolean new_unassignedAfter_Variable_value = getDeclarator(getNumDeclarator() - 1).unassignedAfter(v); if (((Boolean)_value.value) != new_unassignedAfter_Variable_value) { state.setChangeInCycle(); _value.value = new_unassignedAfter_Variable_value; } return new_unassignedAfter_Variable_value; } else { return (Boolean) _value.value; } } /** * @attribute syn * @aspect Annotations * @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:425 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="Annotations", declaredAt="/home/jesper/git/extendj/java5/frontend/Annotations.jrag:425") public boolean hasAnnotationSuppressWarnings(String annot) { boolean hasAnnotationSuppressWarnings_String_value = getModifiers().hasAnnotationSuppressWarnings(annot); return hasAnnotationSuppressWarnings_String_value; } /** @apilevel internal */ private void usesTypeVariable_reset() { usesTypeVariable_computed = null; } /** @apilevel internal */ protected ASTState.Cycle usesTypeVariable_computed = null; /** @apilevel internal */ protected boolean usesTypeVariable_value; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1331 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="LookupParTypeDecl", declaredAt="/home/jesper/git/extendj/java5/frontend/Generics.jrag:1331") public boolean usesTypeVariable() { ASTState state = state(); if (usesTypeVariable_computed == ASTState.NON_CYCLE || usesTypeVariable_computed == state().cycle()) { return usesTypeVariable_value; } usesTypeVariable_value = getTypeAccess().usesTypeVariable(); if (state().inCircle()) { usesTypeVariable_computed = state().cycle(); } else { usesTypeVariable_computed = ASTState.NON_CYCLE; } return usesTypeVariable_value; } /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1730 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="LookupParTypeDecl", declaredAt="/home/jesper/git/extendj/java5/frontend/Generics.jrag:1730") public boolean isSubstitutable() { boolean isSubstitutable_value = !isStatic(); return isSubstitutable_value; } /** * @attribute syn * @aspect GenericsParTypeDecl * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsParTypeDecl.jrag:100 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="GenericsParTypeDecl", declaredAt="/home/jesper/git/extendj/java5/frontend/GenericsParTypeDecl.jrag:100") public boolean visibleTypeParameters() { boolean visibleTypeParameters_value = !isStatic(); return visibleTypeParameters_value; } /** @apilevel internal */ private void hasInit_reset() { hasInit_computed = null; } /** @apilevel internal */ protected ASTState.Cycle hasInit_computed = null; /** @apilevel internal */ protected boolean hasInit_value; /** * @return {@code true} if any of the contained field declarations has an * initializer * @attribute syn * @aspect CreateBCode * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:64 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="CreateBCode", declaredAt="/home/jesper/git/extendj/java4/backend/CreateBCode.jrag:64") public boolean hasInit() { ASTState state = state(); if (hasInit_computed == ASTState.NON_CYCLE || hasInit_computed == state().cycle()) { return hasInit_value; } hasInit_value = hasInit_compute(); if (state().inCircle()) { hasInit_computed = state().cycle(); } else { hasInit_computed = ASTState.NON_CYCLE; } return hasInit_value; } /** @apilevel internal */ private boolean hasInit_compute() { for (FieldDeclarator decl : getDeclaratorList()) { if (decl.hasInit()) { return true; } } return false; } /** * @attribute syn * @aspect InnerClasses * @declaredat /home/jesper/git/extendj/java4/backend/InnerClasses.jrag:48 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="InnerClasses", declaredAt="/home/jesper/git/extendj/java4/backend/InnerClasses.jrag:48") public boolean hasField(String name) { { for (FieldDeclarator decl : getDeclaratorList()) { if (decl.name().equals(name)) { return true; } } return false; } } /** * @return all fields declared in this body decl * @attribute syn * @aspect GenerateClassfile * @declaredat /home/jesper/git/extendj/java4/backend/GenerateClassfile.jrag:370 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="GenerateClassfile", declaredAt="/home/jesper/git/extendj/java4/backend/GenerateClassfile.jrag:370") public Collection fieldDeclarations() { { Collection fields = new ArrayList(); for (FieldDeclarator decl : getDeclaratorList()) { fields.add(decl); } return fields; } } /** * @attribute syn * @aspect GenerateClassfile * @declaredat /home/jesper/git/extendj/java4/backend/GenerateClassfile.jrag:444 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="GenerateClassfile", declaredAt="/home/jesper/git/extendj/java4/backend/GenerateClassfile.jrag:444") public boolean isField() { boolean isField_value = true; return isField_value; } /** * @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/java4/frontend/SyntacticClassification.jrag:101 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; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DeclareBeforeUse.jrag:58 * @apilevel internal */ public boolean Define_declaredBefore(ASTNode _callerNode, ASTNode _childNode, Variable decl) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java4/frontend/DeclareBeforeUse.jrag:62 int index = _callerNode.getIndexOfChild(_childNode); { for (int i = index - 1; i >= 0; --i) { if (getDeclarator(i) == decl) { return true; } } return declaredBefore(decl); } } else { return getParent().Define_declaredBefore(this, _callerNode, decl); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DeclareBeforeUse.jrag:58 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute declaredBefore */ protected boolean canDefine_declaredBefore(ASTNode _callerNode, ASTNode _childNode, Variable decl) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:133 * @apilevel internal */ public Modifiers Define_declarationModifiers(ASTNode _callerNode, ASTNode _childNode) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:137 int index = _callerNode.getIndexOfChild(_childNode); return getModifiers(); } else { return getParent().Define_declarationModifiers(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:133 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute declarationModifiers */ protected boolean canDefine_declarationModifiers(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:144 * @apilevel internal */ public Access Define_declarationType(ASTNode _callerNode, ASTNode _childNode) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:148 int index = _callerNode.getIndexOfChild(_childNode); return getTypeAccess(); } else { return getParent().Define_declarationType(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag:144 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute declarationType */ protected boolean canDefine_declarationType(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:723 * @apilevel internal */ public TypeDecl Define_declType(ASTNode _callerNode, ASTNode _childNode) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:278 int childIndex = _callerNode.getIndexOfChild(_childNode); return null; } else { return getParent().Define_declType(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:723 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute declType */ protected boolean canDefine_declType(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:430 * @apilevel internal */ public boolean Define_mayBePublic(ASTNode _callerNode, ASTNode _childNode) { if (getModifiersNoTransform() != null && _callerNode == getModifiers()) { // @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:312 return true; } else { return getParent().Define_mayBePublic(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:430 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute mayBePublic */ protected boolean canDefine_mayBePublic(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:432 * @apilevel internal */ public boolean Define_mayBeProtected(ASTNode _callerNode, ASTNode _childNode) { if (getModifiersNoTransform() != null && _callerNode == getModifiers()) { // @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:313 return true; } else { return getParent().Define_mayBeProtected(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:432 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute mayBeProtected */ protected boolean canDefine_mayBeProtected(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:431 * @apilevel internal */ public boolean Define_mayBePrivate(ASTNode _callerNode, ASTNode _childNode) { if (getModifiersNoTransform() != null && _callerNode == getModifiers()) { // @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:314 return true; } else { return getParent().Define_mayBePrivate(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:431 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute mayBePrivate */ protected boolean canDefine_mayBePrivate(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:433 * @apilevel internal */ public boolean Define_mayBeStatic(ASTNode _callerNode, ASTNode _childNode) { if (getModifiersNoTransform() != null && _callerNode == getModifiers()) { // @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:315 return true; } else { return getParent().Define_mayBeStatic(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:433 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute mayBeStatic */ protected boolean canDefine_mayBeStatic(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @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:316 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/java4/frontend/Modifiers.jrag:437 * @apilevel internal */ public boolean Define_mayBeTransient(ASTNode _callerNode, ASTNode _childNode) { if (getModifiersNoTransform() != null && _callerNode == getModifiers()) { // @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:317 return true; } else { return getParent().Define_mayBeTransient(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:437 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute mayBeTransient */ protected boolean canDefine_mayBeTransient(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:436 * @apilevel internal */ public boolean Define_mayBeVolatile(ASTNode _callerNode, ASTNode _childNode) { if (getModifiersNoTransform() != null && _callerNode == getModifiers()) { // @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:318 return true; } else { return getParent().Define_mayBeVolatile(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/Modifiers.jrag:436 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute mayBeVolatile */ protected boolean canDefine_mayBeVolatile(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/TypeHierarchyCheck.jrag:223 * @apilevel internal */ public boolean Define_inStaticContext(ASTNode _callerNode, ASTNode _childNode) { int childIndex = this.getIndexOfChild(_callerNode); return isStatic(); } /** * @declaredat /home/jesper/git/extendj/java4/frontend/TypeHierarchyCheck.jrag:223 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute inStaticContext */ protected boolean canDefine_inStaticContext(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:66 * @apilevel internal */ public boolean Define_isIncOrDec(ASTNode _callerNode, ASTNode _childNode) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:71 int childIndex = _callerNode.getIndexOfChild(_childNode); return false; } else { return getParent().Define_isIncOrDec(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:66 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute isIncOrDec */ protected boolean canDefine_isIncOrDec(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:256 * @apilevel internal */ public boolean Define_assignedBefore(ASTNode _callerNode, ASTNode _childNode, Variable v) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:563 int index = _callerNode.getIndexOfChild(_childNode); return index == 0 ? assignedBefore(v) : getDeclarator(index - 1).assignedAfter(v); } else { return super.Define_assignedBefore(_callerNode, _childNode, v); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:256 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute assignedBefore */ protected boolean canDefine_assignedBefore(ASTNode _callerNode, ASTNode _childNode, Variable v) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:887 * @apilevel internal */ public boolean Define_unassignedBefore(ASTNode _callerNode, ASTNode _childNode, Variable v) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:1170 int index = _callerNode.getIndexOfChild(_childNode); return index == 0 ? unassignedBefore(v) : getDeclarator(index - 1).unassignedAfter(v); } else { return super.Define_unassignedBefore(_callerNode, _childNode, v); } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:887 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute unassignedBefore */ protected boolean canDefine_unassignedBefore(ASTNode _callerNode, ASTNode _childNode, Variable v) { return true; } /** * @declaredat /home/jesper/git/extendj/java4/frontend/ExceptionHandling.jrag:93 * @apilevel internal */ public boolean Define_handlesException(ASTNode _callerNode, ASTNode _childNode, TypeDecl exceptionType) { int childIndex = this.getIndexOfChild(_callerNode); { if (hostType().isAnonymous()) { return true; } for (ConstructorDecl decl : hostType().constructors()) { if (!decl.throwsException(exceptionType)) { return false; } } return true; } } /** * @declaredat /home/jesper/git/extendj/java4/frontend/ExceptionHandling.jrag:93 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute handlesException */ protected boolean canDefine_handlesException(ASTNode _callerNode, ASTNode _childNode, TypeDecl exceptionType) { 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:145 return name.equals("FIELD"); } 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/java5/frontend/Enums.jrag:563 * @apilevel internal */ public boolean Define_inEnumInitializer(ASTNode _callerNode, ASTNode _childNode) { int childIndex = this.getIndexOfChild(_callerNode); return !isStatic() && hostType().isEnumDecl(); } /** * @declaredat /home/jesper/git/extendj/java5/frontend/Enums.jrag:563 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute inEnumInitializer */ protected boolean canDefine_inEnumInitializer(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1400 * @apilevel internal */ public FieldDecl Define_fieldDecl(ASTNode _callerNode, ASTNode _childNode) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1402 int childIndex = _callerNode.getIndexOfChild(_childNode); return this; } else { return getParent().Define_fieldDecl(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1400 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute fieldDecl */ protected boolean canDefine_fieldDecl(ASTNode _callerNode, ASTNode _childNode) { return true; } /** * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1659 * @apilevel internal */ public FieldDeclarator Define_erasedField(ASTNode _callerNode, ASTNode _childNode) { if (_callerNode == getDeclaratorListNoTransform()) { // @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1661 int index = _callerNode.getIndexOfChild(_childNode); return getDeclarator(index); } else { return getParent().Define_erasedField(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1659 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute erasedField */ protected boolean canDefine_erasedField(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/Modifiers.jrag:126 { 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 : modifierProblems()) { collection.add(value); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy