public void Init()
 {
     Program.TestMode = true;
     CST         = Program.BuildCST("kode.giraph");
     AST         = Program.BuildAST(CST);
     SymbolTable = Program.BuildSymbolTable(AST as StartNode);
 }
 public void Init()
 {
     Program.TestMode = true;
     CST         = Program.BuildCST("kode_TypeChecker.giraph");
     AST         = Program.BuildAST(CST);
     SymbolTable = Program.BuildSymbolTable(AST as StartNode);
     Program.TypeCheck(SymbolTable, AST as StartNode);
     errorlist = SymbolTable.getTypeCheckErrorList();
 }
Beispiel #3
0
 public void Init()
 {
     Program.TestMode = true;
     if (Utilities.IsWindows)
     {
         CodeGeneratorOutputPath = "C:\\Users\\Ezzi\\Source\\Repos\\P4-Project\\Unittests\\CodeGeneration";
     }
     CST = Program.BuildCST("kode_generator.giraph");
     AST = Program.BuildAST(CST);
     Program.WriteCodeToFiles(AST as StartNode);
 }
Beispiel #4
0
 public override AbstractNode VisitStart([NotNull] GiraphParser.StartContext context)
 {
     root = new StartNode(context.Start.Line, context.Start.Column);
     // Program+ (Multiple Program children, atleast one)
     foreach (var child in context.children)
     {
         root.AdoptChildren(Visit(child));
     }
     root.Name = "Root";
     return(root);
 }
Beispiel #5
0
        public static AbstractNode BuildAST(GiraphParser.StartContext start)
        {
            Stopwatch AstBuildTimer = new Stopwatch();

            AstBuildTimer.Start();
            AbstractNode ast = new AstBuilder().VisitStart(start);

            AstBuildTimer.Stop();
            PrintCompilerMessage("AstBuilder took: " + AstBuildTimer.ElapsedMilliseconds + "ms");
            return(ast);
        }
Beispiel #6
0
        public static void Compile()
        {
            Stopwatch TotalTimer = new Stopwatch();

            TotalTimer.Start();
            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("Giraph Compiler 1.0.1");
            Console.ForegroundColor = ConsoleColor.Red;

            GiraphParser.StartContext CST = BuildCST("kode.giraph");
            ErrorChecker(_error, 9999, "Code error!");
            AbstractNode AST         = BuildAST(CST);
            SymTable     SymbolTable = BuildSymbolTable(AST as StartNode);

            TypeCheck(SymbolTable, AST as StartNode);
            //PrettyPrint(AST as StartNode);
            WriteCodeToFiles(AST as StartNode);
            TotalTimer.Stop();
            PrintCompilerMessage($"Total compile timer: {TotalTimer.ElapsedMilliseconds}ms");
            CompileGeneratedCode();             // Compile the C# code.
        }
Beispiel #7
0
 public void Init()
 {
     Program.TestMode = true;
     CST = Program.BuildCST("kode_ast.giraph");
     AST = Program.BuildAST(CST);
 }