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");
84 Output.Append(
"public enum ");
85 Output.Append(ToCSharp(this.
Name));
86 Output.AppendLine(
"Enum");
106 Output.Append(Field.Name);
114 Output.AppendLine(
"}");
121 Output.Append(
"public class ");
122 Output.Append(ToCSharp(this.
Name));
124 Output.Append(
"Choice");
128 Output.AppendLine(
"{");
133 Output.Append(
"public ");
134 Output.Append(ToCSharp(this.
Name));
136 Output.Append(
"Enum");
137 Output.AppendLine(
" _choice;");
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.
Helps with common JSON-related tasks.
static void Indent(StringBuilder Output, int NrTabs)
Appends an indentation to a string builder using tab characters.
CSharpExportPass
Defines different C# export passes.