Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Asn1Node.cs
1using System;
3using System.Text;
4using System.Threading.Tasks;
5
7{
11 public enum CSharpExportPass
12 {
16 Preprocess,
17
21 Variables,
22
26 Implicit,
27
31 Explicit
32 }
33
37 public abstract class Asn1Node
38 {
46 public virtual Task ExportCSharp(StringBuilder Output, CSharpExportState State,
47 int Indent, CSharpExportPass Pass)
48 {
49 if (Pass == CSharpExportPass.Explicit)
50 {
51 throw new NotImplementedException("Support for exporting objects of type " +
52 this.GetType().FullName + " not implemented.");
53 }
54
55 return Task.CompletedTask;
56 }
57
58 internal static string ToCSharp(string Identifier)
59 {
60 switch (Identifier)
61 {
62 case "abstract":
63 case "as":
64 case "base":
65 case "bool":
66 case "break":
67 case "byte":
68 case "case":
69 case "catch":
70 case "char":
71 case "checked":
72 case "class":
73 case "const":
74 case "continue":
75 case "decimal":
76 case "default":
77 case "delegate":
78 case "do":
79 case "double":
80 case "else":
81 case "enum":
82 case "event":
83 case "explicit":
84 case "extern":
85 case "false":
86 case "finally":
87 case "fixed":
88 case "float":
89 case "for":
90 case "foreach":
91 case "goto":
92 case "if":
93 case "implicit":
94 case "in":
95 case "int":
96 case "interface":
97 case "internal":
98 case "is":
99 case "lock":
100 case "long":
101 case "namespace":
102 case "new":
103 case "null":
104 case "object":
105 case "operator":
106 case "out":
107 case "override":
108 case "params":
109 case "private":
110 case "protected":
111 case "public":
112 case "readonly":
113 case "ref":
114 case "return":
115 case "sbyte":
116 case "sealed":
117 case "short":
118 case "sizeof":
119 case "stackalloc":
120 case "static":
121 case "string":
122 case "struct":
123 case "switch":
124 case "this":
125 case "throw":
126 case "true":
127 case "try":
128 case "typeof":
129 case "uint":
130 case "ulong":
131 case "unchecked":
132 case "unsafe":
133 case "ushort":
134 case "using":
135 case "virtual":
136 case "void":
137 case "add":
138 case "alias":
139 case "ascending":
140 case "async":
141 case "await":
142 case "by":
143 case "descending":
144 case "dynamic":
145 case "equals":
146 case "from":
147 case "get":
148 case "global":
149 case "group":
150 case "into":
151 case "join":
152 case "let":
153 case "nameof":
154 case "on":
155 case "orderby":
156 case "partial":
157 case "remove":
158 case "select":
159 case "set":
160 case "value":
161 case "var":
162 case "when":
163 case "where":
164 case "yield":
165 return "_" + Identifier;
166
167 default:
168 int i = Identifier.IndexOf('-');
169 if (i >= 0)
170 Identifier = Identifier.Replace('-', '_');
171
172 return Identifier;
173 }
174 }
175 }
176}
Base class for all ASN.1 nodes.
Definition: Asn1Node.cs:38
virtual Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
Definition: Asn1Node.cs:46
CSharpExportPass
Defines different C# export passes.
Definition: Asn1Node.cs:12