⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 think_c_notes

📁 flex编译器的源代码
💻
字号:
Notes on the THINK C version of Flex 2.4.6
Scott Hofmann 23-JUL-94
Internet: scotth@visix.com

The only changes needed to compile Flex 2.4.6 under Symantec C++ 6.0 was
to #include <console.h> in main.c and call ccommand() just before flexinit()
in main(). The notes below are mostly of historical significance only; most
of the workarounds below were to get around restrictions/problems in earlier
versions of THINK C. The only section which still applies is Russell Finn's 
description of how to make Flex generate output of type 'KAHL'. Also, 4-byte
ints must be used by any project which uses Flex output.

If you want to recreate the project, you'll need to add the files 
alloca.c and xmalloc.c in this directory. Both files are copylefted; see
the GNU General Public License for details. You will also need to recompile
both the ANSI and unix libraries to use 4 byte ints, and if you want the
files that flex creates to have 'KAHL' as the creator you'll need to apply
Russell Finn's patch.

Notes on the THINK C version of Flex 2.3.7
Jonas Barklund, 25-JAN-92
Internet: jonas@csd.uu.se

I have merged the sources for Flex version 2.3.7 with the older version
which was hacked for THINK C version 4. I have conditionalized the code
so that I think it should work with both THINK C version 4 and 5 (for
those of you who don't know: the THINK_C symbol is defined as 1 in version
4 and as 5 in version 5). I have put in some missing prototypes, so it
compiles also with "require prototypes" on.

Most of the notes below still apply, in particular that about the MakeRes
program.


Notes on the THINK C version of Flex
Russell S. Finn, 19-FEB-90
Internet: rsfinn@athena.mit.edu, rsfinn@neutron.lcs.mit.edu
CompuServe: 76377,1107
GEnie: RSFINN

Flex appears to be covered by a copyright notice from the University of
California, similar to the one covering Berkeley Unix; the Free Software
Foundation is not part of the picture here.  So here is a version
created with THINK C 4.0, along with the source code; as with the
Bison distribution, I am including *all* of the source code I received
with the package.

The current version (modification date January 25, 1990) has only the
bare-bones interface provided by the THINK C library routine "ccommand",
which allows the user to type a command line and to redirect the output.
Perhaps someday I may try to implement a "real" user interface; perhaps
not.

The only modifications made to the source file are surrounded by "#ifdef
THINK_C"..."#endif"; in theory, then, these sources could be recompiled
on another system if necessary.  These are the actual files modified:
alloca.c, dfa.c, flexdef.h, main.c, misc.c, scan.c, sym.c.  Most of these
changes were minor, and many of them would have been unnecessary if the
original Flex source code had been written for an ANSI-compliant C compiler.
In addition, the file "macutils.c" is completely new; see the discussion
of "MakeRes" below.

THINK C users may find it convenient to have the output text files written
by Flex be THINK C documents.  To do this, create a copy of the "ANSI"
project called "ANSI-KAHL", and a copy of the file "fopen.c" called
"fopen-KAHL.c".  In the copy, find the routine "setfiletype", and replace
the lines:
	if (!(oflag & F_BINARY))
		pb.ioFlFndrInfo.fdType = 'TEXT';
with the lines:
	if (!(oflag & F_BINARY)) {
		pb.ioFlFndrInfo.fdType = 'TEXT';
		pb.ioFlFndrInfo.fdCreator = 'KAHL';
		}
Replace "fopen.c" with the new "fopen-KAHL.c", rebuild the new project
"ANSI-KAHL", and use this project in the project file "Flex.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -