CTF metadata: AST nodes
[babeltrace.git] / formats / ctf / metadata / ctf-parser.y
index fb7e9b7cf5d4a4abf3d29f6fb4ffbe5279436aef..7847a85d2664c6149ea0b3ecb527f0487fd6af27 100644 (file)
@@ -28,8 +28,7 @@
 #include "ctf-parser.h"
 #include "ctf-ast.h"
 
-#define printf_dbg(fmt, args...)       fprintf(stderr, "%s: " fmt, __func__, args)
-#define printf_dbg_noarg(fmt)  fprintf(stderr, "%s: " fmt, __func__)
+#define printf_dbg(fmt, args...)       fprintf(stderr, "%s: " fmt, __func__, ## args)
 
 int yyparse(struct ctf_scanner *scanner);
 int yylex(union YYSTYPE *yyval, struct ctf_scanner *scanner);
@@ -87,7 +86,7 @@ static void push_scope(struct ctf_scanner *scanner)
 {
        struct ctf_scanner_scope *ns;
 
-       printf_dbg_noarg("push scope\n");
+       printf_dbg("push scope\n");
        ns = malloc(sizeof(struct ctf_scanner_scope));
        init_scope(ns, scanner->cs);
        scanner->cs = ns;
@@ -97,7 +96,7 @@ static void pop_scope(struct ctf_scanner *scanner)
 {
        struct ctf_scanner_scope *os;
 
-       printf_dbg_noarg("pop scope\n");
+       printf_dbg("pop scope\n");
        os = scanner->cs;
        scanner->cs = os->parent;
        finalize_scope(os);
@@ -350,16 +349,12 @@ event_declaration:
 
 event_declaration_begin:
                EVENT LBRAC
-               {
-                       push_scope(scanner);
-               }
+               {       push_scope(scanner);    }
        ;
 
 event_declaration_end:
                RBRAC SEMICOLON
-               {
-                       pop_scope(scanner);
-               }
+               {       pop_scope(scanner);     }
        ;
 
 
@@ -370,16 +365,12 @@ stream_declaration:
 
 stream_declaration_begin:
                STREAM LBRAC
-               {
-                       push_scope(scanner);
-               }
+               {       push_scope(scanner);    }
        ;
 
 stream_declaration_end:
                RBRAC SEMICOLON
-               {
-                       pop_scope(scanner);
-               }
+               {       pop_scope(scanner);     }
        ;
 
 
@@ -390,16 +381,12 @@ trace_declaration:
 
 trace_declaration_begin:
                TRACE LBRAC
-               {
-                       push_scope(scanner);
-               }
+               {       push_scope(scanner);    }
        ;
 
 trace_declaration_end:
                RBRAC SEMICOLON
-               {
-                       pop_scope(scanner);
-               }
+               {       pop_scope(scanner);     }
        ;
 
 declaration_specifiers:
@@ -453,16 +440,12 @@ struct_type_specifier:
 
 struct_declaration_begin:
                LBRAC
-               {
-                       push_scope(scanner);
-               }
+               {       push_scope(scanner);    }
        ;
 
 struct_declaration_end:
                RBRAC
-               {
-                       pop_scope(scanner);
-               }
+               {       pop_scope(scanner);     }
        ;
 
 variant_type_specifier:
@@ -483,16 +466,12 @@ variant_type_specifier:
 
 variant_declaration_begin:
                LBRAC
-               {
-                       push_scope(scanner);
-               }
+               {       push_scope(scanner);    }
        ;
 
 variant_declaration_end:
                RBRAC
-               {
-                       pop_scope(scanner);
-               }
+               {       pop_scope(scanner);     }
        ;
 
 type_specifier_or_integer_constant:
@@ -607,9 +586,7 @@ type_declarator:
 
 direct_type_declarator:
                IDENTIFIER
-               {
-                       add_type(scanner, $1->s);
-               }
+               {       add_type(scanner, $1->s);       }
        |       LPAREN type_declarator RPAREN
        |       direct_type_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
        ;
@@ -622,9 +599,7 @@ abstract_type_declarator:
 direct_abstract_type_declarator:
                /* empty */
        |       IDENTIFIER
-               {
-                       add_type(scanner, $1->s);
-               }
+               {       add_type(scanner, $1->s);       }
        |       LPAREN abstract_type_declarator RPAREN
        |       direct_abstract_type_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
        |       direct_abstract_type_declarator LSBRAC RSBRAC
This page took 0.025935 seconds and 4 git commands to generate.