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

📄 atari.patches

📁 Minix比较全的源码
💻 PATCHES
📖 第 1 页 / 共 2 页
字号:
X***************X*** 520,526 ****X      if ( (skelfile = fopen( skelname, "r" )) == NULL )X  	lerrsf( "can't open skeleton file %s", skelname );X  X!     (void) mktemp( action_file_name );X  X      if ( (temp_action_file = fopen( action_file_name, "w" )) == NULL )X  	lerrsf( "can't open temporary action file %s", action_file_name );X--- 554,562 ----X      if ( (skelfile = fopen( skelname, "r" )) == NULL )X  	lerrsf( "can't open skeleton file %s", skelname );X  X! #ifndef ATARI && LATTICEX!     (void) mktemp( action_file_name );X! #endifX  X      if ( (temp_action_file = fopen( action_file_name, "w" )) == NULL )X  	lerrsf( "can't open temporary action file %s", action_file_name );X***************X*** 566,571 ****X--- 602,640 ----X      }X  X  X+ flexinfo(status)X+ int status;X+ {X+    fprintf(stderr,"Syntax  :  FLEX  inp_file\n");X+    fprintf(stderr,"Function: fast lexical analyzer generator  V%s\n",flex_version);X+    fprintf(stderr,"Options : a dir_path  : directory path for temporary files\n");X+    fprintf(stderr,"	- b  : generate backtracking information to lex.backtrack\n");X+    fprintf(stderr,"	- c  : compressed table, no equiv., no meta equiv.classes\n");X+    fprintf(stderr,"	   e : equivalence classes\n");X+    fprintf(stderr,"	   F : fast table\n");X+    fprintf(stderr,"	  |f : full table\n");X+    fprintf(stderr,"	  |m : meta equivalence classes\n");X+    fprintf(stderr,"	- d  : generate debugging scanner\n");X+    fprintf(stderr,"	- F  : fast table\n");X+    fprintf(stderr,"	- f  : full (not compressed) table\n");X+    fprintf(stderr,"	- I  : generate interactive scanner\n");X+    fprintf(stderr,"	- i  : generate case-insensitive scanner\n");X+    fprintf(stderr,"	- L  : supress #line directives\n");X+ /*   fprintf(stderr,"	- n hexnum : generate scanner using <hexnum> as newline char.\n");*/X+    fprintf(stderr,"	- p  : generate performance report to stderr\n");X+    fprintf(stderr,"	- S skeleton_path : file path for skeleton file\n");X+    fprintf(stderr,"	- s  : suppress echo of unmatched scanner input to stdout\n");X+    fprintf(stderr,"	- T  : run flex in trace mode\n");X+ #ifdef ATARIX+    fprintf(stderr,"	- t  : place result on stdout instead of lex_yy.c\n");X+ #elseX+    fprintf(stderr,"	- t  : place result on stdout instead of lex.yy.c\n");X+ #endifX+    fprintf(stderr,"	- v  : print statistics of generated scanner\n");X+    fprintf(stderr,"     default =  -cem\n");X+    exit(status);X+ }X+ X  /* readin - read in the rules section of the input file(s)X   *X   * synopsis/echo x - scan.l_cdiffsed '/^X/s///' > scan.l_cdiff << '/'X*** Src_2.1/scan.l	Thu Jun 30 19:42:00 1989X--- scan.l	Thu Jul  2 22:19:26 1989X***************X*** 125,132 ****X  X  {SCNAME}		RETURNNAME;X  ^{OPTWS}\n		++linenum; /* allows blank lines in section 1 */X! \n			++linenum; return ( '\n' );X! .			synerr( "illegal character" ); BEGIN(RECOVER);X  X  X  <C_COMMENT>"*/"		ECHO; BEGIN(0);X--- 125,136 ----X  X  {SCNAME}		RETURNNAME;X  ^{OPTWS}\n		++linenum; /* allows blank lines in section 1 */X! {OPTWS}\n		++linenum; return ( '\n' );X! .			{X! 			synerr( "illegal character" );X! 			fprintf(stderr,"Char : $%x\n",yytext[yyleng-1]);X! 			BEGIN(RECOVER);X! 			}X  X  X  <C_COMMENT>"*/"		ECHO; BEGIN(0);X***************X*** 206,212 ****X  <SECT2>^{OPTWS}\n	++linenum; /* allow blank lines in section 2 */X  X  	/* this horrible mess of a rule matches indented lines whichX! 	 * do not contain "/*".  We need to make the distinction becauseX  	 * otherwise this rule will be taken instead of the rule whichX  	 * matches the beginning of comments like this oneX  	 */X--- 210,216 ----X  <SECT2>^{OPTWS}\n	++linenum; /* allow blank lines in section 2 */X  X  	/* this horrible mess of a rule matches indented lines whichX! 	 * do not contain '/','*'.  We need to make the distinction becauseX  	 * otherwise this rule will be taken instead of the rule whichX  	 * matches the beginning of comments like this oneX  	 *//echo x - Makefile.tossed '/^X/s///' > Makefile.tos << '/'X# make file for "flex" toolXX# @(#) $Header$ (LBL)XX# Porting considerations:X#X#    For System V Unix machines, add -DSYS_V to CFLAGS.X#    For Vax/VMS, add -DSYS_V to CFLAGS.X#    For MS-DOS, add "-DMS_DOS -DSYS_V" to CFLAGS.  Create \tmp if not present.X#         You will also want to rename flex.skel to something with a threeX#         character extension, change SKELETON_FILE below appropriately,X#    For Amiga, add "-DAMIGA -DSYS_V" to CFLAGS.X#X# A long time ago, flex was successfully built using Microsoft C andX# the following options: /AL, /stack:10000, -LARGE, -Ml, -Mt128, -DSYS_VXXX# the first time around use "make first_flex"XX# The following definitions must be set according to your compiler -X# examples for a Lattice Compiler with GST assembler and TURBO C withX# assembler are provided below and must just be updated (don't forget toX# update the linker argument extension files (*.lnk,*.tlk), too) :X#X#CCPATH  = path to compiler directory without trailing \X#CHPATH  = path to header files without trailing \X#CC      = filename of the compilerX#CFLAGS  = compiler option flagsX#CIEXT   = extension of C sources that should be used for input filenamesX#ASMPATH = path to assembler directory without trailing \X#ASM     = filename of the assemblerX#AFLAGS  = assembler option flagsX#AIEXT   = extension of assembler sources that should be used for assemblerX#          input filenamesX#AEXT    = general assembler filename extensionX#LNKPATH = path to linker directory without trailing \X#LINK    = filename of the linkerX#LFLAG0  = first option (full pathname of C startupcode) X#LFLAG1  = further options + option flag for argument extension filenameX#LFLAG2  = further options + option flag for output-filename X#LNKEXT  = extension of linker argument extension fileX#OIEXT   = extension of objects that should be used for linker input filesX#OEXT    = general object file extensionXX# Lattice definitionsXCCPATH  = d:\lattXCHPATH  = d:\latt\includeXCC      = lc.ttpXCFLAGS  = -h -n -cw -cc -i$(CHPATH)\ -g$(CCPATH)\ -dLATTICE -dATARIXCIEXT   =XASMPATH = d:\gstXASM     = assem.ttpXAFLAGS  = -nolist -errors errors.outXAIEXT   =XAEXT    = .asmXLNKPATH = d:\gstXLINK    = ld.ttpXLFLAG0  =XLFLAG1  = -with XLFLAG2  = -nolist -sec -mem 200 -prog XLNKEXT  = .lnkXOIEXT   =XOEXT    = .binXX# Turbo definitionsX#CCPATH  = d:\turboX#CHPATH  = d:\turbo\includeX#CC      = tcc.prgX#CFLAGS  = -GJMPRZ -H=$(CHPATH)\ -w- -DTURBO -DATARIX#CIEXT   = .cX#ASMPATH = d:\turboX#ASM     = mas.prgX#AFLAGS  =X#AIEXT   = .sX#AEXT    = .sX#LNKPATH = d:\turboX#LINK    = tlink.ttpX#LFLAG0  = $(LNKPATH)\lib\tcstart.oX#LFLAG1  = -I=X#LFLAG2  = -O=X#LNKEXT  = .tlkX#OIEXT   = .oX#OEXT    = .oXX# Other definitionsX# (not used for Atari because of short argument string - defined in flexdef.hXXSKELETON_DIR = /usr/libXSKELETON_FILE = flex.skelXSKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_DIR)/$(SKELETON_FILE)\"XXXFLEX       = d:\etc\flex.ttpXFLEX_FLAGS = -isXYACC       = d:\etc\yacc.ttpXRENAME     = d:\bin\renameXDEL        = d:\bin\delXX# Internal definitionsXLNK     = $(LNKPATH)\$(LINK)XXFLEXOBJS = \X	ccl$(OEXT) \X	dfa$(OEXT) \X	ecs$(OEXT) \X	gen$(OEXT) \X	main$(OEXT) \X	misc$(OEXT) \X	nfa$(OEXT) \X	parse$(OEXT) \X	scan$(OEXT) \X	sym$(OEXT) \X	tblcmp$(OEXT) \X	yylex$(OEXT)XXFLEX_C_SOURCES = \X	ccl.c \X	dfa.c \X	ecs.c \X	gen.c \X	main.c \X	misc.c \X	nfa.c \X	parse.c \X	scan.c \X	sym.c \X	tblcmp.c \X	yylex.cXXflex : $(FLEXOBJS)X	 $(LNK) $(LFLAG0) $(LFLAG1)flex$(LNKEXT) $(LFLAG2)flex.ttpXXfirst_flex:X	cp initscan.c scan.cX	make $(MFLAGS) flexXXparse.h parse.c : parse.yX	$(YACC)   -d parse.yX	$(DEL)    parse.cX	$(RENAME) y_tab.c parse.cX	$(DEL)    parse.hX	$(RENAME) y_tab.h parse.hXXscan.c : scan.lX	$(FLEX)   $(FLEX_FLAGS) scan.lX	$(RENAME) lex_yy.c scan.cXXscan$(OEXT) : scan.c parse.h flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS) scan$(CIEXT)XXmain$(OEXT) : main.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  main$(CIEXT)XXccl$(OEXT) : ccl.c flexdef.h X	 $(CCPATH)\$(CC) $(CFLAGS)  ccl$(CIEXT)XXdfa$(OEXT) : dfa.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  dfa$(CIEXT)XXecs$(OEXT) : ecs.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  ecs$(CIEXT)XXgen$(OEXT) : gen.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  gen$(CIEXT)XXmisc$(OEXT) : misc.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  misc$(CIEXT)XXnfa$(OEXT) : nfa.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  nfa$(CIEXT)XXparse$(OEXT) : parse.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  parse$(CIEXT)XXsym$(OEXT) : sym.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  sym$(CIEXT)XXtblcmp$(OEXT) : tblcmp.c flexdef.hX	 $(CCPATH)\$(CC) $(CFLAGS)  tblcmp$(CIEXT)XXyylex$(OEXT) : yylex.c flexdef.h X	 $(CCPATH)\$(CC) $(CFLAGS)  yylex$(CIEXT)XXflex.man : flex.1X	nroff -man flex.1 >flex.manXXlint : $(FLEX_C_SOURCES)X	lint $(FLEX_C_SOURCES) > flex.lintXXdistrib :X	mv scan.c initscan.cX	chmod 444 initscan.cX	$(MAKE) $(MFLAGS) cleanXXclean :X	rm -f core errs flex *$(OEXT) parse.c *.lint parse.h flex.man tagsXXtags :X	ctags $(FLEX_C_SOURCES)XXvms :	flex.manX	$(MAKE) $(MFLAGS) distribXXtest :X	$(FLEX) $(FLEX_FLAGS) scan.lX	$(RENAME) lex_yy.c scan.ctestX	cmp scan.c scan.ctestX/echo x - Readme2sed '/^X/s///' > Readme2 << '/'XThe changes:                                                  (1.7.89 RAL)XX - Bug fix: The original flex didn't like trailing spaces in exclusive startX     condition lists ! If you add an trailing space to line 68 in scan.lX     X     "%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE "X     X     you get a misleading error message: X     X     "Syntax error at line 69: bad start condition list"X     X     This bug can either be fixed in parse.y or in scan.l . I have chosen theX     last because there the fix is minimal: Just change the rule (line 128)X     X      "\n"    to   "{OPTWS}\n"X      X - Enhancements:X    - new option "-?" that provides some help information about the otherX      flags (main.c)X    - new option "-aTMPPATH" that allows a redefinition of the standardX      path for the temporary file (this might be rather large >200k if X      F,f options are selected). (main.c, flexdef.h (l.376))X    - hexdump of illegal characters -- this proved to be a useful debuggingX      tool especialy if invisible control characters occur which weren'tX      covered by the rules. (scan.l  fprintf statement line 129,...)X      X - Patches due to TOSX    - General: TOS uses CR,LF as end of line char., Flex wants only a singleX      LF as EOL char. Therefore all I/O must be translated using f* calls.X      This is done everywhere besides the YY_INPUT macro (flex.skel (scan.c),X      line 31) that uses a low level 'read'. This should be definitly changedX      to fread, so that all I/O calls occur on the same level.X    - the short action_file_name has been "flexXXXXXX.tmp", but that's too X      much for TOS,MSDOS ! I changed it to "flexXXXX.tmp" in main.c (patchX      covered by the -a option additions)X    - some compilers don't like external names that are ambiguous withinX      the first 8 characters. I defined macros that change all these longX      external names to names that are unique within the first 8 characters.X      Just define SHORT_EXTERNAL_NAMES to use this feature (flexdef.h)X    - some statement changes that some compiler don't like:X      typedef *xxx[]  -> typedef **xxx       (flexdef.h.,l.308)X      "/*" -> '/','*' within a comment in (scan.l, l.209)X    - changed short "lexyy.c" to "lex_yy.c" what's more similar to the unixX      "lex.yy.c" (main.c).X    - a few further really compiler dependent changes provided withX      #ifdef ATARI && LATTICE res. TURBO braces.X      X - Additional TOS only filesX    - Makefile.tos: Common makefile for all TOS compilers. If you add furtherX      ones please email me the new makefile.X    - flex.lnk: Lattice - GST linker argument extension fileX    - flex.tlk: Turbo linker argument extension fileX      X    XAdditional remarks:X XI didn't add a new initscan.c (= flex -ist scan.l). The current one is goodXenough for a first compilation. With this first version of flex you canXrebuild your own scan.c and the final flex version !XXMinix ST :X  - I had to "chmem =70000 cv" (>50000) to get flex linkedX  - 'memset' (PC 1.3, EFTH40,...) is necessaryX  - chmem =90000 flex may be sufficientX  XMinix PC :X  It should be possible to port Flex to Minix PC. The current sizes of flexX  are:X                        Minix ST (ACK)    Lattice (TOS)    Turbo (TOS)X       X       size               75300             83305             57957X       compilation time      22'               15'             3'40"X       flex -is scan.l     1'49"               43"               30"X       X  The Minix ST size includes the bad generated code using only a subset ofX  the 68000 commands, long addresses only and a huge relocation table.X  Therefore the PC size will be <64 k ! More serious is the fact that I hadX  to chmem =90000 flex to get scan.l converted to scan.c . But I never sawX  a more complex lex source than scan.l -- so it should be possible toX  reduce some array sizes without limitation for all day usage.X  X  No one volunteered yet for a Minix PC port -- but if someone will try itX  I would provide him with a new scan.c and some hints.X  XTOS: X  Don't forget to adapt the flexskel path within flexdef.h !XX/echo x - flex.lnksed '/^X/s///' > flex.lnk << '/'X*X*X*  linker control file for flex.ttpX*X*X*XINPUT   d:\latt\lib\startup.binX*XINPUT ccl.binXINPUT dfa.binXINPUT ecs.binXINPUT gen.binXINPUT misc.binXINPUT nfa.binXINPUT parse.binXINPUT sym.binXINPUT tblcmp.binXINPUT main.binXINPUT yylex.binXINPUT scan.binX*XLIBRARY d:\latt\lib\clib.binX/echo x - flex.tlksed '/^X/s///' > flex.tlk << '/'Xccl.oXdfa.oXecs.oXgen.oXmisc.oXnfa.oXparse.oXsym.oXtblcmp.oXyylex.oXmain.oXscan.oXd:\turbo\lib\tcstdlib.lib   ; standard libXd:\turbo\lib\tcextlib.lib   ; extended libXd:\turbo\lib\tctoslib.lib   ; TOS libXd:\turbo\lib\tcgemlib.lib   ; AES and VDI libX-S=200000/

⌨️ 快捷键说明

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