分享

Unicode Patch for Flex-2.5.4

 daomucun 2009-04-29
# This is a patch against the current flex-2.5.4a.tar.gz distribution
# to add unicode support. The only difference from the patch on the net
# is the Makefile, removing the broken bootstrapping
# Extract the flex distribution then
# cd flex-2.5.4
# patch -p1 < ../flex-unicode-patch.patch

diff -aur flex-2.5.4/FlexLexer.h flex-2.5.4uni/FlexLexer.h
--- flex-2.5.4/FlexLexer.h Sun Jul 27 03:41:38 1997
+++ flex-2.5.4uni/FlexLexer.h Tue Sep 16 08:42:07 1997
@@ -9,17 +9,16 @@
// This code is derived from software contributed to Berkeley by
// Kent Williams and Tom Epperly.
//
-// Redistribution and use in source and binary forms with or without
-// modification are permitted provided that: (1) source distributions retain
-// this entire copyright notice and comment, and (2) distributions including
-// binaries display the following acknowledgement: ``This product includes
-// software developed by the University of California, Berkeley and its
-// contributors'' in the documentation or other materials provided with the
-// distribution and in all advertising materials mentioning features or use
-// of this software. Neither the name of the University nor the names of
-// its contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-
+// Redistribution and use in source and binary forms are permitted provided
+// that: (1) source distributions retain this entire copyright notice and
+// comment, and (2) distributions including binaries display the following
+// acknowledgement: ``This product includes software developed by the
+// University of California, Berkeley and its contributors'' in the
+// documentation or other materials provided with the distribution and in
+// all advertising materials mentioning features or use of this software.
+// Neither the name of the University nor the names of its contributors may
+// be used to endorse or promote products derived from this software without
+// specific prior written permission.
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -40,6 +39,16 @@
// #define yyFlexLexer zzFlexLexer
// #include <FlexLexer.h>
// ...
+//
+// Since this header is generic for all sizes of flex scanners, you must
+// define the type YY_CHAR before including it:
+//
+// typedef xxx YY_CHAR;
+// #include <FlexLexer.h>
+// ...
+//
+// where xxx = char for 7-bit scanners, unsigned char for 8-bit, and
+// wchar_t for 16-bit.

#ifndef __FLEX_LEXER_H
// Never included before - need to define base class.
@@ -55,7 +64,7 @@
public:
virtual ~FlexLexer() { }

- const char* YYText() { return yytext; }
+ const YY_CHAR* YYText() { return yytext; }
int YYLeng() { return yyleng; }

virtual void
@@ -85,7 +94,7 @@
void set_debug( int flag ) { yy_flex_debug = flag; }

protected:
- char* yytext;
+ YY_CHAR* yytext;
int yyleng;
int yylineno; // only maintained if you use %option yylineno
int yy_flex_debug; // only has effect with -d or "%option debug"
@@ -117,11 +126,11 @@
virtual void switch_streams( istream* new_in, ostream* new_out );

protected:
- virtual int LexerInput( char* buf, int max_size );
- virtual void LexerOutput( const char* buf, int size );
+ virtual int LexerInput( YY_CHAR* buf, int max_size );
+ virtual void LexerOutput( const YY_CHAR* buf, int size );
virtual void LexerError( const char* msg );

- void yyunput( int c, char* buf_ptr );
+ void yyunput( int c, YY_CHAR* buf_ptr );
int yyinput();

void yy_load_buffer_state();
@@ -146,13 +155,13 @@
struct yy_buffer_state* yy_current_buffer;

// yy_hold_char holds the character lost when yytext is formed.
- char yy_hold_char;
+ YY_CHAR yy_hold_char;

// Number of characters read into yy_ch_buf.
int yy_n_chars;

// Points to current character in buffer.
- char* yy_c_buf_p;
+ YY_CHAR* yy_c_buf_p;

int yy_init; // whether we need to initialize
int yy_start; // start state number
@@ -165,12 +174,12 @@
// on use of certain flex features (like REJECT or yymore()).

yy_state_type yy_last_accepting_state;
- char* yy_last_accepting_cpos;
+ YY_CHAR* yy_last_accepting_cpos;

yy_state_type* yy_state_buf;
yy_state_type* yy_state_ptr;

- char* yy_full_match;
+ YY_CHAR* yy_full_match;
int* yy_full_state;
int yy_full_lp;

