]> git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/compiler/back-ends/c++-gen/rules.c
d5c449dc54eeab8c9db975d547ff7386b18576c2
[apple/security.git] / SecuritySNACCRuntime / compiler / back-ends / c++-gen / rules.c
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 * compiler/back_ends/c++_gen/rules.c - initialized c rule structure
21 * inits a table that contains info about
22 * converting each ASN.1 type to a C++ class
23 *
24 * Copyright (C) 1991, 1992 Michael Sample
25 * and the University of British Columbia
26 *
27 * This program is free software; you can redistribute it and/or modify
28 * it under the terms of the GNU General Public License as published by
29 * the Free Software Foundation; either version 2 of the License, or
30 * (at your option) any later version.
31 *
32 * $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/compiler/back-ends/c++-gen/rules.c,v 1.1.1.1 2001/05/18 23:14:09 mb Exp $
33 * $Log: rules.c,v $
34 * Revision 1.1.1.1 2001/05/18 23:14:09 mb
35 * Move from private repository to open source repository
36 *
37 * Revision 1.2 2001/05/05 00:59:27 rmurphy
38 * Adding darwin license headers
39 *
40 * Revision 1.1.1.1 1999/03/16 18:06:40 aram
41 * Originals from SMIME Free Library.
42 *
43 * Revision 1.4 1995/07/25 18:24:13 rj
44 * file name has been shortened for redundant part: c++-gen/c++-rules -> c++-gen/rules.
45 *
46 * changed `_' to `-' in file names.
47 *
48 * Revision 1.3 1994/10/08 03:47:49 rj
49 * since i was still irritated by cpp standing for c++ and not the C preprocessor, i renamed them to cxx (which is one known suffix for C++ source files). since the standard #define is __cplusplus, cplusplus would have been the more obvious choice, but it is a little too long.
50 *
51 * Revision 1.2 1994/09/01 01:53:33 rj
52 * snacc_config.h removed.
53 *
54 * Revision 1.1 1994/08/28 09:47:54 rj
55 * first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
56 *
57 */
58
59 #include "asn-incl.h"
60 #include "asn1module.h"
61 #include "rules.h"
62
63
64 CxxRules cxxRulesG =
65 {
66 4,
67 "choiceId",
68 "ChoiceIdEnum",
69 "a",
70 "ChoiceUnion",
71 FALSE,
72 "Enc",
73 "Dec",
74 "EncContent",
75 "DecContent",
76 "EncPdu",
77 "DecPdu",
78 {
79 {
80 BASICTYPE_UNKNOWN,
81 "???",
82 FALSE,
83 FALSE,
84 FALSE,
85 TRUE,
86 TRUE,
87 TRUE,
88 TRUE,
89 "NOT_NULL",
90 "unknown"
91 },
92 {
93 BASICTYPE_BOOLEAN,
94 "AsnBool",
95 FALSE,
96 TRUE,
97 FALSE,
98 TRUE,
99 TRUE,
100 FALSE,
101 TRUE,
102 "NOT_NULL",
103 "bool"
104 },
105 {
106 BASICTYPE_INTEGER,
107 "AsnInt",
108 FALSE,
109 TRUE,
110 FALSE,
111 TRUE,
112 TRUE,
113 FALSE,
114 TRUE,
115 "NOT_NULL",
116 "integer"
117 },
118 {
119 BASICTYPE_BITSTRING,
120 "AsnBits",
121 FALSE,
122 TRUE,
123 FALSE,
124 TRUE,
125 TRUE,
126 FALSE,
127 TRUE,
128 "NOT_NULL",
129 "bits"
130 },
131 {
132 BASICTYPE_OCTETSTRING,
133 "AsnOcts",
134 FALSE,
135 TRUE,
136 FALSE,
137 TRUE,
138 TRUE,
139 FALSE,
140 TRUE,
141 "NOT_NULL",
142 "octs"
143 },
144 {
145 BASICTYPE_NULL,
146 "AsnNull",
147 FALSE,
148 TRUE,
149 FALSE,
150 TRUE,
151 TRUE,
152 FALSE,
153 TRUE,
154 "NOT_NULL",
155 "null"
156 },
157 {
158 BASICTYPE_OID,
159 "AsnOid",
160 FALSE,
161 TRUE,
162 FALSE,
163 TRUE,
164 TRUE,
165 FALSE,
166 TRUE,
167 "NOT_NULL",
168 "oid"
169 },
170 {
171 BASICTYPE_REAL,
172 "AsnReal",
173 FALSE,
174 TRUE,
175 FALSE,
176 TRUE,
177 TRUE,
178 FALSE,
179 TRUE,
180 "NOT_NULL",
181 "real"
182 },
183 {
184 BASICTYPE_ENUMERATED,
185 "AsnEnum",
186 FALSE,
187 TRUE,
188 FALSE,
189 TRUE,
190 TRUE,
191 FALSE,
192 TRUE,
193 "NOT_NULL",
194 "enumeration"
195 },
196 {
197 BASICTYPE_SEQUENCE,
198 NULL,
199 FALSE,
200 TRUE,
201 FALSE,
202 TRUE,
203 TRUE,
204 TRUE,
205 TRUE,
206 "NOT_NULL",
207 "seq"
208 },
209 {
210 BASICTYPE_SEQUENCEOF,
211 "AsnList",
212 FALSE,
213 TRUE,
214 FALSE,
215 TRUE,
216 TRUE,
217 FALSE,
218 TRUE,
219 "NOT_NULL",
220 "seqOf"
221 },
222 {
223 BASICTYPE_SET,
224 NULL,
225 FALSE,
226 TRUE,
227 FALSE,
228 TRUE,
229 TRUE,
230 TRUE,
231 FALSE,
232 "NOT_NULL",
233 "set"
234 },
235 {
236 BASICTYPE_SETOF,
237 "AsnList",
238 FALSE,
239 TRUE,
240 FALSE,
241 TRUE,
242 TRUE,
243 FALSE,
244 TRUE,
245 "NOT_NULL",
246 "setOf"
247 },
248 {
249 BASICTYPE_CHOICE,
250 NULL,
251 FALSE,
252 TRUE,
253 FALSE,
254 TRUE,
255 TRUE,
256 TRUE,
257 FALSE,
258 "NOT_NULL",
259 "choice"
260 },
261 {
262 BASICTYPE_SELECTION,
263 NULL,
264 FALSE,
265 TRUE,
266 FALSE,
267 TRUE,
268 TRUE,
269 FALSE,
270 TRUE,
271 "NOT_NULL",
272 "foo"
273 },
274 {
275 BASICTYPE_COMPONENTSOF,
276 NULL,
277 FALSE,
278 TRUE,
279 FALSE,
280 TRUE,
281 TRUE,
282 FALSE,
283 TRUE,
284 "NOT_NULL",
285 "bar"
286 },
287 {
288 BASICTYPE_ANY,
289 "AsnAny",
290 FALSE,
291 TRUE,
292 FALSE,
293 TRUE,
294 TRUE,
295 FALSE,
296 TRUE,
297 "NOT_NULL",
298 "any"
299 },
300 {
301 BASICTYPE_ANYDEFINEDBY,
302 "AsnAnyDefinedBy",
303 FALSE,
304 TRUE,
305 FALSE,
306 TRUE,
307 TRUE,
308 FALSE,
309 TRUE,
310 "NOT_NULL",
311 "anyDefBy"
312 },
313 {
314 BASICTYPE_LOCALTYPEREF,
315 NULL,
316 FALSE,
317 TRUE,
318 FALSE,
319 TRUE,
320 TRUE,
321 FALSE,
322 TRUE,
323 "NOT_NULL",
324 "foo"
325 },
326 {
327 BASICTYPE_IMPORTTYPEREF,
328 NULL,
329 FALSE,
330 TRUE,
331 FALSE,
332 TRUE,
333 TRUE,
334 FALSE,
335 TRUE,
336 "NOT_NULL",
337 "bar"
338 },
339 {
340 BASICTYPE_MACROTYPE,
341 NULL,
342 FALSE,
343 FALSE,
344 FALSE,
345 TRUE,
346 TRUE,
347 FALSE,
348 TRUE,
349 "NOT_NULL",
350 "foo"
351 },
352 {
353 BASICTYPE_MACRODEF,
354 NULL,
355 FALSE,
356 FALSE,
357 FALSE,
358 TRUE,
359 TRUE,
360 FALSE,
361 TRUE,
362 "NOT_NULL",
363 "foo"
364 }
365 }
366 };