0
votes

I write a sets evaluation program with flex and bison.

I face a problem with error

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

my platform information is as follow:

Compiler Version: gcc 4.2.1

Bison: 2.5.1

Flex: 2.5.4

Please help me to deal with above error, thanks very much!

The following links are my codes on 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

(I don't have enough reputation to pose more than two link, so I took off "http://")

1
if the line "flex -o calc.lex.c calc.l" is invalid. Please try "flex calc.l".Veck Hsiao
Please share your code online —in a Gist for example—, as we don't want to download your archive, extract it, open the files, etc.Samy Dindane
Thank for telling me that usage. The system told me that I don't have enough reputation to pose more than one link, so I remove the "http://".Veck Hsiao
I found the answer here with different title. Thanks everybody try to help me. >Referenc: stackoverflow.com/questions/10273523/…Veck Hsiao
Glad you found an answer. You can answer your own question and accept it. (by the way, you can have many files in a single gist ;))Samy Dindane

1 Answers

1
votes

I found the answer here with different title. Thanks everybody try to help me.

Referenc: Flex/Bison Error:request for member `str' in something not a structure or union