コード例 #1
0
        /**
         * Creates a class field Foo::$bar
         */
        public override Expr createClassField(QuercusParser parser, StringValue name)
        {
            ExprFactory factory = parser.getExprFactory();

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

            if ("self".equals(specialClassName))
            {
                if ("this".equals(name.ToString()))
                {
                    return(factory.createThis(parser.getClassDef()));
                }
                else
                {
                    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));
            }
        }