public static BoundAccessExpression BindAccess(AbstractPhaseContext context, SyntaxNode node, Symbol accessSymbol, BoundExpression symbolExpressionSource) { if (node.Kind() == SyntaxKind.ThisExpression) { return(new BoundThisAccessExpression(node, ((ParameterSymbol)accessSymbol).Type, symbolExpressionSource)); } switch (accessSymbol) { case LocalSymbol localSymbol: return(BoundLocalAccessExpression.BindLocalAccess(node, localSymbol)); case ParameterSymbol parameterSymbol: return(new BoundParameterAccessExpression(node, parameterSymbol)); case FieldSymbol fieldSymbol: return(BoundFieldAccessExpression.BindFieldAccess(node, fieldSymbol, symbolExpressionSource)); case PropertySymbol propertySymbol: return(BoundPropertyAccessExpression.BindPropertyAccess(context, node, propertySymbol, symbolExpressionSource)); } throw new System.NotImplementedException(); }
public static BoundAccessExpression BindElementAccess(AbstractPhaseContext context, SyntaxNode node, PropertySymbol accessSymbol, BoundExpression symbolExpressionSource, BoundExpression[] indexers) { return(BoundPropertyAccessExpression.BindPropertyAccess(context, node, accessSymbol, symbolExpressionSource, indexers)); }