/// <summary> /// Saves the compiled program to the specified stream. /// </summary> /// <param name="stream">The stream to save the program to.</param> public void SaveToStream(Stream stream) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } using (var output = new EasyWriter(stream, Endian.Little, true)) { output.WriteBytes(Encoding.ASCII.GetBytes(Magic)); RST.SerializeRST(SyntaxTree, output); } stream.Flush(); }
internal override void SerializeData(EasyWriter writer) { writer.Write(Name); RST.SerializeRST(SyntaxTree, writer); }