]> granicus.if.org Git - re2c/commitdiff
Modified the code to be in namespace re2c, this should prevent problems with typedefs...
authornuffer <nuffer@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 1 Nov 2004 04:35:57 +0000 (04:35 +0000)
committernuffer <nuffer@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 1 Nov 2004 04:35:57 +0000 (04:35 +0000)
22 files changed:
actions.cc
basics.h
bootstrap/scanner.cc
code.cc
configure.in
dfa.cc
dfa.h
globals.h
ins.h
main.cc
mbo_getopt.cc
mbo_getopt.h
parser.h
parser.tab.h
parser.y
re.h
scanner.h
scanner.re
substr.cc
substr.h
token.h
translate.cc

index 5bd98be1ce6a72d673c892cbbac0d23c88645276..eacedbbd0d4aabaee1a565e4e4d8f86d853f6edf 100644 (file)
@@ -9,6 +9,9 @@
 #include "parser.h"
 #include "dfa.h"
 
+namespace re2c
+{
+
 Symbol *Symbol::first = NULL;
 
 Symbol::Symbol(const SubStr &str) : next(first), name(str), re(NULL)
@@ -810,3 +813,6 @@ void genCode(std::ostream& o, RegExp *re)
        delete dfa;
        delete [] ins;
 }
+
+} // end namespace re2c
+
index a1233879b4219332963805560aa7e43f8dd160f6..2e1862778d8f1dfc8eea912c6340474a2275edbf 100644 (file)
--- a/basics.h
+++ b/basics.h
@@ -6,6 +6,9 @@
 #include "config.h"
 #endif
 
+namespace re2c
+{
+
 #if SIZEOF_CHAR == 1
 typedef unsigned char byte;
 #elif SIZEOF_SHORT == 1
@@ -42,20 +45,11 @@ typedef unsigned long dword;
 typedef unsigned long dword;
 #endif
 
-#ifndef HAVE_UINT
 typedef unsigned int uint;
-#endif
-
-#ifndef HAVE_UCHAR
 typedef unsigned char uchar;
-#endif
-
-#ifndef HAVE_USHORT
 typedef unsigned short ushort;
-#endif
-
-#ifndef HAVE_ULONG
 typedef unsigned long ulong;
-#endif
+
+} // end namespace re2c
 
 #endif
index 61dc3ff6d5707208fc048014eb2653509b4de133..2d641bbb23fdc274a348fd98535859a021624c17 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.4 on Mon Jul 26 23:14:20 2004 */
+/* Generated by re2c 0.9.4 on Sun Oct 31 21:27:49 2004 */
 #line 1 "scanner.re"
 /* $Id$ */
 #include <stdlib.h>
@@ -24,6 +24,8 @@ extern YYSTYPE yylval;
 
 #define        RETURN(i)       {cur = cursor; return i;}
 
