]> granicus.if.org Git - re2c/commitdiff
- Prevent from allowing '::' in config names
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 2 Jan 2006 10:48:18 +0000 (10:48 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 2 Jan 2006 10:48:18 +0000 (10:48 +0000)
bootstrap/scanner.cc
scanner.re

index 2dcf4a7f0822a09e847658f178fe88afc1bbc307..4081285f4532175ceaeabd6e1a9f5cbecc2b2023 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.10.0.dev on Sun Jan  1 19:37:31 2006 */
+/* Generated by re2c 0.10.0.dev on Mon Jan  2 11:47:26 2006 */
 #line 1 "scanner.re"
 /* $Id$ */
 #include <stdlib.h>
@@ -269,7 +269,7 @@ scan:
        goto yy29;
        ++YYCURSOR;
 yy29:
-       if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+       if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
        yych = *YYCURSOR;
        if(yych <= '/') {
                if(yych <= '!') {
@@ -502,7 +502,9 @@ yy64:
        if(yych != ':') goto yy61;
        goto yy65;
 yy65:
-       yych = *++YYCURSOR;
+       ++YYCURSOR;
+       if(YYLIMIT == YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
        if(yych <= '@') goto yy66;
        if(yych <= 'Z') goto yy67;
        if(yych <= '`') goto yy66;
@@ -515,20 +517,26 @@ yy66:
        case 1: goto yy38;
        case 2: goto yy40;
        case 3: goto yy42;
-       case 5: goto yy98;
+       case 6: goto yy98;
+       case 5: goto yy69;
        case 4: goto yy46;
        }
 yy67:
-       ++YYCURSOR;
+       yyaccept = 5;
+       YYMARKER = ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        goto yy68;
 yy68:
        if(yych <= 'Z') {
-               if(yych <= '/') goto yy69;
-               if(yych <= ':') goto yy67;
-               if(yych >= 'A') goto yy67;
-               goto yy69;
+               if(yych <= '9') {
+                       if(yych >= '0') goto yy67;
+                       goto yy69;
+               } else {
+                       if(yych <= ':') goto yy65;
+                       if(yych >= 'A') goto yy67;
+                       goto yy69;
+               }
        } else {
                if(yych <= '_') {
                        if(yych >= '_') goto yy67;
@@ -547,7 +555,7 @@ yy69:
                                  yylval.str = new Str(token());
                                  return CONFIG;
                                }
-#line 551 "scanner.cc"
+#line 559 "scanner.cc"
 yy70:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -590,7 +598,7 @@ yy76:
        { cur = cursor;
                                  yylval.regexp = ranToRE(token());
                                  return RANGE; }
-#line 594 "scanner.cc"
+#line 602 "scanner.cc"
 yy77:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -605,7 +613,7 @@ yy79:
        { cur = cursor;
                                  yylval.regexp = invToRE(token());
                                  return RANGE; }
-#line 609 "scanner.cc"
+#line 617 "scanner.cc"
 yy80:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -634,7 +642,7 @@ yy84:
        { cur = cursor;
                                  yylval.regexp = strToCaseInsensitiveRE(token());
                                  return STRING; }
-#line 638 "scanner.cc"
+#line 646 "scanner.cc"
 yy85:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -663,7 +671,7 @@ yy89:
        { cur = cursor;
                                  yylval.regexp = strToRE(token());
                                  return STRING; }
-#line 667 "scanner.cc"
+#line 675 "scanner.cc"
 yy90:
        ++YYCURSOR;
        goto yy91;
@@ -671,7 +679,7 @@ yy91:
 #line 167 "scanner.re"
        { tok = cursor;
                                  RETURN(0); }
-#line 675 "scanner.cc"
+#line 683 "scanner.cc"
 yy92:
        ++YYCURSOR;
        goto yy93;
@@ -679,7 +687,7 @@ yy93:
 #line 164 "scanner.re"
        { depth = 1;
                                  goto comment; }
-#line 683 "scanner.cc"
+#line 691 "scanner.cc"
 yy94:
        yych = *++YYCURSOR;
        if(yych == ',') goto yy108;
@@ -704,7 +712,7 @@ yy97:
 yy98:
 #line 211 "scanner.re"
        { fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); }
-#line 708 "scanner.cc"
+#line 716 "scanner.cc"
 yy99:
        ++YYCURSOR;
        goto yy100;
@@ -713,9 +721,9 @@ yy100:
        { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = atoi((char *)tok+1);
                                  RETURN(CLOSESIZE); }
-#line 717 "scanner.cc"
+#line 725 "scanner.cc"
 yy101:
-       yyaccept = 5;
+       yyaccept = 6;
        yych = *(YYMARKER = ++YYCURSOR);
        if(yych <= '/') goto yy98;
        if(yych <= '9') goto yy104;
@@ -729,7 +737,7 @@ yy103:
        { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = -1;
                                  RETURN(CLOSESIZE); }
-#line 733 "scanner.cc"
+#line 741 "scanner.cc"
 yy104:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -748,9 +756,9 @@ yy107:
        { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)tok, ',')+1));
                                  RETURN(CLOSESIZE); }
-#line 752 "scanner.cc"
+#line 760 "scanner.cc"
 yy108:
