retro_idl 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/ext/retro_idl/asn/ext_parser/ext_common.h +27 -0
  3. data/ext/retro_idl/asn/ext_parser/ext_parser.l +201 -0
  4. data/ext/retro_idl/asn/ext_parser/ext_parser.y +1207 -0
  5. data/ext/retro_idl/asn/ext_parser/extconf.rb +3 -0
  6. data/ext/retro_idl/asn/ext_parser/lexer.c +2873 -0
  7. data/ext/retro_idl/asn/ext_parser/lexer.h +366 -0
  8. data/ext/retro_idl/asn/ext_parser/parser.c +2963 -0
  9. data/ext/retro_idl/asn/ext_parser/parser.h +175 -0
  10. data/lib/retro_idl/asn/alternative_type.rb +43 -0
  11. data/lib/retro_idl/asn/asn.rb +309 -0
  12. data/lib/retro_idl/asn/asn_error.rb +2 -0
  13. data/lib/retro_idl/asn/base_type.rb +87 -0
  14. data/lib/retro_idl/asn/base_value.rb +75 -0
  15. data/lib/retro_idl/asn/bit_string.rb +44 -0
  16. data/lib/retro_idl/asn/boolean.rb +50 -0
  17. data/lib/retro_idl/asn/builtin_value.rb +51 -0
  18. data/lib/retro_idl/asn/choice.rb +95 -0
  19. data/lib/retro_idl/asn/component_type.rb +56 -0
  20. data/lib/retro_idl/asn/constraint.rb +162 -0
  21. data/lib/retro_idl/asn/defined_type.rb +61 -0
  22. data/lib/retro_idl/asn/defined_value.rb +82 -0
  23. data/lib/retro_idl/asn/enumerated.rb +127 -0
  24. data/lib/retro_idl/asn/enumeration_item.rb +103 -0
  25. data/lib/retro_idl/asn/integer.rb +84 -0
  26. data/lib/retro_idl/asn/location.rb +10 -0
  27. data/lib/retro_idl/asn/named_number.rb +83 -0
  28. data/lib/retro_idl/asn/null.rb +41 -0
  29. data/lib/retro_idl/asn/octetstring.rb +48 -0
  30. data/lib/retro_idl/asn/real.rb +36 -0
  31. data/lib/retro_idl/asn/sequence.rb +132 -0
  32. data/lib/retro_idl/asn/sequenceof.rb +62 -0
  33. data/lib/retro_idl/asn/single_value.rb +26 -0
  34. data/lib/retro_idl/asn/tag.rb +163 -0
  35. data/lib/retro_idl/asn/type_list.rb +121 -0
  36. data/lib/retro_idl/asn/value_assignment.rb +21 -0
  37. data/lib/retro_idl/asn/value_list.rb +48 -0
  38. data/lib/retro_idl.rb +20 -0
  39. data/rakefile +33 -0
  40. data/test/asn/ext_parser/capture_stderr.rb +20 -0
  41. data/test/asn/ext_parser/tc_ext_parser.rb +94 -0
  42. data/test/asn/parser/capture_stderr.rb +20 -0
  43. data/test/asn/parser/tc_parser.rb +90 -0
  44. metadata +133 -0
