/**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value eval(Env env)
        {
            string className = _className.evalString(env);

            QuercusClass qClass = env.getClass(className);

            StringValue varName = _varName.evalStringValue(env);

            return(qClass.getStaticFieldValue(env, varName));
        }
Ejemplo n.º 2
0
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value evalArg(Env env, bool isTop)
        {
            Value value = _objExpr.evalArg(env, false);

            // XXX: getFieldArg(isTop)

            return(value.getFieldArg(env, _nameExpr.evalStringValue(env), isTop));
        }
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value eval(Env env)
        {
            string      className = env.getThis().getQuercusClass().getName();
            StringValue varName   = _varName.evalStringValue(env);

            StringValue sb = env.createStringBuilder();

            sb.append(className);
            sb.append("::");
            sb.append(varName);

            return(env.getStaticValue(sb));
        }
Ejemplo n.º 4
0
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value eval(Env env)
        {
            Value qThis = env.getThis();

            QuercusClass cls = qThis.getQuercusClass();

            if (cls == null)
            {
                env.error(L.l("no calling class found"), getLocation());

                return(NullValue.NULL);
            }

            StringValue methodName = _methodName.evalStringValue(env);
            int         hash       = methodName.hashCodeCaseInsensitive();

            Value [] values = evalArgs(env, _args);

            env.pushCall(this, cls, values);

            try {
                env.checkTimeout();

                return(cls.callMethod(env, qThis, methodName, hash, values));
            } finally {
                env.popCall();
            }
        }
Ejemplo n.º 5
0
        private StringValue evalName(Env env)
        {
            StringValue name = _nameExpr.evalStringValue(env);

            ClassField entry = _qThis.getClassDef().getField(name);

            if (entry != null)
            {
                name = entry.getCanonicalName();
            }

            return(name);
        }
  /**
   * Evaluates the expression.
   *
   * @param env the calling environment.
   *
   * @return the expression value.
   */
  public Value eval(Env env)
  {
    StringValue varName = _var.evalStringValue(env);

    Value value = env.getValue(varName);

    if (value != null)
      return value;
    else
      return NullValue.NULL;
  }
Ejemplo n.º 7
0
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value eval(Env env)
        {
            QuercusClass cl = env.findClass(_className);

            if (cl == null)
            {
                env.error(L.l("no matching class {0}", _className), getLocation());
            }

            // qa/0954 - static calls pass the current $this
            Value qThis = env.getThis();

            StringValue methodName = _nameExpr.evalStringValue(env);

            Value [] args = evalArgs(env, _args);
            int      hash = methodName.hashCodeCaseInsensitive();

            return(cl.callStaticMethod(env, qThis, methodName, hash, args));
        }
Ejemplo n.º 8
0
        //
        // evaluation
        //

        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value eval(Env env)
        {
            string className = _className.evalString(env);

            QuercusClass cl = env.findClass(className);

            if (cl == null)
            {
                env.error(L.l("no matching class {0}", className), getLocation());
            }

            StringValue methodName = _methodName.evalStringValue(env);
            int         hash       = methodName.hashCodeCaseInsensitive();

            Value [] args = evalArgs(env, _args);

            return(cl.callMethod(env, env.getThis(),
                                 methodName, hash,
                                 args));
        }
Ejemplo n.º 9
0
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public Value eval(Env env)
        {
            StringValue name = _name.evalStringValue(env);

            return(env.getCallingClass().getConstant(env, name));
        }
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value eval(Env env)
        {
            StringValue varName = _varName.evalStringValue(env);

            return(env.getClass(_className).getStaticFieldValue(env, varName));
        }
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public override Value eval(Env env)
        {
            StringValue name = _name.evalStringValue(env);

            return(env.getClass(_className).getConstant(env, name));
        }
Ejemplo n.º 12
0
        /**
         * Evaluates the expression.
         *
         * @param env the calling environment.
         *
         * @return the expression value.
         */
        public Value eval(Env env)
        {
            QuercusClass cls = _className.evalQuercusClass(env);

            return(cls.getConstant(env, _name.evalStringValue(env)));
        }