-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EOF error about windows line endings. #4
Comments
please confirm whether #5 fixes this. |
rofl0r, I tested it, the error message is gone, but it has some problem:
$ ./lex -o test.c test.txt
$ gcc test.c -o test
test.txt:342:1: error: stray ‘\1’ in program
test.txt:342:2: error: stray ‘\17’ in program Thanks. |
pushed 9065faa to #5 branch, i suspect that was the issue causing the generated |
The commit 9065faa didn't fix 2. If you run command xxd -g 1 test.c, you can see the last line have "01 0f", it is the problem:
If I remove "01 0f", then it can be compiled by GCC successfully. By the way, I should add a line "int yywrap(){return 1;}" in the test.txt before compile it by lex. Thanks. |
pushed a couple more commits to that branch. since you didnt provide a new test.c which i could vbindiff against the correct result from lex compiled on linux, i made it work with my pellescc wrapper for Pelles C compiler and wine. the windows binary so compiled now produces identical output to the linux version, which can then in turn be compiled too. |
I have test it, attach the test.zip, I don't know why there always is a "01 0f" at the file end. |
that's odd. did you really check out the branch of #5 , ran make clean , and compiled everything anew ? your test.c is identical to your previous one, except addition of |
I downloaded multiple lex package, and I think I confused with them, I'm sorry. |
I build this lex tool pass on Windows system platform using MSYS2, but when I compile a minimal lex souce code using command ./lex -o test.c test.txt, it always show error message "Error: EOF before %}".
I google it and got this:
https://stackoverflow.com/questions/8226993/premature-eof-error-in-flex-file
I think there may be invisible chars influenced the parser, so I change the Windows text line ending(CR LF) to Unix line ending(LF) and it worked, so I think this lex cannot handle Windows line ending correctly.
Follow is the test.txt.
Thanks.
The text was updated successfully, but these errors were encountered: