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

📄 diffs

📁 flex编译器的源代码
💻
📖 第 1 页 / 共 2 页
字号:
  static char *outfile = "lexyy.c";
! #endif  /* SHORT_FILE_NAMES */
  static int outfile_created = 0;
  static int use_stdout;
  static char *skelname = NULL;
***************
*** 209,216 ****
--- 213,222 ----
  	else if ( fclose( temp_action_file ) )
  	    flexfatal( "error occurred when closing temporary action file" );
  
+ #ifndef OSVS
  	else if ( unlink( action_file_name ) )
  	    flexfatal( "error occurred when deleting temporary action file" );
+ #endif
  	}
  
      if ( status != 0 && outfile_created )
***************
*** 221,228 ****
--- 227,236 ----
  	else if ( fclose( stdout ) )
  	    flexfatal( "error occurred when closing output file" );
  
+ #ifndef OSVS
  	else if ( unlink( outfile ) )
  	    flexfatal( "error occurred when deleting output file" );
+ #endif
  	}
  
      if ( backtrack_report && backtrack_file )
***************
*** 574,583 ****
      if ( backtrack_report )
  	{
  #ifndef SHORT_FILE_NAMES
  	backtrack_file = fopen( "lex.backtrack", "w" );
! #else
  	backtrack_file = fopen( "lex.bck", "w" );
! #endif
  
  	if ( backtrack_file == NULL )
  	    flexerror( "could not create lex.backtrack" );
--- 582,595 ----
      if ( backtrack_report )
  	{
  #ifndef SHORT_FILE_NAMES
+ #ifdef OSVS
+ 	backtrack_file = fopen( SYSUT2, "w");
+ #else   /* not OSVS */
  	backtrack_file = fopen( "lex.backtrack", "w" );
! #endif	/* OSVS */
! #else   /* SHORT_FILE_NAMES  */
  	backtrack_file = fopen( "lex.bck", "w" );
! #endif  /* SHORT_FILE_NAMES */
  
  	if ( backtrack_file == NULL )
  	    flexerror( "could not create lex.backtrack" );
***************
*** 597,604 ****
  	lerrsf( "can't open skeleton file %s", skelname );
  
  #ifdef SYS_V
      action_file_name = tmpnam( NULL );
! #endif
  
      if ( action_file_name == NULL )
  	{
--- 609,620 ----
  	lerrsf( "can't open skeleton file %s", skelname );
  
  #ifdef SYS_V
+ #ifndef OSVS
      action_file_name = tmpnam( NULL );
! #else	/* OSVS */
!     action_file_name = SYSUT1;
! #endif	/* OSVS */
! #endif	/* SYS_V */
  
      if ( action_file_name == NULL )
  	{
***************
*** 609,615 ****
--- 625,636 ----
  #else
  	(void) strcpy( temp_action_file_name, "flexXXXXXX.tmp" );
  #endif
+ #ifndef OSVS
  	(void) mktemp( temp_action_file_name );
+ #else	/* OSVS */
+ 	/* should never be executed in OSVS as IF should always be false  */
+ 	(void) strcpy( temp_action_file_name, SYSUT1 ) ;
+ #endif  /* OSVS */
  
  	action_file_name = temp_action_file_name;
  	}
diff -c ../misc.c ./misc.c
*** ../misc.c	Thu Jun 28 00:44:40 1990
--- ./misc.c	Mon Jul 16 13:57:35 1990
***************
*** 28,38 ****
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/misc.c,v 2.7 90/06/27 23:48:27 vern Exp $ (LBL)";
  #endif
  
  #include <ctype.h>
! #include "flexdef.h"
  
  
  /* ANSI C does not guarantee that isascii() is defined */
--- 28,38 ----
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: misc.c,v 2.7 90/06/27 23:48:27 vern Exp $ (LBL)";
  #endif
  
  #include <ctype.h>
! #include <flexdef.h>
  
  
  /* ANSI C does not guarantee that isascii() is defined */
***************
*** 107,113 ****
--- 107,117 ----
      {
      while ( *str )
  	{
+ #ifdef OSVS
+ 	if ( ! islower( *str ) )
+ #else
  	if ( ! isascii( *str ) || ! islower( *str ) )
+ #endif
  	    return ( 0 );
  	++str;
  	}
***************
*** 130,136 ****
--- 134,144 ----
      {
      while ( *str )
  	{
+ #ifdef OSVS
+ 	if ( ! isupper( (char) *str ) )
+ #else
  	if ( ! isascii( *str ) || ! isupper( (char) *str ) )
+ #endif
  	    return ( 0 );
  	++str;
  	}
***************
*** 182,188 ****
--- 190,200 ----
  register int c;
  
      {
+ #ifdef OSVS
+     return ( isupper( c ) ? (Char) tolower( c ) : (Char) c );
+ #else
      return ( (isascii( c ) && isupper( c )) ? tolower( c ) : c );
+ #endif
      }
  
  
***************
*** 204,210 ****
      for ( c = str; *c; ++c )
  	;
  
!     copy = malloc( (unsigned) ((c - str + 1) * sizeof( char )) );
  
      if ( copy == NULL )
  	flexfatal( "dynamic memory failure in copy_string()" );
--- 216,222 ----
      for ( c = str; *c; ++c )
  	;
  
!     copy = (char *) malloc( (unsigned) ((c - str + 1) * sizeof( char )) );
  
      if ( copy == NULL )
  	flexfatal( "dynamic memory failure in copy_string()" );
***************
*** 392,403 ****
--- 404,421 ----
  
  #ifndef MS_DOS
  #ifndef VMS
+ #ifndef OSVS
  #include <sys/types.h>
+ #endif  /* OSVS */
  #else
  #include <types.h>
  #endif
  #endif
  
+ #ifdef OSVS
+ #include <time.h>
+ #endif /* OSVS */
+ 
  #ifdef MS_DOS
  #include <time.h>
  typedef long time_t;
***************
*** 615,621 ****
--- 633,643 ----
  	    if ( array[1] == 'x' )
  		++sptr;
  
+ #ifdef OSVS
+ 	    while ( isdigit( array[sptr] ) )
+ #else
  	    while ( isascii( array[sptr] ) && isdigit( array[sptr] ) )
+ #endif
  		/* don't increment inside loop control because if
  		 * isdigit() is a macro it will expand it to two
  		 * increments ...
Only in ..: new
diff -c ../nfa.c ./nfa.c
*** ../nfa.c	Thu Jun 28 00:44:40 1990
--- ./nfa.c	Mon Jul 16 13:57:36 1990
***************
*** 28,37 ****
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/nfa.c,v 2.6 90/06/27 23:48:29 vern Exp $ (LBL)";
  #endif
  
! #include "flexdef.h"
  
  
  /* declare functions that have forward references */
--- 28,37 ----
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: nfa.c,v 2.6 90/06/27 23:48:29 vern Exp $ (LBL)";
  #endif
  
! #include <flexdef.h>
  
  
  /* declare functions that have forward references */
***************
*** 110,116 ****
      {
      int sym, tsp1, tsp2, anum, ns;
  
!     fprintf( stderr, "\n\n********** beginning dump of nfa with start state %d\n",
  	     state1 );
  
      /* we probably should loop starting at firstst[state1] and going to
--- 110,116 ----
      {
      int sym, tsp1, tsp2, anum, ns;
  
!     fprintf(stderr,"\n\n********* beginning dump of nfa with start state %d\n",
  	     state1 );
  
      /* we probably should loop starting at firstst[state1] and going to
diff -c ../parse.y ./parse.y
*** ../parse.y	Thu Jun 28 00:44:40 1990
--- ./parse.y	Mon Jul 16 13:57:36 1990
***************
*** 32,45 ****
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/parse.y,v 2.7 90/06/27 23:48:31 vern Exp $ (LBL)";
  #endif
  
! #include "flexdef.h"
  
  int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
  int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule;
  Char clower();
  
  static int madeany = false;  /* whether we've made the '.' character class */
  int previous_continued_action;	/* whether the previous rule's action was '|' */
--- 32,47 ----
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: parse.y,v 2.7 90/06/27 23:48:31 vern Exp $ (LBL)";
  #endif
  
! #include <flexdef.h>
  
  int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
  int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule;
  Char clower();
+ void build_eof_action();
+ void yyerror();
  
  static int madeany = false;  /* whether we've made the '.' character class */
  int previous_continued_action;	/* whether the previous rule's action was '|' */
diff -c ../scan.l ./scan.l
*** ../scan.l	Thu Jun 28 00:44:41 1990
--- ./scan.l	Mon Jul 16 13:57:37 1990
***************
*** 30,42 ****
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/scan.l,v 2.9 90/06/27 23:48:34 vern Exp $ (LBL)";
  #endif
  
  #undef yywrap
  
! #include "flexdef.h"
! #include "parse.h"
  
  #define ACTION_ECHO fprintf( temp_action_file, "%s", yytext )
  #define MARK_END_OF_PROLOG fprintf( temp_action_file, "%%%% end of prolog\n" );
--- 30,42 ----
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: scan.l,v 2.9 90/06/27 23:48:34 vern Exp $ (LBL)";
  #endif
  
  #undef yywrap
  
! #include <flexdef.h>
! #include <parse.h>
  
  #define ACTION_ECHO fprintf( temp_action_file, "%s", yytext )
  #define MARK_END_OF_PROLOG fprintf( temp_action_file, "%%%% end of prolog\n" );
diff -c ../sym.c ./sym.c
*** ../sym.c	Thu Jun 28 00:44:41 1990
--- ./sym.c	Mon Jul 16 13:57:37 1990
***************
*** 28,37 ****
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/sym.c,v 2.4 90/06/27 23:48:36 vern Exp $ (LBL)";
  #endif
  
! #include "flexdef.h"
  
  
  /* declare functions that have forward references */
--- 28,37 ----
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: sym.c,v 2.4 90/06/27 23:48:36 vern Exp $ (LBL)";
  #endif
  
! #include <flexdef.h>
  
  
  /* declare functions that have forward references */
diff -c ../tblcmp.c ./tblcmp.c
*** ../tblcmp.c	Thu Jun 28 00:44:41 1990
--- ./tblcmp.c	Mon Jul 16 13:57:38 1990
***************
*** 28,37 ****
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/tblcmp.c,v 2.5 90/06/27 23:48:38 vern Exp $ (LBL)";
  #endif
  
! #include "flexdef.h"
  
  
  /* declarations for functions that have forward references */
--- 28,37 ----
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: tblcmp.c,v 2.5 90/06/27 23:48:38 vern Exp $ (LBL)";
  #endif
  
! #include <flexdef.h>
  
  
  /* declarations for functions that have forward references */
diff -c ../yylex.c ./yylex.c
*** ../yylex.c	Thu Jun 28 00:44:41 1990
--- ./yylex.c	Mon Jul 16 13:57:38 1990
***************
*** 28,39 ****
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/yylex.c,v 2.5 90/06/27 23:48:40 vern Exp $ (LBL)";
  #endif
  
  #include <ctype.h>
! #include "flexdef.h"
! #include "parse.h"
  
  
  /* ANSI C does not guarantee that isascii() is defined */
--- 28,39 ----
  
  #ifndef lint
  static char rcsid[] =
!     "@(#) $Header: yylex.c,v 2.5 90/06/27 23:48:40 vern Exp $ (LBL)";
  #endif
  
  #include <ctype.h>
! #include <flexdef.h>
! #include <parse.h>
  
  
  /* ANSI C does not guarantee that isascii() is defined */
***************
*** 180,186 ****
--- 180,190 ----
  			break;
  
  		    default:
+ #ifdef OSVS
+ 			if ( ! isprint( yylval ) )
+ #else
  			if ( ! isascii( yylval ) || ! isprint( yylval ) )
+ #endif
  			    fprintf( stderr, "\\%.3o", yylval );
  			else
  			    (void) putc( yylval, stderr );

⌨️ 快捷键说明

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