X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fmetadata%2Fctf-visitor-semantic-validator.c;h=da813e0a50acf6ce1b9eacde0e6caaaf81b15fde;hp=eab4391b7007015df38504a7d1f6efe9acc2e3a1;hb=73d159163aa1c2b8e9da78ade3ded6ef1c81513f;hpb=6204d33cac1f29ec4dab146fd139caba7acc3363 diff --git a/formats/ctf/metadata/ctf-visitor-semantic-validator.c b/formats/ctf/metadata/ctf-visitor-semantic-validator.c index eab4391b..da813e0a 100644 --- a/formats/ctf/metadata/ctf-visitor-semantic-validator.c +++ b/formats/ctf/metadata/ctf-visitor-semantic-validator.c @@ -108,6 +108,7 @@ int ctf_visitor_unary_expression(FILE *fd, int depth, struct ctf_node *node) case NODE_EVENT: case NODE_STREAM: case NODE_TRACE: + case NODE_CLOCK: case NODE_TYPEDEF: case NODE_TYPEALIAS_TARGET: case NODE_TYPEALIAS_ALIAS: @@ -210,6 +211,7 @@ int ctf_visitor_type_specifier_list(FILE *fd, int depth, struct ctf_node *node) case NODE_EVENT: case NODE_STREAM: case NODE_TRACE: + case NODE_CLOCK: case NODE_UNARY_EXPRESSION: case NODE_TYPEALIAS: case NODE_TYPE_SPECIFIER: @@ -249,6 +251,7 @@ int ctf_visitor_type_specifier(FILE *fd, int depth, struct ctf_node *node) case NODE_EVENT: case NODE_STREAM: case NODE_TRACE: + case NODE_CLOCK: case NODE_UNARY_EXPRESSION: case NODE_TYPEALIAS: case NODE_TYPE_SPECIFIER: @@ -329,6 +332,7 @@ int ctf_visitor_type_declarator(FILE *fd, int depth, struct ctf_node *node) case NODE_EVENT: case NODE_STREAM: case NODE_TRACE: + case NODE_CLOCK: case NODE_CTF_EXPRESSION: case NODE_UNARY_EXPRESSION: case NODE_TYPEALIAS: @@ -480,6 +484,21 @@ int _ctf_visitor_semantic_check(FILE *fd, int depth, struct ctf_node *node) return ret; } break; + case NODE_CLOCK: + switch (node->parent->type) { + case NODE_ROOT: + break; /* OK */ + default: + goto errinval; + } + + cds_list_for_each_entry(iter, &node->u.clock.declaration_list, siblings) { + ret = _ctf_visitor_semantic_check(fd, depth + 1, iter); + if (ret) + return ret; + } + break; + case NODE_CTF_EXPRESSION: switch (node->parent->type) { @@ -487,6 +506,7 @@ int _ctf_visitor_semantic_check(FILE *fd, int depth, struct ctf_node *node) case NODE_EVENT: case NODE_STREAM: case NODE_TRACE: + case NODE_CLOCK: case NODE_FLOATING_POINT: case NODE_INTEGER: case NODE_STRING: @@ -553,6 +573,7 @@ int _ctf_visitor_semantic_check(FILE *fd, int depth, struct ctf_node *node) case NODE_STRING: case NODE_ENUMERATOR: case NODE_ENUM: + case NODE_CLOCK: default: goto errinval; } @@ -657,6 +678,7 @@ int _ctf_visitor_semantic_check(FILE *fd, int depth, struct ctf_node *node) case NODE_STRING: case NODE_ENUMERATOR: case NODE_ENUM: + case NODE_CLOCK: default: goto errinval; }