@@ -0,0 +1,366 @@
1
+ #ifndef yyHEADER_H
2
+ #define yyHEADER_H 1
3
+ #define yyIN_HEADER 1
4
+
5
+ #line 6 "ext/retro_idl/asn/ext_parser/lexer.h"
6
+ #line 32 "ext/retro_idl/asn/ext_parser/ext_parser.l"
7
+
8
+ #include "ext_common.h"
9
+
10
+
11
+
12
+
13
+ #line 14 "ext/retro_idl/asn/ext_parser/lexer.h"
14
+
15
+ #define YY_INT_ALIGNED short int
16
+
17
+ /* A lexical scanner generated by flex */
18
+
19
+ #define FLEX_SCANNER
20
+ #define YY_FLEX_MAJOR_VERSION 2
21
+ #define YY_FLEX_MINOR_VERSION 5
22
+ #define YY_FLEX_SUBMINOR_VERSION 35
23
+ #if YY_FLEX_SUBMINOR_VERSION > 0
24
+ #define FLEX_BETA
25
+ #endif
26
+
27
+ /* First, we deal with platform-specific or compiler-specific issues. */
28
+
29
+ /* begin standard C headers. */
30
+ #include <stdio.h>
31
+ #include <string.h>
32
+ #include <errno.h>
33
+ #include <stdlib.h>
34
+
35
+ /* end standard C headers. */
36
+
37
+ /* flex integer type definitions */
38
+
39
+ #ifndef FLEXINT_H
40
+ #define FLEXINT_H
41
+
42
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
43
+
44
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
45
+
46
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
47
+ * if you want the limit (max/min) macros for int types.
48
+ */
49
+ #ifndef __STDC_LIMIT_MACROS
50
+ #define __STDC_LIMIT_MACROS 1
51
+ #endif
52
+
53
+ #include <inttypes.h>
54
+ typedef int8_t flex_int8_t;
55
+ typedef uint8_t flex_uint8_t;
56
+ typedef int16_t flex_int16_t;
57
+ typedef uint16_t flex_uint16_t;
58
+ typedef int32_t flex_int32_t;
59
+ typedef uint32_t flex_uint32_t;
60
+ #else
61
+ typedef signed char flex_int8_t;
62
+ typedef short int flex_int16_t;
63
+ typedef int flex_int32_t;
64
+ typedef unsigned char flex_uint8_t;
65
+ typedef unsigned short int flex_uint16_t;
66
+ typedef unsigned int flex_uint32_t;
67
+
68
+ /* Limits of integral types. */
69
+ #ifndef INT8_MIN
70
+ #define INT8_MIN (-128)
71
+ #endif
72
+ #ifndef INT16_MIN
73
+ #define INT16_MIN (-32767-1)
74
+ #endif
75
+ #ifndef INT32_MIN
76
+ #define INT32_MIN (-2147483647-1)
77
+ #endif
78
+ #ifndef INT8_MAX
79
+ #define INT8_MAX (127)
80
+ #endif
81
+ #ifndef INT16_MAX
82
+ #define INT16_MAX (32767)
83
+ #endif
84
+ #ifndef INT32_MAX
85
+ #define INT32_MAX (2147483647)
86
+ #endif
87
+ #ifndef UINT8_MAX
88
+ #define UINT8_MAX (255U)
89
+ #endif
90
+ #ifndef UINT16_MAX
91
+ #define UINT16_MAX (65535U)
92
+ #endif
93
+ #ifndef UINT32_MAX
94
+ #define UINT32_MAX (4294967295U)
95
+ #endif
96
+
97
+ #endif /* ! C99 */
98
+
99
+ #endif /* ! FLEXINT_H */
100
+
101
+ #ifdef __cplusplus
102
+
103
+ /* The "const" storage-class-modifier is valid. */
104
+ #define YY_USE_CONST
105
+
106
+ #else /* ! __cplusplus */
107
+
108
+ /* C99 requires __STDC__ to be defined as 1. */
109
+ #if defined (__STDC__)
110
+
111
+ #define YY_USE_CONST
112
+
113
+ #endif /* defined (__STDC__) */
114
+ #endif /* ! __cplusplus */
115
+
116
+ #ifdef YY_USE_CONST
117
+ #define yyconst const
118
+ #else
119
+ #define yyconst
120
+ #endif
121
+
122
+ /* An opaque pointer. */
123
+ #ifndef YY_TYPEDEF_YY_SCANNER_T
124
+ #define YY_TYPEDEF_YY_SCANNER_T
125
+ typedef void* yyscan_t;
126
+ #endif
127
+
128
+ /* For convenience, these vars (plus the bison vars far below)
129
+ are macros in the reentrant scanner. */
130
+ #define yyin yyg->yyin_r
131
+ #define yyout yyg->yyout_r
132
+ #define yyextra yyg->yyextra_r
133
+ #define yyleng yyg->yyleng_r
134
+ #define yytext yyg->yytext_r
135
+ #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136
+ #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137
+ #define yy_flex_debug yyg->yy_flex_debug_r
138
+
139
+ /* Size of default input buffer. */
140
+ #ifndef YY_BUF_SIZE
141
+ #ifdef __ia64__
142
+ /* On IA-64, the buffer size is 16k, not 8k.
143
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
144
+ * Ditto for the __ia64__ case accordingly.
145
+ */
146
+ #define YY_BUF_SIZE 32768
147
+ #else
148
+ #define YY_BUF_SIZE 16384
149
+ #endif /* __ia64__ */
150
+ #endif
151
+
152
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
153
+ #define YY_TYPEDEF_YY_BUFFER_STATE
154
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
155
+ #endif
156
+
157
+ #ifndef YY_TYPEDEF_YY_SIZE_T
158
+ #define YY_TYPEDEF_YY_SIZE_T
159
+ typedef size_t yy_size_t;
160
+ #endif
161
+
162
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
163
+ #define YY_STRUCT_YY_BUFFER_STATE
164
+ struct yy_buffer_state
165
+ {
166
+ FILE *yy_input_file;
167
+
168
+ char *yy_ch_buf; /* input buffer */
169
+ char *yy_buf_pos; /* current position in input buffer */
170
+
171
+ /* Size of input buffer in bytes, not including room for EOB
172
+ * characters.
173
+ */
174
+ yy_size_t yy_buf_size;
175
+
176
+ /* Number of characters read into yy_ch_buf, not including EOB
177
+ * characters.
178
+ */
179
+ int yy_n_chars;
180
+
181
+ /* Whether we "own" the buffer - i.e., we know we created it,
182
+ * and can realloc() it to grow it, and should free() it to
183
+ * delete it.
184
+ */
185
+ int yy_is_our_buffer;
186
+
187
+ /* Whether this is an "interactive" input source; if so, and
188
+ * if we're using stdio for input, then we want to use getc()
189
+ * instead of fread(), to make sure we stop fetching input after
190
+ * each newline.
191
+ */
192
+ int yy_is_interactive;
193
+
194
+ /* Whether we're considered to be at the beginning of a line.
195
+ * If so, '^' rules will be active on the next match, otherwise
196
+ * not.
197
+ */
198
+ int yy_at_bol;
199
+
200
+ int yy_bs_lineno; /**< The line count. */
201
+ int yy_bs_column; /**< The column count. */
202
+
203
+ /* Whether to try to fill the input buffer when we reach the
204
+ * end of it.
205
+ */
206
+ int yy_fill_buffer;
207
+
208
+ int yy_buffer_status;
209
+
210
+ };
211
+ #endif /* !YY_STRUCT_YY_BUFFER_STATE */
212
+
213
+ void yyrestart (FILE *input_file ,yyscan_t yyscanner );
214
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
215
+ YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
216
+ void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
217
+ void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
218
+ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
219
+ void yypop_buffer_state (yyscan_t yyscanner );
220
+
221
+ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
222
+ YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
223
+ YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
224
+
225
+ void *yyalloc (yy_size_t ,yyscan_t yyscanner );
226
+ void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
227
+ void yyfree (void * ,yyscan_t yyscanner );
228
+
229
+ /* Begin user sect3 */
230
+
231
+ #define yywrap(n) 1
232
+ #define YY_SKIP_YYWRAP
233
+
234
+ #define yytext_ptr yytext_r
235
+
236
+ #ifdef YY_HEADER_EXPORT_START_CONDITIONS
237
+ #define INITIAL 0
238
+ #define BLOCK_COMMENT 1
239
+
240
+ #endif
241
+
242
+ #ifndef YY_NO_UNISTD_H
243
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
244
+ * down here because we want the user's section 1 to have been scanned first.
245
+ * The user has a chance to override it with an option.
246
+ */
247
+ #include <unistd.h>
248
+ #endif
249
+
250
+ #ifndef YY_EXTRA_TYPE
251
+ #define YY_EXTRA_TYPE void *
252
+ #endif
253
+
254
+ int yylex_init (yyscan_t* scanner);
255
+
256
+ int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
257
+
258
+ /* Accessor methods to globals.
259
+ These are made visible to non-reentrant scanners for convenience. */
260
+
261
+ int yylex_destroy (yyscan_t yyscanner );
262
+
263
+ int yyget_debug (yyscan_t yyscanner );
264
+
265
+ void yyset_debug (int debug_flag ,yyscan_t yyscanner );
266
+
267
+ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
268
+
269
+ void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
270
+
271
+ FILE *yyget_in (yyscan_t yyscanner );
272
+
273
+ void yyset_in (FILE * in_str ,yyscan_t yyscanner );
274
+
275
+ FILE *yyget_out (yyscan_t yyscanner );
276
+
277
+ void yyset_out (FILE * out_str ,yyscan_t yyscanner );
278
+
279
+ int yyget_leng (yyscan_t yyscanner );
280
+
281
+ char *yyget_text (yyscan_t yyscanner );
282
+
283
+ int yyget_lineno (yyscan_t yyscanner );
284
+
285
+ void yyset_lineno (int line_number ,yyscan_t yyscanner );
286
+
287
+ YYSTYPE * yyget_lval (yyscan_t yyscanner );
288
+
289
+ void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
290
+
291
+ YYLTYPE *yyget_lloc (yyscan_t yyscanner );
292
+
293
+ void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
294
+
295
+ /* Macros after this point can all be overridden by user definitions in
296
+ * section 1.
297
+ */
298
+
299
+ #ifndef YY_SKIP_YYWRAP
300
+ #ifdef __cplusplus
301
+ extern "C" int yywrap (yyscan_t yyscanner );
302
+ #else
303
+ extern int yywrap (yyscan_t yyscanner );
304
+ #endif
305
+ #endif
306
+
307
+ #ifndef yytext_ptr
308
+ static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
309
+ #endif
310
+
311
+ #ifdef YY_NEED_STRLEN
312
+ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
313
+ #endif
314
+
315
+ #ifndef YY_NO_INPUT
316
+
317
+ #endif
318
+
319
+ /* Amount of stuff to slurp up with each read. */
320
+ #ifndef YY_READ_BUF_SIZE
321
+ #ifdef __ia64__
322
+ /* On IA-64, the buffer size is 16k, not 8k */
323
+ #define YY_READ_BUF_SIZE 16384
324
+ #else
325
+ #define YY_READ_BUF_SIZE 8192
326
+ #endif /* __ia64__ */
327
+ #endif
328
+
329
+ /* Number of entries by which start-condition stack grows. */
330
+ #ifndef YY_START_STACK_INCR
331
+ #define YY_START_STACK_INCR 25
332
+ #endif
333
+
334
+ /* Default declaration of generated scanner - a define so the user can
335
+ * easily add parameters.
336
+ */
337
+ #ifndef YY_DECL
338
+ #define YY_DECL_IS_OURS 1
339
+
340
+ extern int yylex \
341
+ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
342
+
343
+ #define YY_DECL int yylex \
344
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
345
+ #endif /* !YY_DECL */
346
+
347
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
348
+
349
+ #undef YY_NEW_FILE
350
+ #undef YY_FLUSH_BUFFER
351
+ #undef yy_set_bol
352
+ #undef yy_new_buffer
353
+ #undef yy_set_interactive
354
+ #undef YY_DO_BEFORE_ACTION
355
+
356
+ #ifdef YY_DECL_IS_OURS
357
+ #undef YY_DECL_IS_OURS
358
+ #undef YY_DECL
359
+ #endif
360
+
361
+ #line 178 "ext/retro_idl/asn/ext_parser/ext_parser.l"
362
+
363
+
364
+ #line 365 "ext/retro_idl/asn/ext_parser/lexer.h"
365
+ #undef yyIN_HEADER
366
+ #endif /* yyHEADER_H */