diff -aur flex-2.5.4/Makefile.in flex-2.5.4uni/Makefile.in
--- flex-2.5.4/Makefile.in Wed Sep 11 00:59:11 1996
+++ flex-2.5.4uni/Makefile.in Tue Sep 18 09:32:47 2001
@@ -85,7 +85,7 @@
DIST_NAME = flex

# which "flex" to use to generate scan.c from scan.l
-FLEX_EXEC = ./$(FLEX)
+FLEX_EXEC = flex
FLEX_FLAGS = -t $(PERF_REPORT)
COMPRESSION =
PERF_REPORT = -p
@@ -93,7 +93,7 @@

all: $(FLEX)

-$(FLEX): .bootstrap $(OBJECTS) $(FLEXLIB)
+$(FLEX): $(OBJECTS) $(FLEXLIB)
$(CC) $(CFLAGS) -o $(FLEX) $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)

.bootstrap: initscan.c
diff -aur flex-2.5.4/ccl.c flex-2.5.4uni/ccl.c
--- flex-2.5.4/ccl.c Sun Jul 27 03:32:17 1997
+++ flex-2.5.4uni/ccl.c Tue Sep 16 08:42:07 1997
@@ -11,16 +11,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -57,7 +57,7 @@

++num_reallocs;

- ccltbl = reallocate_Character_array( ccltbl,
+ ccltbl = reallocate_wchar_array( ccltbl,
current_max_ccl_tbl_size );
}

Only in flex-2.5.4uni: changes
diff -aur flex-2.5.4/ecs.c flex-2.5.4uni/ecs.c
--- flex-2.5.4/ecs.c Sun Jul 27 03:32:18 1997
+++ flex-2.5.4uni/ecs.c Tue Sep 16 08:42:07 1997
@@ -11,16 +11,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -113,7 +113,7 @@
*/

void mkeccl( ccls, lenccl, fwd, bck, llsiz, NUL_mapping )
-Char ccls[];
+wchar_t ccls[];
int lenccl, fwd[], bck[], llsiz, NUL_mapping;
{
int cclp, oldec, newec;
diff -aur flex-2.5.4/flex.1 flex-2.5.4uni/flex.1
--- flex-2.5.4/flex.1 Mon Apr 24 21:26:20 1995
+++ flex-2.5.4uni/flex.1 Fri Apr 30 23:07:29 1999
@@ -3,7 +3,7 @@
flex \- fast lexical analyzer generator
.SH SYNOPSIS
.B flex
-.B [\-bcdfhilnpstvwBFILTV78+? \-C[aefFmr] \-ooutput \-Pprefix \-Sskeleton]
+.B [\-bcdfhilnpstvwBFILTUV78+? \-C[aefFmr] \-ooutput \-Pprefix \-Sskeleton]
.B [\-\-help \-\-version]
.I [filename ...]
.SH OVERVIEW
@@ -2411,6 +2411,39 @@
above for flex's default behavior and the tradeoffs between 7-bit
and 8-bit scanners.
.TP
+.B \-U
+instructs
+.I flex
+to generate a 16-bit scanner, i.e., one which can recognize Unicode
+characters. The tables of a scanner generated with
+.B \-U
+are always substantially larger than those of a 7- or 8-bit scanner, but there
+are three significant benefits if you need to scan Unicode. First, a 16-bit
+Unicode scanner is much faster than an equivalent 8-bit because it does not
+have to match NULs. Second, the generated scanner is portable - 8-bit Unicode
+scanners are non-portable because their patterns reflect the endianness of the
+platform on which they were written. Third, 16-bit patterns use the standard
+syntax of regular expressions with one small addition: escape sequences can
+specify 16-bit characters. For example, the patterns \177377 and \xFEFF both
+match the Unicode byte-order mark. Note the following related issues:
+.IP
+If your operating system distinguishes between text and binary file I/O,
+.I yyin
+and
+.I yyout
+should be opened in binary mode.
+.IP
+C++ support of Unicode varies. This currently limits 16-bit C++
+scanners to file I/O.
+.IP
+The
+.B \-C, -Cf,
+and
+.B \-CF
+table compression options are not available with
+.B \-U
+in order to keep table sizes within reason.
+.TP
.B \-+
specifies that you want flex to generate a C++
scanner class. See the section on Generating C++ Scanners below for
@@ -2426,7 +2459,8 @@
the tables are better aligned for memory access and computation. On some
RISC architectures, fetching and manipulating longwords is more efficient
than with smaller-sized units such as shortwords. This option can
-double the size of the tables used by your scanner.
+double the size of the tables used by a 7- or 8-bit scanner, and can
+quadruple those of a 16-bit scanner.
.IP
.B \-Ce
directs
@@ -2451,7 +2485,8 @@
.I flex
should not compress the
tables by taking advantages of similar transition functions for
-different states.
+different states. This option cannot be used with
+.B \-U.
.IP
.B \-CF
specifies that the alternate fast scanner representation (described
@@ -2459,7 +2494,9 @@
.B \-F
flag)
should be used. This option cannot be used with
-.B \-+.
+.B \-+
+or
+.B \-U.
.IP
.B \-Cm
directs
@@ -2502,6 +2539,8 @@
.B \-C
specifies that the scanner tables should be compressed but neither
equivalence classes nor meta-equivalence classes should be used.
+This option cannot be used with
+.B \-U.
.IP
The options
.B \-Cf
@@ -3700,7 +3739,7 @@
ignores them.
.IP -
The name
-.bd
+.B
FLEX_SCANNER
is #define'd so scanners may be written for use with either
.I flex
diff -aur flex-2.5.4/flex.skl flex-2.5.4uni/flex.skl
--- flex-2.5.4/flex.skl Wed Sep 11 00:58:54 1996
+++ flex-2.5.4uni/flex.skl Tue Sep 16 08:42:08 1997
@@ -67,16 +67,11 @@
#define YY_PROTO(proto) ()
#endif

+%% YY_CHAR and YY_SC_TO_UI() go here
+
/* Returned upon end-of-file. */
#define YY_NULL 0

-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
@@ -156,8 +151,8 @@
istream* yy_input_file;
%*

- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
+ YY_CHAR *yy_ch_buf; /* input buffer */
+ YY_CHAR *yy_buf_pos; /* current position in input buffer */

/* Size of input buffer in bytes, not including room for EOB
* characters.
@@ -222,7 +217,7 @@

%- Standard (non-C++) definition
/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
+static YY_CHAR yy_hold_char;

static int yy_n_chars; /* number of characters read into yy_ch_buf */

@@ -230,7 +225,7 @@
int yyleng;

/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
+static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */

@@ -249,9 +244,13 @@
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )

