Re: HLA, Flex, and Bison
From: T.M. Sommers (tms2_at_mail.ptd.net)
Date: 10/15/03
- Next message: Beth: "Re: Circular buffer"
- Previous message: Ed Beroset: "Re: Circular buffer"
- In reply to: Randall Hyde: "Re: HLA, Flex, and Bison"
- Next in thread: Frank Kotler: "Re: HLA, Flex, and Bison"
- Reply: Frank Kotler: "Re: HLA, Flex, and Bison"
- Reply: Randall Hyde: "Re: HLA, Flex, and Bison"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 15 Oct 2003 05:34:56 GMT
Randall Hyde wrote:
> "T.M. Sommers" <tms2@mail.ptd.net> wrote in message news:jjMib.1001$_i.93454@nnrp1.ptd.net...
>
>>I don't know what you meant about the inability to support separate
>>compilation. You can certainly call external functions from within a
>>yacc production.
>
> Yes, you can call external C code (which the HLA Bison file does a lot of),
> but you can compile productions separately and link those together (i.e.,
> separate compilation of Bison files).
But the productions can consist of mostly external code:
foo: whatever { do_foo($1); }
>>I've finally installed the newest bison (had to upgrade the os first),
>>and managed to compile the program natively on FreeBSD with only two
>>small changes to hlaparse.bsn:
>>
>>1) comment out the definition of __STDC__ on line 612; and
>>2) add #include <sys/types.h> before #include <sys/timeb.h> on line 31.
>>
>>I have not tested it, because the libraries will have to be fixed
>>first, and that looks like a big job.
>
> Yep. That's a very big job.
I'll see if I can't generate the syscall functions automatically.
FreeBSD does that for the C library, so it should be possible here.
In fact, FreeBSD does the same for its Linux compatibility mode, so it
should be possible to generate the Linux library automatically, too.
Does Linux do the same thing?
Looking at the libraries, it looks like, except for the syscalls, the
Linux versions are more generic than just Linux; they should work for
any Unix. How about making it so that when you define os.linux, it
also defines os.unix. That way common code won't have to be duplicated.
Also, regarding the console library, the Linux version assumes the tty
works in a particular way. While that will be true most of the time,
it won't always be true. Using termcap/terminfo would require linking
to a C library, but it would be more portable.
> Also, there are a *few* OS-specific sections of code in the compiler
> itself. I suspect, however, that much of the Linux-specific code may
> actually work for BSD. I'd do a grep for "Linux" throughout the source
> tree, just to be on the safe side.
I did compile with -DLinux, but didn't look at the code. Now I've
looked.
It seems like most of the Linux dependencies in output.c are really
gas dependencies, so maybe they can be handled that way. Near line
8305 is a real dependency (for calling exit), which will need new code
for FreeBSD.
In hlaparse.bsn, near line 76593, there is the same deal involving exit.
In the other files the dependencies are benign. Some, I think, can
even be eliminated with a little fiddling. Also, FreeBSD has
strcasecmp, which can replace stricmp.
>>The makefile is a bit of a mess right now, but I could clean it up and
>>send it to you if you want.
>
> Sounds good.
Okay, I'll clean it up and send it to you. I'll also send some diffs
for the above issues.
Also, while browsing in the library code I came across this near line
1226 of linux.hhf:
#if( !@defined( nogroup ))
ngroup := -1;
#endif
which looks suspsicious. Should the ngroup be a nogroup?
- Next message: Beth: "Re: Circular buffer"
- Previous message: Ed Beroset: "Re: Circular buffer"
- In reply to: Randall Hyde: "Re: HLA, Flex, and Bison"
- Next in thread: Frank Kotler: "Re: HLA, Flex, and Bison"
- Reply: Frank Kotler: "Re: HLA, Flex, and Bison"
- Reply: Randall Hyde: "Re: HLA, Flex, and Bison"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|