File: yyaccept_missing_bci_eager_skip.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 (175 lines) | stat: -rw-r--r-- 3,988 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/* Generated by re2c */
// re2c $INPUT -o $OUTPUT -bci --eager-skip
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define YYGETCONDITION()  yy_state
#define YYSETCONDITION(s) yy_state = s
#define YYCTYPE         char
#define YYCURSOR        p
#define YYLIMIT         (s+l)
#define YYMARKER        q
#define YYFILL(n)

#define STATE(name)  yyc##name

static enum YYCONDTYPE yy_state;

enum YYCONDTYPE {
	yycINITIAL,
	yycST_VALUE
};


int scan(char *s, int l)
{
	char *p = s;
	char *q = 0;
	char *t;

	for(;;)
	{
		t = p;

		{
			YYCTYPE yych;
			unsigned int yyaccept = 0;
			static const unsigned char yybm_ST_VALUE[256] = {
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0, 128,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				128,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0,
				  0,   0,   0,   0,   0,   0,   0,   0
			};
			if (YYGETCONDITION() < 1) goto yyc_INITIAL;
			else goto yyc_ST_VALUE;
/* *********************************** */
yyc_INITIAL:
			if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
			yych = *YYCURSOR++;
			if (yych <= 0x00) goto yy1;
			if (yych == '$') goto yy4;
			goto yy2;
yy1:
			{ printf("EOF\n");	return 0; }
yy2:
yy3:
			{ printf("ERR\n");	return 1; }
yy4:
			yych = *YYCURSOR;
			if (yych <= '@') goto yy3;
			if (yych <= 'Z') {
				++YYCURSOR;
				goto yy5;
			}
			if (yych <= '`') goto yy3;
			if (yych >= '{') goto yy3;
			++YYCURSOR;
yy5:
			{
		printf("FOUND %s\n", t);
		continue;
	}
/* *********************************** */
yyc_ST_VALUE:
			YYMARKER = YYCURSOR;
			if (YYLIMIT <= YYCURSOR) YYFILL(1);
			yych = *YYCURSOR;
			if (yybm_ST_VALUE[0+yych] & 128) {
				++YYCURSOR;
				goto yy8;
			}
			if (yych == '$') {
				++YYCURSOR;
				goto yy9;
			}
yy7:
			{
		YYSETCONDITION(STATE(INITIAL));
		printf("Found spaces\n");
	}
yy8:
			if (YYLIMIT <= YYCURSOR) YYFILL(1);
			yych = *YYCURSOR;
			if (yybm_ST_VALUE[0+yych] & 128) {
				++YYCURSOR;
				goto yy8;
			}
			goto yy7;
yy9:
			if (YYLIMIT <= YYCURSOR) YYFILL(1);
			yych = *YYCURSOR;
			if (yych <= '@') goto yy10;
			if (yych <= 'Z') {
				++YYCURSOR;
				goto yy11;
			}
			if (yych <= '`') goto yy10;
			if (yych <= 'z') {
				++YYCURSOR;
				goto yy11;
			}
yy10:
			YYCURSOR = YYMARKER;
			if (yyaccept == 0) goto yy7;
			else goto yy12;
yy11:
			yyaccept = 1;
			YYMARKER = YYCURSOR;
			if (YYLIMIT <= YYCURSOR) YYFILL(1);
			yych = *YYCURSOR;
			if (yych == '$') {
				++YYCURSOR;
				goto yy9;
			}
yy12:
			{
		printf("Found $ or $\\<x>\n");
		continue;
	}
		}

	}
}

int main(int argc, char **argv)
{
	if (argc > 1)
	{
		return scan(argv[1], strlen(argv[1]));
	}
	else
	{
		fprintf(stderr, "%s <expr>\n", argv[0]);
		return 1;
	}
}
yyaccept_missing_bci_eager_skip.re:45:27: warning: rule in condition 'ST_VALUE' matches empty string [-Wmatch-empty-string]