I wrote a simple assembler using flex and bison . It worked perfectly until I made a small change . Was a harmless additional rule in the lex and yacc specifications . After that it throws a segmentation fault each time I run it . I tried to trace the source of this seg fault but it turns out it occurs before the main in the lex file is executed . Then I removed the addition I made and recompiled it , It still shows the same error.
What’s wrong???
I did something like this
- Lookup Table , Symbol Table , Code
Generator in separate files - Parser in a “.y” file importing the above mentioned files
- Lexical Scanner in a “.l” file importing the “*.tab.h” file
- linked lex.yy.c and parser.tab.c to make an executable
Thanks in Advance
And if the answer isn’t at that point obvious, select the entire above sequence and update your question above.
BTW, my guess is that you have changed the way you are building it. Perhaps you should just just cut your program back to hello, world, and then start adding in the other components one by one.