+namespace re2c
+{
 
 Scanner::Scanner(std::istream& i) : in(i),
        bot(NULL), tok(NULL), ptr(NULL), cur(NULL), pos(NULL), lim(NULL),
@@ -62,7 +64,7 @@ char *Scanner::fill(char *cursor){
     return cursor;
 }
 
-#line 72 "scanner.re"
+#line 74 "scanner.re"
 
 
 int Scanner::echo(std::ostream &out){
@@ -92,13 +94,13 @@ yy2:        yyaccept = 0;
        if(yych == '*') goto yy7;
        goto yy3;
 yy3:
-#line 91 "scanner.re"
+#line 93 "scanner.re"
 { goto echo; }
 #line 26 "scanner.cc"
 yy4:   ++YYCURSOR;
        goto yy5;
 yy5:
-#line 87 "scanner.re"
+#line 89 "scanner.re"
 { if(cursor == eof) RETURN(0);
                                  out.write((const char*)(tok), (const char*)(cursor) - (const char*)(tok));
                                  tok = pos = cursor; cline++;
@@ -128,13 +130,13 @@ yy12:     yych = *++YYCURSOR;
 yy13:  ++YYCURSOR;
        goto yy14;
 yy14:
-#line 84 "scanner.re"
+#line 86 "scanner.re"
 { out.write((const char*)(tok), (const char*)(&cursor[-7]) - (const char*)(tok));
                                  tok = cursor;
                                  RETURN(1); }
 #line 64 "scanner.cc"
 }
-#line 92 "scanner.re"
+#line 94 "scanner.re"
 
 }
 
@@ -210,7 +212,7 @@ yy17:       yyaccept = 0;
        if(yych <= '9') goto yy63;
        goto yy18;
 yy18:
-#line 105 "scanner.re"
+#line 107 "scanner.re"
 { depth = 1;
                                  goto code;
                                }
@@ -219,14 +221,14 @@ yy19:     ++YYCURSOR;
        if((yych = *YYCURSOR) == '*')   goto yy61;
        goto yy20;
 yy20:
-#line 131 "scanner.re"
+#line 133 "scanner.re"
 { RETURN(*tok); }
 #line 141 "scanner.cc"
 yy21:  ++YYCURSOR;
        if((yych = *YYCURSOR) == '/')   goto yy59;
        goto yy22;
 yy22:
-#line 133 "scanner.re"
+#line 135 "scanner.re"
 { yylval.op = *tok;
                                  RETURN(CLOSE); }
 #line 149 "scanner.cc"
@@ -235,7 +237,7 @@ yy23:       yyaccept = 1;
        if(yych != 0x0A)        goto yy55;
        goto yy24;
 yy24:
-#line 122 "scanner.re"
+#line 124 "scanner.re"
 { fatal("unterminated string constant (missing \")"); }
 #line 157 "scanner.cc"
 yy25:  yyaccept = 2;
@@ -243,7 +245,7 @@ yy25:       yyaccept = 2;
        if(yych != 0x0A)        goto yy50;
        goto yy26;
 yy26:
-#line 123 "scanner.re"
+#line 125 "scanner.re"
 { fatal("unterminated string constant (missing ')"); }
 #line 165 "scanner.cc"
 yy27:  yyaccept = 3;
@@ -251,7 +253,7 @@ yy27:       yyaccept = 3;
        if(yych != 0x0A)        goto yy44;
        goto yy28;
 yy28:
-#line 129 "scanner.re"
+#line 131 "scanner.re"
 { fatal("unterminated range (missing ])"); }
 #line 173 "scanner.cc"
 yy29:  yych = *++YYCURSOR;
@@ -262,7 +264,7 @@ yy31:       ++YYCURSOR;
        yych = *YYCURSOR;
        goto yy42;
 yy32:
-#line 148 "scanner.re"
+#line 150 "scanner.re"
 { cur = cursor;
                                  yylval.symbol = Symbol::find(token());
                                  return ID; }
@@ -271,13 +273,13 @@ yy33:     ++YYCURSOR;
        yych = *YYCURSOR;
        goto yy40;
 yy34:
-#line 152 "scanner.re"
+#line 154 "scanner.re"
 { goto scan; }
 #line 191 "scanner.cc"
 yy35:  ++YYCURSOR;
        goto yy36;
 yy36:
-#line 154 "scanner.re"
+#line 156 "scanner.re"
 { if(cursor == eof) RETURN(0);
                                  pos = cursor; cline++;
                                  goto scan;
@@ -286,7 +288,7 @@ yy36:
 yy37:  ++YYCURSOR;
        goto yy38;
 yy38:
-#line 159 "scanner.re"
+#line 161 "scanner.re"
 { std::cerr << "unexpected character: " << *tok << std::endl;
                                  goto scan;
                                }
@@ -339,7 +341,7 @@ yy46:       ++YYCURSOR;
 yy47:  ++YYCURSOR;
        goto yy48;
 yy48:
-#line 125 "scanner.re"
+#line 127 "scanner.re"
 { cur = cursor;
                                  yylval.regexp = ranToRE(token());
                                  return RANGE; }
@@ -364,7 +366,7 @@ yy51:       ++YYCURSOR;
 yy52:  ++YYCURSOR;
        goto yy53;
 yy53:
-#line 118 "scanner.re"
+#line 120 "scanner.re"
 { cur = cursor;
                                  yylval.regexp = strToCaseInsensitiveRE(token());
                                  return STRING; }
@@ -389,7 +391,7 @@ yy56:       ++YYCURSOR;
 yy57:  ++YYCURSOR;
        goto yy58;
 yy58:
-#line 114 "scanner.re"
+#line 116 "scanner.re"
 { cur = cursor;
                                  yylval.regexp = strToRE(token());
                                  return STRING; }
@@ -397,14 +399,14 @@ yy58:
 yy59:  ++YYCURSOR;
        goto yy60;
 yy60:
-#line 111 "scanner.re"
+#line 113 "scanner.re"
 { tok = cursor;
                                  RETURN(0); }
 #line 326 "scanner.cc"
 yy61:  ++YYCURSOR;
        goto yy62;
 yy62:
-#line 108 "scanner.re"
+#line 110 "scanner.re"
 { depth = 1;
                                  goto comment; }
 #line 333 "scanner.cc"
@@ -423,7 +425,7 @@ yy64:       if(yych <= '/'){
 yy65:  ++YYCURSOR;
        goto yy66;
 yy66:
-#line 136 "scanner.re"
+#line 138 "scanner.re"
 { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = atoi((char *)tok+1);
                                  RETURN(CLOSESIZE); }
@@ -434,7 +436,7 @@ yy67:       yych = *++YYCURSOR;
 yy68:  ++YYCURSOR;
        goto yy69;
 yy69:
-#line 144 "scanner.re"
+#line 146 "scanner.re"
 { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = -1;
                                  RETURN(CLOSESIZE); }
@@ -450,13 +452,13 @@ yy71:     if(yych <= '/') goto yy45;
 yy72:  ++YYCURSOR;
        goto yy73;
 yy73:
-#line 140 "scanner.re"
+#line 142 "scanner.re"
 { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)tok, ',')+1));
                                  RETURN(CLOSESIZE); }
 #line 382 "scanner.cc"
 }
