Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This is a parser of the ASN.1 grammar. |
| 3 | */ |
| 4 | #ifndef ASN1PARSER_H |
| 5 | #define ASN1PARSER_H |
| 6 | |
| 7 | #ifdef HAVE_CONFIG_H |
| 8 | #include "config.h" |
| 9 | #endif /* HAVE_CONFIG_H */ |
| 10 | |
Lev Walkin | c0e03b9 | 2017-08-22 01:48:23 -0700 | [diff] [blame] | 11 | #include "asn1_ref.h" |
| 12 | #include "asn1_buffer.h" |
| 13 | #include "asn1_namespace.h" |
| 14 | |
Lev Walkin | da997b1 | 2017-08-04 01:38:41 -0700 | [diff] [blame] | 15 | #include "asn1p_integer.h" |
Lev Walkin | 4efbfb7 | 2005-02-25 14:20:30 +0000 | [diff] [blame] | 16 | #include "asn1p_list.h" |
| 17 | #include "asn1p_oid.h" /* Object identifiers (OIDs) */ |
Bi-Ruei, Chiu | 80fd306 | 2017-05-07 21:00:51 +0800 | [diff] [blame] | 18 | #include "asn1p_module.h" /* ASN.1 definition module */ |
Lev Walkin | 4efbfb7 | 2005-02-25 14:20:30 +0000 | [diff] [blame] | 19 | #include "asn1p_value.h" /* Value definition */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 20 | #include "asn1p_param.h" /* Parameterization */ |
Lev Walkin | 4efbfb7 | 2005-02-25 14:20:30 +0000 | [diff] [blame] | 21 | #include "asn1p_constr.h" /* Type Constraints */ |
| 22 | #include "asn1p_xports.h" /* IMports/EXports */ |
Lev Walkin | 4efbfb7 | 2005-02-25 14:20:30 +0000 | [diff] [blame] | 23 | #include "asn1p_class.h" /* CLASS-related stuff */ |
| 24 | #include "asn1p_expr.h" /* A single ASN.1 expression */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 25 | |
| 26 | /* |
| 27 | * Parser flags. |
| 28 | */ |
| 29 | enum asn1p_flags { |
Lev Walkin | be518fa | 2017-09-07 02:05:28 -0700 | [diff] [blame] | 30 | A1P_NOFLAGS, |
| 31 | /* |
Lev Walkin | 0c68645 | 2017-09-07 22:59:36 -0700 | [diff] [blame] | 32 | * Enable verbose debugging output from lexer and parser. |
Lev Walkin | be518fa | 2017-09-07 02:05:28 -0700 | [diff] [blame] | 33 | */ |
Lev Walkin | 0c68645 | 2017-09-07 22:59:36 -0700 | [diff] [blame] | 34 | A1P_DEBUG_LEXER = 0x01, |
| 35 | A1P_DEBUG_PARSER = 0x02, |
Lev Walkin | be518fa | 2017-09-07 02:05:28 -0700 | [diff] [blame] | 36 | /* |
| 37 | * Unlock internal helper value types. |
| 38 | */ |
Lev Walkin | 0c68645 | 2017-09-07 22:59:36 -0700 | [diff] [blame] | 39 | A1P_EXTENDED_VALUES = 0x04 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | /* |
| 43 | * Perform low-level parsing of ASN.1 module[s] |
| 44 | * and return a list of module trees. |
| 45 | */ |
| 46 | asn1p_t *asn1p_parse_file(const char *filename, |
| 47 | enum asn1p_flags); |
| 48 | asn1p_t *asn1p_parse_buffer(const char *buffer, int size /* = -1 */, |
Lev Walkin | be518fa | 2017-09-07 02:05:28 -0700 | [diff] [blame] | 49 | const char *debug_filename, int initial_lineno, |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 50 | enum asn1p_flags); |
| 51 | |
Lev Walkin | d523ea4 | 2017-09-06 22:15:08 -0700 | [diff] [blame] | 52 | extern const char *asn1p_parse_debug_filename; |
| 53 | |
Bi-Ruei, Chiu | 3dcf05b | 2017-05-04 21:45:05 +0800 | [diff] [blame] | 54 | int asn1p_lex_destroy(); |
Lev Walkin | d370e9f | 2006-03-16 10:03:35 +0000 | [diff] [blame] | 55 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 56 | #endif /* ASN1PARSER_H */ |