Cleanup parser code, add some node IDs to AST
[babeltrace.git] / formats / ctf / metadata / ctf-ast.h
1 #ifndef _CTF_PARSER_H
2 #define _CTF_PARSER_H
3
4 #include <helpers/list.h>
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;
17
18 enum node_type {
19 NODE_UNKNOWN,
20 NODE_ROOT,
21
22 NODE_EVENT,
23 NODE_STREAM,
24 NODE_TRACE,
25
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
41 NR_NODE_TYPES,
42 };
43
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
55 struct ctf_ast {
56 struct ctf_node root;
57 };
58
59 #endif /* _CTF_PARSER_H */
This page took 0.030798 seconds and 5 git commands to generate.