blob: 081981692421f02fe3984077dd0ab4bf1b1e5a92 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001/*
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 Walkinc0e03b92017-08-22 01:48:23 -070011#include "asn1_ref.h"
12#include "asn1_buffer.h"
13#include "asn1_namespace.h"
14
Lev Walkinda997b12017-08-04 01:38:41 -070015#include "asn1p_integer.h"
Lev Walkin4efbfb72005-02-25 14:20:30 +000016#include "asn1p_list.h"
17#include "asn1p_oid.h" /* Object identifiers (OIDs) */
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +080018#include "asn1p_module.h" /* ASN.1 definition module */
Lev Walkin4efbfb72005-02-25 14:20:30 +000019#include "asn1p_value.h" /* Value definition */
Lev Walkina00d6b32006-03-21 03:40:38 +000020#include "asn1p_param.h" /* Parameterization */
Lev Walkin4efbfb72005-02-25 14:20:30 +000021#include "asn1p_constr.h" /* Type Constraints */
22#include "asn1p_xports.h" /* IMports/EXports */
Lev Walkin4efbfb72005-02-25 14:20:30 +000023#include "asn1p_class.h" /* CLASS-related stuff */
24#include "asn1p_expr.h" /* A single ASN.1 expression */
Lev Walkinf15320b2004-06-03 03:38:44 +000025
26/*
27 * Parser flags.
28 */
29enum asn1p_flags {
Lev Walkinbe518fa2017-09-07 02:05:28 -070030 A1P_NOFLAGS,
31 /*
Lev Walkin0c686452017-09-07 22:59:36 -070032 * Enable verbose debugging output from lexer and parser.
Lev Walkinbe518fa2017-09-07 02:05:28 -070033 */
Lev Walkin0c686452017-09-07 22:59:36 -070034 A1P_DEBUG_LEXER = 0x01,
35 A1P_DEBUG_PARSER = 0x02,
Lev Walkinbe518fa2017-09-07 02:05:28 -070036 /*
37 * Unlock internal helper value types.
38 */
Lev Walkin0c686452017-09-07 22:59:36 -070039 A1P_EXTENDED_VALUES = 0x04
Lev Walkinf15320b2004-06-03 03:38:44 +000040};
41
42/*
43 * Perform low-level parsing of ASN.1 module[s]
44 * and return a list of module trees.
45 */
46asn1p_t *asn1p_parse_file(const char *filename,
47 enum asn1p_flags);
48asn1p_t *asn1p_parse_buffer(const char *buffer, int size /* = -1 */,
Lev Walkinbe518fa2017-09-07 02:05:28 -070049 const char *debug_filename, int initial_lineno,
Lev Walkinf15320b2004-06-03 03:38:44 +000050 enum asn1p_flags);
51
Lev Walkind523ea42017-09-06 22:15:08 -070052extern const char *asn1p_parse_debug_filename;
53
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +080054int asn1p_lex_destroy();
Lev Walkind370e9f2006-03-16 10:03:35 +000055
Lev Walkinf15320b2004-06-03 03:38:44 +000056#endif /* ASN1PARSER_H */