using System; using System.Collections.Generic; using System.Text; using Sunweaver.Commands; using Sunweaver.DataPrototypes; using Sunweaver.Commands.Abstracts; namespace Sunweaver.Console { class Program { static void Main(string[] args) { try { Sunweaver.DNASystem.Initialize(); } catch (Exception Except) { System.Console.WriteLine("Error initializing: \"" + Except.Message + "\""); } VirtualMachine VM = new VirtualMachine(); DNA dna = new DNA(); System.Console.Write( "Welcome to the Sunweaver console command line.\n" + "Enter a blank line to exit.\n"); string line; while ((line = System.Console.ReadLine()) != string.Empty) { try { if (!Sunweaver.Parser.ParseLine(line, dna)) { //Reparse the line as base pairs, and execute it now List basepairs = Sunweaver.Parser.ParseCodule(line.Split(" ".ToCharArray()), dna); Codule codule = new Codule(basepairs); codule.Execute(VM); System.Console.WriteLine(VM.Stack.ToString()); } } catch(Exception Except) { System.Console.Write("The previous line failed to execute, \"" + Except.Message + "\"\n"); } } } } }