Hi.
I wrote the following program to show the problem.
It uses very simple plex and pyacc modules that only try to find out if a line of the input contais the word "hallo". The main program does the following:
* open a file
* parse it
* print "----successful parse!----"
* reopen it
* parse it again
...
The first time parsing the file works well.
The second time works almost, but have a look yourself:
LEX: Found HALLO
YACC: Line containing Hallo found.
LEX: Found some text.
YACC: Line with some other text found.
LEX: Found HALLO
YACC: Line containing Hallo found.
---------successful parse!---------------
Reset.
LEX: Found HALLO
YACC: Line containing Hallo found.
LEX: Found some text.
YACC: Line with some other text found.
LEX: Found HALLO
YACC: Line containing Hallo found.
Runtime error 103 at 0x08053A3A
0x08053A3A
0x080480B0
0x00000000
The runtime error is 103 but the return code of the program was 0147 (shown by gdb).
I have tested version 1.0.4 and 1.0.6 of fpc under Linux on i386. Both with the same result.
I can't say if is a fpc problem or a problem of the state machine generated by pyacc.
I have added the following files to this mail:
* Makefile - for easier testing :-)
* yaccerror.pp - the main program
* yaccerror_lex.l - the lex file
* yaccerror_yacc.y - the yacc file
* hallofile.txt - the textfile used above
What I have done so far:
- looked through the documentation/examples of tply41a.
- written a program that opens a textfile and displays all lines several times to see if "Reset" works. It worked.
- some sessions with DDD (frontend for gdb)
- tested fpc 1.0.4 ad 1.0.6
Thank you,
Ralf Paaschen
