private static void fatal() throws CompileError { throw new CompileError("fatal"); }
/** * Constructs a CannotCompileException with an <code>CompileError</code>. */ public CannotCompileException(CompileError e) { this("[source error] " + e.getMessage(), e); }
public void atArrayInit(ArrayInit init) throws CompileError { throw new CompileError("array initializer is not supported"); }
/** * Constructs a CannotCompileException with an <code>CompileError</code>. */ public CannotCompileException(CompileError e) { this("[source error] " + e.getMessage(), e); }
private static void badMethod() throws CompileError { throw new CompileError("bad method"); }
private static void badMethod() throws CompileError { throw new CompileError("bad method"); }
protected static void fatal() throws CompileError { throw new CompileError("fatal"); }
private static void badLvalue() throws CompileError { throw new CompileError("bad l-value"); }
private static void badNewExpr() throws CompileError { throw new CompileError("bad new expression"); }
protected static void fatal() throws CompileError { throw new CompileError("fatal"); }
@Override public void atArrayInit(ArrayInit init) throws CompileError { throw new CompileError("array initializer is not supported"); }
private static void badNewExpr() throws CompileError { throw new CompileError("bad new expression"); }
protected static void fatal() throws CompileError { throw new CompileError("fatal"); }
public static CtClass getSuperclass(CtClass c) throws CompileError { try { CtClass sc = c.getSuperclass(); if (sc != null) return sc; } catch (NotFoundException e) {} throw new CompileError("cannot find the super class of " + c.getName()); }
private void atArrayLength(ASTree expr) throws CompileError { if (arrayDim == 0) throw new CompileError(".length applied to a non array"); bytecode.addOpcode(ARRAYLENGTH); exprType = INT; arrayDim = 0; }
protected static void badAssign(Expr expr) throws CompileError { String msg; if (expr == null) msg = "incompatible type for assignment"; else msg = "incompatible type for " + expr.getName(); throw new CompileError(msg); }
public static CtClass getSuperInterface(CtClass c, String interfaceName) throws CompileError { try { CtClass[] intfs = c.getInterfaces(); for (int i = 0; i < intfs.length; i++) if (intfs[i].getName().equals(interfaceName)) return intfs[i]; } catch (NotFoundException e) {} throw new CompileError("cannot find the super inetrface " + interfaceName + " of " + c.getName()); }
protected static void badTypes(Expr expr) throws CompileError { throw new CompileError("invalid types for " + expr.getName()); }
protected static void badType(Expr expr) throws CompileError { throw new CompileError("invalid type for " + expr.getName()); }
private void atArrayLength(ASTree expr) throws CompileError { if (arrayDim == 0) throw new CompileError(".length applied to a non array"); bytecode.addOpcode(ARRAYLENGTH); exprType = INT; arrayDim = 0; }