home *** CD-ROM | disk | FTP | other *** search
- package sun.tools.tree;
-
- import java.io.ByteArrayOutputStream;
- import java.io.PrintStream;
- import sun.tools.java.ClassNotFound;
- import sun.tools.java.CompilerError;
- import sun.tools.java.Constants;
- import sun.tools.java.Environment;
- import sun.tools.java.Type;
-
- public class Node implements Constants, Cloneable {
- // $FF: renamed from: op int
- int field_0;
- int where;
-
- Node(int var1, int var2) {
- this.field_0 = var1;
- this.where = var2;
- }
-
- public int getOp() {
- return this.field_0;
- }
-
- public int getWhere() {
- return this.where;
- }
-
- public Expression convert(Environment var1, Context var2, Type var3, Expression var4) {
- if (!var4.type.isType(13) && !var3.isType(13)) {
- if (var4.type.equals(var3)) {
- return var4;
- } else {
- try {
- if (var4.fitsType(var1, var2, var3)) {
- return new ConvertExpression(this.where, var3, var4);
- }
-
- if (var1.explicitCast(var4.type, var3)) {
- var1.error(this.where, "explicit.cast.needed", Constants.opNames[this.field_0], var4.type, var3);
- return new ConvertExpression(this.where, var3, var4);
- }
- } catch (ClassNotFound var6) {
- var1.error(this.where, "class.not.found", var6.name, Constants.opNames[this.field_0]);
- }
-
- var1.error(this.where, "incompatible.type", Constants.opNames[this.field_0], var4.type, var3);
- return new ConvertExpression(this.where, Type.tError, var4);
- }
- } else {
- return var4;
- }
- }
-
- public void print(PrintStream var1) {
- throw new CompilerError("print");
- }
-
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException var1) {
- throw new InternalError();
- }
- }
-
- public String toString() {
- ByteArrayOutputStream var1 = new ByteArrayOutputStream();
- this.print(new PrintStream(var1));
- return var1.toString();
- }
- }
-