-#line 162 "scanner.re"
+#line 164 "scanner.re"
 
 
 code:
@@ -491,7 +493,7 @@ yy74:
 yy76:  ++YYCURSOR;
        goto yy77;
 yy77:
-#line 166 "scanner.re"
+#line 168 "scanner.re"
 { if(--depth == 0){
                                        cur = cursor;
                                        yylval.token = new Token(token(), tline);
@@ -502,14 +504,14 @@ yy77:
 yy78:  ++YYCURSOR;
        goto yy79;
 yy79:
-#line 172 "scanner.re"
+#line 174 "scanner.re"
 { ++depth;
                                  goto code; }
 #line 430 "scanner.cc"
 yy80:  ++YYCURSOR;
        goto yy81;
 yy81:
-#line 174 "scanner.re"
+#line 176 "scanner.re"
 { if(cursor == eof) fatal("missing '}'");
                                  pos = cursor; cline++;
                                  goto code;
@@ -518,7 +520,7 @@ yy81:
 yy82:  ++YYCURSOR;
        goto yy83;
 yy83:
-#line 178 "scanner.re"
+#line 180 "scanner.re"
 { goto code; }
 #line 445 "scanner.cc"
 yy84:  yyaccept = 0;
@@ -568,7 +570,7 @@ yy92:       ++YYCURSOR;
        if(yych == 0x0A)        goto yy88;
        goto yy90;
 }
-#line 179 "scanner.re"
+#line 181 "scanner.re"
 
 
 comment:
@@ -594,7 +596,7 @@ yy95:       ++YYCURSOR;
        if((yych = *YYCURSOR) == '/')   goto yy103;
        goto yy96;
 yy96:
-#line 193 "scanner.re"
+#line 195 "scanner.re"
 { goto comment; }
 #line 522 "scanner.cc"
 yy97:  yych = *++YYCURSOR;
@@ -603,7 +605,7 @@ yy97:       yych = *++YYCURSOR;
 yy98:  ++YYCURSOR;
        goto yy99;
 yy99:
-#line 189 "scanner.re"
+#line 191 "scanner.re"
 { if(cursor == eof) RETURN(0);
                                  tok = pos = cursor; cline++;
                                  goto comment;
@@ -614,21 +616,21 @@ yy100:    yych = *++YYCURSOR;
 yy101: ++YYCURSOR;
        goto yy102;
 yy102:
-#line 187 "scanner.re"
+#line 189 "scanner.re"
 { ++depth;
                                  goto comment; }
 #line 543 "scanner.cc"
 yy103: ++YYCURSOR;
        goto yy104;
 yy104:
-#line 183 "scanner.re"
+#line 185 "scanner.re"
 { if(--depth == 0)
                                        goto scan;
                                    else
                                        goto comment; }
 #line 552 "scanner.cc"
 }
-#line 194 "scanner.re"
+#line 196 "scanner.re"
 
 }
 
@@ -637,3 +639,6 @@ void Scanner::fatal(char *msg){
        << msg << std::endl;
     exit(1);
 }
+
+} // end namespace re2c
+
diff --git a/code.cc b/code.cc
index e708d6969a0552d37febda6cf59771a9298c1f93..13198019c9dfc6b87577beae74223d0fae9724cf 100644 (file)
--- a/code.cc
+++ b/code.cc
@@ -9,6 +9,9 @@
 #include "dfa.h"
 #include "parser.h"
 
