Remove unneeded declaration "name", work in progress for gen io struct
[babeltrace.git] / formats / ctf / metadata / ctf-ast.h
index 7dcf9f966bb5a9366eb4e15690e52e951b8beca5..6ee937b6e44ec7597a39c6d34217ab9bc4f1bf89 100644 (file)
@@ -2,9 +2,9 @@
 #define _CTF_PARSER_H
 
 #include <stdint.h>
-#include <helpers/list.h>
 #include <stdio.h>
 #include <glib.h>
+#include <babeltrace/list.h>
 
 // the parameter name (of the reentrant 'yyparse' function)
 // data is a pointer to a 'SParserParam' structure
@@ -54,6 +54,7 @@ struct ctf_node {
         */
        struct ctf_node *parent;
        struct cds_list_head siblings;
+       struct cds_list_head tmp_head;
        struct cds_list_head gc;
 
        enum node_type type;
@@ -90,8 +91,8 @@ struct ctf_node {
                        struct cds_list_head declaration_list;
                } trace;
                struct {
-                       struct ctf_node *left;  /* Should be string */
-                       struct ctf_node *right; /* Unary exp. or type */
+                       struct cds_list_head left;      /* Should be string */
+                       struct cds_list_head right;     /* Unary exp. or type */
                } ctf_expression;
                struct {
                        enum {
@@ -100,6 +101,7 @@ struct ctf_node {
                                UNARY_SIGNED_CONSTANT,
                                UNARY_UNSIGNED_CONSTANT,
                                UNARY_SBRAC,
+                               UNARY_NESTED,
                        } type;
                        union {
                                /*
@@ -107,14 +109,16 @@ struct ctf_node {
                                 * string literals and character constants.
                                 */
                                char *string;
-                               uint64_t unsigned_constant;
                                int64_t signed_constant;
+                               uint64_t unsigned_constant;
                                struct ctf_node *sbrac_exp;
+                               struct ctf_node *nested_exp;
                        } u;
                        enum {
                                UNARY_LINK_UNKNOWN = 0,
                                UNARY_DOTLINK,
                                UNARY_ARROWLINK,
+                               UNARY_DOTDOTDOT,
                        } link;
                } unary_expression;
                struct {
@@ -148,6 +152,7 @@ struct ctf_node {
                                TYPESPEC_UNSIGNED,
                                TYPESPEC_BOOL,
                                TYPESPEC_COMPLEX,
+                               TYPESPEC_IMAGINARY,
                                TYPESPEC_CONST,
                                TYPESPEC_ID_TYPE,
                        } type;
@@ -190,29 +195,35 @@ struct ctf_node {
                } string;
                struct {
                        char *id;
-                       /* first node of range list or single node */
-                       struct ctf_node *values;
+                       /*
+                        * Range list or single value node. Contains unary
+                        * expressions.
+                        */
+                       struct cds_list_head values;
                } enumerator;
                struct {
                        char *enum_id;
                        /* NULL, value or declaration specifier */
                        struct ctf_node *container_type;
                        struct cds_list_head enumerator_list;
+                       int has_body;
                } _enum;
                struct {
                        struct cds_list_head declaration_specifier;
                        struct cds_list_head type_declarators;
                } struct_or_variant_declaration;
                struct {
-                       /* list of typedef, typealias and declarations */
-                       struct cds_list_head declaration_list;
                        char *name;
                        char *choice;
+                       /* list of typedef, typealias and declarations */
+                       struct cds_list_head declaration_list;
+                       int has_body;
                } variant;
                struct {
+                       char *name;
                        /* list of typedef, typealias and declarations */
                        struct cds_list_head declaration_list;
-                       char *name;
+                       int has_body;
                } _struct;
        } u;
 };
@@ -222,4 +233,14 @@ struct ctf_ast {
        struct cds_list_head allocated_nodes;
 };
 
+const char *node_type(struct ctf_node *node);
+
+struct ctf_trace;
+
+int ctf_visitor_print_xml(FILE *fd, int depth, struct ctf_node *node);
+int ctf_visitor_semantic_check(FILE *fd, int depth, struct ctf_node *node);
+int ctf_visitor_parent_links(FILE *fd, int depth, struct ctf_node *node);
+int ctf_visitor_construct_metadata(FILE *fd, int depth, struct ctf_node *node,
+                       struct ctf_trace *trace, int byte_order);
+
 #endif /* _CTF_PARSER_H */
This page took 0.025419 seconds and 4 git commands to generate.