/**
         * Creates an assignment using this value as the right hand side.
         */
        public override Expr createAssignFrom(QuercusParser parser,
                                              AbstractVarExpr leftHandSide)
        {
            ExprFactory factory = parser.getExprFactory();

            return(factory.createAssignRef(leftHandSide, _expr));
        }
        /**
         * Creates a class field Foo::${bar}
         */
        public override Expr createClassField(QuercusParser parser, Expr name)
        {
            ExprFactory factory = parser.getExprFactory();

            string className        = _var;
            string specialClassName = getSpecialClassName();

            if ("self".equals(specialClassName))
            {
                className = parser.getSelfClassName();

                return(factory.createClassField(className, name));
            }
            else if ("parent".equals(specialClassName))
            {
                className = parser.getParentClassName();

                return(factory.createClassField(className, name));
            }
            else if ("static".equals(specialClassName))
            {
                return(factory.createClassVirtualField(name));
            }
            else
            {
                return(factory.createClassField(className, name));
            }
        }
示例#3
0
        /**
         * Creates an assignment using this value as the right hand side.
         */
        public Expr createAssignFrom(QuercusParser parser,
                                     AbstractVarExpr leftHandSide)
        {
            ExprFactory factory = parser.getExprFactory();

            return(factory.createAssign(leftHandSide, this));
        }
示例#4
0
        /**
         * Creates a class field $class::foo
         */
        public override Expr createClassConst(QuercusParser parser, Expr name)
        {
            ExprFactory factory = parser.getExprFactory();

            string className = _value.ToString();

            if ("self".equals(className))
            {
                className = parser.getSelfClassName();

                return(factory.createClassConst(className, name));
            }
            else if ("parent".equals(className))
            {
                className = parser.getParentClassName();

                return(factory.createClassConst(className, name));
            }
            else if ("static".equals(className))
            {
                return(factory.createClassVirtualConst(name));
            }
            else
            {
                return(factory.createClassConst(className, name));
            }
        }
示例#5
0
        //
        // function call creation
        //

        /**
         * Creates a function call expression
         */
        public override Expr createCall(QuercusParser parser,
                                        Location location,
                                        ArrayList <Expr> args)

        {
            ExprFactory factory = parser.getExprFactory();

            return(factory.createThisMethod(location, _qThis, _nameExpr, args));
        }
        //
        // function call creation
        //

        /**
         * Creates a function call expression
         */
        public override Expr createCall(QuercusParser parser,
                                        Location location,
                                        ArrayList <Expr> args)

        {
            ExprFactory factory = parser.getExprFactory();

            return(factory.createClassMethodCall(location, _className, _varName, args));
        }
示例#7
0
        //
        // function call creation
        //

        /**
         * Creates a function call expression
         */
        public Expr createCall(QuercusParser parser,
                               Location location,
                               ArrayList <Expr> args)

        {
            ExprFactory factory = parser.getExprFactory();

            return(factory.createVarFunction(location, this, args));
        }
        //
        // function call creation
        //

        /**
         * Creates a function call expression
         */
        public override Expr createCall(QuercusParser parser,
                                        Location location,
                                        ArrayList <Expr> args)

        {
            ExprFactory factory = parser.getExprFactory();

            Expr var = parser.createVar(_varName);

            return(factory.createClassVirtualMethodCall(location, var, args));
        }
        //
        // function call creation
        //

        /**
         * Creates a function call expression
         */
        public override Expr createCall(QuercusParser parser,
                                        Location location,
                                        ArrayList <Expr> args)

        {
            /*
             * if (_className.equals(_name))
             * return factory.createClassConstructor(location, _className, _name, args);
             * else
             * return factory.createClassMethodCall(location, _className, _name, args);
             */
            ExprFactory factory = parser.getExprFactory();

            return(factory.createClassMethodCall(location, _className, _name, args));
        }
        //
        // expression creation
        //

        /**
         * Creates a class field Foo::bar
         */
        public override Expr createClassConst(QuercusParser parser, StringValue name)
        {
            ExprFactory factory = parser.getExprFactory();

            string className        = _var;
            string specialClassName = getSpecialClassName();

            if ("self".equals(specialClassName))
            {
                className = parser.getSelfClassName();

                return(factory.createClassConst(className, name));
            }
            else if ("parent".equals(specialClassName))
            {
                className = parser.getParentClassName();

                if (className != null)
                {
                    return(factory.createClassConst(className, name));
                }
                else
                {
                    // trait's parent @is not known at parse time
                    return(factory.createTraitParentClassConst(parser.getClassName(), name));
                }
            }
            else if ("static".equals(specialClassName))
            {
                return(factory.createClassVirtualConst(name));
            }
            else
            {
                return(factory.createClassConst(className, name));
            }
        }
示例#11
0
 /**
  * Creates the reference
  * @param location
  */
 public override Expr createRef(QuercusParser parser)
 {
     return(parser.getExprFactory().createRef(this));
 }
示例#12
0
 /**
  * Creates the assignment.
  */
 public override Expr createAssignRef(QuercusParser parser,
                                      Expr value)
 {
     return(parser.getExprFactory().createAssignRef(this, value));
 }
示例#13
0
        /**
         * Creates a class field $class::${foo}
         */
        public Expr createClassField(QuercusParser parser, Expr name)
        {
            ExprFactory factory = parser.getExprFactory();

            return(factory.createClassField(this, name));
        }
示例#14
0
        //
        // class field refs $class::$bar
        //

        /**
         * Creates a class field $class::foo
         */
        public Expr createClassConst(QuercusParser parser, StringValue name)
        {
            ExprFactory factory = parser.getExprFactory();

            return(factory.createClassConst(this, name));
        }