1 cananian 1.1.2.1 // Exp.java, created Wed Jan 13 21:14:57 1999 by cananian 2 cananian 1.1.2.9 // Copyright (C) 1998 C. Scott Ananian <cananian@alumni.princeton.edu> 3 cananian 1.1.2.9 // Licensed under the terms of the GNU GPL; see COPYING for details. 4 cananian 1.1.2.1 package harpoon.IR.Tree; 5 cananian 1.1.2.1 6 cananian 1.1.2.12 import harpoon.ClassFile.HCodeElement; 7 duncan 1.1.2.4 import harpoon.Temp.CloningTempMap; 8 duncan 1.1.2.7 9 cananian 1.1.2.10 import java.util.Collections; 10 duncan 1.1.2.7 import java.util.Set; 11 duncan 1.1.2.4 12 cananian 1.1.2.1 /** 13 cananian 1.1.2.1 * <code>Exp</code> objects are expressions which stand for the computation 14 cananian 1.1.2.1 * of some value (possibly with side effects). 15 cananian 1.1.2.1 * 16 cananian 1.1.2.1 * @author C. Scott Ananian <cananian@alumni.princeton.edu>, based on 17 cananian 1.1.2.1 * <i>Modern Compiler Implementation in Java</i> by Andrew Appel. 18 cananian 1.2 * @version $Id: Exp.java,v 1.2 2002/02/25 21:05:31 cananian Exp $ 19 cananian 1.1.2.1 */ 20 cananian 1.1.2.6 abstract public class Exp extends Tree implements Typed { 21 cananian 1.1.2.12 protected Exp(TreeFactory tf, HCodeElement source, int arity) { 22 cananian 1.1.2.12 super(tf, source, arity); 23 cananian 1.1.2.3 } 24 duncan 1.1.2.5 25 cananian 1.1.2.1 /** Build an <code>Exp</code> of this type from the given list of 26 cananian 1.1.2.1 * subexpressions. */ 27 cananian 1.1.2.12 public final Exp build(ExpList kids) { return build(this.tf, kids); } 28 duncan 1.1.2.8 abstract public Exp build(TreeFactory tf, ExpList kids); 29 cananian 1.1.2.6 30 cananian 1.1.2.6 // Typed interface: 31 cananian 1.1.2.6 /** Result type. */ 32 cananian 1.1.2.6 public abstract int type(); 33 cananian 1.1.2.6 /** Returns <code>true</code> if the expression corresponds to a 34 cananian 1.1.2.6 * 64-bit value. */ 35 cananian 1.1.2.6 public boolean isDoubleWord() { return Type.isDoubleWord(tf, type()); } 36 cananian 1.1.2.6 /** Returns <code>true</code> if the expression corresponds to a 37 cananian 1.1.2.6 * floating-point value. */ 38 cananian 1.1.2.6 public boolean isFloatingPoint() { return Type.isFloatingPoint(type()); } 39 duncan 1.1.2.11 40 cananian 1.1.2.1 } 41 duncan 1.1.2.11 42 cananian 1.2