-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( YY_CHAR *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst YY_CHAR *yy_str ));
+
+/* This is the old yy_scan_bytes function - renamed to avoid
+ * confusion since a character may now be 1 or 2 bytes.
+ */
+YY_BUFFER_STATE yy_scan_chars YY_PROTO(( yyconst YY_CHAR *chars, int len ));
%*

static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
@@ -292,7 +291,7 @@
yytext_ptr = yy_bp; \
%% code to fiddle yytext and yyleng for yymore() goes here
yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
+ *yy_cp = (YY_CHAR) '\0'; \
%% code to copy yytext_ptr to yytext[] goes here, if %array
yy_c_buf_p = yy_cp;

@@ -312,16 +311,16 @@

%-
#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+static void yyunput YY_PROTO(( int c, YY_CHAR *buf_ptr ));
#endif
%*

#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy YY_PROTO(( YY_CHAR *, yyconst YY_CHAR *, int ));
#endif

#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen YY_PROTO(( yyconst YY_CHAR * ));
#endif

#ifndef YY_NO_INPUT
@@ -381,7 +380,7 @@
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO (void) fwrite( yytext, sizeof( YY_CHAR ), yyleng, yyout )
%+ C++ definition
#define ECHO LexerOutput( yytext, yyleng )
%*
@@ -394,7 +393,7 @@
#define YY_INPUT(buf,result,max_size) \
%% fread()/read() definition of YY_INPUT goes here unless we're doing C++
%+ C++ definition
- if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
+ if ( (result = LexerInput( buf, max_size )) < 0 ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
%*
#endif
@@ -449,7 +448,7 @@
YY_DECL
{
register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
+ register YY_CHAR *yy_cp, *yy_bp;
register int yy_act;

%% user's declarations go here
@@ -694,16 +693,16 @@
}

#ifdef YY_INTERACTIVE
-int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
+int yyFlexLexer::LexerInput( YY_CHAR* buf, int /* max_size */ )
#else
-int yyFlexLexer::LexerInput( char* buf, int max_size )
+int yyFlexLexer::LexerInput( YY_CHAR* buf, int max_size )
#endif
{
if ( yyin->eof() || yyin->fail() )
return 0;

#ifdef YY_INTERACTIVE
- yyin->get( buf[0] );
+ (void) yyin->read((unsigned char *) buf, sizeof( YY_CHAR ) );

if ( yyin->eof() )
return 0;
@@ -714,18 +713,18 @@
return 1;

#else
- (void) yyin->read( buf, max_size );
+ (void) yyin->read((unsigned char *) buf, max_size * sizeof( YY_CHAR ) );

if ( yyin->bad() )
return -1;
else
- return yyin->gcount();
+ return ( yyin->gcount() / sizeof( YY_CHAR ) );
#endif
}

-void yyFlexLexer::LexerOutput( const char* buf, int size )
+void yyFlexLexer::LexerOutput( const YY_CHAR* buf, int size )
{
- (void) yyout->write( buf, size );
+ (void) yyout->write((unsigned char *) buf, size * sizeof( YY_CHAR ) );
}
%*

@@ -743,8 +742,8 @@
int yyFlexLexer::yy_get_next_buffer()
%*
{
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr;
+ register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
+ register YY_CHAR *source = yytext_ptr;
register int number_to_move, i;
int ret_val;

@@ -812,10 +811,11 @@
else
b->yy_buf_size *= 2;

- b->yy_ch_buf = (char *)
+ b->yy_ch_buf = (YY_CHAR *)
/* Include room in for 2 EOB chars. */
yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
+ ( b->yy_buf_size + 2 ) *
+ sizeof( YY_CHAR ) );
}
else
/* Can't grow it, we don't own it. */
@@ -880,7 +880,7 @@
%*
{
register yy_state_type yy_current_state;
- register char *yy_cp;
+ register YY_CHAR *yy_cp;

%% code to get the start state into yy_current_state goes here

@@ -920,17 +920,17 @@
%-
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
+static void yyunput( int c, register YY_CHAR *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
-register char *yy_bp;
+register YY_CHAR *yy_bp;
#endif
%+
-void yyFlexLexer::yyunput( int c, register char* yy_bp )
+void yyFlexLexer::yyunput( int c, register YY_CHAR* yy_bp )
%*
{
- register char *yy_cp = yy_c_buf_p;
+ register YY_CHAR *yy_cp = yy_c_buf_p;

/* undo effects of setting up yytext */
*yy_cp = yy_hold_char;
@@ -939,9 +939,9 @@
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
+ register YY_CHAR *dest = &yy_current_buffer->yy_ch_buf[
yy_current_buffer->yy_buf_size + 2];
- register char *source =
+ register YY_CHAR *source =
&yy_current_buffer->yy_ch_buf[number_to_move];

while ( source > yy_current_buffer->yy_ch_buf )
@@ -956,7 +956,7 @@
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}

- *--yy_cp = (char) c;
+ *--yy_cp = (YY_CHAR) c;

%% update yylineno here

@@ -991,7 +991,7 @@
*/
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* This was really a NUL. */
- *yy_c_buf_p = '\0';
+ *yy_c_buf_p = (YY_CHAR) '\0';

else
{ /* need more input */
@@ -1037,8 +1037,8 @@
}
}

- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
+ c = YY_SC_TO_UI(*yy_c_buf_p);
+ *yy_c_buf_p = (YY_CHAR) '\0'; /* preserve yytext */
yy_hold_char = *++yy_c_buf_p;

%% update BOL and yylineno
@@ -1140,7 +1140,8 @@
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ b->yy_ch_buf = (YY_CHAR *) yy_flex_alloc(
+ ( b->yy_buf_size + 2 ) * sizeof( YY_CHAR ) );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

@@ -1256,10 +1257,10 @@
#ifndef YY_NO_SCAN_BUFFER
%-
#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+YY_BUFFER_STATE yy_scan_buffer( YY_CHAR *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
+YY_CHAR *base;
yy_size_t size;
#endif
{
@@ -1296,17 +1297,17 @@
#ifndef YY_NO_SCAN_STRING
%-
#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+YY_BUFFER_STATE yy_scan_string( yyconst YY_CHAR *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
+yyconst YY_CHAR *yy_str;
#endif
{
int len;
for ( len = 0; yy_str[len]; ++len )
;

- return yy_scan_bytes( yy_str, len );
+ return yy_scan_chars( yy_str, len );
}
%*
#endif
@@ -1315,32 +1316,32 @@
#ifndef YY_NO_SCAN_BYTES
%-
#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+YY_BUFFER_STATE yy_scan_chars( yyconst YY_CHAR *chars, int len )
#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
+YY_BUFFER_STATE yy_scan_chars( chars, len )
+yyconst YY_CHAR *chars;
int len;
#endif
{
YY_BUFFER_STATE b;
- char *buf;
+ YY_CHAR *buf;
yy_size_t n;
int i;

/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
- buf = (char *) yy_flex_alloc( n );
+ buf = (YY_CHAR *) yy_flex_alloc( n * sizeof( YY_CHAR ) );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_chars()" );

for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
+ buf[i] = chars[i];

buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;

b = yy_scan_buffer( buf, n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_chars()" );

/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -1426,7 +1427,7 @@
static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
-char msg[];
+YY_CHAR msg[];
#endif
{
(void) fprintf( stderr, "%s\n", msg );
@@ -1453,7 +1454,7 @@
yytext[yyleng] = yy_hold_char; \
yy_c_buf_p = yytext + n; \
yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
+ *yy_c_buf_p = (YY_CHAR) '\0'; \
yyleng = n; \
} \
while ( 0 )
@@ -1463,11 +1464,11 @@

#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+static void yy_flex_strncpy( YY_CHAR *s1, yyconst YY_CHAR *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
+YY_CHAR *s1;
+yyconst YY_CHAR *s2;
int n;
#endif
{
@@ -1479,10 +1480,10 @@

#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
+static int yy_flex_strlen( yyconst YY_CHAR *s )
#else
static int yy_flex_strlen( s )
-yyconst char *s;
+yyconst YY_CHAR *s;
#endif
{
register int n;
diff -aur flex-2.5.4/flexdef.h flex-2.5.4uni/flexdef.h
--- flex-2.5.4/flexdef.h Sun Jul 27 03:42:50 1997
+++ flex-2.5.4uni/flexdef.h Tue Sep 16 08:42:08 1997
@@ -11,16 +11,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -70,8 +70,8 @@
*/
#define _(String) (String)

-/* Always be prepared to generate an 8-bit scanner. */
-#define CSIZE 256
+/* Always be prepared to generate an 16-bit scanner. */
+#define CSIZE 65536
#define Char unsigned char

/* Size of input alphabet - should be size of ASCII set. */
@@ -98,6 +98,14 @@
#define SHORT_FILE_NAMES
#endif

+#ifdef _WIN32
+#if __STDC__
+#define unlink _unlink
+#define isatty _isatty
+#define fileno _fileno
+#endif
+#endif
+

/* Maximum line length we'll have to deal with. */
#define MAXLINE 2048
@@ -624,7 +632,7 @@

extern int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
extern int current_maxccls, current_max_ccl_tbl_size;
-extern Char *ccltbl;
+extern wchar_t *ccltbl;


/* Variables for miscellaneous information:
@@ -697,6 +705,12 @@
#define reallocate_Character_array(array,size) \
(Char *) reallocate_array( (void *) array, size, sizeof( Char ) )

+#define allocate_wchar_array(size) \
+ (wchar_t *) allocate_array( size, sizeof( wchar_t ) )
+
+#define reallocate_wchar_array(array,size) \
+ (wchar_t *) reallocate_array( (void *) array, size, sizeof( wchar_t ) )
+

/* Used to communicate between scanner and parser. The type should really
* be YYSTYPE, but we can't easily get our hands on it.
@@ -746,7 +760,7 @@
extern int cre8ecs PROTO((int[], int[], int));

/* Update equivalence classes based on character class transitions. */
-extern void mkeccl PROTO((Char[], int, int[], int[], int, int));
+extern void mkeccl PROTO((wchar_t[], int, int[], int[], int, int));

/* Create equivalence class for single character. */
extern void mkechar PROTO((int, int[], int[]));
@@ -834,7 +848,7 @@
extern Char *copy_unsigned_string PROTO((register Char *));

/* Shell sort a character array. */
-extern void cshell PROTO((Char [], int, int));
+extern void cshell PROTO((wchar_t[], int, int));

/* Finish up a block of data declarations. */
extern void dataend PROTO((void));
@@ -877,7 +891,7 @@
extern int myctoi PROTO((char []));

/* Return character corresponding to escape sequence. */
-extern Char myesc PROTO((Char[]));
+extern int myesc PROTO((Char[]));

/* Convert an octal digit string to an integer value. */
extern int otoi PROTO((Char [] ));
diff -aur flex-2.5.4/gen.c flex-2.5.4uni/gen.c
--- flex-2.5.4/gen.c Sun Jul 27 03:32:18 1997
+++ flex-2.5.4uni/gen.c Tue Sep 16 08:42:08 1997
@@ -11,16 +11,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -55,6 +55,10 @@
static char C_long_decl[] = "static yyconst long int %s[%d] =\n { 0,\n";
static char C_state_decl[] =
"static yyconst yy_state_type %s[%d] =\n { 0,\n";
+static char C_uchar_decl[] =
+ "static yyconst unsigned char %s[%d] =\n { 0,\n";
+static char C_ushort_decl[] =
+ "static yyconst unsigned short %s[%d] =\n { 0,\n";


/* Indent to the current level. */
@@ -230,7 +234,14 @@
register int i, j;
int numrows;

- out_str_dec( C_int_decl, "yy_ec", csize );
+ if ( csize == 65536 && long_align )
+ out_str_dec( C_long_decl, "yy_ec", csize );
+ else if ( csize == 65536 && numecs < 256 )
+ out_str_dec( C_uchar_decl, "yy_ec", csize );
+ else if ( csize == 65536 && numecs < 65536 )
+ out_str_dec( C_ushort_decl, "yy_ec", csize );
+ else
+ out_str_dec( C_int_decl, "yy_ec", csize );

for ( i = 1; i < csize; ++i )
{
@@ -672,7 +683,7 @@
/* We're going to need yy_cp lying around for the call
* below to gen_backing_up().
*/
- indent_puts( "register char *yy_cp = yy_c_buf_p;" );
+ indent_puts( "register YY_CHAR *yy_cp = yy_c_buf_p;" );

outc( '\n' );

@@ -1165,7 +1176,7 @@
indent_puts(
"static yy_state_type yy_last_accepting_state;" );
indent_puts(
- "static char *yy_last_accepting_cpos;\n" );
+ "static YY_CHAR *yy_last_accepting_cpos;\n" );
}
}

@@ -1206,7 +1217,7 @@
{
outn(
"static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;" );
- outn( "static char *yy_full_match;" );
+ outn( "static YY_CHAR *yy_full_match;" );
outn( "static int yy_lp;" );
}

@@ -1311,12 +1322,12 @@
outn( "#ifndef YYLMAX" );
outn( "#define YYLMAX 8192" );
outn( "#endif\n" );
- outn( "char yytext[YYLMAX];" );
- outn( "char *yytext_ptr;" );
+ outn( "YY_CHAR yytext[YYLMAX];" );
+ outn( "YY_CHAR *yytext_ptr;" );
}

else
- outn( "char *yytext;" );
+ outn( "YY_CHAR *yytext;" );
}

out( &action_array[defs1_offset] );
@@ -1330,7 +1341,7 @@
if ( use_read )
{
outn(
-"\tif ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \\" );
+"\tif ( (result = read( fileno(yyin), (char *) buf, max_size * sizeof( YY_CHAR ) ) ) < 0 ) \\" );
outn(
"\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" );
}
@@ -1342,18 +1353,32 @@
outn( "\t\t{ \\" );
outn( "\t\tint c = '*', n; \\" );
outn( "\t\tfor ( n = 0; n < max_size && \\" );
- outn( "\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\" );
- outn( "\t\t\tbuf[n] = (char) c; \\" );
+
+ if ( csize == 65536 )
+ outn(
+ "\t\t\t (c = getwc( yyin )) != WEOF && c != '\\n'; ++n ) \\" );
+ else
+ outn(
+ "\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\" );
+
+ outn( "\t\t\tbuf[n] = (YY_CHAR) c; \\" );
outn( "\t\tif ( c == '\\n' ) \\" );
- outn( "\t\t\tbuf[n++] = (char) c; \\" );
- outn( "\t\tif ( c == EOF && ferror( yyin ) ) \\" );
+ outn( "\t\t\tbuf[n++] = (YY_CHAR) c; \\" );
+
+ if ( csize == 65536 )
+ outn(
+ "\t\tif ( c == WEOF && ferror( yyin ) ) \\" );
+ else
+ outn(
+ "\t\tif ( c == EOF && ferror( yyin ) ) \\" );
+
outn(
"\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\" );
outn( "\t\tresult = n; \\" );
outn( "\t\t} \\" );
outn(
- "\telse if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \\" );
- outn( "\t\t && ferror( yyin ) ) \\" );
+"\telse if ( ((result = fread( buf, sizeof( YY_CHAR ), max_size, yyin )) \\" );
+ outn( "\t\t == 0) && ferror( yyin ) ) \\" );
outn(
"\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" );
}
diff -aur flex-2.5.4/main.c flex-2.5.4uni/main.c
--- flex-2.5.4/main.c Sun Jul 27 03:32:19 1997
+++ flex-2.5.4uni/main.c Wed Apr 28 02:04:11 1999
@@ -11,16 +11,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -93,7 +93,7 @@
int numsnpairs, jambase, jamstate;
int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
int current_maxccls, current_max_ccl_tbl_size;
-Char *ccltbl;
+wchar_t *ccltbl;
char nmstr[MAXLINE];
int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
@@ -203,7 +203,7 @@
if ( (fulltbl || fullspd) && ! useecs )
csize = DEFAULT_CSIZE;
else
- csize = CSIZE;
+ csize = 256;
}

if ( interactive == unspecified )
@@ -244,6 +244,26 @@
yytext_is_array = false;
}

