public void atMember(Member mem) throws CompileError { String name = mem.get(); if (name.equals(codeGen.paramArrayName)) { exprType = CLASS; arrayDim = 1; className = jvmJavaLangObject; } else if (name.equals(JvstCodeGen.sigName)) { exprType = CLASS; arrayDim = 1; className = "java/lang/Class"; } else if (name.equals(JvstCodeGen.dollarTypeName) || name.equals(JvstCodeGen.clazzName)) { exprType = CLASS; arrayDim = 0; className = "java/lang/Class"; } else super.atMember(mem); }
public boolean isParamListName(ASTList args) { if (codeGen.paramTypeList != null && args != null && args.tail() == null) { ASTree left = args.head(); return (left instanceof Member && ((Member)left).get().equals(codeGen.paramListName)); } else return false; }
public boolean isParamListName(ASTList args) { if (paramTypeList != null && args != null && args.tail() == null) { ASTree left = args.head(); return (left instanceof Member && ((Member)left).get().equals(paramListName)); } else return false; }
public int getMethodArgsLength(ASTList args) { String pname = codeGen.paramListName; int n = 0; while (args != null) { ASTree a = args.head(); if (a instanceof Member && ((Member)a).get().equals(pname)) { if (codeGen.paramTypeList != null) n += codeGen.paramTypeList.length; } else ++n; args = args.tail(); } return n; }
public int getMethodArgsLength(ASTList args) { String pname = paramListName; int n = 0; while (args != null) { ASTree a = args.head(); if (a instanceof Member && ((Member)a).get().equals(pname)) { if (paramTypeList != null) n += paramTypeList.length; } else ++n; args = args.tail(); } return n; }
public boolean isParamListName(ASTList args) { if (paramTypeList != null && args != null && args.tail() == null) { ASTree left = args.head(); return (left instanceof Member && ((Member)left).get().equals(paramListName)); } return false; }
public boolean isParamListName(ASTList args) { if (codeGen.paramTypeList != null && args != null && args.tail() == null) { ASTree left = args.head(); return (left instanceof Member && ((Member)left).get().equals(codeGen.paramListName)); } return false; }
protected void atFieldAssign(Expr expr, int op, ASTree left, ASTree right) throws CompileError { if (left instanceof Member && ((Member)left).get().equals(codeGen.paramArrayName)) { right.accept(this); CtClass[] params = codeGen.paramTypeList; if (params == null) return; int n = params.length; for (int i = 0; i < n; ++i) compileUnwrapValue(params[i]); } else super.atFieldAssign(expr, op, left, right); }
@Override public int getMethodArgsLength(ASTList args) { String pname = paramListName; int n = 0; while (args != null) { ASTree a = args.head(); if (a instanceof Member && ((Member)a).get().equals(pname)) { if (paramTypeList != null) n += paramTypeList.length; } else ++n; args = args.tail(); } return n; }
@Override public int getMethodArgsLength(ASTList args) { String pname = codeGen.paramListName; int n = 0; while (args != null) { ASTree a = args.head(); if (a instanceof Member && ((Member)a).get().equals(pname)) { if (codeGen.paramTypeList != null) n += codeGen.paramTypeList.length; } else ++n; args = args.tail(); } return n; }
public void atCallExpr(CallExpr expr) throws CompileError { ASTree method = expr.oprand1(); if (method instanceof Member) { String name = ((Member)method).get(); if (procHandler != null && name.equals(proceedName)) { procHandler.doit(this, bytecode, (ASTList)expr.oprand2()); return; } else if (name.equals(cflowName)) { atCflow((ASTList)expr.oprand2()); return; } } super.atCallExpr(expr); }
@Override protected void atFieldAssign(Expr expr, int op, ASTree left, ASTree right) throws CompileError { if (left instanceof Member && ((Member)left).get().equals(codeGen.paramArrayName)) { right.accept(this); CtClass[] params = codeGen.paramTypeList; if (params == null) return; int n = params.length; for (int i = 0; i < n; ++i) compileUnwrapValue(params[i]); } else super.atFieldAssign(expr, op, left, right); }
public void atCallExpr(CallExpr expr) throws CompileError { ASTree method = expr.oprand1(); if (method instanceof Member) { String name = ((Member)method).get(); if (codeGen.procHandler != null && name.equals(codeGen.proceedName)) { codeGen.procHandler.setReturnType(this, (ASTList)expr.oprand2()); return; } else if (name.equals(JvstCodeGen.cflowName)) { atCflow((ASTList)expr.oprand2()); return; } } super.atCallExpr(expr); }
public void atMethodArgs(ASTList args, int[] types, int[] dims, String[] cnames) throws CompileError { CtClass[] params = codeGen.paramTypeList; String pname = codeGen.paramListName; int i = 0; while (args != null) { ASTree a = args.head(); if (a instanceof Member && ((Member)a).get().equals(pname)) { if (params != null) { int n = params.length; for (int k = 0; k < n; ++k) { CtClass p = params[k]; setType(p); types[i] = exprType; dims[i] = arrayDim; cnames[i] = className; ++i; } } } else { a.accept(this); types[i] = exprType; dims[i] = arrayDim; cnames[i] = className; ++i; } args = args.tail(); } }
protected void atFieldAssign(Expr expr, int op, ASTree left, ASTree right, boolean doDup) throws CompileError { if (left instanceof Member && ((Member)left).get().equals(paramArrayName)) { if (op != '=') throw new CompileError("bad operator for " + paramArrayName); right.accept(this); if (arrayDim != 1 || exprType != CLASS) throw new CompileError("invalid type for " + paramArrayName); atAssignParamList(paramTypeList, bytecode); if (!doDup) bytecode.addOpcode(POP); } else super.atFieldAssign(expr, op, left, right, doDup); }
@Override public void atCallExpr(CallExpr expr) throws CompileError { ASTree method = expr.oprand1(); if (method instanceof Member) { String name = ((Member)method).get(); if (procHandler != null && name.equals(proceedName)) { procHandler.doit(this, bytecode, (ASTList)expr.oprand2()); return; } else if (name.equals(cflowName)) { atCflow((ASTList)expr.oprand2()); return; } } super.atCallExpr(expr); }
@Override public void atCallExpr(CallExpr expr) throws CompileError { ASTree method = expr.oprand1(); if (method instanceof Member) { String name = ((Member)method).get(); if (codeGen.procHandler != null && name.equals(codeGen.proceedName)) { codeGen.procHandler.setReturnType(this, (ASTList)expr.oprand2()); return; } else if (name.equals(JvstCodeGen.cflowName)) { atCflow((ASTList)expr.oprand2()); return; } } super.atCallExpr(expr); }
while (args != null) { ASTree a = args.head(); if (a instanceof Member && ((Member)a).get().equals(pname)) { if (params != null) { int n = params.length;
@Override protected void atFieldAssign(Expr expr, int op, ASTree left, ASTree right, boolean doDup) throws CompileError { if (left instanceof Member && ((Member)left).get().equals(paramArrayName)) { if (op != '=') throw new CompileError("bad operator for " + paramArrayName); right.accept(this); if (arrayDim != 1 || exprType != CLASS) throw new CompileError("invalid type for " + paramArrayName); atAssignParamList(paramTypeList, bytecode); if (!doDup) bytecode.addOpcode(POP); } else super.atFieldAssign(expr, op, left, right, doDup); }
public void atMember(Member mem) throws CompileError { String name = mem.get(); if (name.equals(paramArrayName)) { compileParameterList(bytecode, paramTypeList, indexOfParam1());