/* Generated by re2c */
#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;
			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 yy4;
			if (yych != '$') goto yy6;
			++YYCURSOR;
			if ((yych = *YYCURSOR) <= '@') goto yy3;
			if (yych <= 'Z') goto yy7;
			if (yych <= '`') goto yy3;
			if (yych <= 'z') goto yy7;
yy3:
			{ printf("ERR\n");	return 1; }
yy4:
			++YYCURSOR;
			{ printf("EOF\n");	return 0; }
yy6:
			yych = *++YYCURSOR;
			goto yy3;
yy7:
			++YYCURSOR;
			{
		printf("FOUND %s\n", t);
		continue;
	}
/* *********************************** */
yyc_ST_VALUE:
			{
				static const unsigned char yybm[] = {
					  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 (YYLIMIT <= YYCURSOR) YYFILL(1);
				yych = *(YYMARKER = YYCURSOR);
				if (yybm[0+yych] & 128) {
					goto yy14;
				}
				if (yych == '$') goto yy12;
yy11:
				{
		YYSETCONDITION(STATE(INITIAL));
		printf("Found spaces\n");
	}
yy12:
				++YYCURSOR;
				if (YYLIMIT <= YYCURSOR) YYFILL(1);
				yych = *YYCURSOR;
				if (yych <= '@') goto yy13;
				if (yych <= 'Z') goto yy16;
				if (yych <= '`') goto yy13;
				if (yych <= 'z') goto yy16;
yy13:
				YYCURSOR = YYMARKER;
				if (yyaccept <= 0) {
					goto yy11;
				} else {
					goto yy17;
				}
yy14:
				++YYCURSOR;
				if (YYLIMIT <= YYCURSOR) YYFILL(1);
				yych = *YYCURSOR;
				if (yybm[0+yych] & 128) {
					goto yy14;
				}
				goto yy11;
yy16:
				yyaccept = 1;
				YYMARKER = ++YYCURSOR;
				if (YYLIMIT <= YYCURSOR) YYFILL(1);
				yych = *YYCURSOR;
				if (yych == '$') goto yy12;
yy17:
				{
		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;
	}
}
