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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
/* Generated by re2c */
#line 1 "cvsignore.u.re"
#define YYFILL(n) if (cursor >= limit) break;
#define YYCTYPE unsigned int
#define YYCURSOR cursor
#define YYLIMIT limit
#define YYMARKER marker
#line 16 "cvsignore.u.re"
#define APPEND(text) \
append(output, outsize, text, sizeof(text) - sizeof(YYCTYPE))
inline void append(YYCTYPE *output, size_t & outsize, const YYCTYPE * text, size_t len)
{
memcpy(output + outsize, text, len);
outsize += (len / sizeof(YYCTYPE));
}
void scan(YYCTYPE *pText, size_t *pSize, int *pbChanged)
{
// rule
// scan lines
// find $ in lines
// compact $<keyword>: .. $ to $<keyword>$
YYCTYPE *output;
const YYCTYPE *cursor, *limit, *marker;
cursor = marker = output = *pText;
size_t insize = *pSize;
size_t outsize = 0;
limit = cursor + insize;
while(1) {
loop:
#line 43 "cvsignore.u.c"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
yych = *YYCURSOR;
if (yych != '$') goto yy4;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
case 'D': goto yy10;
case 'I': goto yy9;
case 'L': goto yy8;
case 'R': goto yy7;
case 'S': goto yy5;
default: goto yy3;
}
yy3:
#line 53 "cvsignore.u.re"
{ output[outsize++] = cursor[-1]; if (cursor >= limit) break; goto loop; }
#line 61 "cvsignore.u.c"
yy4:
yych = *++YYCURSOR;
goto yy3;
yy5:
yych = *++YYCURSOR;
if (yych == 'o') goto yy44;
yy6:
YYCURSOR = YYMARKER;
goto yy3;
yy7:
yych = *++YYCURSOR;
if (yych == 'e') goto yy32;
goto yy6;
yy8:
yych = *++YYCURSOR;
if (yych == 'o') goto yy25;
goto yy6;
yy9:
yych = *++YYCURSOR;
if (yych == 'd') goto yy19;
goto yy6;
yy10:
yych = *++YYCURSOR;
if (yych != 'a') goto yy6;
yych = *++YYCURSOR;
if (yych != 't') goto yy6;
yych = *++YYCURSOR;
if (yych != 'e') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy15;
if (yych != ':') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy6;
goto yy18;
yy15:
++YYCURSOR;
#line 48 "cvsignore.u.re"
{ APPEND(L"$" L"Date$"); goto loop; }
#line 100 "cvsignore.u.c"
yy17:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy18:
if (yych == '\n') goto yy6;
if (yych == '$') goto yy15;
goto yy17;
yy19:
yych = *++YYCURSOR;
if (yych == '$') goto yy21;
if (yych != ':') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy6;
goto yy24;
yy21:
++YYCURSOR;
#line 49 "cvsignore.u.re"
{ APPEND(L"$" L"Id$"); goto loop; }
#line 120 "cvsignore.u.c"
yy23:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy24:
if (yych == '\n') goto yy6;
if (yych == '$') goto yy21;
goto yy23;
yy25:
yych = *++YYCURSOR;
if (yych != 'g') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy28;
if (yych != ':') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy6;
goto yy31;
yy28:
++YYCURSOR;
#line 50 "cvsignore.u.re"
{ APPEND(L"$" L"Log$"); goto loop; }
#line 142 "cvsignore.u.c"
yy30:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy31:
if (yych == '\n') goto yy6;
if (yych == '$') goto yy28;
goto yy30;
yy32:
yych = *++YYCURSOR;
if (yych != 'v') goto yy6;
yych = *++YYCURSOR;
if (yych != 'i') goto yy6;
yych = *++YYCURSOR;
if (yych != 's') goto yy6;
yych = *++YYCURSOR;
if (yych != 'i') goto yy6;
yych = *++YYCURSOR;
if (yych != 'o') goto yy6;
yych = *++YYCURSOR;
if (yych != 'n') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy40;
if (yych != ':') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy6;
goto yy43;
yy40:
++YYCURSOR;
#line 51 "cvsignore.u.re"
{ APPEND(L"$" L"Revision$"); goto loop; }
#line 174 "cvsignore.u.c"
yy42:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy43:
if (yych == '\n') goto yy6;
if (yych == '$') goto yy40;
goto yy42;
yy44:
yych = *++YYCURSOR;
if (yych != 'u') goto yy6;
yych = *++YYCURSOR;
if (yych != 'r') goto yy6;
yych = *++YYCURSOR;
if (yych != 'c') goto yy6;
yych = *++YYCURSOR;
if (yych != 'e') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy50;
if (yych != ':') goto yy6;
yych = *++YYCURSOR;
if (yych == '$') goto yy6;
goto yy53;
yy50:
++YYCURSOR;
#line 52 "cvsignore.u.re"
{ APPEND(L"$" L"Source$"); goto loop; }
#line 202 "cvsignore.u.c"
yy52:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy53:
if (yych == '\n') goto yy6;
if (yych == '$') goto yy50;
goto yy52;
}
#line 55 "cvsignore.u.re"
}
output[outsize] = '\0';
// set the new size
*pSize = outsize;
*pbChanged = (insize == outsize) ? 0 : 1;
}
|