+ if ( csize == 65536 )
+ {
+ if ( fulltbl )
+ {
+ if ( use_read )
+ flexerror( _( "Can't use -f with -U" ) );
+ else
+ flexerror( _( "Can't use -Cf with -U" ) );
+ }
+ else if ( fullspd )
+ {
+ if ( use_read )
+ flexerror( _( "Can't use -F with -U" ) );
+ else
+ flexerror( _( "Can't use -CF with -U" ) );
+ }
+ else if ( ! useecs && ! usemecs )
+ flexerror( _( "Can't use -C with -U" ) );
+ }
+
if ( useecs )
{ /* Set up doubly-linked equivalence classes. */

@@ -339,6 +359,36 @@
line_directive_out( stdout, 0 );

skelout();
+
+ outn( "/* Define the YY_CHAR type. */" );
+
+ switch (csize) {
+ case 65536:
+ outn( "#include <wchar.h>" );
+ outn( "typedef unsigned short YY_CHAR;" );
+ break;
+ case 256:
+ outn( "typedef unsigned char YY_CHAR;" );
+ break;
+ default:
+ outn( "typedef char YY_CHAR;" );
+ break;
+ }
+
+ outn( "\n/* Promotes a YY_CHAR to an unsigned integer for use as an array index. */");
+
+ switch (csize) {
+ case 65536:
+ case 256:
+ outn( "#define YY_SC_TO_UI(c) ((unsigned int) (unsigned short) c)" );
+ break;
+ default:
+ outn(
+ "#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)" );
+ break;
+ }
+
+ skelout();
}


