public override void EnterModule(VBAParser.ModuleContext context)
        {
            Module = new Lazy <Declaration>(() => State.DeclarationFinder
                                            .UserDeclarations(DeclarationType.Module)
                                            .SingleOrDefault(m => m.QualifiedName.QualifiedModuleName.Equals(CurrentModuleName)));

            Members = new Lazy <IDictionary <string, Declaration> >(() => State.DeclarationFinder
                                                                    .Members(CurrentModuleName)
                                                                    .Where(m => !m.DeclarationType.HasFlag(DeclarationType.Module))
                                                                    .GroupBy(m => m.IdentifierName)
                                                                    .ToDictionary(m => m.Key, m => m.FirstOrDefault()));

            SetCurrentScope();
        }
Exemple #2
0
            public override void EnterModule(VBAParser.ModuleContext context)
            {
                _module = new Lazy <Declaration>(() => _state.DeclarationFinder
                                                 .UserDeclarations(DeclarationType.Module)
                                                 .SingleOrDefault(m => m.QualifiedName.QualifiedModuleName.Equals(CurrentModuleName)));

                _members = new Lazy <IDictionary <string, Declaration> >(() => _state.DeclarationFinder
                                                                         .Members(CurrentModuleName)
                                                                         .GroupBy(m => m.IdentifierName)
                                                                         .ToDictionary(m => m.Key, m => m.First()));

                // we did not process the first member of the module we just entered, so reset here
                _isFirstMemberProcessed = false;
            }
 public override void ExitModule(VBAParser.ModuleContext context)
 {
     CurrentScopeDeclaration = null;
 }
Exemple #4
0
 public override bool VisitModule(VBAParser.ModuleContext context)
 {
     return(context.moduleConfig() == null &&
            Visit(context.moduleBody()) &&
            Visit(context.moduleDeclarations()));
 }