+namespace re2c
+{
+
 // there must be at least one span in list;  all spans must cover
 // same range
 
@@ -1133,3 +1136,6 @@ void DFA::emit(std::ostream &o)
        delete [] saves;
        delete [] rules;
 }
+
+} // end namespace re2c
+
index 207ba0c51ad15e85dd8c74909c09ca69f5c2702d..ac42ce40e50df09b00ddce32c990467cd2d89c43 100644 (file)
@@ -41,19 +41,6 @@ AC_CHECK_SIZEOF([short])
 AC_CHECK_SIZEOF([int])
 AC_CHECK_SIZEOF([long])
 
-AC_CHECK_TYPE([uchar], [
-  AC_DEFINE([HAVE_UCHAR], [1],  [Define to 1 if you have uchar type definition])
-])
-AC_CHECK_TYPE([ushort], [
-  AC_DEFINE([HAVE_USHORT], [1],  [Define to 1 if you have ushort type definition])
-])
-AC_CHECK_TYPE([uint], [
-  AC_DEFINE([HAVE_UINT], [1],  [Define to 1 if you have uint type definition])
-])
-AC_CHECK_TYPE([ulong], [
-  AC_DEFINE([HAVE_ULONG], [1],  [Define to 1 if you have ulong type definition])
-])
-
 AC_CONFIG_FILES([\
 Makefile \
 README \
diff --git a/dfa.cc b/dfa.cc
index 27cdb05db38262af3d6f378dc7c703cfb54eec7b..77b14572398af416a6d975869dee51fea8f68c5f 100644 (file)
--- a/dfa.cc
+++ b/dfa.cc
@@ -5,6 +5,9 @@
 #include "substr.h"
 #include "dfa.h"
 
+namespace re2c
+{
+
 inline char octCh(uint c)
 {
        return '0' + c % 8;
@@ -355,3 +358,6 @@ unmarkAll:
 
        return s;
 }
+
+} // end namespace re2c
+
diff --git a/dfa.h b/dfa.h
index 1d3ffc73b1168fb411b2020dbfcd88982e53c976..032d80c828c37a81c4a82a5680d245cfc140b109 100644 (file)
--- a/dfa.h
+++ b/dfa.h
@@ -5,6 +5,9 @@
 #include <iosfwd>
 #include "re.h"
 
+namespace re2c
+{
+
 extern void prtCh(std::ostream&, uchar);
 extern void prtChOrHex(std::ostream&, uchar);
 extern void printSpan(std::ostream&, uint, uint);
@@ -223,4 +226,6 @@ inline std::ostream& operator<<(std::ostream &o, const DFA *dfa)
        return o << *dfa;
 }
 
+} // end namespace re2c
+
 #endif
index ee1703ea58302c68cb3fa24f5ac8c7530c9d5867..8a59104dd600952ef5f8a5d99768f70e7b0f7058 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -4,6 +4,9 @@
 
 #include "basics.h"
 
+namespace re2c
+{
+
 extern char *fileName;
 extern char *outputFileName;
 extern bool sFlag;
@@ -15,4 +18,6 @@ extern uchar ebc2asc[256];
 
 extern uchar *xlat, *talx;
 
+} // end namespace re2c
+
 #endif
diff --git a/ins.h b/ins.h
index 4fec59b9ddf52abdbf04cfc795df63a1bf32b043..5700121bf897d255fa876cae6270a722d0e2fa85 100644 (file)
--- a/ins.h
+++ b/ins.h
@@ -4,6 +4,9 @@
 
 #include "basics.h"
 
+namespace re2c
+{
+
 const uint nChars = 256;
 typedef uchar Char;
 
@@ -49,4 +52,6 @@ inline void unmark(Ins *i)
        i->i.marked = false;
 }
 
+} // end namespace re2c
+
 #endif
