X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Fcommon%2Fmetadata%2Fparser.y;h=16868179282c18b66da6a110becc880336d3cc68;hb=3d800ab3af749cfaf79f436bf3d134325a25ebf1;hp=ef89fcf8bfeb714ce750cd982857cc5305f4425a;hpb=98b15851a941e7342b8bb19e265cdc3a40fabfb8;p=babeltrace.git diff --git a/src/plugins/ctf/common/metadata/parser.y b/src/plugins/ctf/common/metadata/parser.y index ef89fcf8..16868179 100644 --- a/src/plugins/ctf/common/metadata/parser.y +++ b/src/plugins/ctf/common/metadata/parser.y @@ -41,16 +41,10 @@ #include "common/list.h" #include "common/assert.h" #include "scanner.h" -#include "parser.h" #include "ast.h" #include "objstack.h" -#if BT_LOG_ENABLED_TRACE -# define YYDEBUG 1 -# define YYFPRINTF(_stream, _fmt, args...) BT_LOGT(_fmt, ## args) -#else -# define YYDEBUG 0 -#endif +#include "parser-wrap.h" /* Join two lists, put "add" at the end of "head". */ static inline void @@ -1044,6 +1038,17 @@ void ctf_scanner_free(struct ctf_scanner *scanner) %} +/* + * This ends up in parser.h and makes sure those who want to include it pass + * through parser-wrap.h. + */ +%code requires { +#ifndef ALLOW_INCLUDE_PARSER_H +# error "Don't include parser.h directly, include parser-wrap.h instead." +#endif +} + + %define api.pure /* %locations */ %error-verbose @@ -1305,7 +1310,7 @@ unary_expression: $$->u.unary_expression.type = UNARY_SIGNED_CONSTANT; $$->u.unary_expression.u.signed_constant = -($$->u.unary_expression.u.unsigned_constant); - } else if ($$->u.unary_expression.type == UNARY_UNSIGNED_CONSTANT) { + } else if ($$->u.unary_expression.type == UNARY_SIGNED_CONSTANT) { $$->u.unary_expression.u.signed_constant = -($$->u.unary_expression.u.signed_constant); } else {