diff --git a/Assignment 1/Program.cs b/Assignment 1/Program.cs index 297d21b..4cefba3 100644 --- a/Assignment 1/Program.cs +++ b/Assignment 1/Program.cs @@ -49,10 +49,8 @@ namespace Assignment_1 Console.WriteLine("│ 159.341 2021 Semester 1, Assignment 1 │"); Console.WriteLine("│ Submitted by Brychan Dempsey, 14299890 │"); Console.WriteLine("└──────────────────────────────────────────┘"); - MemoryStream sourceStream = new MemoryStream(1024); // Creates a memory stream to retain source while being interpreted. - - - + // Parse the source from the memory stream + MemoryStream sourceStream = new MemoryStream(1024); Parser parser = new Parser(); bool dynamicInput = false; // From https://stackoverflow.com/questions/3453220/how-to-detect-if-console-in-stdin-has-been-redirected @@ -150,6 +148,7 @@ namespace Assignment_1 case statements.reverse: result = Reverse(source); break; + // These are additional helper functions. Thier input gets excluded from the MemoryStream case statements.h: Console.WriteLine("Commands are: "); foreach (var item in Enum.GetValues(typeof(statements))) @@ -384,25 +383,6 @@ namespace Assignment_1 Console.WriteLine(errorMSG); source.SetLength(source.Position); } - /// - /// Gets the starting point of the expression at expected line. - /// - /// - /// - /// - long GetLineStart(Stream source, string word) - { - // Decrement and check the previous value is 32 (space), before incrementing back to our current pos - // Don't need to guard against oob - implied it's within bounds by the set command being at least 3 bytes long - source.Position--; - if (source.ReadByte() == 32) - { - source.Position--; - } - //source.Position++; - return source.Position - word.Length; - } - #endregion #region Data Handling // Data Handling