2012-11-18 67 views
4

我是彎曲新手,野牛和我一直在工作在這個項目上幾天。我有過蜜蜂以前正常工作野牛文件,我改變了一點,現在,它不會創建tab.h文件...我已經放置在兩個錯誤,我的野牛和下面的柔性文件... 錯誤:野牛不是創建tab.h文件

In file included from stojk_3_2.y:55: 
    stojkovic_project1_2.l:4:27: error: stojk_3_2.tab.h: No such file or directory 
    stojk_3_2.tab.c: In function ‘int yyparse()’: 
    stojk_3_2.tab.c:1416: warning: deprecated conversion from string constant to ‘char*’ 
    stojk_3_2.tab.c:1562: warning: deprecated conversion from string constant to ‘char*’ 

.Y文件:

%{ 
#include <stdio.h> 
#include <stdlib.h> 
#include <ctype.h> 

#define YYSTYPE double 

int yylex(void); 

static 
void yyerror(char *s) 
{ 
printf("yyerror: %s\n", s); 
} 

%} 

%token PLUS 
%token MINUS 
%token MULT 
%token DIVIDE 

%token LPAREN 
%token RPAREN 

%token UNSIGNEDINTEGER 

%left PLUS MINUS 
%left MULT DIVIDE 

%token Variable 
%token Exp 
%token Sign 
%token Unsigned_int 
%token Unsigned_float_int 
%token Factor 

%% 

lines  :   lines expr '\n'   {printf("%g\n", $2);} 
|   lines '\n' 
|   /*empty*/ 
; 

expr  :   expr PLUS expr   {$$ = $1 + $3;} 
|   expr MINUS expr   {$$ = $1 - $3;} 
|   expr MULT expr   {$$ = $1 * $3;} 
|   expr DIVIDE expr   {$$ = $1/$3;} 
|   LPAREN expr RPAREN  {$$ = $2;} 
|   UNSIGNEDINTEGER 
; 

%% 

#include "lex.yy.c" 

int yylex(void); 
int yyparse(void); 

int main(void) 
{ 
return yyparse(); 
} 

.L文件

​​
+0

我重新簽名,因爲這不是關於Adobe/Apache UI框架。 – JeffryHouser

回答

8

嘗試運行

bison -d blah.y 

這將使它產生.h文件

+0

是兩個文件運行沒有錯誤.. – codenamejupiterx

+0

這兩個文件?目錄中是否創建了stojk_3_2.tab.h? –

+0

無其不...我不知道爲什麼 – codenamejupiterx