Ejemplo n.º 1
0
        public override void Process(ICode iCode, SymbolTableStack symtabstack)
        {
            var start = DateTime.Now;
            //
            var end = DateTime.Now;
            double elapsed_time = (end - start).Ticks / (1.0 * TimeSpan.TicksPerSecond);
            int instruction_count = 0;

            // send the message
            var args = Tuple.Create(instruction_count, elapsed_time);
            Message msg = new Message(MessageType.CompilerSummary, args);
            Send(msg);
        }
Ejemplo n.º 2
0
        public override void Process(ICode iCode, SymbolTableStack symtabstack)
        {
            int execution_count = 0;
            var start = DateTime.Now;

            ICodeNode root = iCode.Root;
            StatementInterpreter stmnt_interpreter = StatementInterpreter.CreateWithObservers(observers);
            var execution_results = stmnt_interpreter.Execute(root, ref execution_count);

            var end = DateTime.Now;
            double elapsed_time = (end - start).Ticks / (1.0 * TimeSpan.TicksPerSecond);
            int runtime_errors = RuntimeErrorHandler.Errors;

            // send the message
            var args = Tuple.Create(execution_count, runtime_errors, elapsed_time);
            Message msg = new Message(MessageType.InterpreterSummary, args);
            Send(msg);
        }
Ejemplo n.º 3
0
 public void Print(ICode icode)
 {
     writer.WriteLine("\n===== INTERMEDIATE CODE =====\n");
     PrintNode(icode.Root);
     PrintLine();
 }
Ejemplo n.º 4
0
 public abstract void Process(ICode iCode, SymbolTableStack symtabstack);