File: bug145.c

package info (click to toggle)
re2c 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 50,052 kB
  • sloc: cpp: 32,477; ml: 8,279; sh: 5,265; makefile: 968; haskell: 612; python: 428; ansic: 227; javascript: 111; java: 3
file content (60 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Generated by re2c */
// re2c $INPUT -o $OUTPUT -ci
#include <stdio.h>

enum YYCONDTYPE {
	yycinit,
	yycC2
};


int test(const char* str)
{
    const unsigned char* YYCURSOR = (const unsigned char*)str;
    const unsigned char* YYMARKER;
    const unsigned char *YYCTXMARKER;
    int c = yycinit;

    
{
	unsigned char yych;
	switch (c) {
		case yycinit: goto yyc_init;
		case yycC2: goto yyc_C2;
	}
/* *********************************** */
yyc_init:
	yych = *YYCURSOR;
	switch (yych) {
		case 'A': goto yy2;
		default: goto yy1;
	}
yy1:
	++YYCURSOR;
	{ return 0; }
yy2:
	++YYCURSOR;
	c = yycC2;
	goto yyc_C2;
/* *********************************** */
yyc_C2:
	yych = *YYCURSOR;
	switch (yych) {
		case 'B': goto yy5;
		default: goto yy4;
	}
yy4:
	++YYCURSOR;
	{ return 0; }
yy5:
	++YYCURSOR;
	{ return 1; }
}

}

int main()
{
    printf("%d\n", test("AB"));
    return 0;
}