我寫了一套flex和野牛的套評估程序。野牛集評估代碼錯誤
我面對的問題與錯誤
bison -d calc.y
flex calc.l
cc -o a.out calc.tab.c lex.yy.c -lfl
calc.y: In function 'yyparse':
calc.y:25: error: request for member 'exp' in something not a structure or union
calc.y:25: error: request for member 'set' in something not a structure or union
calc.y:25: error: request for member 'set' in something not a structure or union
calc.y:26: error: request for member 'exp' in something not a structure or union
calc.y:26: error: request for member 'set' in something not a structure or union
calc.y:26: error: request for member 'set' in something not a structure or union
calc.y:27: error: request for member 'exp' in something not a structure or union
calc.y:27: error: request for member 'set' in something not a structure or union
calc.y:27: error: request for member 'set' in something not a structure or union
calc.y:30: error: request for member 'set' in something not a structure or union
calc.y:30: error: request for member 'string' in something not a structure or union
calc.y:31: error: request for member 'string' in something not a structure or union
calc.y:32: error: request for member 'set' in something not a structure or union
calc.y:32: error: request for member 'set' in something not a structure or union
* Error code 1
我的平臺信息如下:
編譯器版本:4.2.1 GCC
野牛:2.5.1
軟硬度: 2.5.4
請幫我處理上面的錯誤,非常感謝!
以下鏈接是我在Gist上的代碼。
calc.l:gist.github.com/fbukevin/5662335
calc.y:gist.github.com/fbukevin/5662350
test.h:gist.github.com/fbukevin/ 5662533
的Makefile:gist.github.com/fbukevin/5662359
(我沒有足夠的聲譽造成兩個以上的環節,所以我摘下的 「http://」)
如果行「flex -o calc.lex.c calc.l」無效。請嘗試「flex calc.l」。 –
請在線分享您的代碼 - 例如,我們不想下載您的檔案,解壓縮,打開文件等。 –
感謝告訴我這種用法。系統告訴我,我沒有足夠的聲望來構成多個鏈接,因此我刪除了「http://」。 –