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

org.extendj.ast.ParExpr 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;
/**
 * @ast node
 * @declaredat /home/jesper/git/extendj/java4/grammar/Java.ast:248
 * @astdecl ParExpr : PrimaryExpr ::= Expr;
 * @production ParExpr : {@link PrimaryExpr} ::= {@link Expr};

 */
public class ParExpr extends PrimaryExpr implements Cloneable {
  /**
   * @aspect Java4PrettyPrint
   * @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd:528
   */
  public void prettyPrint(PrettyPrinter out) {
    out.print("(");
    out.print(getExpr());
    out.print(")");
  }
  /**
   * @aspect CreateBCode
   * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:1249
   */
  public void branchTrue(CodeGeneration gen, int target) {
    // Branch when true.
    getExpr().branchTrue(gen, target);
  }
  /**
   * @aspect CreateBCode
   * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:1360
   */
  public void branchFalse(CodeGeneration gen, int target) {
    // Branch when false.
    getExpr().branchFalse(gen, target);
  }
  /**
   * @aspect CodeGeneration
   * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:367
   */
  void emitCastTo(CodeGeneration gen, TypeDecl type) {
    getExpr().emitCastTo(gen, type);
  }
  /**
   * @declaredat ASTNode:1
   */
  public ParExpr() {
    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[1];
  }
  /**
   * @declaredat ASTNode:13
   */
  @ASTNodeAnnotation.Constructor(
    name = {"Expr"},
    type = {"Expr"},
    kind = {"Child"}
  )
  public ParExpr(Expr p0) {
    setChild(p0, 0);
  }
  /** @apilevel low-level 
   * @declaredat ASTNode:22
   */
  protected int numChildren() {
    return 1;
  }
  /**
   * @apilevel internal
   * @declaredat ASTNode:28
   */
  public boolean mayHaveRewrite() {
    return false;
  }
  /** @apilevel internal 
   * @declaredat ASTNode:32
   */
  public void flushAttrCache() {
    super.flushAttrCache();
    type_reset();
    unassignedAfterTrue_Variable_reset();
    unassignedAfterFalse_Variable_reset();
    unassignedAfter_Variable_reset();
    isBooleanExpression_reset();
    isPolyExpression_reset();
    assignConversionTo_TypeDecl_reset();
    compatibleStrictContext_TypeDecl_reset();
    compatibleLooseContext_TypeDecl_reset();
    pertinentToApplicability_Expr_BodyDecl_int_reset();
    moreSpecificThan_TypeDecl_TypeDecl_reset();
    potentiallyCompatible_TypeDecl_BodyDecl_reset();
  }
  /** @apilevel internal 
   * @declaredat ASTNode:48
   */
  public void flushCollectionCache() {
    super.flushCollectionCache();
  }
  /** @apilevel internal 
   * @declaredat ASTNode:52
   */
  public ParExpr clone() throws CloneNotSupportedException {
    ParExpr node = (ParExpr) super.clone();
    return node;
  }
  /** @apilevel internal 
   * @declaredat ASTNode:57
   */
  public ParExpr copy() {
    try {
      ParExpr node = (ParExpr) 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 ParExpr 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 ParExpr treeCopyNoTransform() {
    ParExpr tree = (ParExpr) 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 ParExpr treeCopy() {
    ParExpr tree = (ParExpr) 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);    
  }
  /**
   * Replaces the Expr child.
   * @param node The new node to replace the Expr child.
   * @apilevel high-level
   */
  public void setExpr(Expr node) {
    setChild(node, 0);
  }
  /**
   * Retrieves the Expr child.
   * @return The current node used as the Expr child.
   * @apilevel high-level
   */
  @ASTNodeAnnotation.Child(name="Expr")
  public Expr getExpr() {
    return (Expr) getChild(0);
  }
  /**
   * Retrieves the Expr child.
   * 

This method does not invoke AST transformations.

* @return The current node used as the Expr child. * @apilevel low-level */ public Expr getExprNoTransform() { return (Expr) getChildNoTransform(0); } /** * @attribute syn * @aspect ConstantExpression * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:32 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="ConstantExpression", declaredAt="/home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:32") public Constant constant() { Constant constant_value = getExpr().constant(); return constant_value; } /** * @attribute syn * @aspect ConstantExpression * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:383 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="ConstantExpression", declaredAt="/home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:383") public boolean isConstant() { boolean isConstant_value = getExpr().isConstant(); return isConstant_value; } /** * @attribute syn * @aspect ConstantExpression * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:435 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="ConstantExpression", declaredAt="/home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:435") public boolean isTrue() { boolean isTrue_value = getExpr().isTrue(); return isTrue_value; } /** * @attribute syn * @aspect ConstantExpression * @declaredat /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:438 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="ConstantExpression", declaredAt="/home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag:438") public boolean isFalse() { boolean isFalse_value = getExpr().isFalse(); return isFalse_value; } /** * @attribute syn * @aspect AccessTypes * @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:56 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="AccessTypes", declaredAt="/home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:56") public boolean isSuperAccess() { boolean isSuperAccess_value = getExpr().isSuperAccess(); return isSuperAccess_value; } /** * @attribute syn * @aspect AccessTypes * @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:62 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="AccessTypes", declaredAt="/home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:62") public boolean isThisAccess() { boolean isThisAccess_value = getExpr().isThisAccess(); return isThisAccess_value; } /** * Test if an expression contains an unresolved parse name. * @attribute syn * @aspect NameResolution * @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:555 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="NameResolution", declaredAt="/home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:555") public boolean containsParseName() { boolean containsParseName_value = getExpr().containsParseName(); return containsParseName_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:295 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="TypeAnalysis", declaredAt="/home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:295") public TypeDecl type() { ASTState state = state(); if (type_computed == ASTState.NON_CYCLE || type_computed == state().cycle()) { return type_value; } type_value = getExpr().isTypeAccess() ? unknownType() : getExpr().type(); if (state().inCircle()) { type_computed = state().cycle(); } else { type_computed = ASTState.NON_CYCLE; } return type_value; } /** * @attribute syn * @aspect TypeHierarchyCheck * @declaredat /home/jesper/git/extendj/java4/frontend/TypeHierarchyCheck.jrag:240 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="TypeHierarchyCheck", declaredAt="/home/jesper/git/extendj/java4/frontend/TypeHierarchyCheck.jrag:240") public boolean staticContextQualifier() { boolean staticContextQualifier_value = getExpr().staticContextQualifier(); return staticContextQualifier_value; } /** * @attribute syn * @aspect DefiniteAssignment * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:77 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="DefiniteAssignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:77") public Variable varDecl() { Variable varDecl_value = getExpr().varDecl(); return varDecl_value; } /** * @attribute syn * @aspect DefiniteAssignment * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:375 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="DefiniteAssignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:375") public boolean assignedAfterTrue(Variable v) { boolean assignedAfterTrue_Variable_value = isFalse() || getExpr().assignedAfterTrue(v); return assignedAfterTrue_Variable_value; } /** * @attribute syn * @aspect DefiniteAssignment * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:377 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="DefiniteAssignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:377") public boolean assignedAfterFalse(Variable v) { boolean assignedAfterFalse_Variable_value = isTrue() || getExpr().assignedAfterFalse(v); return assignedAfterFalse_Variable_value; } /** * @attribute syn * @aspect DefiniteAssignment * @declaredat /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:268 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="DefiniteAssignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:268") public boolean assignedAfter(Variable v) { boolean assignedAfter_Variable_value = getExpr().assignedAfter(v); return assignedAfter_Variable_value; } /** @apilevel internal */ private void unassignedAfterTrue_Variable_reset() { unassignedAfterTrue_Variable_values = null; } protected java.util.Map unassignedAfterTrue_Variable_values; @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN, isCircular=true) @ASTNodeAnnotation.Source(aspect="DefiniteUnassignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:905") public boolean unassignedAfterTrue(Variable v) { Object _parameters = v; if (unassignedAfterTrue_Variable_values == null) unassignedAfterTrue_Variable_values = new java.util.HashMap(4); ASTState.CircularValue _value; if (unassignedAfterTrue_Variable_values.containsKey(_parameters)) { Object _cache = unassignedAfterTrue_Variable_values.get(_parameters); if (!(_cache instanceof ASTState.CircularValue)) { return (Boolean) _cache; } else { _value = (ASTState.CircularValue) _cache; } } else { _value = new ASTState.CircularValue(); unassignedAfterTrue_Variable_values.put(_parameters, _value); _value.value = true; } ASTState state = state(); if (!state.inCircle() || state.calledByLazyAttribute()) { state.enterCircle(); boolean new_unassignedAfterTrue_Variable_value; do { _value.cycle = state.nextCycle(); new_unassignedAfterTrue_Variable_value = getExpr().unassignedAfterTrue(v); if (((Boolean)_value.value) != new_unassignedAfterTrue_Variable_value) { state.setChangeInCycle(); _value.value = new_unassignedAfterTrue_Variable_value; } } while (state.testAndClearChangeInCycle()); unassignedAfterTrue_Variable_values.put(_parameters, new_unassignedAfterTrue_Variable_value); state.leaveCircle(); return new_unassignedAfterTrue_Variable_value; } else if (_value.cycle != state.cycle()) { _value.cycle = state.cycle(); boolean new_unassignedAfterTrue_Variable_value = getExpr().unassignedAfterTrue(v); if (((Boolean)_value.value) != new_unassignedAfterTrue_Variable_value) { state.setChangeInCycle(); _value.value = new_unassignedAfterTrue_Variable_value; } return new_unassignedAfterTrue_Variable_value; } else { return (Boolean) _value.value; } } /** @apilevel internal */ private void unassignedAfterFalse_Variable_reset() { unassignedAfterFalse_Variable_values = null; } protected java.util.Map unassignedAfterFalse_Variable_values; @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN, isCircular=true) @ASTNodeAnnotation.Source(aspect="DefiniteUnassignment", declaredAt="/home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag:907") public boolean unassignedAfterFalse(Variable v) { Object _parameters = v; if (unassignedAfterFalse_Variable_values == null) unassignedAfterFalse_Variable_values = new java.util.HashMap(4); ASTState.CircularValue _value; if (unassignedAfterFalse_Variable_values.containsKey(_parameters)) { Object _cache = unassignedAfterFalse_Variable_values.get(_parameters); if (!(_cache instanceof ASTState.CircularValue)) { return (Boolean) _cache; } else { _value = (ASTState.CircularValue) _cache; } } else { _value = new ASTState.CircularValue(); unassignedAfterFalse_Variable_values.put(_parameters, _value); _value.value = true; } ASTState state = state(); if (!state.inCircle() || state.calledByLazyAttribute()) { state.enterCircle(); boolean new_unassignedAfterFalse_Variable_value; do { _value.cycle = state.nextCycle(); new_unassignedAfterFalse_Variable_value = getExpr().unassignedAfterFalse(v); if (((Boolean)_value.value) != new_unassignedAfterFalse_Variable_value) { state.setChangeInCycle(); _value.value = new_unassignedAfterFalse_Variable_value; } } while (state.testAndClearChangeInCycle()); unassignedAfterFalse_Variable_values.put(_parameters, new_unassignedAfterFalse_Variable_value); state.leaveCircle(); return new_unassignedAfterFalse_Variable_value; } else if (_value.cycle != state.cycle()) { _value.cycle = state.cycle(); boolean new_unassignedAfterFalse_Variable_value = getExpr().unassignedAfterFalse(v); if (((Boolean)_value.value) != new_unassignedAfterFalse_Variable_value) { state.setChangeInCycle(); _value.value = new_unassignedAfterFalse_Variable_value; } return new_unassignedAfterFalse_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:899") 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 = getExpr().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 = getExpr().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 TypeCheck * @declaredat /home/jesper/git/extendj/java4/frontend/TypeCheck.jrag:33 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="TypeCheck", declaredAt="/home/jesper/git/extendj/java4/frontend/TypeCheck.jrag:33") public boolean isVariable() { boolean isVariable_value = getExpr().isVariable(); return isVariable_value; } /** * @attribute syn * @aspect PreciseRethrow * @declaredat /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:145 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="PreciseRethrow", declaredAt="/home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag:145") public boolean modifiedInScope(Variable var) { boolean modifiedInScope_Variable_value = getExpr().modifiedInScope(var); return modifiedInScope_Variable_value; } /** @apilevel internal */ private void isBooleanExpression_reset() { isBooleanExpression_computed = null; } /** @apilevel internal */ protected ASTState.Cycle isBooleanExpression_computed = null; /** @apilevel internal */ protected boolean isBooleanExpression_value; /** * @attribute syn * @aspect PolyExpressions * @declaredat /home/jesper/git/extendj/java8/frontend/PolyExpressions.jrag:29 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="PolyExpressions", declaredAt="/home/jesper/git/extendj/java8/frontend/PolyExpressions.jrag:29") public boolean isBooleanExpression() { ASTState state = state(); if (isBooleanExpression_computed == ASTState.NON_CYCLE || isBooleanExpression_computed == state().cycle()) { return isBooleanExpression_value; } isBooleanExpression_value = getExpr().isBooleanExpression(); if (state().inCircle()) { isBooleanExpression_computed = state().cycle(); } else { isBooleanExpression_computed = ASTState.NON_CYCLE; } return isBooleanExpression_value; } /** @apilevel internal */ private void isPolyExpression_reset() { isPolyExpression_computed = null; } /** @apilevel internal */ protected ASTState.Cycle isPolyExpression_computed = null; /** @apilevel internal */ protected boolean isPolyExpression_value; /** * @attribute syn * @aspect PolyExpressions * @declaredat /home/jesper/git/extendj/java8/frontend/PolyExpressions.jrag:86 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="PolyExpressions", declaredAt="/home/jesper/git/extendj/java8/frontend/PolyExpressions.jrag:86") public boolean isPolyExpression() { ASTState state = state(); if (isPolyExpression_computed == ASTState.NON_CYCLE || isPolyExpression_computed == state().cycle()) { return isPolyExpression_value; } isPolyExpression_value = getExpr().isPolyExpression(); if (state().inCircle()) { isPolyExpression_computed = state().cycle(); } else { isPolyExpression_computed = ASTState.NON_CYCLE; } return isPolyExpression_value; } /** @apilevel internal */ private void assignConversionTo_TypeDecl_reset() { assignConversionTo_TypeDecl_computed = null; assignConversionTo_TypeDecl_values = null; } /** @apilevel internal */ protected java.util.Map assignConversionTo_TypeDecl_values; /** @apilevel internal */ protected java.util.Map assignConversionTo_TypeDecl_computed; /** * @attribute syn * @aspect PolyExpressions * @declaredat /home/jesper/git/extendj/java8/frontend/PolyExpressions.jrag:149 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="PolyExpressions", declaredAt="/home/jesper/git/extendj/java8/frontend/PolyExpressions.jrag:149") public boolean assignConversionTo(TypeDecl type) { Object _parameters = type; if (assignConversionTo_TypeDecl_computed == null) assignConversionTo_TypeDecl_computed = new java.util.HashMap(4); if (assignConversionTo_TypeDecl_values == null) assignConversionTo_TypeDecl_values = new java.util.HashMap(4); ASTState state = state(); if (assignConversionTo_TypeDecl_values.containsKey(_parameters) && assignConversionTo_TypeDecl_computed.containsKey(_parameters) && (assignConversionTo_TypeDecl_computed.get(_parameters) == ASTState.NON_CYCLE || assignConversionTo_TypeDecl_computed.get(_parameters) == state().cycle())) { return (Boolean) assignConversionTo_TypeDecl_values.get(_parameters); } boolean assignConversionTo_TypeDecl_value = getExpr().assignConversionTo(type); if (state().inCircle()) { assignConversionTo_TypeDecl_values.put(_parameters, assignConversionTo_TypeDecl_value); assignConversionTo_TypeDecl_computed.put(_parameters, state().cycle()); } else { assignConversionTo_TypeDecl_values.put(_parameters, assignConversionTo_TypeDecl_value); assignConversionTo_TypeDecl_computed.put(_parameters, ASTState.NON_CYCLE); } return assignConversionTo_TypeDecl_value; } /** @apilevel internal */ private void compatibleStrictContext_TypeDecl_reset() { compatibleStrictContext_TypeDecl_computed = null; compatibleStrictContext_TypeDecl_values = null; } /** @apilevel internal */ protected java.util.Map compatibleStrictContext_TypeDecl_values; /** @apilevel internal */ protected java.util.Map compatibleStrictContext_TypeDecl_computed; /** Used to compute compatibility during phase 1 of overload resolution. * @attribute syn * @aspect MethodSignature18 * @declaredat /home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:58 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="MethodSignature18", declaredAt="/home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:58") public boolean compatibleStrictContext(TypeDecl type) { Object _parameters = type; if (compatibleStrictContext_TypeDecl_computed == null) compatibleStrictContext_TypeDecl_computed = new java.util.HashMap(4); if (compatibleStrictContext_TypeDecl_values == null) compatibleStrictContext_TypeDecl_values = new java.util.HashMap(4); ASTState state = state(); if (compatibleStrictContext_TypeDecl_values.containsKey(_parameters) && compatibleStrictContext_TypeDecl_computed.containsKey(_parameters) && (compatibleStrictContext_TypeDecl_computed.get(_parameters) == ASTState.NON_CYCLE || compatibleStrictContext_TypeDecl_computed.get(_parameters) == state().cycle())) { return (Boolean) compatibleStrictContext_TypeDecl_values.get(_parameters); } boolean compatibleStrictContext_TypeDecl_value = getExpr().compatibleStrictContext(type); if (state().inCircle()) { compatibleStrictContext_TypeDecl_values.put(_parameters, compatibleStrictContext_TypeDecl_value); compatibleStrictContext_TypeDecl_computed.put(_parameters, state().cycle()); } else { compatibleStrictContext_TypeDecl_values.put(_parameters, compatibleStrictContext_TypeDecl_value); compatibleStrictContext_TypeDecl_computed.put(_parameters, ASTState.NON_CYCLE); } return compatibleStrictContext_TypeDecl_value; } /** @apilevel internal */ private void compatibleLooseContext_TypeDecl_reset() { compatibleLooseContext_TypeDecl_computed = null; compatibleLooseContext_TypeDecl_values = null; } /** @apilevel internal */ protected java.util.Map compatibleLooseContext_TypeDecl_values; /** @apilevel internal */ protected java.util.Map compatibleLooseContext_TypeDecl_computed; /** * @attribute syn * @aspect MethodSignature18 * @declaredat /home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:102 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="MethodSignature18", declaredAt="/home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:102") public boolean compatibleLooseContext(TypeDecl type) { Object _parameters = type; if (compatibleLooseContext_TypeDecl_computed == null) compatibleLooseContext_TypeDecl_computed = new java.util.HashMap(4); if (compatibleLooseContext_TypeDecl_values == null) compatibleLooseContext_TypeDecl_values = new java.util.HashMap(4); ASTState state = state(); if (compatibleLooseContext_TypeDecl_values.containsKey(_parameters) && compatibleLooseContext_TypeDecl_computed.containsKey(_parameters) && (compatibleLooseContext_TypeDecl_computed.get(_parameters) == ASTState.NON_CYCLE || compatibleLooseContext_TypeDecl_computed.get(_parameters) == state().cycle())) { return (Boolean) compatibleLooseContext_TypeDecl_values.get(_parameters); } boolean compatibleLooseContext_TypeDecl_value = getExpr().compatibleLooseContext(type); if (state().inCircle()) { compatibleLooseContext_TypeDecl_values.put(_parameters, compatibleLooseContext_TypeDecl_value); compatibleLooseContext_TypeDecl_computed.put(_parameters, state().cycle()); } else { compatibleLooseContext_TypeDecl_values.put(_parameters, compatibleLooseContext_TypeDecl_value); compatibleLooseContext_TypeDecl_computed.put(_parameters, ASTState.NON_CYCLE); } return compatibleLooseContext_TypeDecl_value; } /** @apilevel internal */ private void pertinentToApplicability_Expr_BodyDecl_int_reset() { pertinentToApplicability_Expr_BodyDecl_int_computed = null; pertinentToApplicability_Expr_BodyDecl_int_values = null; } /** @apilevel internal */ protected java.util.Map pertinentToApplicability_Expr_BodyDecl_int_values; /** @apilevel internal */ protected java.util.Map pertinentToApplicability_Expr_BodyDecl_int_computed; /** * @attribute syn * @aspect MethodSignature18 * @declaredat /home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:130 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="MethodSignature18", declaredAt="/home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:130") public boolean pertinentToApplicability(Expr access, BodyDecl decl, int argIndex) { java.util.List _parameters = new java.util.ArrayList(3); _parameters.add(access); _parameters.add(decl); _parameters.add(argIndex); if (pertinentToApplicability_Expr_BodyDecl_int_computed == null) pertinentToApplicability_Expr_BodyDecl_int_computed = new java.util.HashMap(4); if (pertinentToApplicability_Expr_BodyDecl_int_values == null) pertinentToApplicability_Expr_BodyDecl_int_values = new java.util.HashMap(4); ASTState state = state(); if (pertinentToApplicability_Expr_BodyDecl_int_values.containsKey(_parameters) && pertinentToApplicability_Expr_BodyDecl_int_computed.containsKey(_parameters) && (pertinentToApplicability_Expr_BodyDecl_int_computed.get(_parameters) == ASTState.NON_CYCLE || pertinentToApplicability_Expr_BodyDecl_int_computed.get(_parameters) == state().cycle())) { return (Boolean) pertinentToApplicability_Expr_BodyDecl_int_values.get(_parameters); } boolean pertinentToApplicability_Expr_BodyDecl_int_value = getExpr().pertinentToApplicability(access, decl, argIndex); if (state().inCircle()) { pertinentToApplicability_Expr_BodyDecl_int_values.put(_parameters, pertinentToApplicability_Expr_BodyDecl_int_value); pertinentToApplicability_Expr_BodyDecl_int_computed.put(_parameters, state().cycle()); } else { pertinentToApplicability_Expr_BodyDecl_int_values.put(_parameters, pertinentToApplicability_Expr_BodyDecl_int_value); pertinentToApplicability_Expr_BodyDecl_int_computed.put(_parameters, ASTState.NON_CYCLE); } return pertinentToApplicability_Expr_BodyDecl_int_value; } /** @apilevel internal */ private void moreSpecificThan_TypeDecl_TypeDecl_reset() { moreSpecificThan_TypeDecl_TypeDecl_computed = null; moreSpecificThan_TypeDecl_TypeDecl_values = null; } /** @apilevel internal */ protected java.util.Map moreSpecificThan_TypeDecl_TypeDecl_values; /** @apilevel internal */ protected java.util.Map moreSpecificThan_TypeDecl_TypeDecl_computed; /** * Computes which type is more specific for a specific argument, as defined in 15.12.2.5 * @param type1 * @param type2 * @return {@code true} if type1 is more specific than type2, {@code false} otherwise * @attribute syn * @aspect MethodSignature18 * @declaredat /home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:256 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="MethodSignature18", declaredAt="/home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:256") public boolean moreSpecificThan(TypeDecl type1, TypeDecl type2) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(type1); _parameters.add(type2); if (moreSpecificThan_TypeDecl_TypeDecl_computed == null) moreSpecificThan_TypeDecl_TypeDecl_computed = new java.util.HashMap(4); if (moreSpecificThan_TypeDecl_TypeDecl_values == null) moreSpecificThan_TypeDecl_TypeDecl_values = new java.util.HashMap(4); ASTState state = state(); if (moreSpecificThan_TypeDecl_TypeDecl_values.containsKey(_parameters) && moreSpecificThan_TypeDecl_TypeDecl_computed.containsKey(_parameters) && (moreSpecificThan_TypeDecl_TypeDecl_computed.get(_parameters) == ASTState.NON_CYCLE || moreSpecificThan_TypeDecl_TypeDecl_computed.get(_parameters) == state().cycle())) { return (Boolean) moreSpecificThan_TypeDecl_TypeDecl_values.get(_parameters); } boolean moreSpecificThan_TypeDecl_TypeDecl_value = moreSpecificThan_compute(type1, type2); if (state().inCircle()) { moreSpecificThan_TypeDecl_TypeDecl_values.put(_parameters, moreSpecificThan_TypeDecl_TypeDecl_value); moreSpecificThan_TypeDecl_TypeDecl_computed.put(_parameters, state().cycle()); } else { moreSpecificThan_TypeDecl_TypeDecl_values.put(_parameters, moreSpecificThan_TypeDecl_TypeDecl_value); moreSpecificThan_TypeDecl_TypeDecl_computed.put(_parameters, ASTState.NON_CYCLE); } return moreSpecificThan_TypeDecl_TypeDecl_value; } /** @apilevel internal */ private boolean moreSpecificThan_compute(TypeDecl type1, TypeDecl type2) { if (super.moreSpecificThan(type1, type2)) { return true; } return getExpr().moreSpecificThan(type1, type2); } /** @apilevel internal */ private void potentiallyCompatible_TypeDecl_BodyDecl_reset() { potentiallyCompatible_TypeDecl_BodyDecl_computed = null; potentiallyCompatible_TypeDecl_BodyDecl_values = null; } /** @apilevel internal */ protected java.util.Map potentiallyCompatible_TypeDecl_BodyDecl_values; /** @apilevel internal */ protected java.util.Map potentiallyCompatible_TypeDecl_BodyDecl_computed; /** * @attribute syn * @aspect MethodSignature18 * @declaredat /home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:511 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="MethodSignature18", declaredAt="/home/jesper/git/extendj/java8/frontend/MethodSignature.jrag:511") public boolean potentiallyCompatible(TypeDecl type, BodyDecl candidateDecl) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(type); _parameters.add(candidateDecl); if (potentiallyCompatible_TypeDecl_BodyDecl_computed == null) potentiallyCompatible_TypeDecl_BodyDecl_computed = new java.util.HashMap(4); if (potentiallyCompatible_TypeDecl_BodyDecl_values == null) potentiallyCompatible_TypeDecl_BodyDecl_values = new java.util.HashMap(4); ASTState state = state(); if (potentiallyCompatible_TypeDecl_BodyDecl_values.containsKey(_parameters) && potentiallyCompatible_TypeDecl_BodyDecl_computed.containsKey(_parameters) && (potentiallyCompatible_TypeDecl_BodyDecl_computed.get(_parameters) == ASTState.NON_CYCLE || potentiallyCompatible_TypeDecl_BodyDecl_computed.get(_parameters) == state().cycle())) { return (Boolean) potentiallyCompatible_TypeDecl_BodyDecl_values.get(_parameters); } boolean potentiallyCompatible_TypeDecl_BodyDecl_value = getExpr().potentiallyCompatible(type, candidateDecl); if (state().inCircle()) { potentiallyCompatible_TypeDecl_BodyDecl_values.put(_parameters, potentiallyCompatible_TypeDecl_BodyDecl_value); potentiallyCompatible_TypeDecl_BodyDecl_computed.put(_parameters, state().cycle()); } else { potentiallyCompatible_TypeDecl_BodyDecl_values.put(_parameters, potentiallyCompatible_TypeDecl_BodyDecl_value); potentiallyCompatible_TypeDecl_BodyDecl_computed.put(_parameters, ASTState.NON_CYCLE); } return potentiallyCompatible_TypeDecl_BodyDecl_value; } /** * @attribute syn * @aspect CreateBCode * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:300 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="CreateBCode", declaredAt="/home/jesper/git/extendj/java4/backend/CreateBCode.jrag:300") public boolean needsPop() { boolean needsPop_value = getExpr().needsPop(); return needsPop_value; } /** * @attribute syn * @aspect CreateBCode * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:313 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="CreateBCode", declaredAt="/home/jesper/git/extendj/java4/backend/CreateBCode.jrag:313") public boolean isVarAccessWithAccessor() { boolean isVarAccessWithAccessor_value = getExpr().isVarAccessWithAccessor(); return isVarAccessWithAccessor_value; } /** * @attribute syn * @aspect CreateBCode * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:1150 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="CreateBCode", declaredAt="/home/jesper/git/extendj/java4/backend/CreateBCode.jrag:1150") public boolean canBeTrue() { boolean canBeTrue_value = getExpr().canBeTrue(); return canBeTrue_value; } /** * @attribute syn * @aspect CreateBCode * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:1162 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="CreateBCode", declaredAt="/home/jesper/git/extendj/java4/backend/CreateBCode.jrag:1162") public boolean canBeFalse() { boolean canBeFalse_value = getExpr().canBeFalse(); return canBeFalse_value; } /** * This finds the erased runtime type of this expression. * *

The erased type of a field or method depends on the original * declaration of the field or method (without generic type substitution). * *

The erased type is used to determine when a checkcast conversion is * needed to cast a generic type to the expected type. * @attribute syn * @aspect GenericsCodegen * @declaredat /home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:147 */ @ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN) @ASTNodeAnnotation.Source(aspect="GenericsCodegen", declaredAt="/home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:147") public TypeDecl erasedType() { TypeDecl erasedType_value = getExpr().erasedType(); return erasedType_value; } /** * @declaredat /home/jesper/git/extendj/java8/frontend/TargetType.jrag:31 * @apilevel internal */ public TypeDecl Define_targetType(ASTNode _callerNode, ASTNode _childNode) { if (getExprNoTransform() != null && _callerNode == getExpr()) { // @declaredat /home/jesper/git/extendj/java8/frontend/TargetType.jrag:38 return targetType(); } else { return getParent().Define_targetType(this, _callerNode); } } /** * @declaredat /home/jesper/git/extendj/java8/frontend/TargetType.jrag:31 * @apilevel internal * @return {@code true} if this node has an equation for the inherited attribute targetType */ protected boolean canDefine_targetType(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/TypeCheck.jrag:373 if (getExpr().isTypeAccess()) { { 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); if (getExpr().isTypeAccess()) { collection.add(errorf("%s is a type and may not be used in parenthesized expression", getExpr().prettyPrint())); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy