2using System.Collections.Generic;
4using System.Threading.Tasks;
38 int Bak = Document.pos;
47 return Type.Parse(Document, Macro);
56 throw Document.SyntaxError(
"Unable to parse choices.");
71 Output.Append(ToCSharp(this.
Name));
72 Output.Append(
"Choice");
83 Output.Append(Tabs(Indent));
84 Output.Append(
"public enum ");
85 Output.Append(ToCSharp(this.
Name));
86 Output.AppendLine(
"Enum");
88 Output.Append(Tabs(Indent));
105 Output.Append(Tabs(Indent));
106 Output.Append(Field.Name);
113 Output.Append(Tabs(Indent));
114 Output.AppendLine(
"}");
120 Output.Append(Tabs(Indent));
121 Output.Append(
"public class ");
122 Output.Append(ToCSharp(this.
Name));
124 Output.Append(
"Choice");
127 Output.Append(Tabs(Indent));
128 Output.AppendLine(
"{");
132 Output.Append(Tabs(Indent));
133 Output.Append(
"public ");
134 Output.Append(ToCSharp(this.
Name));
136 Output.Append(
"Enum");
137 Output.AppendLine(
" _choice;");
144 Output.Append(Tabs(Indent));
145 Output.AppendLine(
"}");
Represents an ASN.1 document.
void ClosePending(StringBuilder Output)
Close pending actions
Represents a ASN.1 CHOICE construct.
Asn1Choice(string Name, bool TypeDef, Asn1Node[] Nodes)
Represents a ASN.1 CHOICE construct.
override async Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
override bool ConstructedType
If the type is a constructed type.
override Asn1Node Parse(Asn1Document Document, Asn1Macro Macro)
Parses the portion of the document at the current position, according to the type.
string Name
Optional field or type name.
bool TypeDefinition
If construct is part of a type definition.
Represents an ASN.1 field definition.
Abstract base class for list constructs.
Base class for all ASN.1 nodes.
virtual Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
Abstract base class for ASN.1 types.
CSharpExportPass
Defines different C# export passes.