@@ -449,8 +499,10 @@

if ( csize == 128 )
putc( '7', stderr );
- else
+ else if ( csize == 256 )
putc( '8', stderr );
+ else
+ putc( 'U', stderr );

fprintf( stderr, " -C" );

@@ -788,6 +840,10 @@
trace = true;
break;

+ case 'U':
+ csize = 65536;
+ break;
+
case 'v':
printstats = true;
break;
@@ -806,7 +862,7 @@
break;

case '8':
- csize = CSIZE;
+ csize = 256;
break;

default:
@@ -955,11 +1011,6 @@
if ( ddebug )
outn( "\n#define FLEX_DEBUG" );

- if ( csize == 256 )
- outn( "typedef unsigned char YY_CHAR;" );
- else
- outn( "typedef char YY_CHAR;" );
-
if ( C_plus_plus )
{
outn( "#define yytext_ptr yytext" );
@@ -1025,11 +1076,11 @@
else
{
if ( yytext_is_array )
- outn( "extern char yytext[];\n" );
+ outn( "extern YY_CHAR yytext[];\n" );

else
{
- outn( "extern char *yytext;" );
+ outn( "extern YY_CHAR *yytext;" );
outn( "#define yytext_ptr yytext" );
}

@@ -1085,7 +1136,7 @@
cclng = allocate_integer_array( current_maxccls );

current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
- ccltbl = allocate_Character_array( current_max_ccl_tbl_size );
+ ccltbl = allocate_wchar_array( current_max_ccl_tbl_size );

current_max_dfa_size = INITIAL_MAX_DFA_SIZE;

@@ -1155,6 +1206,7 @@
fprintf( f, _( "\t-V report %s version\n" ), program_name );
fprintf( f, _( "\t-7 generate 7-bit scanner\n" ) );
fprintf( f, _( "\t-8 generate 8-bit scanner\n" ) );
+ fprintf( f, _( "\t-U generate 16-bit (Unicode) scanner\n" ) );
fprintf( f, _( "\t-+ generate C++ scanner class\n" ) );
fprintf( f, _( "\t-? produce this help message\n" ) );
fprintf( f,
diff -aur flex-2.5.4/misc.c flex-2.5.4uni/misc.c
--- flex-2.5.4/misc.c Sun Jul 27 03:32:19 1997
+++ flex-2.5.4uni/misc.c Tue Sep 16 08:42:08 1997
@@ -11,16 +11,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -170,9 +170,16 @@
readable_form( c ) );

if ( c >= csize )
- lerrsf(
- _( "scanner requires -8 flag to use the character %s" ),
- readable_form( c ) );
+ {
+ if ( c < 256 )
+ lerrsf(
+ _( "scanner requires -8 flag to use the character %s" ),
+ readable_form( c ) );
+ else
+ lerrsf(
+ _( "scanner requires -U flag to use the character %s" ),
+ readable_form( c ) );
+ }
}


@@ -255,11 +262,11 @@
*/

void cshell( v, n, special_case_0 )
-Char v[];
+wchar_t v[];
int n, special_case_0;
{
int gap, i, j, jg;
- Char k;
+ wchar_t k;

for ( gap = n / 2; gap > 0; gap = gap / 2 )
for ( i = gap; i < n; ++i )
@@ -525,10 +532,11 @@

/* myesc - return character corresponding to escape sequence */

-Char myesc( array )
+int myesc( array )
Char array[];
{
- Char c, esc_char;
+ Char c;
+ unsigned int esc_char;

switch ( array[1] )
{
diff -aur flex-2.5.4/scan.l flex-2.5.4uni/scan.l
--- flex-2.5.4/scan.l Sun Jul 27 03:44:13 1997
+++ flex-2.5.4uni/scan.l Tue Sep 16 08:42:08 1997
@@ -12,16 +12,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -83,7 +83,7 @@

SCNAME {NAME}

-ESCSEQ (\\([^\n]|[0-7]{1,3}|x[[:xdigit:]]{1,2}))
+ESCSEQ (\\([^\n]|[0-7]{1,6}|x[[:xdigit:]]{1,4}))

FIRST_CCL_CHAR ([^\\\n]|{ESCSEQ})
CCL_CHAR ([^\\\n\]]|{ESCSEQ})
@@ -98,7 +98,7 @@

int doing_codeblock = false;
int i;
- Char nmdef[MAXLINE], myesc();
+ Char nmdef[MAXLINE];


<INITIAL>{
@@ -217,6 +217,7 @@

7bit csize = option_sense ? 128 : 256;
8bit csize = option_sense ? 256 : 128;
+ 16bit csize = option_sense ? 65536 : 256;

align long_align = option_sense;
always-interactive {
@@ -434,7 +435,6 @@

"{"{NAME}"}" {
register Char *nmdefptr;
- Char *ndlookup();

strcpy( nmstr, yytext + 1 );
nmstr[yyleng - 2] = '\0'; /* chop trailing brace */
diff -aur flex-2.5.4/tblcmp.c flex-2.5.4uni/tblcmp.c
--- flex-2.5.4/tblcmp.c Sun Jul 27 03:32:20 1997
+++ flex-2.5.4uni/tblcmp.c Tue Sep 16 08:42:08 1997
@@ -11,16 +11,16 @@
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
- * Redistribution and use in source and binary forms with or without
- * modification are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement: ``This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software. Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * Neither the name of the University nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -712,7 +712,7 @@
int state[], statenum, comstate;
{
int i, numdiff, tmpbase, tmp[CSIZE + 1];
- Char transset[CSIZE + 1];
+ wchar_t transset[CSIZE + 1];
int tsptr;

++numtemps;

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多