Make this compatible with byacc

This commit is contained in:
christos 2017-06-05 18:59:21 +00:00
parent 5e046fca2c
commit f8d365c3eb
1 changed files with 11 additions and 0 deletions

View File

@ -24,7 +24,11 @@
#include "srcpos.h"
extern int yylex(void);
#ifndef YYBYACC
extern void yyerror(char const *s);
#else
#include "dtc-parser.h"
#endif
#define ERROR(loc, ...) \
do { \
srcpos_error((loc), "Error", __VA_ARGS__); \
@ -471,7 +475,14 @@ subnode:
%%
#ifndef YYBYACC
void yyerror(char const *s)
{
ERROR(&yylloc, "%s", s);
}
#else
void yyerror(YYLTYPE *loc, char const *s)
{
ERROR(loc, "%s", s);
}
#endif