#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 : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
%.cc: %.re
re2c -s $< >$@
parser.cc: 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)
$(CC) -o $@ $(OBJS) $(LDFLAGS) -lstdc++
#include <time.h>
#include <string.h>
#include <iostream.h>
#include <iostream>
#include <iomanip.h>
#include <iomanip>
#include "globals.h"
#include "parser.h"
#define YYPREFIX "yy"
#line 2 "parser.y"
#include <stdlib.h>
#include <malloc.h>
register int yym, yyn, yystate;
#if YYDEBUG
register char *yys;
extern char *getenv();
if (yys = getenv("YYDEBUG"))
{
#line 1 "scanner.re"
#include <unistd.h>
#include "scanner.h"
#include <ctype.h>
#include "substr.h"
#include "dfa.h"
// there must be at least one span in list; all spans must cover
#ifndef _dfa_h
#define _dfa_h
#include "re.h"
extern void prtCh(ostream&, uchar);
#include "scanio.h"
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
#ifndef _ins_h
#define _ins_h
#include "basics.h"
const uint nChars = 256;
#include <fstream.h>
#include <fcntl.h>
#include <fstream>
%{
BEGIN_C_DECLS()
int yyparse();
int yylex();
void yyerror(char*);
END_C_DECLS()
static uint accept;
static RegExp *spec;
static Scanner *in;
#ifndef _re_h
#define _re_h
#include "token.h"
#include "ins.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;
uchar *fill(uchar*);
char *fill(char*);
public:
Scanner(int);
int echo(ostream&);
#define BSIZE 8192
#define YYCTYPE uchar
#define YYCTYPE char
#define YYCURSOR cursor
#define YYLIMIT lim
#define YYMARKER ptr
;
}
uchar *Scanner::fill(uchar *cursor){
char *Scanner::fill(char *cursor){
if(!eof){
uint cnt = tok - bot;
if(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];
*/
int Scanner::echo(ostream &out){
uchar *cursor = cur;
char *cursor = cur;
tok = cursor;
echo:
/*!re2c
int Scanner::scan(){
uint depth;
scan:
#ifndef _substr_h
#define _substr_h
class SubStr {