Logo Search packages:      
Sourcecode: janino version File versions  Download package

void org::codehaus::janino::UnitCompiler::determineValue ( Java.SuperclassFieldAccessExpression  scfae  )  throws CompileException [inline, private]

"super.fld", "Type.super.fld"

Definition at line 5493 of file UnitCompiler.java.

References org::codehaus::janino::IClass::getSuperclass(), and org::codehaus::janino::Java::Rvalue::Rvalue().

                                                                                                    {
        if (scfae.value != null) return;

        Rvalue lhs;
        {
            Java.ThisReference tr = new Java.ThisReference(scfae.getLocation());
            tr.setEnclosingBlockStatement(scfae.getEnclosingBlockStatement());
            IClass type;
            if (scfae.optionalQualification != null) {
                type = UnitCompiler.this.getType(scfae.optionalQualification);
            } else
            {
                type = this.getType(tr);
            }
            lhs = new Java.Cast(scfae.getLocation(), new SimpleType(scfae.getLocation(), type.getSuperclass()), tr);
        }

        IClass.IField iField = this.findIField(this.getType(lhs), scfae.fieldName, scfae.getLocation());
        if (iField == null) {
            this.compileError("Class has no field \"" + scfae.fieldName + "\"", scfae.getLocation());
            scfae.value = new Java.Rvalue(scfae.getLocation()) {
                public String toString() { return "???"; }
                public final void accept(Visitor.AtomVisitor visitor) {}
                public final void accept(Visitor.RvalueVisitor visitor) {}
            };
            return;
        }
        scfae.value = new Java.FieldAccess(
            scfae.getLocation(),
            lhs,
            iField
        );
        scfae.value.setEnclosingBlockStatement(scfae.getEnclosingBlockStatement());
    }


Generated by  Doxygen 1.6.0   Back to index