View | Details | Raw Unified
Collapse All | Expand All

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