Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 43449
Collapse All | Expand All

(-)re2c-0.9.1/Makefile (-5 / +6 lines)
Lines 3-15 Link Here
3
#Initial revision
3
#Initial revision
4
#
4
#
5
5
6
BIN = /usr/local/bin
6
BIN = /usr/bin
7
MAN = /usr/local/man
7
MAN = /usr/share/man
8
8
9
%.o : %.cc ; $(CC) -o $@ $(CFLAGS) -c $<
9
%.o : %.cc ; $(CXX) -o $@ $(CXXFLAGS) -c $<
10
%.o : %.c ; $(CC) -o $@ $(CFLAGS) -c $<
10
%.cc : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
11
%.cc : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
11
%.cc : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
12
%.cc : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
12
13
%.cc:	%.re
13
%.cc:	%.re
14
	re2c -s $< >$@
14
	re2c -s $< >$@
15
15
Lines 30-36 clean: Link Here
30
30
31
parser.cc:	parser.y
31
parser.cc:	parser.y
32
	yacc -d parser.y
32
	yacc -d parser.y
33
	mv -f y.tab.c parser.cc
33
	grep -v '^char \* getenv' y.tab.c >y.tab.c.new
34
	mv -f y.tab.c.new parser.cc
34
35
35
re2c:	$(OBJS)
36
re2c:	$(OBJS)
36
	$(CC) -o $@ $(OBJS) $(LDFLAGS) -lstdc++
37
	$(CC) -o $@ $(OBJS) $(LDFLAGS) -lstdc++
(-)re2c-0.9.1/actions.cc (-2 / +2 lines)
Lines 1-7 Link Here
1
#include <time.h>
1
#include <time.h>
2
#include <string.h>
2
#include <string.h>
3
#include <iostream.h>
3
#include <iostream>
4
#include <iomanip.h>
4
#include <iomanip>
5
5
6
#include "globals.h"
6
#include "globals.h"
7
#include "parser.h"
7
#include "parser.h"
(-)re2c-0.9.1/bootstrap/parser.cc (-2 / +2 lines)
Lines 10-17 static char yysccsid[] = "@(#)yaccpar 1. Link Here
10
#define YYPREFIX "yy"
10
#define YYPREFIX "yy"
11
#line 2 "parser.y"
11
#line 2 "parser.y"
12
12
13
#include <stdlib.h>
13
#include <time.h>
14
#include <time.h>
14
#include <iostream.h>
15
#include <iostream>
15
#include <string.h>
16
#include <string.h>
16
#include <malloc.h>
17
#include <malloc.h>
17
#include "globals.h"
18
#include "globals.h"
Lines 242-248 yyparse() Link Here
242
    register int yym, yyn, yystate;
243
    register int yym, yyn, yystate;
243
#if YYDEBUG
244
#if YYDEBUG
244
    register char *yys;
245
    register char *yys;
245
    extern char *getenv();
246
246
247
    if (yys = getenv("YYDEBUG"))
247
    if (yys = getenv("YYDEBUG"))
