diff -rNd -U 7 re2c-0.9.1-orig/Makefile re2c-0.9.1/Makefile --- re2c-0.9.1-orig/Makefile 2003-06-03 10:54:04.000000000 -0700 +++ re2c-0.9.1/Makefile 2003-06-03 10:56:13.000000000 -0700 @@ -1,19 +1,19 @@ # $Log: 0.9.1-patch,v $ # Revision 1.1 2006/01/30 13:22:24 blubb # no need to gzip smallish patches # (Portage version: 2.1_pre3-r1) # #Revision 1.1 1994/04/08 16:30:37 peter #Initial revision # -BIN = /usr/local/bin -MAN = /usr/local/man +BIN = /usr/bin +MAN = /usr/share/man -%.o : %.cc ; $(CC) -o $@ $(CFLAGS) -c $< +%.o : %.cc ; $(CXX) -o $@ $(CXXFLAGS) -c $< +%.o : %.c ; $(CC) -o $@ $(CFLAGS) -c $< %.cc : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ %.cc : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ - %.cc: %.re re2c -s $< >$@ SOURCES = code.cc dfa.cc main.cc parser.y actions.cc scanner.re substr.cc\ translate.cc OBJS = code.o dfa.o main.o parser.o actions.o scanner.o substr.o\ translate.o diff -rNd -U 7 re2c-0.9.1-orig/scanner.cc re2c-0.9.1/scanner.cc --- re2c-0.9.1-orig/scanner.cc 2003-06-03 10:54:04.000000000 -0700 +++ re2c-0.9.1/scanner.cc 2003-06-03 10:54:21.000000000 -0700 @@ -8,42 +8,42 @@ #include "parser.h" #include "y.tab.h" extern YYSTYPE yylval; #define BSIZE 8192 -#define YYCTYPE uchar +#define YYCTYPE char #define YYCURSOR cursor #define YYLIMIT lim #define YYMARKER ptr #define YYFILL(n) {cursor = fill(cursor);} #define RETURN(i) {cur = cursor; return i;} Scanner::Scanner(int i) : in(i), bot(NULL), tok(NULL), ptr(NULL), cur(NULL), pos(NULL), lim(NULL), top(NULL), eof(NULL), tchar(0), tline(0), cline(1) { ; } -uchar *Scanner::fill(uchar *cursor){ +char *Scanner::fill(char *cursor){ if(!eof){ uint cnt = tok - bot; if(cnt){ memcpy(bot, tok, lim - tok); tok = bot; ptr -= cnt; cursor -= cnt; pos -= cnt; lim -= cnt; } if((top - lim) < BSIZE){ - uchar *buf = new uchar[(lim - bot) + BSIZE]; + char *buf = new char[(lim - bot) + BSIZE]; memcpy(buf, tok, lim - tok); tok = buf; ptr = &buf[ptr - bot]; cursor = &buf[cursor - bot]; pos = &buf[pos - bot]; lim = &buf[lim - bot]; top = &lim[BSIZE]; @@ -58,15 +58,15 @@ return cursor; } #line 68 int Scanner::echo(ostream &out){ - uchar *cursor = cur; + char *cursor = cur; tok = cursor; echo: { YYCTYPE yych; unsigned int yyaccept; goto yy0; yy1: ++YYCURSOR; @@ -113,15 +113,15 @@ } #line 83 } int Scanner::scan(){ - uchar *cursor = cur; + char *cursor = cur; uint depth; scan: tchar = cursor - pos; tline = cline; tok = cursor; { diff -rNd -U 7 re2c-0.9.1-orig/scanner.h re2c-0.9.1/scanner.h --- re2c-0.9.1-orig/scanner.h 2003-06-03 10:54:04.000000000 -0700 +++ re2c-0.9.1/scanner.h 2003-06-03 10:54:22.000000000 -0700 @@ -2,18 +2,18 @@ #define _scanner_h #include "token.h" class Scanner { private: int in; - uchar *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof; + char *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof; uint tchar, tline, cline; private: - uchar *fill(uchar*); + char *fill(char*); public: Scanner(int); int echo(ostream&); int scan(); void fatal(char*); SubStr token(); uint line(); diff -rNd -U 7 re2c-0.9.1-orig/scanner.re re2c-0.9.1/scanner.re --- re2c-0.9.1-orig/scanner.re 2003-06-03 10:54:04.000000000 -0700 +++ re2c-0.9.1/scanner.re 2003-06-03 10:54:23.000000000 -0700 @@ -6,42 +6,42 @@ #include "parser.h" #include "y.tab.h" extern YYSTYPE yylval; #define BSIZE 8192 -#define YYCTYPE uchar +#define YYCTYPE char #define YYCURSOR cursor #define YYLIMIT lim #define YYMARKER ptr #define YYFILL(n) {cursor = fill(cursor);} #define RETURN(i) {cur = cursor; return i;} Scanner::Scanner(int i) : in(i), bot(NULL), tok(NULL), ptr(NULL), cur(NULL), pos(NULL), lim(NULL), top(NULL), eof(NULL), tchar(0), tline(0), cline(1) { ; } -uchar *Scanner::fill(uchar *cursor){ +char *Scanner::fill(char *cursor){ if(!eof){ uint cnt = tok - bot; if(cnt){ memcpy(bot, tok, lim - tok); tok = bot; ptr -= cnt; cursor -= cnt; pos -= cnt; lim -= cnt; } if((top - lim) < BSIZE){ - uchar *buf = new uchar[(lim - bot) + BSIZE]; + char *buf = new char[(lim - bot) + BSIZE]; memcpy(buf, tok, lim - tok); tok = buf; ptr = &buf[ptr - bot]; cursor = &buf[cursor - bot]; pos = &buf[pos - bot]; lim = &buf[lim - bot]; top = &lim[BSIZE]; @@ -64,15 +64,15 @@ dstring = "\"" ((esc \ ["] ) | "\\" dot)* "\""; sstring = "'" ((esc \ ['] ) | "\\" dot)* "'" ; letter = [a-zA-Z]; digit = [0-9]; */ int Scanner::echo(ostream &out){ - uchar *cursor = cur; + char *cursor = cur; tok = cursor; echo: /*!re2c "/*!re2c" { out.write(tok, &cursor[-7] - tok); tok = cursor; RETURN(1); } "\n" { if(cursor == eof) RETURN(0); @@ -81,15 +81,15 @@ goto echo; } any { goto echo; } */ } int Scanner::scan(){ - uchar *cursor = cur; + char *cursor = cur; uint depth; scan: tchar = cursor - pos; tline = cline; tok = cursor; /*!re2c