Esempio n. 1
0
        BoundExpression BindFieldUse(AST.StaticFieldUse x, BoundAccess access)
        {
            var typeref = BindTypeRef(x.TypeRef);
            BoundVariableName varname;

            if (x is AST.DirectStFldUse)
            {
                var dx = (AST.DirectStFldUse)x;
                varname = new BoundVariableName(dx.PropertyName);
            }
            else if (x is AST.IndirectStFldUse)
            {
                var ix            = (AST.IndirectStFldUse)x;
                var fieldNameExpr = BindExpression(ix.FieldNameExpr, BoundAccess.Read);

                varname = new BoundVariableName(fieldNameExpr);
            }
            else
            {
                throw ExceptionUtilities.UnexpectedValue(x);
            }

            return(BoundFieldRef.CreateStaticField(typeref, varname));
        }
 public virtual TResult VisitVariableName(BoundVariableName x) => DefaultVisitOperation(x);
Esempio n. 3
0
 public static BoundFieldRef CreateClassConst(BoundTypeRef parent, BoundVariableName name) => new BoundFieldRef()
 {
     _parentType = parent, _fieldName = name, _type = FieldType.ClassConstant
 };
Esempio n. 4
0
 public static BoundFieldRef CreateStaticField(BoundTypeRef parent, BoundVariableName name) => new BoundFieldRef()
 {
     _parentType = parent, _fieldName = name, _type = FieldType.StaticField
 };
Esempio n. 5
0
 public static BoundFieldRef CreateInstanceField(BoundExpression instance, BoundVariableName name) => new BoundFieldRef()
 {
     _parentExpr = instance, _fieldName = name, _type = FieldType.InstanceField
 };
Esempio n. 6
0
 public BoundVariableRef(BoundVariableName name)
 {
     Debug.Assert(name != null);
     _name = name;
 }