From 2305012ad8de9015df6ee3b51e01ee1dda928264 Mon Sep 17 00:00:00 2001 From: helly Date: Sun, 1 Jan 2006 19:37:11 +0000 Subject: [PATCH] - Add new tests --- test/input10.c | 44 ++++++ test/input10.re | 12 ++ test/input10.s.c | 38 +++++ test/input10.s.re | 12 ++ test/input11.c | 374 ++++++++++++++++++++++++++++++++++++++++++++++ test/input11.re | 15 ++ test/input11.s.c | 147 ++++++++++++++++++ test/input11.s.re | 15 ++ 8 files changed, 657 insertions(+) create mode 100755 test/input10.c create mode 100755 test/input10.re create mode 100755 test/input10.s.c create mode 100755 test/input10.s.re create mode 100755 test/input11.c create mode 100755 test/input11.re create mode 100755 test/input11.s.c create mode 100755 test/input11.s.re diff --git a/test/input10.c b/test/input10.c new file mode 100755 index 00000000..a11c97fc --- /dev/null +++ b/test/input10.c @@ -0,0 +1,44 @@ +/* Generated by re2c */ +#line 1 "input10.re" + +#line 5 "" +{ + YYCTYPE yych; + goto yy0; + ++YYCURSOR; +yy0: + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch(yych){ + case 'A': + case 'B': + case 'C': + case 'D': + case 'F': + case 'G': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': goto yy2; + default: goto yy4; + } +yy2: + ++YYCURSOR; + goto yy3; +yy3: +#line 8 "input10.re" + { return 1; } +#line 33 "" +yy4: + ++YYCURSOR; + goto yy5; +yy5: +#line 10 "input10.re" + { return -1; } +#line 40 "" +} +#line 12 "input10.re" + diff --git a/test/input10.re b/test/input10.re new file mode 100755 index 00000000..0291f726 --- /dev/null +++ b/test/input10.re @@ -0,0 +1,12 @@ +/*!re2c + +a = [aA]; +b = [bB]; +c = [cC]; +d = [dD]; + +(a|b|c|d|"e"|'f'|[gG]) { return 1; } + +.|"\n" { return -1; } + +*/ diff --git a/test/input10.s.c b/test/input10.s.c new file mode 100755 index 00000000..f45cfcb8 --- /dev/null +++ b/test/input10.s.c @@ -0,0 +1,38 @@ +/* Generated by re2c */ +#line 1 "input10.s.re" + +#line 5 "" +{ + YYCTYPE yych; + goto yy0; + ++YYCURSOR; +yy0: + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if(yych <= 'E') { + if(yych <= '@') goto yy4; + if(yych >= 'E') goto yy4; + goto yy2; + } else { + if(yych <= 'G') goto yy2; + if(yych <= '`') goto yy4; + if(yych >= 'h') goto yy4; + goto yy2; + } +yy2: + ++YYCURSOR; + goto yy3; +yy3: +#line 8 "input10.s.re" + { return 1; } +#line 29 "" +yy4: + ++YYCURSOR; + goto yy5; +yy5: +#line 10 "input10.s.re" + { return -1; } +#line 36 "" +} +#line 12 "input10.s.re" + diff --git a/test/input10.s.re b/test/input10.s.re new file mode 100755 index 00000000..dc0a7713 --- /dev/null +++ b/test/input10.s.re @@ -0,0 +1,12 @@ +/*!re2c + +a = [aA]; +b = [bB]; +c = [cC]; +d = [dD]; + +(a|b|c|d|"e"|'f'|[gG]) { return 1; } + +.|"\n" { return -1; } + +*/ diff --git a/test/input11.c b/test/input11.c new file mode 100755 index 00000000..72f4c553 --- /dev/null +++ b/test/input11.c @@ -0,0 +1,374 @@ +/* Generated by re2c */ +#line 1 "input11.re" + +#line 5 "" +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + goto yy0; + ++YYCURSOR; +yy0: + if((YYLIMIT - YYCURSOR) < 6) YYFILL(6); + yych = *YYCURSOR; + switch(yych){ + case '-': goto yy7; + case '0': goto yy5; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy4; + case 'r': goto yy2; + default: goto yy10; + } +yy2: + ++YYCURSOR; + switch((yych = *YYCURSOR)) { + case 'e': goto yy15; + default: goto yy14; + } +yy3: +#line 10 "input11.re" + { return 1; } +#line 87 "" +yy4: + yych = *++YYCURSOR; + goto yy14; +yy5: + ++YYCURSOR; + goto yy6; +yy6: +#line 11 "input11.re" + { return 2; } +#line 97 "" +yy7: + ++YYCURSOR; + switch((yych = *YYCURSOR)) { + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy8; + } +yy8: +#line 13 "input11.re" + { return -1; } +#line 115 "" +yy9: + yych = *++YYCURSOR; + goto yy12; +yy10: + yych = *++YYCURSOR; + goto yy8; +yy11: + ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + goto yy12; +yy12: + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy13: + ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + goto yy14; +yy14: + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy13; + default: goto yy3; + } +yy15: + yych = *++YYCURSOR; + switch(yych){ + case '2': goto yy16; + default: goto yy14; + } +yy16: + yych = *++YYCURSOR; + switch(yych){ + case 'c': goto yy17; + default: goto yy14; + } +yy17: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + switch(yych){ + case ':': goto yy18; + default: goto yy14; + } +yy18: + yych = *++YYCURSOR; + switch(yych){ + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy20; + default: goto yy19; + } +yy19: + YYCURSOR = YYMARKER; + switch(yyaccept){ + case 0: goto yy3; + } +yy20: + ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + goto yy21; +yy21: + switch(yych){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case ':': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy20; + default: goto yy22; + } +yy22: +#line 9 "input11.re" + { return 0; } +#line 363 "" +} +#line 15 "input11.re" + diff --git a/test/input11.re b/test/input11.re new file mode 100755 index 00000000..cda4c216 --- /dev/null +++ b/test/input11.re @@ -0,0 +1,15 @@ +/*!re2c + +letter = [a-zA-Z]; +digit = [0-9]; +number = "0" | ("-"? [1-9] digit*); +name = letter (letter|digit)*; +config = "re2c:" (letter|"_") (letter|digit|"_"|":")*; + +config { return 0; } +name { return 1; } +number { return 2; } + +.|"\n" { return -1; } + +*/ diff --git a/test/input11.s.c b/test/input11.s.c new file mode 100755 index 00000000..735621fa --- /dev/null +++ b/test/input11.s.c @@ -0,0 +1,147 @@ +/* Generated by re2c */ +#line 1 "input11.s.re" + +#line 5 "" +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + goto yy0; + ++YYCURSOR; +yy0: + if((YYLIMIT - YYCURSOR) < 6) YYFILL(6); + yych = *YYCURSOR; + if(yych <= '@') { + if(yych <= '/') { + if(yych == '-') goto yy7; + goto yy10; + } else { + if(yych <= '0') goto yy5; + if(yych <= '9') goto yy9; + goto yy10; + } + } else { + if(yych <= 'q') { + if(yych <= 'Z') goto yy4; + if(yych <= '`') goto yy10; + goto yy4; + } else { + if(yych <= 'r') goto yy2; + if(yych <= 'z') goto yy4; + goto yy10; + } + } +yy2: + ++YYCURSOR; + if((yych = *YYCURSOR) == 'e') goto yy15; + goto yy14; +yy3: +#line 10 "input11.s.re" + { return 1; } +#line 41 "" +yy4: + yych = *++YYCURSOR; + goto yy14; +yy5: + ++YYCURSOR; + goto yy6; +yy6: +#line 11 "input11.s.re" + { return 2; } +#line 51 "" +yy7: + ++YYCURSOR; + if((yych = *YYCURSOR) <= '0') goto yy8; + if(yych <= '9') goto yy11; + goto yy8; +yy8: +#line 13 "input11.s.re" + { return -1; } +#line 60 "" +yy9: + yych = *++YYCURSOR; + goto yy12; +yy10: + yych = *++YYCURSOR; + goto yy8; +yy11: + ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + goto yy12; +yy12: + if(yych <= '/') goto yy6; + if(yych <= '9') goto yy11; + goto yy6; +yy13: + ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + goto yy14; +yy14: + if(yych <= '@') { + if(yych <= '/') goto yy3; + if(yych <= '9') goto yy13; + goto yy3; + } else { + if(yych <= 'Z') goto yy13; + if(yych <= '`') goto yy3; + if(yych <= 'z') goto yy13; + goto yy3; + } +yy15: + yych = *++YYCURSOR; + if(yych != '2') goto yy14; + goto yy16; +yy16: + yych = *++YYCURSOR; + if(yych != 'c') goto yy14; + goto yy17; +yy17: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if(yych != ':') goto yy14; + goto yy18; +yy18: + yych = *++YYCURSOR; + if(yych <= '^') { + if(yych <= '@') goto yy19; + if(yych <= 'Z') goto yy20; + goto yy19; + } else { + if(yych == '`') goto yy19; + if(yych <= 'z') goto yy20; + goto yy19; + } +yy19: + YYCURSOR = YYMARKER; + switch(yyaccept){ + case 0: goto yy3; + } +yy20: + ++YYCURSOR; + if(YYLIMIT == YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + goto yy21; +yy21: + if(yych <= 'Z') { + if(yych <= '/') goto yy22; + if(yych <= ':') goto yy20; + if(yych >= 'A') goto yy20; + goto yy22; + } else { + if(yych <= '_') { + if(yych >= '_') goto yy20; + goto yy22; + } else { + if(yych <= '`') goto yy22; + if(yych <= 'z') goto yy20; + goto yy22; + } + } +yy22: +#line 9 "input11.s.re" + { return 0; } +#line 145 "" +} +#line 15 "input11.s.re" + diff --git a/test/input11.s.re b/test/input11.s.re new file mode 100755 index 00000000..cda4c216 --- /dev/null +++ b/test/input11.s.re @@ -0,0 +1,15 @@ +/*!re2c + +letter = [a-zA-Z]; +digit = [0-9]; +number = "0" | ("-"? [1-9] digit*); +name = letter (letter|digit)*; +config = "re2c:" (letter|"_") (letter|digit|"_"|":")*; + +config { return 0; } +name { return 1; } +number { return 2; } + +.|"\n" { return -1; } + +*/ -- 2.50.1