Examples of CallExpr


Examples of com.caucho.quercus.expr.CallExpr

  private static void addInterpreted(Env env, ArrayValue result, int i)
  {
    Expr expr = env.peekCall(i);

    if (expr instanceof CallExpr) {
      CallExpr callExpr = (CallExpr) expr;

      String functionName = callExpr.getName();
      if ("debug_backtrace".equals(functionName))
        return;
 
      ArrayValue call = new ArrayValueImpl();
      result.put(call);
     
      if (callExpr.getFileName() != null) {
        call.put(FILE,
                 env.createString(callExpr.getFileName()));
        call.put(LINE,
                 LongValue.create(callExpr.getLine()));
      }

      call.put(FUNCTION,
               env.createString(callExpr.getName()));

      // Create "args" argument value array

      // evaluating args a second time is problematic, affecting mediawiki
      // php/180q
      //ArrayValueImpl args = evalArgsArray(env, callExpr);

      ArrayValueImpl args = new ArrayValueImpl(env.peekArgs(i));
     
      call.put(ARGS, args);
    }
    else if (expr instanceof ObjectMethodExpr) {
      ObjectMethodExpr callExpr = (ObjectMethodExpr) expr;

      ArrayValue call = new ArrayValueImpl();
      result.put(call);
     
      if (callExpr.getFileName() != null) {
        call.put(FILE,
                 env.createString(callExpr.getFileName()));
        call.put(LINE,
                 LongValue.create(callExpr.getLine()));
      }

      call.put(FUNCTION,
               env.createString(callExpr.getName()));

      call.put(CLASS,
               env.createString(env.peekCallThis(i).getClassName()));

      call.put(TYPE, env.createString("->"));
View Full Code Here

Examples of com.caucho.quercus.expr.CallExpr

  private static void addInterpreted(Env env, ArrayValue result, int i)
  {
    Expr expr = env.peekCall(i);

    if (expr instanceof CallExpr) {
      CallExpr callExpr = (CallExpr) expr;

      String functionName = callExpr.getName();
      if ("debug_backtrace".equals(functionName))
        return;
       
      ArrayValue call = new ArrayValueImpl();
      result.put(call);
     
      if (callExpr.getFileName() != null) {
        call.put(FILE,
                 env.createString(callExpr.getFileName()));
        call.put(LINE,
                 LongValue.create(callExpr.getLine()));
      }

      call.put(FUNCTION,
               env.createString(callExpr.getName()));

      // Create "args" argument value array

      // evaluating args a second time is problematic, affecting mediawiki
      // php/180q
      //ArrayValueImpl args = evalArgsArray(env, callExpr);

      ArrayValueImpl args = new ArrayValueImpl(env.peekArgs(i));
     
      call.put(ARGS, args);
    }
    else if (expr instanceof ObjectMethodExpr) {
      ObjectMethodExpr callExpr = (ObjectMethodExpr) expr;

      ArrayValue call = new ArrayValueImpl();
      result.put(call);
     
      if (callExpr.getFileName() != null) {
        call.put(FILE,
                 env.createString(callExpr.getFileName()));
        call.put(LINE,
                 LongValue.create(callExpr.getLine()));
      }

      call.put(FUNCTION,
               env.createString(callExpr.getName()));

      call.put(CLASS,
               env.createString(env.peekCallThis(i).getClassName()));

      call.put(TYPE, env.createString("->"));
View Full Code Here

Examples of org.allspice.structured.expr.CallExpr

      }
    }
    else {
        v = factor ;
    }
    return new CallExpr(v,elist_opt,range) ;

  }
View Full Code Here

Examples of org.allspice.structured.expr.CallExpr

  private static void modifyConstructor(EvaluationContext context,
      final ArrayList<Statement> body) throws CompilerException {
    boolean foundInit = firstIsSuperInit(body);
    if (!foundInit) {
      body.add(0,new ExprStatement(new CallExpr(new FieldVarExpr(new VarExpr("super",null),"<init>",null),new FIFO<Expr>(),null),null)) ;
    }
    StubResolver resolver = context.classDef ;
    int pos = 1 ;
    ClassStub stub = resolver.getStub() ;
    for(FieldStub def: stub.fields.values()) {
View Full Code Here

Examples of org.allspice.structured.expr.CallExpr

      Statement st = i.next() ;
      if (st instanceof ExprStatement) {
        ExprStatement es = (ExprStatement)st ;
        Expr e = es.e ;
        if (e instanceof CallExpr) {
          CallExpr ce = (CallExpr)e ;
          Expr ve = ce.object ;
          if (ve instanceof FieldVarExpr) {
            FieldVarExpr fvar = (FieldVarExpr)ve ;
            if (fvar.name.equals("<init>")) {
              return true ;
View Full Code Here

Examples of org.allspice.structured.expr.CallExpr

  public static interface CallStaticTest {
    public int meth(int arg0) ;
  }
  public void test0() throws Exception {
    CallStaticTest obj = makeObject(CallStaticTest.class,new CallExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.TestCallStatic","addone",null),
        new FIFO<Expr>(ARG0),null)) ;
    assertEquals(obj.meth(5),6) ;
  }
View Full Code Here

Examples of org.allspice.structured.expr.CallExpr

public class TestCallVirtual extends MyTestCase {
  public static interface CallVirtualTest {
    public int meth(CallVirtualTestClass arg0,int arg1) ;
  }
  public void test0() throws Exception {
    CallVirtualTest obj = makeObject(CallVirtualTest.class,new CallExpr(new FieldVarExpr(ARG0,"addone",null),
        new FIFO<Expr>(ARG1),null)) ;
    CallVirtualTestClass o2 = new CallVirtualTestClass() ;
    assertEquals(obj.meth(o2,5),6) ;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.