/* Generated by re2c */
#include <stddef.h> /* size_t */
#include <stdio.h>
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memcpy */
static void *read_file
( const char *fname
, size_t unit
, size_t padding
, size_t *pfsize
)
{
void *buffer = NULL;
size_t fsize = 0;
/* open file */
FILE *f = fopen(fname, "rb");
if(f == NULL) {
goto error;
}
/* get file size */
fseek(f, 0, SEEK_END);
fsize = (size_t) ftell(f) / unit;
fseek(f, 0, SEEK_SET);
/* allocate memory for file and padding */
buffer = malloc(unit * (fsize + padding));
if (buffer == NULL) {
goto error;
}
/* read the whole file in memory */
if (fread(buffer, unit, fsize, f) != fsize) {
goto error;
}
fclose(f);
*pfsize = fsize;
return buffer;
error:
fprintf(stderr, "error: cannot read file '%s'\n", fname);
free(buffer);
if (f != NULL) {
fclose(f);
}
return NULL;
}
#define YYCTYPE unsigned char
#define YYKEYTYPE unsigned char
#define YYPEEK() *cursor
#define YYSKIP() ++cursor
#define YYBACKUP() marker = cursor
#define YYRESTORE() cursor = marker
#define YYLESSTHAN(n) (limit - cursor) < n
#define YYFILL(n) { break; }
static int action_line144
( unsigned *pkix
, const YYKEYTYPE *keys
, const YYCTYPE *start
, const YYCTYPE *token
, const YYCTYPE **cursor
, YYKEYTYPE rule_act
)
{
const unsigned kix = *pkix;
const long pos = token - start;
const long len_act = *cursor - token;
const long len_exp = (long) keys[kix + 1];
const YYKEYTYPE rule_exp = keys[kix + 2];
*pkix = kix + 3;
if (rule_exp == 255) {
fprintf
( stderr
, "warning: lex_line144: control flow is undefined for input"
" at position %ld, rerun re2c with '-W'\n"
, pos
);
}
if (len_act == len_exp && rule_act == rule_exp) {
const YYKEYTYPE offset = keys[kix];
*cursor = token + offset;
return 0;
} else {
fprintf
( stderr
, "error: lex_line144: at position %ld (key %u):\n"
"\texpected: match length %ld, rule %u\n"
"\tactual: match length %ld, rule %u\n"
, pos
, kix
, len_exp
, rule_exp
, len_act
, rule_act
);
return 1;
}
}
static int check_key_count_line144(unsigned have, unsigned used, unsigned need)
{
if (used + need <= have) return 0;
fprintf(stderr, "error: lex_line144: not enough keys\n");
return 1;
}
int lex_line144()
{
const size_t padding = 11; /* YYMAXFILL */
int status = 0;
size_t input_len = 0;
size_t keys_count = 0;
YYCTYPE *input = NULL;
YYKEYTYPE *keys = NULL;
const YYCTYPE *cursor = NULL;
const YYCTYPE *limit = NULL;
const YYCTYPE *token = NULL;
const YYCTYPE *eof = NULL;
unsigned int i = 0;
input = (YYCTYPE *) read_file
("scanner.--skeleton.c.line144.input"
, sizeof (YYCTYPE)
, padding
, &input_len
);
if (input == NULL) {
status = 1;
goto end;
}
keys = (YYKEYTYPE *) read_file
("scanner.--skeleton.c.line144.keys"
, sizeof (YYKEYTYPE)
, 0
, &keys_count
);
if (keys == NULL) {
status = 1;
goto end;
}
cursor = input;
limit = input + input_len + padding;
eof = input + input_len;
for (i = 0; status == 0 && cursor < eof && i < keys_count;) {
token = cursor;
const YYCTYPE *marker = NULL;
YYCTYPE yych;
if (YYLESSTHAN (11)) YYFILL(11);
yych = YYPEEK ();
switch (yych) {
case 0x00: goto yy2;
case '\n': goto yy6;
case '*': goto yy8;
case '/': goto yy9;
default: goto yy4;
}
yy2:
YYSKIP ();
status = check_key_count_line144(keys_count, i, 3)
|| action_line144(&i, keys, input, token, &cursor, 4);
continue;
yy4:
YYSKIP ();
yy5:
status = check_key_count_line144(keys_count, i, 3)
|| action_line144(&i, keys, input, token, &cursor, 5);
continue;
yy6:
YYSKIP ();
status = check_key_count_line144(keys_count, i, 3)
|| action_line144(&i, keys, input, token, &cursor, 3);
continue;
yy8:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '/': goto yy10;
default: goto yy5;
}
yy9:
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '*': goto yy12;
default: goto yy5;
}
yy10:
YYSKIP ();
status = check_key_count_line144(keys_count, i, 3)
|| action_line144(&i, keys, input, token, &cursor, 2);
continue;
yy12:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '!': goto yy14;
default: goto yy13;
}
yy13:
YYRESTORE ();
goto yy5;
yy14:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'm': goto yy15;
case 'r': goto yy16;
default: goto yy13;
}
yy15:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'a': goto yy17;
default: goto yy13;
}
yy16:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'e': goto yy18;
default: goto yy13;
}
yy17:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'x': goto yy19;
default: goto yy13;
}
yy18:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '2': goto yy20;
default: goto yy13;
}
yy19:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case ':': goto yy21;
default: goto yy13;
}
yy20:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'c': goto yy22;
default: goto yy13;
}
yy21:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'r': goto yy24;
default: goto yy13;
}
yy22:
YYSKIP ();
status = check_key_count_line144(keys_count, i, 3)
|| action_line144(&i, keys, input, token, &cursor, 0);
continue;
yy24:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'e': goto yy25;
default: goto yy13;
}
yy25:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '2': goto yy26;
default: goto yy13;
}
yy26:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'c': goto yy27;
default: goto yy13;
}
yy27:
YYSKIP ();
status = check_key_count_line144(keys_count, i, 3)
|| action_line144(&i, keys, input, token, &cursor, 1);
continue;
}
if (status == 0) {
if (cursor != eof) {
status = 1;
const long pos = token - input;
fprintf(stderr, "error: lex_line144: unused input strings left at position %ld\n", pos);
}
if (i != keys_count) {
status = 1;
fprintf(stderr, "error: lex_line144: unused keys left after %u keys\n", i);
}
}
end:
free(input);
free(keys);
return status;
}
#undef YYCTYPE
#undef YYKEYTYPE
#undef YYPEEK
#undef YYSKIP
#undef YYBACKUP
#undef YYRESTORE
#undef YYLESSTHAN
#undef YYFILL
#define YYCTYPE unsigned char
#define YYKEYTYPE unsigned char
#define YYPEEK() *cursor
#define YYSKIP() ++cursor
#define YYBACKUP() marker = cursor
#define YYRESTORE() cursor = marker
#define YYLESSTHAN(n) (limit - cursor) < n
#define YYFILL(n) { break; }
static int action_line247
( unsigned *pkix
, const YYKEYTYPE *keys
, const YYCTYPE *start
, const YYCTYPE *token
, const YYCTYPE **cursor
, YYKEYTYPE rule_act
)
{
const unsigned kix = *pkix;
const long pos = token - start;
const long len_act = *cursor - token;
const long len_exp = (long) keys[kix + 1];
const YYKEYTYPE rule_exp = keys[kix + 2];
*pkix = kix + 3;
if (rule_exp == 255) {
fprintf
( stderr
, "warning: lex_line247: control flow is undefined for input"
" at position %ld, rerun re2c with '-W'\n"
, pos
);
}
if (len_act == len_exp && rule_act == rule_exp) {
const YYKEYTYPE offset = keys[kix];
*cursor = token + offset;
return 0;
} else {
fprintf
( stderr
, "error: lex_line247: at position %ld (key %u):\n"
"\texpected: match length %ld, rule %u\n"
"\tactual: match length %ld, rule %u\n"
, pos
, kix
, len_exp
, rule_exp
, len_act
, rule_act
);
return 1;
}
}
static int check_key_count_line247(unsigned have, unsigned used, unsigned need)
{
if (used + need <= have) return 0;
fprintf(stderr, "error: lex_line247: not enough keys\n");
return 1;
}
int lex_line247()
{
const size_t padding = 5; /* YYMAXFILL */
int status = 0;
size_t input_len = 0;
size_t keys_count = 0;
YYCTYPE *input = NULL;
YYKEYTYPE *keys = NULL;
const YYCTYPE *cursor = NULL;
const YYCTYPE *limit = NULL;
const YYCTYPE *token = NULL;
const YYCTYPE *eof = NULL;
unsigned int i = 0;
input = (YYCTYPE *) read_file
("scanner.--skeleton.c.line247.input"
, sizeof (YYCTYPE)
, padding
, &input_len
);
if (input == NULL) {
status = 1;
goto end;
}
keys = (YYKEYTYPE *) read_file
("scanner.--skeleton.c.line247.keys"
, sizeof (YYKEYTYPE)
, 0
, &keys_count
);
if (keys == NULL) {
status = 1;
goto end;
}
cursor = input;
limit = input + input_len + padding;
eof = input + input_len;
for (i = 0; status == 0 && cursor < eof && i < keys_count;) {
token = cursor;
const YYCTYPE *marker = NULL;
YYCTYPE yych;
unsigned int yyaccept = 0;
if (YYLESSTHAN (5)) YYFILL(5);
yych = YYPEEK ();
switch (yych) {
case '\t':
case ' ': goto yy33;
case '\n': goto yy36;
case '\r': goto yy38;
case '"': goto yy39;
case '\'': goto yy41;
case '(':
case ')':
case ';':
case '=':
case '\\':
case '|': goto yy43;
case '*': goto yy45;
case '+':
case '?': goto yy47;
case '.': goto yy48;
case '/': goto yy50;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy51;
case '[': goto yy54;
case 'r': goto yy56;
case '{': goto yy57;
default: goto yy31;
}
yy31:
YYSKIP ();
yy32:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 22);
continue;
yy33:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case ' ': goto yy33;
default: goto yy35;
}
yy35:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 20);
continue;
yy36:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 21);
continue;
yy38:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy36;
default: goto yy32;
}
yy39:
yyaccept = 0;
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy40;
default: goto yy60;
}
yy40:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 5);
continue;
yy41:
yyaccept = 1;
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy42;
default: goto yy66;
}
yy42:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 6);
continue;
yy43:
YYSKIP ();
yy44:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 10);
continue;
yy45:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '/': goto yy70;
default: goto yy46;
}
yy46:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 11);
continue;
yy47:
YYSKIP ();
goto yy46;
yy48:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 19);
continue;
yy50:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '*': goto yy72;
default: goto yy44;
}
yy51:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
yy52:
switch (yych) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy51;
default: goto yy53;
}
yy53:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 18);
continue;
yy54:
yyaccept = 2;
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy55;
case '^': goto yy79;
default: goto yy75;
}
yy55:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 9);
continue;
yy56:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'e': goto yy81;
default: goto yy52;
}
yy57:
yyaccept = 3;
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case ',': goto yy82;
case '0': goto yy84;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy85;
default: goto yy58;
}
yy58:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 0);
continue;
yy59:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
yy60:
switch (yych) {
case '\n': goto yy61;
case '"': goto yy62;
case '\\': goto yy64;
default: goto yy59;
}
yy61:
YYRESTORE ();
switch (yyaccept) {
case 0: goto yy40;
case 1: goto yy42;
case 2: goto yy55;
case 3: goto yy58;
case 4: goto yy83;
case 5: goto yy53;
default: goto yy107;
}
yy62:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 3);
continue;
yy64:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy61;
default: goto yy59;
}
yy65:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
yy66:
switch (yych) {
case '\n': goto yy61;
case '\'': goto yy67;
case '\\': goto yy69;
default: goto yy65;
}
yy67:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 4);
continue;
yy69:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy61;
default: goto yy65;
}
yy70:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 2);
continue;
yy72:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 1);
continue;
yy74:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
yy75:
switch (yych) {
case '\n': goto yy61;
case '\\': goto yy76;
case ']': goto yy77;
default: goto yy74;
}
yy76:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy61;
default: goto yy74;
}
yy77:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 8);
continue;
yy79:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy61;
case '\\': goto yy87;
case ']': goto yy88;
default: goto yy79;
}
yy81:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '2': goto yy90;
default: goto yy52;
}
yy82:
YYSKIP ();
yy83:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 16);
continue;
yy84:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case ',': goto yy91;
default: goto yy86;
}
yy85:
YYSKIP ();
if (YYLESSTHAN (2)) YYFILL(2);
yych = YYPEEK ();
yy86:
switch (yych) {
case ',': goto yy94;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy85;
case '}': goto yy92;
default: goto yy61;
}
yy87:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy61;
default: goto yy79;
}
yy88:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 7);
continue;
yy90:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case 'c': goto yy95;
default: goto yy52;
}
yy91:
yyaccept = 4;
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy96;
case '}': goto yy98;
default: goto yy83;
}
yy92:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 13);
continue;
yy94:
yyaccept = 4;
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy96;
case '}': goto yy100;
default: goto yy83;
}
yy95:
yyaccept = 5;
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case ':': goto yy102;
default: goto yy52;
}
yy96:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy96;
case '}': goto yy103;
default: goto yy61;
}
yy98:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 12);
continue;
yy100:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 15);
continue;
yy102:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy105;
default: goto yy61;
}
yy103:
YYSKIP ();
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 14);
continue;
yy105:
yyaccept = 6;
YYSKIP ();
YYBACKUP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy105;
case ':': goto yy102;
default: goto yy107;
}
yy107:
status = check_key_count_line247(keys_count, i, 3)
|| action_line247(&i, keys, input, token, &cursor, 17);
continue;
}
if (status == 0) {
if (cursor != eof) {
status = 1;
const long pos = token - input;
fprintf(stderr, "error: lex_line247: unused input strings left at position %ld\n", pos);
}
if (i != keys_count) {
status = 1;
fprintf(stderr, "error: lex_line247: unused keys left after %u keys\n", i);
}
}
end:
free(input);
free(keys);
return status;
}
#undef YYCTYPE
#undef YYKEYTYPE
#undef YYPEEK
#undef YYSKIP
#undef YYBACKUP
#undef YYRESTORE
#undef YYLESSTHAN
#undef YYFILL
#define YYCTYPE unsigned char
#define YYKEYTYPE unsigned char
#define YYPEEK() *cursor
#define YYSKIP() ++cursor
#define YYBACKUP() marker = cursor
#define YYRESTORE() cursor = marker
#define YYLESSTHAN(n) (limit - cursor) < n
#define YYFILL(n) { break; }
static int action_line264
( unsigned *pkix
, const YYKEYTYPE *keys
, const YYCTYPE *start
, const YYCTYPE *token
, const YYCTYPE **cursor
, YYKEYTYPE rule_act
)
{
const unsigned kix = *pkix;
const long pos = token - start;
const long len_act = *cursor - token;
const long len_exp = (long) keys[kix + 1];
const YYKEYTYPE rule_exp = keys[kix + 2];
*pkix = kix + 3;
if (rule_exp == 255) {
fprintf
( stderr
, "warning: lex_line264: control flow is undefined for input"
" at position %ld, rerun re2c with '-W'\n"
, pos
);
}
if (len_act == len_exp && rule_act == rule_exp) {
const YYKEYTYPE offset = keys[kix];
*cursor = token + offset;
return 0;
} else {
fprintf
( stderr
, "error: lex_line264: at position %ld (key %u):\n"
"\texpected: match length %ld, rule %u\n"
"\tactual: match length %ld, rule %u\n"
, pos
, kix
, len_exp
, rule_exp
, len_act
, rule_act
);
return 1;
}
}
static int check_key_count_line264(unsigned have, unsigned used, unsigned need)
{
if (used + need <= have) return 0;
fprintf(stderr, "error: lex_line264: not enough keys\n");
return 1;
}
int lex_line264()
{
const size_t padding = 2; /* YYMAXFILL */
int status = 0;
size_t input_len = 0;
size_t keys_count = 0;
YYCTYPE *input = NULL;
YYKEYTYPE *keys = NULL;
const YYCTYPE *cursor = NULL;
const YYCTYPE *limit = NULL;
const YYCTYPE *token = NULL;
const YYCTYPE *eof = NULL;
unsigned int i = 0;
input = (YYCTYPE *) read_file
("scanner.--skeleton.c.line264.input"
, sizeof (YYCTYPE)
, padding
, &input_len
);
if (input == NULL) {
status = 1;
goto end;
}
keys = (YYKEYTYPE *) read_file
("scanner.--skeleton.c.line264.keys"
, sizeof (YYKEYTYPE)
, 0
, &keys_count
);
if (keys == NULL) {
status = 1;
goto end;
}
cursor = input;
limit = input + input_len + padding;
eof = input + input_len;
for (i = 0; status == 0 && cursor < eof && i < keys_count;) {
token = cursor;
const YYCTYPE *marker = NULL;
YYCTYPE yych;
if (YYLESSTHAN (2)) YYFILL(2);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy112;
case '"': goto yy114;
case '\'': goto yy115;
case '{': goto yy116;
case '}': goto yy118;
default: goto yy110;
}
yy110:
YYSKIP ();
yy111:
status = check_key_count_line264(keys_count, i, 3)
|| action_line264(&i, keys, input, token, &cursor, 3);
continue;
yy112:
YYSKIP ();
status = check_key_count_line264(keys_count, i, 3)
|| action_line264(&i, keys, input, token, &cursor, 2);
continue;
yy114:
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy111;
default: goto yy121;
}
yy115:
YYSKIP ();
YYBACKUP ();
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy111;
default: goto yy125;
}
yy116:
YYSKIP ();
status = check_key_count_line264(keys_count, i, 3)
|| action_line264(&i, keys, input, token, &cursor, 1);
continue;
yy118:
YYSKIP ();
status = check_key_count_line264(keys_count, i, 3)
|| action_line264(&i, keys, input, token, &cursor, 0);
continue;
yy120:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
yy121:
switch (yych) {
case '\n': goto yy122;
case '"': goto yy110;
case '\\': goto yy123;
default: goto yy120;
}
yy122:
YYRESTORE ();
goto yy111;
yy123:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy122;
default: goto yy120;
}
yy124:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
yy125:
switch (yych) {
case '\n': goto yy122;
case '\'': goto yy110;
case '\\': goto yy126;
default: goto yy124;
}
yy126:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy122;
default: goto yy124;
}
}
if (status == 0) {
if (cursor != eof) {
status = 1;
const long pos = token - input;
fprintf(stderr, "error: lex_line264: unused input strings left at position %ld\n", pos);
}
if (i != keys_count) {
status = 1;
fprintf(stderr, "error: lex_line264: unused keys left after %u keys\n", i);
}
}
end:
free(input);
free(keys);
return status;
}
#undef YYCTYPE
#undef YYKEYTYPE
#undef YYPEEK
#undef YYSKIP
#undef YYBACKUP
#undef YYRESTORE
#undef YYLESSTHAN
#undef YYFILL
#define YYCTYPE unsigned char
#define YYKEYTYPE unsigned char
#define YYPEEK() *cursor
#define YYSKIP() ++cursor
#define YYLESSTHAN(n) (limit - cursor) < n
#define YYFILL(n) { break; }
static int action_line281
( unsigned *pkix
, const YYKEYTYPE *keys
, const YYCTYPE *start
, const YYCTYPE *token
, const YYCTYPE **cursor
, YYKEYTYPE rule_act
)
{
const unsigned kix = *pkix;
const long pos = token - start;
const long len_act = *cursor - token;
const long len_exp = (long) keys[kix + 1];
const YYKEYTYPE rule_exp = keys[kix + 2];
*pkix = kix + 3;
if (rule_exp == 255) {
fprintf
( stderr
, "warning: lex_line281: control flow is undefined for input"
" at position %ld, rerun re2c with '-W'\n"
, pos
);
}
if (len_act == len_exp && rule_act == rule_exp) {
const YYKEYTYPE offset = keys[kix];
*cursor = token + offset;
return 0;
} else {
fprintf
( stderr
, "error: lex_line281: at position %ld (key %u):\n"
"\texpected: match length %ld, rule %u\n"
"\tactual: match length %ld, rule %u\n"
, pos
, kix
, len_exp
, rule_exp
, len_act
, rule_act
);
return 1;
}
}
static int check_key_count_line281(unsigned have, unsigned used, unsigned need)
{
if (used + need <= have) return 0;
fprintf(stderr, "error: lex_line281: not enough keys\n");
return 1;
}
int lex_line281()
{
const size_t padding = 2; /* YYMAXFILL */
int status = 0;
size_t input_len = 0;
size_t keys_count = 0;
YYCTYPE *input = NULL;
YYKEYTYPE *keys = NULL;
const YYCTYPE *cursor = NULL;
const YYCTYPE *limit = NULL;
const YYCTYPE *token = NULL;
const YYCTYPE *eof = NULL;
unsigned int i = 0;
input = (YYCTYPE *) read_file
("scanner.--skeleton.c.line281.input"
, sizeof (YYCTYPE)
, padding
, &input_len
);
if (input == NULL) {
status = 1;
goto end;
}
keys = (YYKEYTYPE *) read_file
("scanner.--skeleton.c.line281.keys"
, sizeof (YYKEYTYPE)
, 0
, &keys_count
);
if (keys == NULL) {
status = 1;
goto end;
}
cursor = input;
limit = input + input_len + padding;
eof = input + input_len;
for (i = 0; status == 0 && cursor < eof && i < keys_count;) {
token = cursor;
YYCTYPE yych;
if (YYLESSTHAN (2)) YYFILL(2);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy131;
case '*': goto yy133;
case '/': goto yy134;
default: goto yy129;
}
yy129:
YYSKIP ();
yy130:
status = check_key_count_line281(keys_count, i, 3)
|| action_line281(&i, keys, input, token, &cursor, 3);
continue;
yy131:
YYSKIP ();
status = check_key_count_line281(keys_count, i, 3)
|| action_line281(&i, keys, input, token, &cursor, 2);
continue;
yy133:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '/': goto yy135;
default: goto yy130;
}
yy134:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '*': goto yy137;
default: goto yy130;
}
yy135:
YYSKIP ();
status = check_key_count_line281(keys_count, i, 3)
|| action_line281(&i, keys, input, token, &cursor, 0);
continue;
yy137:
YYSKIP ();
status = check_key_count_line281(keys_count, i, 3)
|| action_line281(&i, keys, input, token, &cursor, 1);
continue;
}
if (status == 0) {
if (cursor != eof) {
status = 1;
const long pos = token - input;
fprintf(stderr, "error: lex_line281: unused input strings left at position %ld\n", pos);
}
if (i != keys_count) {
status = 1;
fprintf(stderr, "error: lex_line281: unused keys left after %u keys\n", i);
}
}
end:
free(input);
free(keys);
return status;
}
#undef YYCTYPE
#undef YYKEYTYPE
#undef YYPEEK
#undef YYSKIP
#undef YYLESSTHAN
#undef YYFILL
#define YYCTYPE unsigned char
#define YYKEYTYPE unsigned char
#define YYPEEK() *cursor
#define YYSKIP() ++cursor
#define YYLESSTHAN(n) (limit - cursor) < n
#define YYFILL(n) { break; }
static int action_line291
( unsigned *pkix
, const YYKEYTYPE *keys
, const YYCTYPE *start
, const YYCTYPE *token
, const YYCTYPE **cursor
, YYKEYTYPE rule_act
)
{
const unsigned kix = *pkix;
const long pos = token - start;
const long len_act = *cursor - token;
const long len_exp = (long) keys[kix + 1];
const YYKEYTYPE rule_exp = keys[kix + 2];
*pkix = kix + 3;
if (rule_exp == 255) {
fprintf
( stderr
, "warning: lex_line291: control flow is undefined for input"
" at position %ld, rerun re2c with '-W'\n"
, pos
);
}
if (len_act == len_exp && rule_act == rule_exp) {
const YYKEYTYPE offset = keys[kix];
*cursor = token + offset;
return 0;
} else {
fprintf
( stderr
, "error: lex_line291: at position %ld (key %u):\n"
"\texpected: match length %ld, rule %u\n"
"\tactual: match length %ld, rule %u\n"
, pos
, kix
, len_exp
, rule_exp
, len_act
, rule_act
);
return 1;
}
}
static int check_key_count_line291(unsigned have, unsigned used, unsigned need)
{
if (used + need <= have) return 0;
fprintf(stderr, "error: lex_line291: not enough keys\n");
return 1;
}
int lex_line291()
{
const size_t padding = 1; /* YYMAXFILL */
int status = 0;
size_t input_len = 0;
size_t keys_count = 0;
YYCTYPE *input = NULL;
YYKEYTYPE *keys = NULL;
const YYCTYPE *cursor = NULL;
const YYCTYPE *limit = NULL;
const YYCTYPE *token = NULL;
const YYCTYPE *eof = NULL;
unsigned int i = 0;
input = (YYCTYPE *) read_file
("scanner.--skeleton.c.line291.input"
, sizeof (YYCTYPE)
, padding
, &input_len
);
if (input == NULL) {
status = 1;
goto end;
}
keys = (YYKEYTYPE *) read_file
("scanner.--skeleton.c.line291.keys"
, sizeof (YYKEYTYPE)
, 0
, &keys_count
);
if (keys == NULL) {
status = 1;
goto end;
}
cursor = input;
limit = input + input_len + padding;
eof = input + input_len;
for (i = 0; status == 0 && cursor < eof && i < keys_count;) {
token = cursor;
YYCTYPE yych;
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case ' ': goto yy143;
case '=': goto yy146;
default: goto yy141;
}
yy141:
YYSKIP ();
status = check_key_count_line291(keys_count, i, 3)
|| action_line291(&i, keys, input, token, &cursor, 2);
continue;
yy143:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case ' ': goto yy143;
default: goto yy145;
}
yy145:
status = check_key_count_line291(keys_count, i, 3)
|| action_line291(&i, keys, input, token, &cursor, 0);
continue;
yy146:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case ' ': goto yy146;
default: goto yy148;
}
yy148:
status = check_key_count_line291(keys_count, i, 3)
|| action_line291(&i, keys, input, token, &cursor, 1);
continue;
}
if (status == 0) {
if (cursor != eof) {
status = 1;
const long pos = token - input;
fprintf(stderr, "error: lex_line291: unused input strings left at position %ld\n", pos);
}
if (i != keys_count) {
status = 1;
fprintf(stderr, "error: lex_line291: unused keys left after %u keys\n", i);
}
}
end:
free(input);
free(keys);
return status;
}
#undef YYCTYPE
#undef YYKEYTYPE
#undef YYPEEK
#undef YYSKIP
#undef YYLESSTHAN
#undef YYFILL
#define YYCTYPE unsigned char
#define YYKEYTYPE unsigned char
#define YYPEEK() *cursor
#define YYSKIP() ++cursor
#define YYBACKUP() marker = cursor
#define YYRESTORE() cursor = marker
#define YYLESSTHAN(n) (limit - cursor) < n
#define YYFILL(n) { break; }
static int action_line305
( unsigned *pkix
, const YYKEYTYPE *keys
, const YYCTYPE *start
, const YYCTYPE *token
, const YYCTYPE **cursor
, YYKEYTYPE rule_act
)
{
const unsigned kix = *pkix;
const long pos = token - start;
const long len_act = *cursor - token;
const long len_exp = (long) keys[kix + 1];
const YYKEYTYPE rule_exp = keys[kix + 2];
*pkix = kix + 3;
if (rule_exp == 255) {
fprintf
( stderr
, "warning: lex_line305: control flow is undefined for input"
" at position %ld, rerun re2c with '-W'\n"
, pos
);
}
if (len_act == len_exp && rule_act == rule_exp) {
const YYKEYTYPE offset = keys[kix];
*cursor = token + offset;
return 0;
} else {
fprintf
( stderr
, "error: lex_line305: at position %ld (key %u):\n"
"\texpected: match length %ld, rule %u\n"
"\tactual: match length %ld, rule %u\n"
, pos
, kix
, len_exp
, rule_exp
, len_act
, rule_act
);
return 1;
}
}
static int check_key_count_line305(unsigned have, unsigned used, unsigned need)
{
if (used + need <= have) return 0;
fprintf(stderr, "error: lex_line305: not enough keys\n");
return 1;
}
int lex_line305()
{
const size_t padding = 2; /* YYMAXFILL */
int status = 0;
size_t input_len = 0;
size_t keys_count = 0;
YYCTYPE *input = NULL;
YYKEYTYPE *keys = NULL;
const YYCTYPE *cursor = NULL;
const YYCTYPE *limit = NULL;
const YYCTYPE *token = NULL;
const YYCTYPE *eof = NULL;
unsigned int i = 0;
input = (YYCTYPE *) read_file
("scanner.--skeleton.c.line305.input"
, sizeof (YYCTYPE)
, padding
, &input_len
);
if (input == NULL) {
status = 1;
goto end;
}
keys = (YYKEYTYPE *) read_file
("scanner.--skeleton.c.line305.keys"
, sizeof (YYKEYTYPE)
, 0
, &keys_count
);
if (keys == NULL) {
status = 1;
goto end;
}
cursor = input;
limit = input + input_len + padding;
eof = input + input_len;
for (i = 0; status == 0 && cursor < eof && i < keys_count;) {
token = cursor;
const YYCTYPE *marker = NULL;
YYCTYPE yych;
if (YYLESSTHAN (2)) YYFILL(2);
yych = YYPEEK ();
switch (yych) {
case '\t':
case '\n':
case '\r':
case ' ':
case ';': goto yy151;
case '"': goto yy154;
case '\'': goto yy156;
case '-': goto yy158;
case '0': goto yy159;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy161;
default: goto yy152;
}
yy151:
status = check_key_count_line305(keys_count, i, 3)
|| action_line305(&i, keys, input, token, &cursor, 1);
continue;
yy152:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
yy153:
switch (yych) {
case '\t':
case '\n':
case '\r':
case ' ':
case ';': goto yy151;
default: goto yy152;
}
yy154:
YYSKIP ();
YYBACKUP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case '\r':
case ' ':
case ';': goto yy163;
case '\n': goto yy151;
case '"': goto yy152;
case '\\': goto yy166;
default: goto yy154;
}
yy156:
YYSKIP ();
YYBACKUP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case '\r':
case ' ':
case ';': goto yy167;
case '\n': goto yy151;
case '\'': goto yy152;
case '\\': goto yy169;
default: goto yy156;
}
yy158:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy161;
default: goto yy153;
}
yy159:
YYSKIP ();
yych = YYPEEK ();
switch (yych) {
case '\t':
case '\n':
case '\r':
case ' ':
case ';': goto yy160;
default: goto yy152;
}
yy160:
status = check_key_count_line305(keys_count, i, 3)
|| action_line305(&i, keys, input, token, &cursor, 0);
continue;
yy161:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case '\n':
case '\r':
case ' ':
case ';': goto yy160;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy161;
default: goto yy152;
}
yy163:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy165;
case '"': goto yy170;
case '\\': goto yy171;
default: goto yy163;
}
yy165:
YYRESTORE ();
goto yy151;
yy166:
YYSKIP ();
YYBACKUP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case '\r':
case ' ':
case ';': goto yy163;
case '\n': goto yy151;
default: goto yy154;
}
yy167:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy165;
case '\'': goto yy170;
case '\\': goto yy172;
default: goto yy167;
}
yy169:
YYSKIP ();
YYBACKUP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\t':
case '\r':
case ' ':
case ';': goto yy167;
case '\n': goto yy151;
default: goto yy156;
}
yy170:
YYSKIP ();
goto yy151;
yy171:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy165;
default: goto yy163;
}
yy172:
YYSKIP ();
if (YYLESSTHAN (1)) YYFILL(1);
yych = YYPEEK ();
switch (yych) {
case '\n': goto yy165;
default: goto yy167;
}
}
if (status == 0) {
if (cursor != eof) {
status = 1;
const long pos = token - input;
fprintf(stderr, "error: lex_line305: unused input strings left at position %ld\n", pos);
}
if (i != keys_count) {
status = 1;
fprintf(stderr, "error: lex_line305: unused keys left after %u keys\n", i);
}
}
end:
free(input);
free(keys);
return status;
}
#undef YYCTYPE
#undef YYKEYTYPE
#undef YYPEEK
#undef YYSKIP
#undef YYBACKUP
#undef YYRESTORE
#undef YYLESSTHAN
#undef YYFILL
int main()
{
if(lex_line144() != 0) {
return 1;
}
if(lex_line247() != 0) {
return 1;
}
if(lex_line264() != 0) {
return 1;
}
if(lex_line281() != 0) {
return 1;
}
if(lex_line291() != 0) {
return 1;
}
if(lex_line305() != 0) {
return 1;
}
return 0;
}
|