Exemplo 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);
Exemplo n.º 3
0
 public static BoundFieldRef CreateClassConst(BoundTypeRef parent, BoundVariableName name) => new BoundFieldRef()
 {
     _parentType = parent, _fieldName = name, _type = FieldType.ClassConstant
 };
Exemplo n.º 4
0
 public static BoundFieldRef CreateStaticField(BoundTypeRef parent, BoundVariableName name) => new BoundFieldRef()
 {
     _parentType = parent, _fieldName = name, _type = FieldType.StaticField
 };
Exemplo n.º 5
0
 public static BoundFieldRef CreateInstanceField(BoundExpression instance, BoundVariableName name) => new BoundFieldRef()
 {
     _parentExpr = instance, _fieldName = name, _type = FieldType.InstanceField
 };
Exemplo n.º 6
0
 public BoundVariableRef(BoundVariableName name)
 {
     Debug.Assert(name != null);
     _name = name;
 }