Skip to content

Commit

Permalink
Refine draft of serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
hallambaker committed Feb 20, 2021
1 parent eeb1872 commit 057ee79
Show file tree
Hide file tree
Showing 37 changed files with 242 additions and 208 deletions.
4 changes: 2 additions & 2 deletions ASN/asn2/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.512")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.512")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.514")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.514")]

4 changes: 2 additions & 2 deletions ASN/asn2/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.512
3.0.0.512
3.0.0.514
3.0.0.514
4 changes: 2 additions & 2 deletions Command/CommandEcho/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.177")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.177")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.179")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.179")]

4 changes: 2 additions & 2 deletions Command/CommandEcho/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.177
3.0.0.177
3.0.0.179
3.0.0.179
4 changes: 2 additions & 2 deletions Command/commandparse/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.526")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.526")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.528")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.528")]

4 changes: 2 additions & 2 deletions Command/commandparse/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.526
3.0.0.526
3.0.0.528
3.0.0.528
4 changes: 2 additions & 2 deletions Constant/constant/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.600")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.600")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.602")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.602")]

4 changes: 2 additions & 2 deletions Constant/constant/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.600
3.0.0.600
3.0.0.602
3.0.0.602
4 changes: 2 additions & 2 deletions DNSConfig/srvconf/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.215")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.215")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.217")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.217")]

4 changes: 2 additions & 2 deletions DNSConfig/srvconf/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.215
3.0.0.215
3.0.0.217
3.0.0.217
4 changes: 2 additions & 2 deletions DocTools/bootmaker/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.540")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.540")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.542")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.542")]

4 changes: 2 additions & 2 deletions DocTools/bootmaker/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.540
3.0.0.540
3.0.0.542
3.0.0.542
4 changes: 2 additions & 2 deletions DocTools/rfctool/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.707")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.707")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.709")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.709")]

4 changes: 2 additions & 2 deletions DocTools/rfctool/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.707
3.0.0.707
3.0.0.709
3.0.0.709
4 changes: 2 additions & 2 deletions Domainer/domainer/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.512")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.512")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.514")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.514")]

4 changes: 2 additions & 2 deletions Domainer/domainer/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.512
3.0.0.512
3.0.0.514
3.0.0.514
4 changes: 2 additions & 2 deletions Exceptional/Exceptional/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.523")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.523")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.525")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.525")]

4 changes: 2 additions & 2 deletions Exceptional/Exceptional/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.523
3.0.0.523
3.0.0.525
3.0.0.525
4 changes: 2 additions & 2 deletions FSRGen/fsrgen/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.519")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.519")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.521")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.521")]

4 changes: 2 additions & 2 deletions FSRGen/fsrgen/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.519
3.0.0.519
3.0.0.521
3.0.0.521
4 changes: 2 additions & 2 deletions GScript/gscript/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.537")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.537")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.540")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.540")]

4 changes: 2 additions & 2 deletions GScript/gscript/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.537
3.0.0.537
3.0.0.540
3.0.0.540
4 changes: 2 additions & 2 deletions Goedel3/goedel3/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.518")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.518")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.521")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.521")]

4 changes: 2 additions & 2 deletions Goedel3/goedel3/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.518
3.0.0.518
3.0.0.521
3.0.0.521
4 changes: 2 additions & 2 deletions MakeyMakey/makey/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.514")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.514")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.516")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.516")]

4 changes: 2 additions & 2 deletions MakeyMakey/makey/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.514
3.0.0.514
3.0.0.516
3.0.0.516
4 changes: 2 additions & 2 deletions Protogen/protogen/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.517")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.517")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.519")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.519")]

4 changes: 2 additions & 2 deletions Protogen/protogen/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.517
3.0.0.517
3.0.0.519
3.0.0.519
4 changes: 2 additions & 2 deletions RegistryConfig/registryconfig/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.512")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.512")]
[assembly: System.Reflection.AssemblyVersionAttribute("3.0.0.514")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("3.0.0.514")]

4 changes: 2 additions & 2 deletions RegistryConfig/registryconfig/version.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.0.0.512
3.0.0.512
3.0.0.514
3.0.0.514
21 changes: 15 additions & 6 deletions YASchema/Goedel.Tool.Yashima/Generate.Script
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,35 @@ namespace #{Yaschema.NameSpaceName} {
#end method

