org.extendj.ast.Modifier Maven / Gradle / Ivy
/* This file was generated with JastAdd2 (http://jastadd.org) version 2.3.0 */
package org.extendj.ast;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
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.*;
import java.util.zip.*;
import java.io.*;
import org.jastadd.util.PrettyPrintable;
import org.jastadd.util.PrettyPrinter;
import org.jastadd.util.*;
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.io.BufferedInputStream;
import java.io.DataInputStream;
/**
* @ast node
* @declaredat /home/jesper/git/extendj/java4/grammar/Java.ast:280
* @astdecl Modifier : ASTNode ::= ;
* @production Modifier : {@link ASTNode} ::= <ID:String>;
*/
public class Modifier extends ASTNode implements Cloneable {
/**
* @aspect Java4PrettyPrint
* @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd:508
*/
public void prettyPrint(PrettyPrinter out) {
out.print(getID());
}
/**
* @declaredat ASTNode:1
*/
public Modifier() {
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() {
}
/**
* @declaredat ASTNode:12
*/
@ASTNodeAnnotation.Constructor(
name = {"ID"},
type = {"String"},
kind = {"Token"}
)
public Modifier(String p0) {
setID(p0);
}
/**
* @declaredat ASTNode:20
*/
public Modifier(beaver.Symbol p0) {
setID(p0);
}
/** @apilevel low-level
* @declaredat ASTNode:24
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @declaredat ASTNode:30
*/
public boolean mayHaveRewrite() {
return false;
}
/** @apilevel internal
* @declaredat ASTNode:34
*/
public void flushAttrCache() {
super.flushAttrCache();
}
/** @apilevel internal
* @declaredat ASTNode:38
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/** @apilevel internal
* @declaredat ASTNode:42
*/
public Modifier clone() throws CloneNotSupportedException {
Modifier node = (Modifier) super.clone();
return node;
}
/** @apilevel internal
* @declaredat ASTNode:47
*/
public Modifier copy() {
try {
Modifier node = (Modifier) 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:66
*/
@Deprecated
public Modifier 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:76
*/
public Modifier treeCopyNoTransform() {
Modifier tree = (Modifier) 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:96
*/
public Modifier treeCopy() {
Modifier tree = (Modifier) 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:110
*/
protected boolean is$Equal(ASTNode node) {
return super.is$Equal(node) && (tokenString_ID == ((Modifier) node).tokenString_ID);
}
/**
* 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 Annotations
* @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:342
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="Annotations", declaredAt="/home/jesper/git/extendj/java5/frontend/Annotations.jrag:342")
public boolean isAnnotation(String packageName, String name) {
boolean isAnnotation_String_String_value = false;
return isAnnotation_String_String_value;
}
/**
* @attribute syn
* @aspect AnnotationsCodegen
* @declaredat /home/jesper/git/extendj/java5/backend/AnnotationsCodegen.jrag:91
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="AnnotationsCodegen", declaredAt="/home/jesper/git/extendj/java5/backend/AnnotationsCodegen.jrag:91")
public boolean isRuntimeVisible() {
boolean isRuntimeVisible_value = false;
return isRuntimeVisible_value;
}
/**
* @attribute syn
* @aspect AnnotationsCodegen
* @declaredat /home/jesper/git/extendj/java5/backend/AnnotationsCodegen.jrag:104
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="AnnotationsCodegen", declaredAt="/home/jesper/git/extendj/java5/backend/AnnotationsCodegen.jrag:104")
public boolean isRuntimeInvisible() {
boolean isRuntimeInvisible_value = false;
return isRuntimeInvisible_value;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:86
* @apilevel internal
*/
public boolean Define_isLeftChildOfDot(ASTNode _callerNode, ASTNode _childNode) {
int childIndex = this.getIndexOfChild(_callerNode);
return false;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:86
* @apilevel internal
* @return {@code true} if this node has an equation for the inherited attribute isLeftChildOfDot
*/
protected boolean canDefine_isLeftChildOfDot(ASTNode _callerNode, ASTNode _childNode) {
return true;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:101
* @apilevel internal
*/
public boolean Define_isRightChildOfDot(ASTNode _callerNode, ASTNode _childNode) {
int childIndex = this.getIndexOfChild(_callerNode);
return false;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:101
* @apilevel internal
* @return {@code true} if this node has an equation for the inherited attribute isRightChildOfDot
*/
protected boolean canDefine_isRightChildOfDot(ASTNode _callerNode, ASTNode _childNode) {
return true;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:118
* @apilevel internal
*/
public Expr Define_prevExpr(ASTNode _callerNode, ASTNode _childNode) {
int childIndex = this.getIndexOfChild(_callerNode);
return prevExprError();
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:118
* @apilevel internal
* @return {@code true} if this node has an equation for the inherited attribute prevExpr
*/
protected boolean canDefine_prevExpr(ASTNode _callerNode, ASTNode _childNode) {
return true;
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:142
* @apilevel internal
*/
public Access Define_nextAccess(ASTNode _callerNode, ASTNode _childNode) {
int childIndex = this.getIndexOfChild(_callerNode);
return nextAccessError();
}
/**
* @declaredat /home/jesper/git/extendj/java4/frontend/ResolveAmbiguousNames.jrag:142
* @apilevel internal
* @return {@code true} if this node has an equation for the inherited attribute nextAccess
*/
protected boolean canDefine_nextAccess(ASTNode _callerNode, ASTNode _childNode) {
return true;
}
/** @apilevel internal */
public ASTNode rewriteTo() {
return super.rewriteTo();
}
/** @apilevel internal */
public boolean canRewrite() {
return false;
}
}