public override void EnterCompilation_unit([NotNull] Compilation_unitContext context)
        {
            errorTable.Clear();

            GlobalScope global = new GlobalScope(null);

            context.Scope = global;
            currentScope  = global;

            //init linker for this file
            linker[currentFileAnalysis] = new List <IScope>();
        }
 public override void ExitCompilation_unit([NotNull] Compilation_unitContext context)
 {
     currentScope = currentScope.GetEnclosingScope();
 }
 public override object VisitCompilation_unit([NotNull] Compilation_unitContext context)
 {
     currentScope = context.Scope;
     return(base.VisitCompilation_unit(context));
 }