Пример #1
0
        private static void RunA86FromFile()
        {
            var infix       = ReadInfixFromFile();
            var postfix     = PostfixFromFile(infix);
            var converter   = new A86Converter(postfix);
            var asm         = converter.ToAsm();
            var asmFileName = Path.GetFileNameWithoutExtension(_filePath) + "a86.asm";

            SaveAsmFile(asm, asmFileName);
        }
Пример #2
0
        private static void RunA86FromConsole()
        {
            var postfix   = PostfixFromConsole();
            var converter = new A86Converter(postfix);

            if (!converter.IsValid)
            {
                Console.WriteLine("Postfix expression has invalid tokens: " + string.Join(", ", converter.InvalidTokens));
                Console.WriteLine("Press enter to exit.");
                Console.ReadLine();
            }
            else
            {
                var asm         = converter.ToAsm();
                var asmFileName = "consoleinputa86.asm";
                SaveAsmFile(asm, asmFileName);
            }
        }