Commit | Line | Data |
---|---|---|
8b9d5b5e MD |
1 | #ifndef _CTF_PARSER_H |
2 | #define _CTF_PARSER_H | |
3 | ||
4 | #include <helpers/list.h> | |
34d3acc4 MD |
5 | #include <stdio.h> |
6 | #include <glib.h> | |
7 | ||
8 | // the parameter name (of the reentrant 'yyparse' function) | |
9 | // data is a pointer to a 'SParserParam' structure | |
10 | //#define YYPARSE_PARAM scanner | |
11 | ||
12 | // the argument for the 'yylex' function | |
13 | #define YYLEX_PARAM ((struct ctf_scanner *) scanner)->scanner | |
14 | ||
15 | struct ctf_node; | |
16 | struct ctf_parser; | |
8b9d5b5e MD |
17 | |
18 | enum node_type { | |
19 | NODE_UNKNOWN, | |
20 | NODE_ROOT, | |
fce8006d | 21 | |
8b9d5b5e MD |
22 | NODE_EVENT, |
23 | NODE_STREAM, | |
8b9d5b5e MD |
24 | NODE_TRACE, |
25 | ||
fce8006d MD |
26 | NODE_CTF_EXPRESSION, |
27 | ||
28 | NODE_TYPEDEF, | |
29 | NODE_TYPEALIAS, | |
30 | ||
31 | NODE_DECLARATION_SPECIFIER, | |
32 | NODE_TYPE_DECLARATOR, | |
33 | ||
34 | NODE_FLOATING_POINT, | |
35 | NODE_INTEGER, | |
36 | NODE_STRING, | |
37 | NODE_ENUM, | |
38 | NODE_VARIANT, | |
39 | NODE_STRUCT, | |
40 | ||
8b9d5b5e MD |
41 | NR_NODE_TYPES, |
42 | }; | |
43 | ||
8b9d5b5e MD |
44 | struct ctf_node { |
45 | enum node_type type; | |
46 | char *str; | |
47 | long long ll; | |
48 | struct ctf_node *parent; | |
49 | char *ident; | |
50 | struct cds_list_head siblings; | |
51 | struct cds_list_head children; | |
52 | struct cds_list_head gc; | |
53 | }; | |
54 | ||
34d3acc4 MD |
55 | struct ctf_ast { |
56 | struct ctf_node root; | |
57 | }; | |
8b9d5b5e MD |
58 | |
59 | #endif /* _CTF_PARSER_H */ |