248
    {
248
    {
(-)re2c-0.9.1/bootstrap/scanner.cc (-1 / +1 lines)
Lines 2-8 Link Here
2
#line 1 "scanner.re"
2
#line 1 "scanner.re"
3
#include <stdlib.h>
3
#include <stdlib.h>
4
#include <string.h>
4
#include <string.h>
5
#include <iostream.h>
5
#include <iostream>
6
#include <unistd.h>
6
#include <unistd.h>
7
#include "scanner.h"
7
#include "scanner.h"
8
#include "parser.h"
8
#include "parser.h"
(-)re2c-0.9.1/code.cc (-2 / +3 lines)
Lines 1-9 Link Here
1
#include <stdlib.h>
1
#include <stdlib.h>
2
#include <string.h>
2
#include <string.h>
3
#include <ctype.h>
3
#include <ctype.h>
4
#include <iomanip.h>
4
#include <iomanip>
5
#include "substr.h"
5
6
#include "globals.h"
6
#include "globals.h"
7
#include "substr.h"
7
#include "dfa.h"
8
#include "dfa.h"
8
9
9
// there must be at least one span in list;  all spans must cover
10
// there must be at least one span in list;  all spans must cover
(-)re2c-0.9.1/dfa.cc (+1 lines)
Lines 1-6 Link Here
1
#include <stdlib.h>
1
#include <stdlib.h>
2
#include <ctype.h>
2
#include <ctype.h>
3
#include <string.h>
3
#include <string.h>
4
4
#include "globals.h"
5
#include "globals.h"
5
#include "substr.h"
6
#include "substr.h"
6
#include "dfa.h"
7
#include "dfa.h"
(-)re2c-0.9.1/dfa.h (-1 / +1 lines)
Lines 1-7 Link Here
1
#ifndef _dfa_h
1
#ifndef _dfa_h
2
#define _dfa_h
2
#define _dfa_h
3
3
4
#include <iostream.h>
4
#include <iostream>
5
#include "re.h"
5
#include "re.h"
6
6
7
extern void prtCh(ostream&, uchar);
7
extern void prtCh(ostream&, uchar);
(-)re2c-0.9.1/examples/rexx/rexx.l (+1 lines)
Lines 1-3 Link Here
1
#include "globals.h"
1
#include "scanio.h"
2
#include "scanio.h"
2
#include "scanner.h"
3
#include "scanner.h"
3
4
(-)re2c-0.9.1/globals.h (+11 lines)
Lines 12-15 extern uchar ebc2asc[256]; Link Here
12
12
13
extern uchar *xlat, *talx;
13
extern uchar *xlat, *talx;
14
14
15
/* Need to use a few pieces from the `std' namespace */
16
using namespace std;
17
18
#ifdef __cplusplus
19
# define BEGIN_C_DECLS() extern "C" {
20
# define END_C_DECLS() }
21
#else
22
# define BEGIN_C_DECLS()
23
# define END_C_DECLS()
24
#endif /* ! __cplusplus */
25
15
#endif
26
#endif
(-)re2c-0.9.1/ins.h (-1 / +1 lines)
Lines 1-7 Link Here
1
#ifndef _ins_h
1
#ifndef _ins_h
2
#define _ins_h
2
#define _ins_h
3
3
4
#include <iostream.h>
4
#include <iostream>
5
#include "basics.h"
5
#include "basics.h"
6
6
7
const uint nChars = 256;
7
const uint nChars = 256;
(-)re2c-0.9.1/main.cc (-1 / +1 lines)
Lines 1-7 Link Here
1
#include <fstream.h>
2
#include <stdlib.h>
1
#include <stdlib.h>
3
#include <fcntl.h>
2
#include <fcntl.h>
4
#include <unistd.h>
3
#include <unistd.h>
4
#include <fstream>
5
5
6
#include "globals.h"
6
#include "globals.h"
7
#include "parser.h"
7
#include "parser.h"
(-)re2c-0.9.1/parser.y (-1 / +9 lines)
Lines 1-15 Link Here
1
%{
1
%{
2
2
3
#include <stdlib.h>
3
#include <time.h>
4
#include <time.h>
4
#include <iostream.h>
5
#include <iostream>
5
#include <string.h>
6
#include <string.h>
6
#include <malloc.h>
7
#include <malloc.h>
8
7
#include "globals.h"
9
#include "globals.h"
8
#include "parser.h"
10
#include "parser.h"
11
#include "scanner.h"
12
13
BEGIN_C_DECLS()
14
9
int yyparse();
15
int yyparse();
10
int yylex();
16
int yylex();
11
void yyerror(char*);
17
void yyerror(char*);
12
18
19
END_C_DECLS()
20
13
static uint accept;
21
static uint accept;
14
static RegExp *spec;
22
static RegExp *spec;
15
static Scanner *in;
23
static Scanner *in;
(-)re2c-0.9.1/re.h (-1 / +1 lines)
Lines 1-7 Link Here
1
#ifndef _re_h
1
#ifndef _re_h
2
#define _re_h
2
#define _re_h
3
3
4
#include <iostream.h>
4
#include <iostream>
5
#include "token.h"
5
#include "token.h"
6
#include "ins.h"
6
#include "ins.h"
7
7
(-)re2c-0.9.1/scanner.h (-2 / +2 lines)
Lines 6-15 Link Here
6
class Scanner {
6
class Scanner {
7
  private:
7
  private:
8
    int			in;
8
    int			in;
9
    uchar		*bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
9
    char		*bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
10
    uint		tchar, tline, cline;
10
    uint		tchar, tline, cline;
11
  private:
11
  private:
12
    uchar *fill(uchar*);
12
    char *fill(char*);
13
  public:
13
  public:
14
    Scanner(int);
14
    Scanner(int);
15
    int echo(ostream&);
15
    int echo(ostream&);
(-)re2c-0.9.1/scanner.re (-6 / +6 lines)
Lines 1-6 Link Here
1
#include <stdlib.h>
1
#include <stdlib.h>
2
#include <string.h>
2
#include <string.h>
3
#include <iostream.h>
3
#include <iostream>
4
#include <unistd.h>
4
#include <unistd.h>
5
#include "scanner.h"
5
#include "scanner.h"
6
#include "parser.h"
6
#include "parser.h"
Lines 10-16 extern YYSTYPE yylval; Link Here
10
10
11
#define	BSIZE	8192
11
#define	BSIZE	8192
12
12
13
#define	YYCTYPE		uchar
13
#define	YYCTYPE		char
14
#define	YYCURSOR	cursor
14
#define	YYCURSOR	cursor
15
#define	YYLIMIT		lim
15
#define	YYLIMIT		lim
16
#define	YYMARKER	ptr
16
#define	YYMARKER	ptr
Lines 25-31 Scanner::Scanner(int i) : in(i), Link Here
25
    ;
25
    ;
26
}
26
}
27
27
28
uchar *Scanner::fill(uchar *cursor){
28
char *Scanner::fill(char *cursor){
29
    if(!eof){
29
    if(!eof){
30
	uint cnt = tok - bot;
30
	uint cnt = tok - bot;
31
	if(cnt){
31
	if(cnt){
Lines 37-43 uchar *Scanner::fill(uchar *cursor){ Link Here
37
	    lim -= cnt;
37
	    lim -= cnt;
38
	}
38
	}
39
	if((top - lim) < BSIZE){
39
	if((top - lim) < BSIZE){
40
	    uchar *buf = new uchar[(lim - bot) + BSIZE];
40
	    char *buf = new char[(lim - bot) + BSIZE];
41
	    memcpy(buf, tok, lim - tok);
41
	    memcpy(buf, tok, lim - tok);
42
	    tok = buf;
42
	    tok = buf;
43
	    ptr = &buf[ptr - bot];
43
	    ptr = &buf[ptr - bot];
Lines 68-74 digit = [0-9]; Link Here
68
*/
68
*/
69
69
70
int Scanner::echo(ostream &out){
70
int Scanner::echo(ostream &out){
71
    uchar *cursor = cur;
71
    char *cursor = cur;
72
    tok = cursor;
72
    tok = cursor;
73
echo:
73
echo:
74
/*!re2c
74
/*!re2c
Lines 85-91 echo: Link Here
85
85
86
86
87
int Scanner::scan(){
87
int Scanner::scan(){
88
    uchar *cursor = cur;
88
    char *cursor = cur;
89
    uint depth;
89
    uint depth;
90
90
91
scan:
91
scan:
(-)re2c-0.9.1/substr.h (-1 / +2 lines)
Lines 1-7 Link Here
1
#ifndef _substr_h
1
#ifndef _substr_h
2
#define _substr_h
2
#define _substr_h
3
3
4
#include <iostream.h>
4
#include <iostream>
5
#include "globals.h"
5
#include "basics.h"
6
#include "basics.h"
6
7
7
class SubStr {
8
class SubStr {

Return to bug 43449