5 #include <helpers/list.h>
9 // the parameter name (of the reentrant 'yyparse' function)
10 // data is a pointer to a 'SParserParam' structure
11 //#define YYPARSE_PARAM scanner
13 // the argument for the 'yylex' function
14 #define YYLEX_PARAM ((struct ctf_scanner *) scanner)->scanner
28 NODE_UNARY_EXPRESSION
,
31 NODE_TYPEALIAS_TARGET
,
44 NODE_STRUCT_OR_VARIANT_DECLARATION
,
53 * Parent node is only set on demand by specific visitor.
55 struct ctf_node
*parent
;
56 struct cds_list_head siblings
;
57 struct cds_list_head gc
;
64 struct cds_list_head _typedef
;
65 struct cds_list_head typealias
;
66 struct cds_list_head declaration_specifier
;
67 struct cds_list_head trace
;
68 struct cds_list_head stream
;
69 struct cds_list_head event
;
73 * Children nodes are ctf_expression, typedef,
74 * typealias and declaration specifiers.
76 struct cds_list_head declaration_list
;
80 * Children nodes are ctf_expression, typedef,
81 * typealias and declaration specifiers.
83 struct cds_list_head declaration_list
;
87 * Children nodes are ctf_expression, typedef,
88 * typealias and declaration specifiers.
90 struct cds_list_head declaration_list
;
93 struct ctf_node
*left
; /* Should be string */
94 struct ctf_node
*right
; /* Unary exp. or type */
100 UNARY_SIGNED_CONSTANT
,
101 UNARY_UNSIGNED_CONSTANT
,
106 * string for identifier, id_type, keywords,
107 * string literals and character constants.
110 uint64_t unsigned_constant
;
111 int64_t signed_constant
;
112 struct ctf_node
*sbrac_exp
;
115 UNARY_LINK_UNKNOWN
= 0,
121 struct cds_list_head declaration_specifier
;
122 struct cds_list_head type_declarators
;
124 /* new type is "alias", existing type "target" */
126 struct cds_list_head declaration_specifier
;
127 struct cds_list_head type_declarators
;
130 struct cds_list_head declaration_specifier
;
131 struct cds_list_head type_declarators
;
134 struct ctf_node
*target
;
135 struct ctf_node
*alias
;
139 TYPESPEC_UNKNOWN
= 0,
157 unsigned int const_qualifier
;
160 struct cds_list_head pointers
;
163 TYPEDEC_ID
, /* identifier */
164 TYPEDEC_NESTED
, /* (), array or sequence */
169 /* typedec has no pointer list */
170 struct ctf_node
*type_declarator
;
171 /* value or first node of declaration specifier list */
172 struct ctf_node
*length
;
173 /* for abstract type declarator */
174 unsigned int abstract_array
;
177 struct ctf_node
*bitfield_len
;
180 /* Children nodes are ctf_expression. */
181 struct cds_list_head expressions
;
184 /* Children nodes are ctf_expression. */
185 struct cds_list_head expressions
;
188 /* Children nodes are ctf_expression. */
189 struct cds_list_head expressions
;
193 /* first node of range list or single node */
194 struct ctf_node
*values
;
198 /* NULL, value or declaration specifier */
199 struct ctf_node
*container_type
;
200 struct cds_list_head enumerator_list
;
203 struct cds_list_head declaration_specifier
;
204 struct cds_list_head type_declarators
;
205 } struct_or_variant_declaration
;
207 /* list of typedef, typealias and declarations */
208 struct cds_list_head declaration_list
;
213 /* list of typedef, typealias and declarations */
214 struct cds_list_head declaration_list
;
221 struct ctf_node root
;
222 struct cds_list_head allocated_nodes
;
225 #endif /* _CTF_PARSER_H */