summaryrefslogtreecommitdiff
path: root/test/yyaccept_initial.i.c
blob: 97fff0346d44541d59a84a523d09fcb1c33a52a2 (plain)
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
61
/* Generated by re2c */
// In this example initial state coincides with fallback state
// which must update 'yyaccept'. There is a loop through initial
// state that changes 'yyaccept' value, so if the initial state
// forgets to update 'yyaccept', the wrong rule will match.


{
	YYCTYPE yych;
	unsigned int yyaccept = 0;
	goto yy0;
yy1:
	yyaccept = 0;
	++YYCURSOR;
yy0:
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *(YYMARKER = YYCURSOR);
	switch (yych) {
	case 'a':	goto yy3;
	default:	goto yy2;
	}
yy2:
	{ 1 }
yy3:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 'b':	goto yy5;
	default:	goto yy4;
	}
yy4:
	YYCURSOR = YYMARKER;
	if (yyaccept == 0) {
		goto yy2;
	} else {
		goto yy6;
	}
yy5:
	yyaccept = 1;
	YYMARKER = ++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 'a':	goto yy7;
	default:	goto yy6;
	}
yy6:
	{ 2 }
yy7:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 'b':	goto yy1;
	default:	goto yy4;
	}
}

re2c: warning: line 8: rule matches empty string [-Wmatch-empty-string]
re2c: warning: line 9: rule matches empty string [-Wmatch-empty-string]