예제 #1
0
 public override void EnterICS_S_VariableOrProcedureCall(VBAParser.ICS_S_VariableOrProcedureCallContext context)
 {
     if (context.Parent.GetType() != typeof(VBAParser.ICS_S_MemberCallContext))
     {
         _resolver.Resolve(context);
     }
 }
        private Declaration ResolveInternal(VBAParser.ICS_S_VariableOrProcedureCallContext context, Declaration localScope, ContextAccessorType accessorType = ContextAccessorType.GetValueOrReference, bool hasExplicitLetStatement = false, bool isAssignmentTarget = false)
        {
            if (context == null)
            {
                return(null);
            }

            var identifierContext = context.ambiguousIdentifier();
            var fieldCall         = context.dictionaryCallStmt();

            return(ResolveInternal(identifierContext, localScope, accessorType, fieldCall, hasExplicitLetStatement, isAssignmentTarget));
        }
        private Declaration Resolve(VBAParser.ICS_S_VariableOrProcedureCallContext context, out VBAParser.AmbiguousIdentifierContext identifierContext, DeclarationType accessorType)
        {
            if (context == null)
            {
                identifierContext = null;
                return(null);
            }

            var identifier = context.ambiguousIdentifier();
            var name       = identifier.GetText();

            var procedure = FindProcedureDeclaration(name, identifier, accessorType);
            var result    = procedure ?? FindVariableDeclaration(name, identifier, accessorType);

            identifierContext = result == null
                ? null
                : result.Context == null
                    ? null
                    : ((dynamic)result.Context).ambiguousIdentifier();
            return(result);
        }
 private Declaration Resolve(VBAParser.ICS_S_VariableOrProcedureCallContext context)
 {
     VBAParser.AmbiguousIdentifierContext discarded;
     return(Resolve(context, out discarded, DeclarationType.PropertyGet));
 }
 public void Resolve(VBAParser.ICS_S_VariableOrProcedureCallContext context)
 {
     ResolveInternal(context, _currentScope);
 }