diff --git a/main.cc b/main.cc
index e57aa7407518e7e124e693e0a0f5d1eca3489e19..f64bf19f93532f179d5a53c3c08e853449e46c51 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -13,6 +13,9 @@
 #include "dfa.h"
 #include "mbo_getopt.h"
 
+namespace re2c
+{
+
 char *fileName = 0;
 char *outputFileName = 0;
 bool sFlag = false;
@@ -60,6 +63,10 @@ static void usage()
        "-v      --version       Show version information.\n";
 }
 
+} // end namespace re2c
+
+using namespace re2c;
+
 int main(int argc, char *argv[])
 {
        int c;
@@ -168,3 +175,4 @@ int main(int argc, char *argv[])
        return 0;
 
 }
+
index 870b9fff0bf29e7f5f1e37630f25cd6f2e78d113..385b10c33cc044f070121a0fb274da23dad5e570 100755 (executable)
@@ -13,6 +13,8 @@
 #define OPTERRNF (2)
 #define OPTERRARG (3)
 
+namespace re2c
+{
 
 static int mbo_opt_error(int argc, char * const *argv, int oint, int optchr, int err, int show_err)
 {
@@ -194,3 +196,6 @@ int mbo_getopt(int argc, char* const *argv, const mbo_opt_struct opts[], char **
        assert(0);
        return (0);     /* never reached */
 }
+
+} // end namespace re2c
+
index acbc15aec7c33f6e5159808dc9070a97184e1e2d..96cf5669874d841d490427bbe457651aac64b2bc 100755 (executable)
@@ -8,6 +8,12 @@
  * If short_open is '-' this is the last option.
  */
 
+#ifndef RE2C_MBO_GETOPT_H_INCLUDE_GUARD_
+#define RE2C_MBO_GETOPT_H_INCLUDE_GUARD_
+
+namespace re2c
+{
+
 typedef struct _mbo_opt_struct
 {
        const char opt_char;
@@ -18,3 +24,8 @@ typedef struct _mbo_opt_struct
 mbo_opt_struct;
 
 int mbo_getopt(int argc, char* const *argv, const mbo_opt_struct opts[], char **optarg, int *optind, int show_err);
+
+} // end namespace re2c
+
+#endif
+
index 822389608003eddad540bc8898dfa194868b329b..ceb9465699cc754ccbed0f785ae5ef386df55274 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -6,6 +6,9 @@
 #include "re.h"
 #include <iosfwd>
 
+namespace re2c
+{
+
 class Symbol
 {
 
@@ -23,4 +26,6 @@ public:
 void line_source(unsigned int, std::ostream&);
 void parse(std::istream&, std::ostream&);
 
+} // end namespace re2c
+
 #endif
index f07debe79671bd318b5bf40a66ce587a4c0459c5..1932bb74250b6174255fa477093ff0936e6e9f79 100644 (file)
@@ -3,9 +3,9 @@
 
 #ifndef YYSTYPE
 typedef union {
-       Symbol  *symbol;
-       RegExp  *regexp;
-       Token   *token;
+       re2c::Symbol    *symbol;
+       re2c::RegExp    *regexp;
+       re2c::Token     *token;
        char    op;
 } yystype;
 # define YYSTYPE yystype
index 8c9bbc60edf2a488291c5e1c9d4b9ef358d55817..31d06b3335da6fc136e17ac6487353e236cad71a 100644 (file)
--- a/parser.y
+++ b/parser.y
@@ -13,6 +13,9 @@
 
 #include "globals.h"
 #include "parser.h"
+#include "basics.h"
+
+using namespace re2c;
 
 extern "C"
 {
@@ -21,7 +24,7 @@ int yylex();
 void yyerror(char*);
 }
 
-static uint accept;
+static re2c::uint accept;
 static RegExp *spec;
 static Scanner *in;
 
@@ -51,11 +54,11 @@ static char* strdup(const char* s)
 %start spec
 
 %union {
-    Symbol     *symbol;
-    RegExp     *regexp;
-    Token      *token;
+    re2c::Symbol       *symbol;
+    re2c::RegExp       *regexp;
+    re2c::Token        *token;
     char       op;
-    ExtOp      extop;
+    re2c::ExtOp        extop;
 };
 
 %token         CLOSESIZE   CLOSE       ID      CODE    RANGE   STRING
@@ -167,6 +170,9 @@ int yylex(){
 }
 } // end extern "C"
 
+namespace re2c
+{
+
 void line_source(unsigned int line, std::ostream& o)
 {
     char *     fnamebuf;
@@ -209,3 +215,6 @@ void parse(std::istream& i, std::ostream &o){
        line_source(in->line(), o);
     }
 }
+
+} // end namespace re2c
+
diff --git a/re.h b/re.h
index c19942d45ff04f095759151563b110b4b10baa19..ea52e6442c3fd9df288f294840e96f6bf6d04e8b 100644 (file)
--- a/re.h
+++ b/re.h
@@ -6,6 +6,9 @@
 #include "token.h"
 #include "ins.h"
 
+namespace re2c
+{
+
 typedef struct extop
 {
        char op;
@@ -293,4 +296,6 @@ extern RegExp *strToRE(SubStr);
 extern RegExp *ranToRE(SubStr);
 extern RegExp *strToCaseInsensitiveRE(SubStr s);
 
+} // end namespace re2c
+
 #endif
index 55a37a18700b39982f335a6afebbcdfb2f742543..d252e2cf236def912c2f0fdb98310d9489a0b95b 100644 (file)
--- a/scanner.h
+++ b/scanner.h
@@ -5,6 +5,9 @@
 #include <iosfwd>
 #include "token.h"
 
+namespace re2c
+{
+
 class Scanner
 {
 
@@ -37,4 +40,6 @@ inline uint Scanner::line()
        return cline;
 }
 
+} // end namespace re2c
+
 #endif
index 88a9bb8a9d6df09397e57e38b408ad9912b9aaef..1ab6433bcc2bf4d0e5b907898caaa0bc4832d106 100644 (file)
@@ -22,6 +22,8 @@ extern YYSTYPE yylval;
 
 #define        RETURN(i)       {cur = cursor; return i;}
 
+namespace re2c
+{
 
 Scanner::Scanner(std::istream& i) : in(i),
        bot(NULL), tok(NULL), ptr(NULL), cur(NULL), pos(NULL), lim(NULL),
@@ -199,3 +201,6 @@ void Scanner::fatal(char *msg){
        << msg << std::endl;
     exit(1);
 }
+
+} // end namespace re2c
+
index b7f8f72f92a1be3f2c00eb65c0e71444684d1e1a..5fdaeacde4ec9ba47047d82100fff92d24733a80 100644 (file)
--- a/substr.cc
+++ b/substr.cc
@@ -3,6 +3,9 @@
 #include "substr.h"
 #include "globals.h"
 
+namespace re2c
+{
+
 void SubStr::out(std::ostream& o) const
 {
        o.write(str, len);
@@ -42,3 +45,6 @@ Str::~Str()
        str = (char*) - 1;
        len = (uint) - 1;
 }
+
+} // end namespace re2c
+
index 476d39a8d088e57559361dc397f2c306185212aa..c7ff3b934428301d1a8d5a0e78ec8ea0715f449a 100644 (file)
--- a/substr.h
+++ b/substr.h
@@ -5,6 +5,9 @@
 #include <iostream>
 #include "basics.h"
 
+namespace re2c
+{
+
 class SubStr
 {
 
@@ -53,4 +56,6 @@ inline SubStr::SubStr(const SubStr &s)
                : str(s.str), len(s.len)
 { }
 
+} // end namespace re2c
+
 #endif
diff --git a/token.h b/token.h
index debb17148a4ec08b011916ef8c668b0be97921d3..330e541acd935d93cb4ba3187cbb4d3ca68e8e04 100644 (file)
--- a/token.h
+++ b/token.h
@@ -4,6 +4,9 @@
 
 #include "substr.h"
 
+namespace re2c
+{
+
 class Token
 {
 
@@ -20,4 +23,6 @@ inline Token::Token(SubStr t, uint l) : text(t), line(l)
        ;
 }
 
+} // end namespace re2c
+
 #endif
index 9331a485114037fb6d6a67734116831071459642..c8b73a423399285e9c5856de19e7cb0fb4686114 100644 (file)
@@ -1,6 +1,9 @@
 /* $Id$ */
 #include "globals.h"
 
+namespace re2c
+{
+
 uchar asc2asc[256] =
     {
         0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
@@ -63,3 +66,6 @@ uchar ebc2asc[256] =
         0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5,
         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f
     };
+
+} // end namespace re2c
+