/* Generated by re2c */
#line 1 "calc_001.re"
/* re2c lesson 001_upn_calculator, calc_001, (c) M. Boerger 2006 - 2007 */
#line 43 "calc_001.re"

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int scan(char *s, int l)
{
	char *p = s;
	char *q = 0;
#define YYCTYPE         char
#define YYCURSOR        p
#define YYLIMIT         (s+l)
#define YYMARKER        q
#define YYFILL(n)
	
	for(;;)
	{

#line 24 "<stdout>"
		{
			YYCTYPE yych;

			if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
			yych = *YYCURSOR;
			switch (yych) {
			case 0x00:	goto yy10;
			case '+':	goto yy6;
			case '-':	goto yy8;
			case '0':	goto yy2;
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':	goto yy4;
			default:	goto yy12;
			}
yy2:
			++YYCURSOR;
			switch ((yych = *YYCURSOR)) {
			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':	goto yy16;
			default:	goto yy3;
			}
yy3:
#line 64 "calc_001.re"
			{ printf("Num\n");	continue; }
#line 64 "<stdout>"
yy4:
			++YYCURSOR;
			yych = *YYCURSOR;
			goto yy15;
yy5:
#line 63 "calc_001.re"
			{ printf("Num\n");	continue; }
#line 72 "<stdout>"
yy6:
			++YYCURSOR;
#line 65 "calc_001.re"
			{ printf("+\n");	continue; }
#line 77 "<stdout>"
yy8:
			++YYCURSOR;
#line 66 "calc_001.re"
			{ printf("-\n");	continue; }
#line 82 "<stdout>"
yy10:
			++YYCURSOR;
#line 67 "calc_001.re"
			{ printf("EOF\n");	return 0; }
#line 87 "<stdout>"
yy12:
			++YYCURSOR;
#line 68 "calc_001.re"
			{ printf("ERR\n");	return 1; }
#line 92 "<stdout>"
yy14:
			++YYCURSOR;
			if (YYLIMIT <= YYCURSOR) YYFILL(1);
			yych = *YYCURSOR;
yy15:
			switch (yych) {
			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':	goto yy14;
			default:	goto yy5;
			}
yy16:
			++YYCURSOR;
			if (YYLIMIT <= YYCURSOR) YYFILL(1);
			yych = *YYCURSOR;
			switch (yych) {
			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':	goto yy16;
			default:	goto yy18;
			}
yy18:
#line 62 "calc_001.re"
			{ printf("Oct\n");	continue; }
#line 131 "<stdout>"
		}
#line 69 "calc_001.re"

	}
}

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;
	}
}
