www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/06/01:24:05

Date: Sat, 6 May 1995 13:34:55 +0900
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: krishnab AT cat DOT syr DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: FLEX, BISON and BCC

A few people have given answers; I think they're mostly inaccurate.
:-) Here's what I know, and what I don't know :-) HTH

   Presently I just wanted to know if it is possible to use Borland C
   compiler instead of gcc for creating executeable from source generated
   from FLEX and BISON?

The primary output of both Bison and flex are C functions.  These
functions should be possible to compile with other compilers.
However, as I recall, both bison and flex may produce code that uses
GNU extensions to the ANSI standard.  (This depends on the versions
used of both programs.)  This behavior may be altered with a switch, I
believe, in versions of those compilers where extensions are used.
(For Bison, try the yacc compatibility mode.  For flex, the lex
compatibility mode.  This will of course reduce features and
performance; but it's a simple workaround.)

Bison's C output is actually data which is used to construct a state
machine interpreted by a function which is imported as GPL'd C code
from the file "bison.skeleton" or "bison.hairy" (depending on whether
certain "hairy" features of bison parsers are used---these filenames
truncate to 8.3 under DJGPP, of course) which live in include or lib,
I forget.  This will also be needed.  There's no way to get around it,
which means that the *entirety* of *any* program using a bison parser
falls under the GPL *no matter what compiler is used to compile the C
code*.  Watch your step....  (If you don't like this, get Berkeley
yacc.  Most recent version I know of is byacc19.zip at SimTel, in a
programming tools directory, I forget its exact name.)

Both of the primary functions produced by Bison and flex require a
number of helper functions.  You can of course define them yourself.
But default versions of some of these are defined as macros, some as
#included function definitions, and some are provided in libraries (I
think this is so for flex but not for bison, I'm not sure).  If you
decide to use them, these libraries *must* be recompiled under BCC, so
you need to get the source for flex, at least, and possibly Bison.
You don't need to recompile flex and Bison themselves, but you could
if you wanted, of course.

-- 
Stephen Turnbull  /  Yaseppochi-gumi  /  <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
http://turnbull.sk.tsukuba.ac.jp/      anon FTP: turnbull.sk.tsukuba.ac.jp
Check out Kansai-WWW, too ------------> http://pclsp2.kuicr.kyoto-u.ac.jp/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019