| Issue 1: | Lemon doesn't produce a header with function prototypes |
1 of 4
Next ›
|
| 1 person starred this issue and may be notified of changes. | Back to list |
When using lemon, programs complain about not having the function prototypes. It would be nice if lemon could output function prototypes in the header file.
Mar 24, 2010
#1
Eric.L.H...@gmail.com
Mar 29, 2010
On line 4019, I inserted the attached code. It worked for me. A few issues that make this harder than you'd think: 1. I had to scan for structs and forward-declare them as well, or else the declarations wouldn't compile. I don't forward-declare classes (can lemon be compiled as C++?), nor do I add typedefs. So there still could be problems. 2. I had to include <stdio.h> and <stddef.h> to get FILE, size_t, ptrdiff_t, etc. But I would have to add <time.h> to get time_t. I'm not sure what others I would need. 3. By adding this stuff, I've created a dependency on lempar.c in lemon.c, which sorta defeats the purpose of having a template file in the first place. Despite all that I've attached my "fix" since it's a fairly common problem.
Mar 29, 2010
I just realized the correct line number was 4016 (I think) because I had added a
warning comment at the top of my source file saying that I had tainted it.
My code goes right after the line:
out = file_open(lemp,".h","wb");
if( out ){
I have attached a proper patch file for lemon.c this time. Sorry about that, guys.
|