Mirror of the BLOAT repository https://www.cs.purdue.edu/homes/hosking/bloat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
bloat/src/edu/purdue/cs/bloat/tree/ExprStmt.java

76 lines
2.2 KiB

/*
* Class: ExprStmt
* Version:
* Date:
*
* All files in the distribution of BLOAT (Bytecode Level Optimization and
* Analysis tool for Java(tm)) are Copyright 1997-2001 by the Purdue
* Research Foundation of Purdue University. All rights reserved.
*
* <p>
*
* Redistribution and use in source and binary forms are permitted
* provided that this entire copyright notice is duplicated in all
* such copies, and that any documentation, announcements, and other
* materials related to such distribution and use acknowledge that the
* software was developed at Purdue University, West Lafayette, IN by
* @author Antony Hosking
* @author David Whitlock
* @author Nathaniel Nystrom
* No charge may be made for copies, derivations, or distributions of
* this material without the express written consent of the copyright
* holder. Neither the name of the University nor the name of the
* author may be used to endorse or promote products derived from this
* material without specific prior written permission. THIS SOFTWARE
* IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE.
*
* <p>
*
* Port of the BLOAT to use the Jakata Apache project BCEL 5.2 was
* contributed by The Australian National University by
* @author Arrin Daley
* @author John N Zigman
*
* <p>
* Java is a trademark of Sun Microsystems, Inc.
*/
package edu.purdue.cs.bloat.tree;
/**
* ExprStmt is a statement consisting of an expression.
*
* @see Expr
*/
public class ExprStmt extends Stmt {
Expr expr; // Expression contained in this statement
/**
* Constructor.
*
* @param expr
* The expression contained in this statement.
*/
public ExprStmt(Expr expr) {
this.expr = expr;
expr.setParent(this);
}
public Expr expr() {
return expr;
}
public void visitForceChildren(TreeVisitor visitor) {
expr.visit(visitor);
}
public void visit(TreeVisitor visitor) {
visitor.visitExprStmt(this);
}
public Object clone() {
return copyInto(new ExprStmt((Expr) expr.clone()));
}
}