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