private IExpressionBinding Visit(Declaration module, Declaration parent, VBAParser.LExpressionContext expression, IBoundExpression withBlockVariable, StatementResolutionContext statementContext) { switch (expression) { case VBAParser.SimpleNameExprContext simpleNameExprContext: return(Visit(module, parent, simpleNameExprContext, statementContext)); case VBAParser.MemberAccessExprContext memberAccessExprContext: return(Visit(module, parent, memberAccessExprContext, withBlockVariable, statementContext)); case VBAParser.IndexExprContext indexExprContext: return(Visit(module, parent, indexExprContext, withBlockVariable)); case VBAParser.WithMemberAccessExprContext withMemberAccessExprContext: return(Visit(module, parent, withMemberAccessExprContext, withBlockVariable, statementContext)); case VBAParser.InstanceExprContext instanceExprContext: return(Visit(module, instanceExprContext)); case VBAParser.WhitespaceIndexExprContext whitespaceIndexExprContext: return(Visit(module, parent, whitespaceIndexExprContext, withBlockVariable)); case VBAParser.DictionaryAccessExprContext dictionaryAccessExprContext: return(Visit(module, parent, dictionaryAccessExprContext, withBlockVariable)); case VBAParser.WithDictionaryAccessExprContext withDictionaryAccessExprContext: return(Visit(module, parent, withDictionaryAccessExprContext, withBlockVariable)); case VBAParser.ObjectPrintExprContext objectPrintExprContext: return(Visit(module, parent, objectPrintExprContext, withBlockVariable)); default: throw new NotSupportedException($"Unexpected lExpression type {expression.GetType()}"); } }
private IExpressionBinding Visit(Declaration module, Declaration parent, VBAParser.LExpressionContext expression) { switch (expression) { case VBAParser.SimpleNameExprContext simpleNameExprContext: return(Visit(module, parent, simpleNameExprContext)); case VBAParser.MemberAccessExprContext memberAccessExprContext: return(Visit(module, parent, memberAccessExprContext)); default: throw new NotSupportedException($"Unexpected lExpression type {expression.GetType()}"); } }