Beispiel #1
0
        /// <summary>
        /// The main entry point.
        /// </summary>
        /// <param name="args">Program arguments.</param>
        static void Main(string[] args)
        {
            // Input folder                // ..\..\..\..\..\Input
            string         codeDirectory;
            string         testDirectory;
            string         yasmPath;    // ..\..\..\Assembler\yasm
            IList <string> files = ReadArguments(args, out codeDirectory, out testDirectory, out yasmPath);

            if (files == null)
            {
                return;
            }

            var specFactoryDispenser = new SpecFactoryDispenser();

            specFactoryDispenser.Register("x86", new X86SpecFactory());
            interpreter     = new ScriptInterpreter(new ScriptTokenizer(), specFactoryDispenser);
            writerDispenser = new SpecWriterDispenser();
            writerDispenser.Register("x86", new X86SpecWriter(yasmPath));

            foreach (string file in files)
            {
                Execute(file, codeDirectory, testDirectory);
            }

            Console.WriteLine("All done!");
            //Console.ReadLine();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ScriptInterpreter"/> class.
 /// </summary>
 /// <param name="tokenizer">The tokenizer to use.</param>
 /// <param name="factoryDispenser">The factory dispenser to use.</param>
 public ScriptInterpreter(ScriptTokenizer tokenizer, SpecFactoryDispenser factoryDispenser)
 {
     this.tokenizer        = tokenizer;
     this.factoryDispenser = factoryDispenser;
 }
Beispiel #3
0
        /// <summary>
        /// The main entry point.
        /// </summary>
        /// <param name="args">Program arguments.</param>
        static void Main(string[] args)
        {
            // Input folder                // ..\..\..\..\..\Input
            string codeDirectory;
            string testDirectory;
            string yasmPath;            // ..\..\..\Assembler\yasm
            IList<string> files = ReadArguments(args, out codeDirectory, out testDirectory, out yasmPath);
            if (files == null)
                return;

            var specFactoryDispenser = new SpecFactoryDispenser();
            specFactoryDispenser.Register("x86", new X86SpecFactory());
            interpreter = new ScriptInterpreter(new ScriptTokenizer(), specFactoryDispenser);
            writerDispenser = new SpecWriterDispenser();
            writerDispenser.Register("x86", new X86SpecWriter(yasmPath));

            foreach (string file in files)
            {
                Execute(file, codeDirectory, testDirectory);
            }

            Console.WriteLine("All done!");
            //Console.ReadLine();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ScriptInterpreter"/> class.
 /// </summary>
 /// <param name="tokenizer">The tokenizer to use.</param>
 /// <param name="factoryDispenser">The factory dispenser to use.</param>
 public ScriptInterpreter(ScriptTokenizer tokenizer, SpecFactoryDispenser factoryDispenser)
 {
     this.tokenizer = tokenizer;
     this.factoryDispenser = factoryDispenser;
 }