나는 flex와 bison으로 세트 평가 프로그램을 작성합니다.들소 세트 평가 코드 오류
내가 오류에 대한 문제에 직면
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
내 플랫폼 정보는 다음과 같다 :
컴파일러 버전 : GCC 4.2.1
들소 : 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
메이크 : gist.github.com/fbukevin/5662359
(I 두 개 이상의 링크를 제기 할 수있는 충분한 명성을하지 않아도, 내가 벗었에 "http : //")
"flex -o calc.lex.c calc.l"행이 유효하지 않은 경우. "flex calc.l"을 시도하십시오. –
아카이브를 다운로드하고 압축을 풀고 파일을 열고 싶지 않으므로 코드를 온라인 (예를 들어 Gist)에 공유하십시오. –
사용법을 알려 주셔서 감사합니다. 시스템은 하나 이상의 링크를 배치 할만큼 충분한 평판이 없다고 말했기 때문에 "http : //"를 제거합니다. –