#method GenersateSerializer Packet packet
#% var plaintext = packet.Plaintext.SafeIndex();
#% var mezzanine = packet.Mezzanine.SafeIndex();
#% var plaintext = packet.Plaintext;
#% var mezzanine = packet.Mezzanine;
// Serialize #{packet.PacketType} packet #{packet.Id}

/// <summary>
/// Create a serialised packet of type #{packet.Id} packet.
/// </summary>
/// <param name="payload">The payload data.</param>
/// <param name="plaintextExtensions">Extensions to be presented in the plaintext segment.</param>
/// <param name="plaintextExtensionsIn">Additional extensions to be presented
/// in the plaintext segment.</param>
#if (packet.HasMezzanine)
/// <param name="mezanineExtensionsIn">Additional extensions to be presented
/// in the mezzanine segment.</param>
#end if
#if (packet.HasEncrypted)
/// <param name="ciphertextExtensions">Additional extensions to be presented
/// in the encrypted segment.</param>
#end if
/// <returns>The serialized data.</returns>
public byte[] Serialize#{packet.ClassName} (
byte[] payload = null,
List<PacketExtension> plaintextExtensionsIn = null#!
#if (packet.HasMezzanine)

,
List<PacketExtension> mezanineExtensionsIn = null#!
#end if
#if (packet.HasEncrypted)

List<PacketExtension> encryptedExtensions = null#!
,
List<PacketExtension> ciphertextExtensions = null#!
#end if

) {
Expand Down
21 changes: 15 additions & 6 deletions YASchema/Goedel.Tool.Yashima/Generate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,35 @@ public void GenerateCS (YaschemaStruct Yaschema) {
// GenersateSerializer
//
public void GenersateSerializer (Packet packet) {
var plaintext = packet.Plaintext.SafeIndex();
var mezzanine = packet.Mezzanine.SafeIndex();
var plaintext = packet.Plaintext;
var mezzanine = packet.Mezzanine;
_Output.Write (" // Serialize {1} packet {2}\n{0}", _Indent, packet.PacketType, packet.Id);
_Output.Write ("\n{0}", _Indent);
_Output.Write (" /// <summary>\n{0}", _Indent);
_Output.Write (" /// Create a serialised packet of type {1} packet.\n{0}", _Indent, packet.Id);
_Output.Write (" /// </summary>\n{0}", _Indent);
_Output.Write (" /// <param name=\"payload\">The payload data.</param>\n{0}", _Indent);
_Output.Write (" /// <param name=\"plaintextExtensions\">Extensions to be presented in the plaintext segment.</param>\n{0}", _Indent);
_Output.Write (" /// <param name=\"plaintextExtensionsIn\">Additional extensions to be presented \n{0}", _Indent);
_Output.Write (" /// in the plaintext segment.</param>\n{0}", _Indent);
if ( (packet.HasMezzanine) ) {
_Output.Write (" /// <param name=\"mezanineExtensionsIn\">Additional extensions to be presented\n{0}", _Indent);
_Output.Write (" /// in the mezzanine segment.</param>\n{0}", _Indent);
}
if ( (packet.HasEncrypted) ) {
_Output.Write (" /// <param name=\"ciphertextExtensions\">Additional extensions to be presented \n{0}", _Indent);
_Output.Write (" /// in the encrypted segment.</param>\n{0}", _Indent);
}
_Output.Write (" /// <returns>The serialized data.</returns>\n{0}", _Indent);
_Output.Write (" public byte[] Serialize{1} (\n{0}", _Indent, packet.ClassName);
_Output.Write (" byte[] payload = null,\n{0}", _Indent);
_Output.Write (" List<PacketExtension> plaintextExtensionsIn = null", _Indent);
if ( (packet.HasMezzanine) ) {
_Output.Write ("\n{0}", _Indent);
_Output.Write (",\n{0}", _Indent);
_Output.Write (" List<PacketExtension> mezanineExtensionsIn = null", _Indent);
}
if ( (packet.HasEncrypted) ) {
_Output.Write ("\n{0}", _Indent);
_Output.Write (" List<PacketExtension> encryptedExtensions = null", _Indent);
_Output.Write (",\n{0}", _Indent);
_Output.Write (" List<PacketExtension> ciphertextExtensions = null", _Indent);
}
_Output.Write ("\n{0}", _Indent);
_Output.Write (" ) {{\n{0}", _Indent);
Expand Down
Loading

0 comments on commit 057ee79

Please sign in to comment.