re2c.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. Index: Makefile
  2. --- Makefile.orig 1999-08-27 05:46:32.000000000 +0200
  3. +++ Makefile 2004-05-08 10:01:19.000000000 +0200
  4. @@ -11,7 +11,7 @@
  5. %.cc : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
  6. %.cc: %.re
  7. - re2c -s $< >$@
  8. + ./re2c -s $< >$@
  9. SOURCES = code.cc dfa.cc main.cc parser.y actions.cc scanner.re substr.cc\
  10. translate.cc
  11. @@ -29,7 +29,7 @@
  12. rm -f *.o *.s y.tab.c y.tab.h scanner.cc parser.cc .version version.h re2c
  13. parser.cc: parser.y
  14. - yacc -d parser.y
  15. + $(YACC) -d parser.y
  16. mv -f y.tab.c parser.cc
  17. re2c: $(OBJS)
  18. Index: parser.cc
  19. --- parser.cc.orig 1999-08-27 05:46:32.000000000 +0200
  20. +++ parser.cc 2004-05-08 10:01:04.000000000 +0200
  21. @@ -13,7 +13,7 @@
  22. #include <time.h>
  23. #include <iostream.h>
  24. #include <string.h>
  25. -#include <malloc.h>
  26. +#include <stdlib.h>
  27. #include "globals.h"
  28. #include "parser.h"
  29. int yyparse();
  30. Index: parser.y
  31. --- parser.y.orig 1999-08-27 05:46:32.000000000 +0200
  32. +++ parser.y 2004-05-08 10:01:04.000000000 +0200
  33. @@ -3,7 +3,7 @@
  34. #include <time.h>
  35. #include <iostream.h>
  36. #include <string.h>
  37. -#include <malloc.h>
  38. +#include <stdlib.h>
  39. #include "globals.h"
  40. #include "parser.h"
  41. int yyparse();
  42. Index: scanner.cc
  43. --- scanner.cc.orig 1999-08-27 05:46:32.000000000 +0200
  44. +++ scanner.cc 2004-05-08 10:01:04.000000000 +0200
  45. @@ -12,7 +12,7 @@
  46. #define BSIZE 8192
  47. -#define YYCTYPE uchar
  48. +#define YYCTYPE char
  49. #define YYCURSOR cursor
  50. #define YYLIMIT lim
  51. #define YYMARKER ptr
  52. @@ -27,7 +27,7 @@
  53. ;
  54. }
  55. -uchar *Scanner::fill(uchar *cursor){
  56. +char *Scanner::fill(char *cursor){
  57. if(!eof){
  58. uint cnt = tok - bot;
  59. if(cnt){
  60. @@ -39,7 +39,7 @@
  61. lim -= cnt;
  62. }
  63. if((top - lim) < BSIZE){
  64. - uchar *buf = new uchar[(lim - bot) + BSIZE];
  65. + char *buf = new char[(lim - bot) + BSIZE];
  66. memcpy(buf, tok, lim - tok);
  67. tok = buf;
  68. ptr = &buf[ptr - bot];
  69. @@ -62,7 +62,7 @@
  70. int Scanner::echo(ostream &out){
  71. - uchar *cursor = cur;
  72. + char *cursor = cur;
  73. tok = cursor;
  74. echo:
  75. {
  76. @@ -117,7 +117,7 @@
  77. int Scanner::scan(){
  78. - uchar *cursor = cur;
  79. + char *cursor = cur;
  80. uint depth;
  81. scan:
  82. Index: scanner.h
  83. --- scanner.h.orig 1999-08-27 05:46:32.000000000 +0200
  84. +++ scanner.h 2004-05-08 10:01:04.000000000 +0200
  85. @@ -6,10 +6,10 @@
  86. class Scanner {
  87. private:
  88. int in;
  89. - uchar *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
  90. + char *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
  91. uint tchar, tline, cline;
  92. private:
  93. - uchar *fill(uchar*);
  94. + char *fill(char*);
  95. public:
  96. Scanner(int);
  97. int echo(ostream&);
  98. Index: scanner.re
  99. --- scanner.re.orig 1999-08-27 05:46:32.000000000 +0200
  100. +++ scanner.re 2004-05-08 10:01:04.000000000 +0200
  101. @@ -10,7 +10,7 @@
  102. #define BSIZE 8192
  103. -#define YYCTYPE uchar
  104. +#define YYCTYPE char
  105. #define YYCURSOR cursor
  106. #define YYLIMIT lim
  107. #define YYMARKER ptr
  108. @@ -25,7 +25,7 @@
  109. ;
  110. }
  111. -uchar *Scanner::fill(uchar *cursor){
  112. +char *Scanner::fill(char *cursor){
  113. if(!eof){
  114. uint cnt = tok - bot;
  115. if(cnt){
  116. @@ -37,7 +37,7 @@
  117. lim -= cnt;
  118. }
  119. if((top - lim) < BSIZE){
  120. - uchar *buf = new uchar[(lim - bot) + BSIZE];
  121. + char *buf = new char[(lim - bot) + BSIZE];
  122. memcpy(buf, tok, lim - tok);
  123. tok = buf;
  124. ptr = &buf[ptr - bot];
  125. @@ -68,7 +68,7 @@
  126. */
  127. int Scanner::echo(ostream &out){
  128. - uchar *cursor = cur;
  129. + char *cursor = cur;
  130. tok = cursor;
  131. echo:
  132. /*!re2c
  133. @@ -85,7 +85,7 @@
  134. int Scanner::scan(){
  135. - uchar *cursor = cur;
  136. + char *cursor = cur;
  137. uint depth;
  138. scan: