public void Load(string[] lines) { _lastnoPrefixCommand = null; foreach(var line in lines) { _stream.Line = line; if (!Command()) { Commands.Clear(); break; } } PostLoad(); }
public override void Load() { PreLoad(); _lastnoPrefixCommand = null; using (StreamReader sr = new StreamReader(LoadOptions.FileName)) { string line; while ((line = sr.ReadLine()) != null) { _stream.Line = line; if (!Command()) { Commands.Clear(); break; } } } PostLoad(); }
private bool ReadGCommand() { _stream.Next(); string cmdname = "G" + _stream.ReadDigits(); _stream.SkipSpaces(); Command cmd = CommandFactory.Create(cmdname); if (cmd != null) { if (cmd.UseWithoutPrefix) _lastnoPrefixCommand = cmd; Commands.AddCommand(cmd); if (!cmd.ReadFrom(_stream)) return false; } else { if (!AddGxxMxxCommand(CommandFactory.Create("GXX"), cmdname)) return false; } return true; }
private bool AddGxxMxxCommand(Command cmd, string cmdname) { cmd.SetCode(cmdname); Commands.AddCommand(cmd); if (!cmd.ReadFrom(_stream)) return false; return true; }