public void Visit(ClassNode node)
        {
            FirstSemanticVisit tour = new FirstSemanticVisit();

            tour.scope = new Scope
            {
                Type   = scope.GetType(node.TypeClass.Text),
                Parent = scope.GetType(node.TypeInherit.Text).ClassReference.Scope
            };
            tour.errors = errors;
            node.Scope  = tour.scope;

            node.FeatureNodes.ForEach(feature => feature.Accept(tour));
        }
        public static void Check(ProgramNode root, Scope scope)
        {
            var errors = new List <string>();

            Console.ForegroundColor = ConsoleColor.Red;

            var programNode = new FirstSemanticVisit().CheckSemantic(root, scope, errors);

            errors.ForEach(e => Console.WriteLine(e));

            programNode = new SecondSemanticVisit().CheckSemantic(programNode, scope, errors);
            errors.ForEach(e => Console.WriteLine(e));

            Console.ForegroundColor = ConsoleColor.Gray;
            if (errors.Count > 0)
            {
                Environment.Exit(1);
            }
        }