public override void AfterVisit(Module node)
 {
     PopAndAssert(node.GetExtension<ScopeExtension>().SymbolTable);
     PopAndAssert(node.UseStatements.GetExtension<ScopeExtension>().SymbolTable);
 }
        public override void BeforeVisit(Module node)
        {
            _currentModule = node;

            node.UseStatements.GetExtension<ScopeExtension>().SymbolTable = new HappySymbolTable("UseStatementList (Import Scope)", null);
            node.GetExtension<ScopeExtension>().SymbolTable = new HappySymbolTable("Globals", node.UseStatements.GetExtension<ScopeExtension>().SymbolTable);

            _scopeStack.Push(node.UseStatements.GetExtension<ScopeExtension>().SymbolTable);
            _scopeStack.Push(node.GetExtension<ScopeExtension>().SymbolTable);

            foreach(var ns in _defaultUseNamespaces)
            {
                string[] namespaceSegments = ns.Split('.');
                addTrackerForDeepestNamespaceToModuleSymbolTable(namespaceSegments,
                                                                 s =>
                                                                 {
                                                                     throw new InternalException("Failed to load default namespace: {0}", ns);
                                                                 });
            }

            foreach (HappyNamespaceTracker tracker in _rootNamespaces.Values)
            {
                node.GetExtension<ScopeExtension>().SymbolTable.Add(new HappyNamedExpressionSymbol(tracker.Name, _getGlobalGetter));
            }
        }