blob: ed0a9f876d9948b0a736134dc2faef2f630fbb08 [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 /*
32 * Enable verbose debugging output from lexer.
33 */
34 A1P_LEXER_DEBUG = 0x01,
35 /*
36 * Unlock internal helper value types.
37 */
38 A1P_EXTENDED_VALUES = 0x02
Lev Walkinf15320b2004-06-03 03:38:44 +000039};
40
41/*
42 * Perform low-level parsing of ASN.1 module[s]
43 * and return a list of module trees.
44 */
45asn1p_t *asn1p_parse_file(const char *filename,
46 enum asn1p_flags);
47asn1p_t *asn1p_parse_buffer(const char *buffer, int size /* = -1 */,
Lev Walkinbe518fa2017-09-07 02:05:28 -070048 const char *debug_filename, int initial_lineno,
Lev Walkinf15320b2004-06-03 03:38:44 +000049 enum asn1p_flags);
50
Lev Walkind523ea42017-09-06 22:15:08 -070051extern const char *asn1p_parse_debug_filename;
52
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +080053int asn1p_lex_destroy();
Lev Walkind370e9f2006-03-16 10:03:35 +000054
Lev Walkinf15320b2004-06-03 03:38:44 +000055#endif /* ASN1PARSER_H */