/* Generated by re2c */
#include <stdio.h>
#include <stdlib.h>

#define YYMAXFILL 4


static int lex(const char *YYCURSOR)
{
    const char *YYMARKER, *n, *p, *u, *g, *f, *h, *c;
    const char *yyt1;const char *yyt2;const char *yyt3;const char *yyt4;const char *yyt5;const char *yyt6;const char *yyt7;
loop:
    
{
	char yych;
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:	goto yy2;
	case '\n':
	case ':':	goto yy6;
	default:
		yyt1 = YYCURSOR;
		goto yy4;
	}
yy2:
	++YYCURSOR;
	{ return 0; }
yy4:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 0x00:
	case '\n':	goto yy5;
	default:	goto yy8;
	}
yy5:
	{ printf("error\n"); return 1; }
yy6:
	++YYCURSOR;
	goto yy5;
yy7:
	yych = *++YYCURSOR;
yy8:
	switch (yych) {
	case 0x00:
	case '\n':	goto yy9;
	case ':':	goto yy10;
	default:	goto yy7;
	}
yy9:
	YYCURSOR = YYMARKER;
	goto yy5;
yy10:
	yych = *++YYCURSOR;
	switch (yych) {
	case 0x00:
	case '\n':	goto yy9;
	case ':':
		yyt2 = YYCURSOR;
		goto yy13;
	default:
		yyt2 = YYCURSOR;
		goto yy11;
	}
yy11:
	yych = *++YYCURSOR;
	switch (yych) {
	case 0x00:
	case '\n':	goto yy9;
	case ':':	goto yy13;
	default:	goto yy11;
	}
yy13:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
		yyt3 = YYCURSOR;
		goto yy14;
	default:	goto yy9;
	}
yy14:
	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 yy14;
	case ':':	goto yy16;
	default:	goto yy9;
	}
yy16:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
		yyt4 = YYCURSOR;
		goto yy17;
	default:	goto yy9;
	}
yy17:
	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 yy17;
	case ':':	goto yy19;
	default:	goto yy9;
	}
yy19:
	yych = *++YYCURSOR;
	switch (yych) {
	case 0x00:
	case '\n':	goto yy9;
	case ':':
		yyt5 = YYCURSOR;
		goto yy22;
	default:
		yyt5 = YYCURSOR;
		goto yy20;
	}
yy20:
	yych = *++YYCURSOR;
	switch (yych) {
	case 0x00:
	case '\n':	goto yy9;
	case ':':	goto yy22;
	default:	goto yy20;
	}
yy22:
	yych = *++YYCURSOR;
	switch (yych) {
	case '/':
		yyt6 = YYCURSOR;
		goto yy23;
	default:	goto yy9;
	}
yy23:
	yych = *++YYCURSOR;
	switch (yych) {
	case 0x00:
	case '\n':	goto yy9;
	case ':':	goto yy25;
	default:	goto yy23;
	}
yy25:
	yych = *++YYCURSOR;
	switch (yych) {
	case '/':
		yyt7 = YYCURSOR;
		goto yy26;
	default:	goto yy9;
	}
yy26:
	yych = *++YYCURSOR;
	switch (yych) {
	case 0x00:
	case ':':	goto yy9;
	case '\n':	goto yy28;
	default:	goto yy26;
	}
yy28:
	++YYCURSOR;
	n = yyt1;
	p = yyt2;
	u = yyt3;
	g = yyt4;
	f = yyt5;
	h = yyt6;
	c = yyt7;
	{
            printf("user:     %.*s\n", (int)(p - n) - 1, n);
            printf("password: %.*s\n", (int)(u - p) - 1, p);
            printf("UID:      %.*s\n", (int)(g - u) - 1, u);
            printf("GID:      %.*s\n", (int)(f - g) - 1, g);
            printf("info:     %.*s\n", (int)(h - f) - 1, f);
            printf("home:     %.*s\n", (int)(c - h) - 1, h);
            printf("command:  %.*s\n", (int)(YYCURSOR - c - 1), c);
            printf("\n");
            goto loop;
        }
}

}

int main(int argc, char **argv)
{
    if (argc < 2) {
        fprintf(stderr, "no input files\n");
        return 1;
    }

    FILE *file = fopen(argv[1], "r");

    fseek(file, 0, SEEK_END);
    const size_t fsize = (size_t) ftell(file);
    fseek(file, 0, SEEK_SET);

    char *buffer = (char*) malloc(fsize + 1);

    fread(buffer, 1, fsize, file);
    buffer[fsize] = 0;

    const int status = lex(buffer);

    fclose(file);
    free(buffer);

    return status;
}
