001    /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */
002    package org.extendj.ast;
003    
004    import java.util.HashSet;
005    import java.io.File;
006    import java.util.Set;
007    import java.util.Collections;
008    import java.util.Collection;
009    import java.util.ArrayList;
010    import beaver.*;
011    import java.util.*;
012    import java.io.ByteArrayOutputStream;
013    import java.io.PrintStream;
014    import java.lang.reflect.InvocationTargetException;
015    import java.lang.reflect.Method;
016    import org.jastadd.util.*;
017    import java.util.zip.*;
018    import java.io.*;
019    import org.jastadd.util.PrettyPrintable;
020    import org.jastadd.util.PrettyPrinter;
021    import java.io.FileNotFoundException;
022    import java.io.BufferedInputStream;
023    import java.io.DataInputStream;
024    /**
025     * @ast node
026     * @declaredat /home/jesper/git/extendj/java8/grammar/MethodReference.ast:9
027     * @production SyntheticTypeAccess : {@link Access};
028    
029     */
030    public class SyntheticTypeAccess extends Access implements Cloneable {
031      /**
032       * @aspect Synthetics
033       * @declaredat /home/jesper/git/extendj/java8/frontend/MethodReference.jrag:373
034       */
035      private TypeDecl type;
036      /**
037       * @aspect Synthetics
038       * @declaredat /home/jesper/git/extendj/java8/frontend/MethodReference.jrag:374
039       */
040      public SyntheticTypeAccess(TypeDecl type) {
041        this.type = type;
042      }
043      /**
044       * @declaredat ASTNode:1
045       */
046      public SyntheticTypeAccess() {
047        super();
048      }
049      /**
050       * Initializes the child array to the correct size.
051       * Initializes List and Opt nta children.
052       * @apilevel internal
053       * @ast method
054       * @declaredat ASTNode:10
055       */
056      public void init$Children() {
057      }
058      /**
059       * @apilevel low-level
060       * @declaredat ASTNode:15
061       */
062      protected int numChildren() {
063        return 0;
064      }
065      /**
066       * @apilevel internal
067       * @declaredat ASTNode:21
068       */
069      public boolean mayHaveRewrite() {
070        return false;
071      }
072      /**
073       * @apilevel internal
074       * @declaredat ASTNode:27
075       */
076      public void flushAttrCache() {
077        super.flushAttrCache();
078        type_reset();
079      }
080      /**
081       * @apilevel internal
082       * @declaredat ASTNode:34
083       */
084      public void flushCollectionCache() {
085        super.flushCollectionCache();
086      }
087      /**
088       * @apilevel internal
089       * @declaredat ASTNode:40
090       */
091      public void flushRewriteCache() {
092        super.flushRewriteCache();
093      }
094      /**
095       * @apilevel internal
096       * @declaredat ASTNode:46
097       */
098      public SyntheticTypeAccess clone() throws CloneNotSupportedException {
099        SyntheticTypeAccess node = (SyntheticTypeAccess) super.clone();
100        return node;
101      }
102      /**
103       * @apilevel internal
104       * @declaredat ASTNode:53
105       */
106      public SyntheticTypeAccess copy() {
107        try {
108          SyntheticTypeAccess node = (SyntheticTypeAccess) clone();
109          node.parent = null;
110          if (children != null) {
111            node.children = (ASTNode[]) children.clone();
112          }
113          return node;
114        } catch (CloneNotSupportedException e) {
115          throw new Error("Error: clone not supported for " + getClass().getName());
116        }
117      }
118      /**
119       * Create a deep copy of the AST subtree at this node.
120       * The copy is dangling, i.e. has no parent.
121       * @return dangling copy of the subtree at this node
122       * @apilevel low-level
123       * @deprecated Please use treeCopy or treeCopyNoTransform instead
124       * @declaredat ASTNode:72
125       */
126      @Deprecated
127      public SyntheticTypeAccess fullCopy() {
128        return treeCopyNoTransform();
129      }
130      /**
131       * Create a deep copy of the AST subtree at this node.
132       * The copy is dangling, i.e. has no parent.
133       * @return dangling copy of the subtree at this node
134       * @apilevel low-level
135       * @declaredat ASTNode:82
136       */
137      public SyntheticTypeAccess treeCopyNoTransform() {
138        SyntheticTypeAccess tree = (SyntheticTypeAccess) copy();
139        if (children != null) {
140          for (int i = 0; i < children.length; ++i) {
141            ASTNode child = (ASTNode) children[i];
142            if (child != null) {
143              child = child.treeCopyNoTransform();
144              tree.setChild(child, i);
145            }
146          }
147        }
148        return tree;
149      }
150      /**
151       * Create a deep copy of the AST subtree at this node.
152       * The subtree of this node is traversed to trigger rewrites before copy.
153       * The copy is dangling, i.e. has no parent.
154       * @return dangling copy of the subtree at this node
155       * @apilevel low-level
156       * @declaredat ASTNode:102
157       */
158      public SyntheticTypeAccess treeCopy() {
159        doFullTraversal();
160        return treeCopyNoTransform();
161      }
162      /**
163       * @apilevel internal
164       * @declaredat ASTNode:109
165       */
166      protected boolean is$Equal(ASTNode node) {
167        return super.is$Equal(node);    
168      }
169      /**
170       * @apilevel internal
171       */
172      protected boolean type_computed = false;
173      /**
174       * @apilevel internal
175       */
176      protected TypeDecl type_value;
177      /**
178       * @apilevel internal
179       */
180      private void type_reset() {
181        type_computed = false;
182        type_value = null;
183      }
184      /**
185       * @attribute syn
186       * @aspect Synthetics
187       * @declaredat /home/jesper/git/extendj/java8/frontend/MethodReference.jrag:377
188       */
189      @ASTNodeAnnotation.Attribute
190      public TypeDecl type() {
191        ASTNode$State state = state();
192        if (type_computed) {
193          return type_value;
194        }
195        boolean intermediate = state.INTERMEDIATE_VALUE;
196        state.INTERMEDIATE_VALUE = false;
197        int num = state.boundariesCrossed;
198        boolean isFinal = this.is$Final();
199        type_value = type;
200        if (isFinal && num == state().boundariesCrossed) {
201          type_computed = true;
202        } else {
203        }
204        state.INTERMEDIATE_VALUE |= intermediate;
205    
206        return type_value;
207      }
208      /**
209       * @apilevel internal
210       */
211      public ASTNode rewriteTo() {
212        return super.rewriteTo();
213      }
214    }