org.extendj.ast.PostIncExpr 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:264
* @astdecl PostIncExpr : PostfixExpr;
* @production PostIncExpr : {@link PostfixExpr};
*/
public class PostIncExpr extends PostfixExpr implements Cloneable {
/**
* @aspect CreateBCode
* @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:1046
*/
public void createBCode(CodeGeneration gen) {
emitPostfix(gen, 1);
}
/**
* @declaredat ASTNode:1
*/
public PostIncExpr() {
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 = {"Operand"},
type = {"Expr"},
kind = {"Child"}
)
public PostIncExpr(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();
stmtCompatible_reset();
}
/** @apilevel internal
* @declaredat ASTNode:37
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/** @apilevel internal
* @declaredat ASTNode:41
*/
public PostIncExpr clone() throws CloneNotSupportedException {
PostIncExpr node = (PostIncExpr) super.clone();
return node;
}
/** @apilevel internal
* @declaredat ASTNode:46
*/
public PostIncExpr copy() {
try {
PostIncExpr node = (PostIncExpr) 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:65
*/
@Deprecated
public PostIncExpr 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:75
*/
public PostIncExpr treeCopyNoTransform() {
PostIncExpr tree = (PostIncExpr) 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:95
*/
public PostIncExpr treeCopy() {
PostIncExpr tree = (PostIncExpr) 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:109
*/
protected boolean is$Equal(ASTNode node) {
return super.is$Equal(node);
}
/**
* Replaces the Operand child.
* @param node The new node to replace the Operand child.
* @apilevel high-level
*/
public void setOperand(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the Operand child.
* @return The current node used as the Operand child.
* @apilevel high-level
*/
@ASTNodeAnnotation.Child(name="Operand")
public Expr getOperand() {
return (Expr) getChild(0);
}
/**
* Retrieves the Operand child.
* This method does not invoke AST transformations.
* @return The current node used as the Operand child.
* @apilevel low-level
*/
public Expr getOperandNoTransform() {
return (Expr) getChildNoTransform(0);
}
/**
* @attribute syn
* @aspect PrettyPrintUtil
* @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:389
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="PrettyPrintUtil", declaredAt="/home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:389")
public String printPostOp() {
String printPostOp_value = "++";
return printPostOp_value;
}
/** @apilevel internal */
private void stmtCompatible_reset() {
stmtCompatible_computed = null;
}
/** @apilevel internal */
protected ASTState.Cycle stmtCompatible_computed = null;
/** @apilevel internal */
protected boolean stmtCompatible_value;
/**
* @attribute syn
* @aspect StmtCompatible
* @declaredat /home/jesper/git/extendj/java8/frontend/LambdaExpr.jrag:149
*/
@ASTNodeAnnotation.Attribute(kind=ASTNodeAnnotation.Kind.SYN)
@ASTNodeAnnotation.Source(aspect="StmtCompatible", declaredAt="/home/jesper/git/extendj/java8/frontend/LambdaExpr.jrag:149")
public boolean stmtCompatible() {
ASTState state = state();
if (stmtCompatible_computed == ASTState.NON_CYCLE || stmtCompatible_computed == state().cycle()) {
return stmtCompatible_value;
}
stmtCompatible_value = true;
if (state().inCircle()) {
stmtCompatible_computed = state().cycle();
} else {
stmtCompatible_computed = ASTState.NON_CYCLE;
}
return stmtCompatible_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 = getOperand().isVariable(var);
return modifiedInScope_Variable_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 = getOperand().isVarAccessWithAccessor();
return needsPop_value;
}
/** @apilevel internal */
public ASTNode rewriteTo() {
return super.rewriteTo();
}
/** @apilevel internal */
public boolean canRewrite() {
return false;
}
}