-       yyaccept = 5;
+       yyaccept = 6;
        yych = *(YYMARKER = ++YYCURSOR);
        if(yych <= '/') goto yy98;
        if(yych <= '9') goto yy104;
@@ -763,14 +771,14 @@ yy110:
 #line 196 "scanner.re"
        { yylval.op = '*';
                                  RETURN(CLOSE); }
-#line 767 "scanner.cc"
+#line 775 "scanner.cc"
 }
 #line 248 "scanner.re"
 
 
 code:
 
-#line 774 "scanner.cc"
+#line 782 "scanner.cc"
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
@@ -808,7 +816,7 @@ yy114:
                                        return CODE;
                                  }
                                  goto code; }
-#line 812 "scanner.cc"
+#line 820 "scanner.cc"
 yy115:
        ++YYCURSOR;
        goto yy116;
@@ -816,7 +824,7 @@ yy116:
 #line 258 "scanner.re"
        { ++depth;
                                  goto code; }
-#line 820 "scanner.cc"
+#line 828 "scanner.cc"
 yy117:
        ++YYCURSOR;
        goto yy118;
@@ -826,14 +834,14 @@ yy118:
                                  pos = cursor; cline++;
                                  goto code;
                                }
-#line 830 "scanner.cc"
+#line 838 "scanner.cc"
 yy119:
        ++YYCURSOR;
        goto yy120;
 yy120:
 #line 264 "scanner.re"
        { goto code; }
-#line 837 "scanner.cc"
+#line 845 "scanner.cc"
 yy121:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
@@ -895,7 +903,7 @@ yy129:
 
 comment:
 
-#line 899 "scanner.cc"
+#line 907 "scanner.cc"
 {
        YYCTYPE yych;
        goto yy130;
@@ -918,7 +926,7 @@ yy132:
 yy133:
 #line 280 "scanner.re"
        { goto comment; }
-#line 922 "scanner.cc"
+#line 930 "scanner.cc"
 yy134:
        yych = *++YYCURSOR;
        if(yych == '*') goto yy138;
@@ -932,7 +940,7 @@ yy136:
                                  tok = pos = cursor; cline++;
                                  goto comment;
                                }
-#line 936 "scanner.cc"
+#line 944 "scanner.cc"
 yy137:
        yych = *++YYCURSOR;
        goto yy133;
@@ -944,7 +952,7 @@ yy139:
        { ++depth;
                                  fatal("ambiguous /* found");
                                  goto comment; }
-#line 948 "scanner.cc"
+#line 956 "scanner.cc"
 yy140:
        ++YYCURSOR;
        goto yy141;
@@ -954,14 +962,14 @@ yy141:
                                        goto scan;
                                    else
                                        goto comment; }
-#line 958 "scanner.cc"
+#line 966 "scanner.cc"
 }
 #line 281 "scanner.re"
 
 
 config:
 
-#line 965 "scanner.cc"
+#line 973 "scanner.cc"
 {
        YYCTYPE yych;
        goto yy142;
@@ -984,7 +992,7 @@ yy144:
 yy145:
 #line 285 "scanner.re"
        { goto config; }
-#line 988 "scanner.cc"
+#line 996 "scanner.cc"
 yy146:
        ++YYCURSOR;
        yych = *YYCURSOR;
@@ -995,14 +1003,14 @@ yy147:
                                  cur = cursor;
                                  RETURN('='); 
                                }
-#line 999 "scanner.cc"
+#line 1007 "scanner.cc"
 yy148:
        ++YYCURSOR;
        goto yy149;
 yy149:
 #line 290 "scanner.re"
        { fatal("missing '='"); }
-#line 1006 "scanner.cc"
+#line 1014 "scanner.cc"
 yy150:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -1027,7 +1035,7 @@ yy153:
 
 value:
 
-#line 1031 "scanner.cc"
+#line 1039 "scanner.cc"
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
@@ -1073,7 +1081,7 @@ yy156:
                                  iscfg = 0;
                                  return VALUE;
                                }
-#line 1077 "scanner.cc"
+#line 1085 "scanner.cc"
 yy157:
        ++YYCURSOR;
        if((yych = *YYCURSOR) <= 0x0D) {
@@ -1097,7 +1105,7 @@ yy158:
                                  iscfg = 0;
                                  return NUMBER;
                                }
-#line 1101 "scanner.cc"
+#line 1109 "scanner.cc"
 yy159:
        yych = *++YYCURSOR;
        if(yych <= '0') goto yy163;
index 4c3162fb151c05ba5a34035ca99ba50e4ac79809..c163a2ebbe859f950a72b1c408bc23149f3accec 100644 (file)
@@ -82,10 +82,10 @@ letter  = [a-zA-Z];
 digit   = [0-9];
 number  = "0" | ("-"? [1-9] digit*);
 name    = letter (letter|digit)*;
-cname   = letter (letter|digit|[:_])*;
+cname   = ":" letter (letter|digit|"_")*;
 space   = [ \t];
 eol     = ("\r\n" | "\n");
-config  = "re2c:" cname;
+config  = "re2c" cname+;
 value   = [^\r\n; \t]* | dstring | sstring;
 */