/* Generated by re2c */
#line 1 "cvsignore.re"
// re2c $INPUT -o $OUTPUT 

#define YYFILL(n) if (cursor >= limit) break;
#define YYCTYPE char
#define YYCURSOR cursor
#define YYLIMIT limit
#define YYMARKER marker

#line 17 "cvsignore.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 44 "cvsignore.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
	yych = *YYCURSOR;
	switch (yych) {
		case '$': goto yy3;
		default: goto yy1;
	}
yy1:
	++YYCURSOR;
yy2:
#line 54 "cvsignore.re"
	{ output[outsize++] = cursor[-1]; if (cursor >= limit) break; goto loop; }
#line 58 "cvsignore.c"
yy3:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
		case 'D': goto yy4;
		case 'I': goto yy6;
		case 'L': goto yy7;
		case 'R': goto yy8;
		case 'S': goto yy9;
		default: goto yy2;
	}
yy4:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'a': goto yy10;
		default: goto yy5;
	}
yy5:
	YYCURSOR = YYMARKER;
	goto yy2;
yy6:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'd': goto yy11;
		default: goto yy5;
	}
yy7:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'o': goto yy12;
		default: goto yy5;
	}
yy8:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'e': goto yy13;
		default: goto yy5;
	}
yy9:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'o': goto yy14;
		default: goto yy5;
	}
yy10:
	yych = *++YYCURSOR;
	switch (yych) {
		case 't': goto yy15;
		default: goto yy5;
	}
yy11:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy16;
		case ':': goto yy17;
		default: goto yy5;
	}
yy12:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'g': goto yy18;
		default: goto yy5;
	}
yy13:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'v': goto yy19;
		default: goto yy5;
	}
yy14:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'u': goto yy20;
		default: goto yy5;
	}
yy15:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'e': goto yy21;
		default: goto yy5;
	}
yy16:
	++YYCURSOR;
#line 50 "cvsignore.re"
	{ APPEND(L"$" L"Id$"); goto loop; }
#line 143 "cvsignore.c"
yy17:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy5;
		default: goto yy23;
	}
yy18:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy24;
		case ':': goto yy25;
		default: goto yy5;
	}
yy19:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'i': goto yy26;
		default: goto yy5;
	}
yy20:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'r': goto yy27;
		default: goto yy5;
	}
yy21:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy28;
		case ':': goto yy29;
		default: goto yy5;
	}
yy22:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy23:
	switch (yych) {
		case '\n': goto yy5;
		case '$': goto yy16;
		default: goto yy22;
	}
yy24:
	++YYCURSOR;
#line 51 "cvsignore.re"
	{ APPEND(L"$" L"Log$"); goto loop; }
#line 190 "cvsignore.c"
yy25:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy5;
		default: goto yy31;
	}
yy26:
	yych = *++YYCURSOR;
	switch (yych) {
		case 's': goto yy32;
		default: goto yy5;
	}
yy27:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'c': goto yy33;
		default: goto yy5;
	}
yy28:
	++YYCURSOR;
#line 49 "cvsignore.re"
	{ APPEND(L"$" L"Date$"); goto loop; }
#line 213 "cvsignore.c"
yy29:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy5;
		default: goto yy35;
	}
yy30:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy31:
	switch (yych) {
		case '\n': goto yy5;
		case '$': goto yy24;
		default: goto yy30;
	}
yy32:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'i': goto yy36;
		default: goto yy5;
	}
yy33:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'e': goto yy37;
		default: goto yy5;
	}
yy34:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy35:
	switch (yych) {
		case '\n': goto yy5;
		case '$': goto yy28;
		default: goto yy34;
	}
yy36:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'o': goto yy38;
		default: goto yy5;
	}
yy37:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy39;
		case ':': goto yy40;
		default: goto yy5;
	}
yy38:
	yych = *++YYCURSOR;
	switch (yych) {
		case 'n': goto yy41;
		default: goto yy5;
	}
yy39:
	++YYCURSOR;
#line 53 "cvsignore.re"
	{ APPEND(L"$" L"Source$"); goto loop; }
#line 275 "cvsignore.c"
yy40:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy5;
		default: goto yy43;
	}
yy41:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy44;
		case ':': goto yy45;
		default: goto yy5;
	}
yy42:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy43:
	switch (yych) {
		case '\n': goto yy5;
		case '$': goto yy39;
		default: goto yy42;
	}
yy44:
	++YYCURSOR;
#line 52 "cvsignore.re"
	{ APPEND(L"$" L"Revision$"); goto loop; }
#line 303 "cvsignore.c"
yy45:
	yych = *++YYCURSOR;
	switch (yych) {
		case '$': goto yy5;
		default: goto yy47;
	}
yy46:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy47:
	switch (yych) {
		case '\n': goto yy5;
		case '$': goto yy44;
		default: goto yy46;
	}
}
#line 56 "cvsignore.re"

	}
	output[outsize] = '\0';

	// set the new size
	*pSize = outsize;
	
	*pbChanged = (insize == outsize) ? 0 : 1;
}
