Add Types.h to %code require in parser definition.

This commit is contained in:
Stefano Sanfilippo 2014-11-24 23:56:54 +01:00
parent aa122fd7a0
commit b5d524c295
3 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,4 @@
%{ %{
#include "Type.h"
#include "Monicelli.tab.h" #include "Monicelli.tab.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>

View File

@ -1,14 +1,15 @@
%{ %{
#include "Type.h"
#define YYERROR_VERBOSE #define YYERROR_VERBOSE
extern void emit(const char *, ...); extern void emit(const char *, ...);
extern void yyerror(const char *); extern void yyerror(const char *);
extern int yylex(); extern int yylex();
%} %}
%code requires {
#include "Type.h"
}
%union { %union {
Type typeval; Type typeval;
int intval; int intval;

1
main.c
View File

@ -1,4 +1,3 @@
#include "Type.h"
#include "Monicelli.tab.h" #include "Monicelli.tab.h"
#include <stdio.h> #include <stdio.h>