From 1a028ffaede9f226d4c26ca5206e84d1774d1688 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sat, 12 Nov 2016 15:24:57 +0000 Subject: [PATCH] Skeleton: check tags. Calculate final tag values during string generation and put them into '.keys' file together with the length of the consumed / matched input and the matching rule number. Each pack of keys only gets those tags that belong to the matching rule (no tags for default paths or paths corresponding to untagged rules). Tags do not include trailing context, as it is already included into the length of matching input. --- re2c/src/codegen/emit_action.cc | 2 +- re2c/src/ir/skeleton/generate_code.cc | 80 +- re2c/src/ir/skeleton/generate_data.cc | 35 +- re2c/src/ir/skeleton/skeleton.h | 3 +- re2c/test/bug1163046.--skeleton.c | 36 +- re2c/test/calc_008.b--skeleton.c | Bin 18429 -> 19085 bytes re2c/test/condition_10.cgif--skeleton.c | 180 +- re2c/test/config10.--skeleton.c | Bin 17756 -> 18287 bytes re2c/test/control_flow_fail.--skeleton.c | Bin 10908 -> 11261 bytes re2c/test/control_flow_ok.--skeleton.c | Bin 7423 -> 7776 bytes .../control_flow_yymarker_fail.--skeleton.c | Bin 10357 -> 10710 bytes .../control_flow_yymarker_ok.--skeleton.c | Bin 8241 -> 8594 bytes ...l_flow_yymarker_yyaccept_fail.--skeleton.c | Bin 14805 -> 15215 bytes ...rol_flow_yymarker_yyaccept_ok.--skeleton.c | Bin 12143 -> 12553 bytes re2c/test/ctx.--skeleton.c | Bin 17746 -> 18277 bytes ...custom_default.--skeleton--input(custom).c | Bin 49015 -> 49372 bytes ...t_custom_fgetc.--skeleton--input(custom).c | Bin 49011 -> 49368 bytes ..._istringstream.--skeleton--input(custom).c | Bin 49027 -> 49384 bytes ...t_custom_mjson.--skeleton--input(custom).c | 138 +- ...0150211_parse_iso_intervals.ig--skeleton.c | 48 +- .../php20150211_pdo_sql_parser.ig--skeleton.c | 51 +- ...0211_pdo_sql_parser_trimmed.ig--skeleton.c | 54 +- ...php20150211_phar_path_check.ig--skeleton.c | 54 +- .../php20150211_url_scanner_ex.ig--skeleton.c | 249 +- ...hp20150211_var_unserializer.ig--skeleton.c | 69 +- ...cd--skeleton--flex-syntax--case-inverted.c | 384 +- ...cd--skeleton--flex-syntax--case-inverted.c | 783 ++-- re2c/test/push.--skeleton.c | 87 +- re2c/test/repeat-01.cgir--skeleton.c | 75 +- re2c/test/repeat-02.cgir--skeleton.c | 75 +- re2c/test/repeat-03.cgir--skeleton.c | 156 +- re2c/test/repeat-06.gir--skeleton.c | 135 +- re2c/test/repeat-07_default.gir--skeleton.c | 144 +- .../reuse_conds_default_0.cgir--skeleton.c | 162 +- .../reuse_conds_default_1.cgir--skeleton.c | 165 +- re2c/test/rexx.--skeleton.c | 393 +- re2c/test/scanner.--skeleton.c | 288 +- re2c/test/strip_003.b--skeleton.c | 144 +- ...cks.8--skeleton--encoding-policy(ignore).c | 3498 +++++++++++------ ...cks.u--skeleton--encoding-policy(ignore).c | 3498 +++++++++++------ ...cks.x--skeleton--encoding-policy(ignore).c | 3498 +++++++++++------ 41 files changed, 9661 insertions(+), 4823 deletions(-) diff --git a/re2c/src/codegen/emit_action.cc b/re2c/src/codegen/emit_action.cc index 4fce6b5d..12f82a46 100644 --- a/re2c/src/codegen/emit_action.cc +++ b/re2c/src/codegen/emit_action.cc @@ -219,7 +219,7 @@ void emit_rule(OutputFile &o, uint32_t ind, const DFA &dfa, size_t rule_idx) gen_fintags(o, ind, dfa, rule); if (opts->target == opt_t::SKELETON) { - emit_action(o, ind, dfa.name, dfa.key_size, dfa.def_rule, rule_idx); + emit_action(o, ind, dfa, rule_idx); } else { const std::string &cond = info->newcond; if (!cond.empty() && dfa.cond != cond) { diff --git a/re2c/src/ir/skeleton/generate_code.cc b/re2c/src/ir/skeleton/generate_code.cc index 577c462c..a4342744 100644 --- a/re2c/src/ir/skeleton/generate_code.cc +++ b/re2c/src/ir/skeleton/generate_code.cc @@ -10,6 +10,7 @@ #include "src/conf/opt.h" #include "src/globals.h" #include "src/ir/regexp/encoding/enc.h" +#include "src/ir/adfa/adfa.h" #include "src/ir/skeleton/skeleton.h" namespace re2c @@ -127,7 +128,7 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, o.ws("\n#define YYFILL(n) { break; }"); o.ws("\n"); o.ws("\nstatic int action_").wstring(name); - o.ws("\n").wind(1).ws("( unsigned int i"); + o.ws("\n").wind(1).ws("( unsigned *pkix"); o.ws("\n").wind(1).ws(", const YYKEYTYPE *keys"); o.ws("\n").wind(1).ws(", const YYCTYPE *start"); o.ws("\n").wind(1).ws(", const YYCTYPE *token"); @@ -135,10 +136,12 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, o.ws("\n").wind(1).ws(", YYKEYTYPE rule_act"); o.ws("\n").wind(1).ws(")"); o.ws("\n{"); + o.ws("\n").wind(1).ws("const unsigned kix = *pkix;"); o.ws("\n").wind(1).ws("const long pos = token - start;"); o.ws("\n").wind(1).ws("const long len_act = *cursor - token;"); - o.ws("\n").wind(1).ws("const long len_exp = (long) keys [3 * i + 1];"); - o.ws("\n").wind(1).ws("const YYKEYTYPE rule_exp = keys [3 * i + 2];"); + o.ws("\n").wind(1).ws("const long len_exp = (long) keys[kix + 1];"); + o.ws("\n").wind(1).ws("const YYKEYTYPE rule_exp = keys[kix + 2];"); + o.ws("\n").wind(1).ws("*pkix = kix + 3;"); o.ws("\n").wind(1).ws("if (rule_exp == ").wu64(norule).ws(") {"); o.ws("\n").wind(2).ws("fprintf"); o.ws("\n").wind(3).ws("( stderr"); @@ -148,17 +151,17 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, o.ws("\n").wind(3).ws(");"); o.ws("\n").wind(1).ws("}"); o.ws("\n").wind(1).ws("if (len_act == len_exp && rule_act == rule_exp) {"); - o.ws("\n").wind(2).ws("const YYKEYTYPE offset = keys[3 * i];"); + o.ws("\n").wind(2).ws("const YYKEYTYPE offset = keys[kix];"); o.ws("\n").wind(2).ws("*cursor = token + offset;"); o.ws("\n").wind(2).ws("return 0;"); o.ws("\n").wind(1).ws("} else {"); o.ws("\n").wind(2).ws("fprintf"); o.ws("\n").wind(3).ws("( stderr"); - o.ws("\n").wind(3).ws(", \"error: lex_").wstring(name).ws(": at position %ld (iteration %u):\\n\""); + o.ws("\n").wind(3).ws(", \"error: lex_").wstring(name).ws(": at position %ld (key %u):\\n\""); o.ws("\n").wind(4).ws("\"\\texpected: match length %ld, rule %u\\n\""); o.ws("\n").wind(4).ws("\"\\tactual: match length %ld, rule %u\\n\""); o.ws("\n").wind(3).ws(", pos"); - o.ws("\n").wind(3).ws(", i"); + o.ws("\n").wind(3).ws(", kix"); o.ws("\n").wind(3).ws(", len_exp"); o.ws("\n").wind(3).ws(", rule_exp"); o.ws("\n").wind(3).ws(", len_act"); @@ -167,7 +170,38 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, o.ws("\n").wind(2).ws("return 1;"); o.ws("\n").wind(1).ws("}"); o.ws("\n}"); + + if (!tagnames.empty()) { + o.ws("\n"); + o.ws("\nstatic int check_tag_").wstring(name) + .ws("(unsigned *pkix, YYKEYTYPE *keys, const YYCTYPE *tag,\n") + .wind(1).ws("const YYCTYPE *input, const YYCTYPE *token, const char *name)"); + o.ws("\n{"); + o.ws("\n").wind(1).ws("const unsigned kix = *pkix;"); + o.ws("\n").wind(1).ws("const YYKEYTYPE\n") + .wind(2).ws("exp = keys[kix],\n") + .wind(2).ws("act = (YYKEYTYPE)(tag - token),\n") + .wind(2).ws("NIL = (YYKEYTYPE)~0u;"); + o.ws("\n").wind(1).ws("*pkix = kix + 1;"); + o.ws("\n"); + o.ws("\n").wind(1).ws("if (exp == act || (exp == NIL && tag == NULL)) return 0;"); + o.ws("\n"); + o.ws("\n").wind(1).ws("fprintf(stderr, \"error: lex_").wstring(name).ws(": at position %ld, key %u: \"") + .ws("\n").wind(2).ws("\"wrong value for tag '%s': expected %u, actual %u\\n\",") + .ws("\n").wind(2).ws("token - input, kix, name, exp, act);"); + o.ws("\n").wind(1).ws("return 1;"); + o.ws("\n}"); + } + + o.ws("\n"); + o.ws("\nstatic int check_key_count_").wstring(name).ws("(unsigned have, unsigned used, unsigned need)"); + o.ws("\n{"); + o.ws("\n").wind(1).ws("if (used + need <= have) return 0;"); + o.ws("\n").wind(1).ws("fprintf(stderr, \"error: lex_").wstring(name).ws(": not enough keys\\n\");"); + o.ws("\n").wind(1).ws("return 1;"); + o.ws("\n}"); o.ws("\n"); + o.ws("\nint lex_").wstring(name).ws("()"); o.ws("\n{"); o.ws("\n").wind(1).ws("const size_t padding = ").wu64(maxfill).ws("; /* YYMAXFILL */"); @@ -201,7 +235,7 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, } o.ws("\n").wind(1).ws("keys = (YYKEYTYPE *) read_file"); o.ws("\n").wind(2).ws("(\"").wstring(filename).ws(".").wstring(name).ws(".keys\""); - o.ws("\n").wind(2).ws(", 3 * sizeof (YYKEYTYPE)"); + o.ws("\n").wind(2).ws(", sizeof (YYKEYTYPE)"); o.ws("\n").wind(2).ws(", 0"); o.ws("\n").wind(2).ws(", &keys_count"); o.ws("\n").wind(2).ws(");"); @@ -212,7 +246,7 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, o.ws("\n"); if (sizeof_key > 1) { - o.ws("\n").wind(1).ws("for (i = 0; i < 3 * keys_count; ++i) {"); + o.ws("\n").wind(1).ws("for (i = 0; i < keys_count; ++i) {"); from_le(o, 2, sizeof_key, "keys[i]"); o.ws("\n").wind(1).ws("}"); o.ws("\n"); @@ -221,7 +255,7 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, o.ws("\n").wind(1).ws("limit = input + input_len + padding;"); o.ws("\n").wind(1).ws("eof = input + input_len;"); o.ws("\n"); - o.ws("\n").wind(1).ws("for (i = 0; status == 0 && i < keys_count; ++i) {"); + o.ws("\n").wind(1).ws("for (i = 0; status == 0 && cursor < eof && i < keys_count;) {"); o.ws("\n").wind(2).ws("token = cursor;"); if (backup) { o.ws("\n").wind(2).ws("const YYCTYPE *marker = NULL;"); @@ -235,7 +269,7 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, } // autogenerated tag variables - ConfTags conf("\n" + indent(2) + "const YYCTYPE *@@;", ""); + ConfTags conf("\n" + indent(2) + "const YYCTYPE *@@ = NULL;", ""); output_tags(o.stream(), conf, tagnames); // user-defined tag variables @@ -268,7 +302,7 @@ void emit_end(OutputFile &o, const std::string &name, bool backup, bool oldstyle o.ws("\n").wind(2).ws("}"); o.ws("\n").wind(2).ws("if (i != keys_count) {"); o.ws("\n").wind(3).ws("status = 1;"); - o.ws("\n").wind(3).ws("fprintf(stderr, \"error: lex_").wstring(name).ws(": unused keys left after %u iterations\\n\", i);"); + o.ws("\n").wind(3).ws("fprintf(stderr, \"error: lex_").wstring(name).ws(": unused keys left after %u keys\\n\", i);"); o.ws("\n").wind(2).ws("}"); o.ws("\n").wind(1).ws("}"); o.ws("\n"); @@ -317,12 +351,26 @@ void emit_epilog(OutputFile &o, const std::set &names) o.ws("\n"); } -void emit_action(OutputFile &o, uint32_t ind, const std::string &name, - size_t key, size_t def, size_t rule) +void emit_action(OutputFile &o, uint32_t ind, const DFA &dfa, size_t rid) { - o.wind(ind).ws("status = action_").wstring(name) - .ws("(i, keys, input, token, &cursor, ") - .wu64(rule2key(rule, key, def)).ws(");\n"); + const std::string &name = dfa.name; + const Rule &rule = dfa.rules[rid]; + const size_t ltag = rule.ltag, htag = rule.htag, + rkey = rule2key(rid, dfa.key_size, dfa.def_rule); + + o.wind(ind).ws("status = check_key_count_").wstring(name) + .ws("(keys_count, i, ").wu64(3 + htag - ltag).ws(")\n") + .wind(ind + 1).ws(" || action_").wstring(name) + .ws("(&i, keys, input, token, &cursor, ").wu64(rkey).ws(")"); + + for (size_t t = ltag; t < htag; ++t) { + const std::string &tag = *dfa.tags[t].name; + o.ws("\n").wind(ind + 1).ws(" || check_tag_").wstring(name) + .ws("(&i, keys, ").wstring(tag).ws(", input, token, \"") + .wstring(tag).ws("\")"); + } + + o.ws(";\n"); o.wind(ind).ws("continue;\n"); } diff --git a/re2c/src/ir/skeleton/generate_data.cc b/re2c/src/ir/skeleton/generate_data.cc index a9ebec8f..91bf145e 100644 --- a/re2c/src/ir/skeleton/generate_data.cc +++ b/re2c/src/ir/skeleton/generate_data.cc @@ -74,20 +74,6 @@ template static uintn_t to_le(uintn_t n) return m; } -template static void keygen(FILE *f, size_t count, - size_t len, size_t len_match, key_t match) -{ - const size_t keys_size = 3 * count; - key_t * keys = new key_t[keys_size]; - for (uint32_t i = 0; i < keys_size;) { - keys[i++] = to_le(static_cast(len)); - keys[i++] = to_le(static_cast(len_match)); - keys[i++] = to_le(match); - } - fwrite(keys, sizeof(key_t), keys_size, f); - delete[] keys; -} - // pick at most 0x100 unique edges from this range // (for 1-byte code units this covers the whole range: [0 - 0xFF]) // - range bounds must be included @@ -182,19 +168,34 @@ template static cover_size_t cover_one( // write keys const key_t match = rule2key(fin.rule, skel.defrule); - size_t len_match = 0; + size_t len_match = 0, ltag = 0, htag = 0; + const tagver_t *vers = NULL; if (fin.rule != Rule::NONE) { const Rule &rule = skel.rules[fin.rule]; + ltag = rule.ltag; + htag = rule.htag; + vers = rule.tags; const size_t trail = rule.trail; if (trail == Tag::NONE) { len_match = f; } else { assert(skel.tags[trail].type == Tag::VAR); - len_match = tags[rule.tags[trail]]; + len_match = tags[vers[trail]]; assert(len_match != NIL); } } - keygen(cover.keys, width, len, len_match, match); + const size_t keys_size = (3 + htag - ltag) * width; + key_t *keys = new key_t[keys_size], *p = keys; + for (size_t j = 0; j < width; ++j) { + *p++ = to_le(static_cast(len)); + *p++ = to_le(static_cast(len_match)); + *p++ = to_le(match); + for (size_t t = ltag; t < htag; ++t) { + *p++ = to_le(static_cast(tags[vers[t]])); + } + } + fwrite(keys, sizeof(key_t), keys_size, cover.keys); + delete[] keys; delete[] buffer; delete[] tags; diff --git a/re2c/src/ir/skeleton/skeleton.h b/re2c/src/ir/skeleton/skeleton.h index 20961bea..39aa370e 100644 --- a/re2c/src/ir/skeleton/skeleton.h +++ b/re2c/src/ir/skeleton/skeleton.h @@ -22,6 +22,7 @@ namespace re2c struct dfa_t; struct dfa_state_t; +struct DFA; struct OutputFile; struct path_t; @@ -99,7 +100,7 @@ void emit_start(OutputFile &o, size_t maxfill, const std::string &name, const std::set &tagnames, const std::set &tagvars); void emit_end(OutputFile &o, const std::string &name, bool backup, bool oldstyle_ctxmarker); void emit_epilog(OutputFile &o, const std::set &names); -void emit_action(OutputFile &o, uint32_t ind, const std::string &name, size_t key, size_t def, size_t rule); +void emit_action(OutputFile &o, uint32_t ind, const DFA &dfa, size_t rid); } // namespace re2c diff --git a/re2c/test/bug1163046.--skeleton.c b/re2c/test/bug1163046.--skeleton.c index ed5b5ec6..95bfe5bc 100644 --- a/re2c/test/bug1163046.--skeleton.c +++ b/re2c/test/bug1163046.--skeleton.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line26 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line26 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line26 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line26: at position %ld (iteration %u):\n" + , "error: lex_line26: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line26 } } +static int check_key_count_line26(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line26: not enough keys\n"); + return 1; +} + int lex_line26() { const size_t padding = 45; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line26() keys = (YYKEYTYPE *) read_file ("bug1163046.--skeleton.c.line26.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line26() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -153,12 +162,14 @@ int lex_line26() } yy2: YYSKIP (); - status = action_line26(i, keys, input, token, &cursor, 2); + status = check_key_count_line26(keys_count, i, 3) + || action_line26(&i, keys, input, token, &cursor, 2); continue; yy4: YYSKIP (); yy5: - status = action_line26(i, keys, input, token, &cursor, 1); + status = check_key_count_line26(keys_count, i, 3) + || action_line26(&i, keys, input, token, &cursor, 1); continue; yy6: YYSKIP (); @@ -507,7 +518,8 @@ yy50: } yy51: YYSKIP (); - status = action_line26(i, keys, input, token, &cursor, 0); + status = check_key_count_line26(keys_count, i, 3) + || action_line26(&i, keys, input, token, &cursor, 0); continue; } @@ -519,7 +531,7 @@ yy51: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line26: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line26: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/calc_008.b--skeleton.c b/re2c/test/calc_008.b--skeleton.c index 7197f5dd7e157cea11ecfc35e7a17d6d2e01b64b..0d9928ecb9b1550a2b2b6c61844fb90d209c758a 100644 GIT binary patch delta 920 zcmey{&)7SaaYG*qt5!jFX2s;mEVIQ*^NKUm^HNh3fC37(3SbFquE`G4vXdQILs_Ch z>gKX)$$=OO+6qRo)?5le09FT74-qxqe3{jYkr|{`iG40}c53D16CfJMPvdBLE`46rlx3e zRfC<7nWmrtk_Ng8B&=X#s{qohsZf+!Qd*R!U;uGxTEXNZX=SCn{1S!Ky!_Ji3L_IDC>U#k9SaIGFsP|fNK7ut%+G^+U2QU>q{3urF?(to*(r9A+D2B2Q{9!% n#T}^a$}ovJR5WrkqvU)>Dw+q1?#<_=+JN~bwQ_Tu%zSMCQLQ4` delta 302 zcmeC3%J{dRaYG*qYi3@FLgwVjEVC#3v1YInt;0r|UFwRoUx1#JbR*v(9AUW}{| zIe+%KoS7x5MTsSu`FWGyv(IJBoZQdRy7><0d?sd~lEqa#jKY};HVWCPmBsPN`K5U! z)(YC%nVVx)Yg zOEQxcGV@9lk~311v*UpZ;*;}B^Gf1#GV@Z+4K(1c$VeV6dWHhf z_Trd4B~6F|sB%N=&1RhQm?q!g{x6?gT2!20q+p|vnxCeirlybyWP&t7+-$x16^|2> z2M(Vg)afW>>L?g%f*lJAGBBvAQAkWK$;{7#`CM&sw4lP|D1LjY8o2p5e;Xs!OxzqT h=+8_w(?A~Hd_$ywdhP?8SSHp2Oo6GDo0%mdbpcSh@e2R| delta 250 zcmaFg$9SiUal?HU*37&Th0MuMSY}V=k`$i2i8Yj6A=+3$3n<3Tro{tgD`+bi#cmE} z^JHX&$jxV;!Zg-2(QQqMMBb+ZfS=HwpVQqX_}^ YZ{99efUXiG+%M6>h;Zj-F{wyh06Qd67ytkO diff --git a/re2c/test/control_flow_fail.--skeleton.c b/re2c/test/control_flow_fail.--skeleton.c index 758aad4e643476e14b20d6a92a934247bfc63ce6..78c9ebae3e515c6bf565e9e1fc626a1a67f2fe60 100644 GIT binary patch delta 489 zcmbOe`Zs(-Hw&v)L3U=v$RASJU{wd6ny z1#JbRSZgi?AOI@?Dusv|Z@$3l!N?3!E6YBcIXks-@i+sq~_(9re`PsZ7+_=Q__T} zfT}mN-u!@LEz{(Q-2dg1ON)y0ixg}WQuEUk)YKF*flQDlh?}i9FXoxe=!V@V2xU47 znK}x_nqbF*LJSOQY7`QaOEUBGpdMG7?8~n(Ih*e)m5kf$%fAR152=-#e+Vp*1OV{Y BqNxA? delta 175 zcmewxJ|}cTHw$ZKUWr2H z?6WyDOHzvxOEUBGCcj{x%a}R2gQIoxMb4E>%s?fJD|r}&GZkzUvQsOIM+z;G1OVekJE;Hw diff --git a/re2c/test/control_flow_ok.--skeleton.c b/re2c/test/control_flow_ok.--skeleton.c index e8afd0334674b340dd6371da707bf26bf002c330..ec58658226ed7af31175b30ddb156e172c662ebf 100644 GIT binary patch delta 489 zcmexw`M_pFHw&v)L3U=v$RASJU{wd6ny z1#JbRSZgi?AOI@?Dusv|Z@$3l!N?3!E6YBcIXks-@i+sq~_(9re`PsZ7+_=Q__T} zfT}mN-u!@LCDY_y?*H=1rA5X0MG7_wsrhLNYHA9ZKqg2N#Ld>5=ku5|x?%STLYa<2 zrjCNKCfKo{5Cemn8imBVzFMd{D0B$^> AqW}N^ delta 164 zcmaE0^WSnqHw$ZKUWr2H z?6WyDOHzvxOEUBGCcj{x%a}R2gQIoxMb4#6%s?fJOL-V4xAO9{C}?YEZl1zx&d8gX h3{o4PlbM%lrZHKNKORFwVe>WqCPsw0o1+C;c>x*NH2MGl diff --git a/re2c/test/control_flow_yymarker_fail.--skeleton.c b/re2c/test/control_flow_yymarker_fail.--skeleton.c index 38fef25baa2a202dc11ea0788451867aa1a1388c..04f463b09e453d900f85fdd559dcea69a8e112a6 100644 GIT binary patch delta 495 zcmewwa4mSlB^Fk#g6zzS$=6wCij@J6(lEjkC zWQEMU5{2Z9)a2}Vpn~}1{L;LV_?*nVR5J~@BQg@pQgsyI+|uII6eMn5YHErmS2frH znQ00dAZehRK*9<(whAE4nhHg!C8b4q3I-5&rWF)rPEHn-SIWyTQAo|pFHO%-0NP$0 zlc%H!Q2|wNXuVmTb3fDMSKR;QlS_+=^NSR06jJlk6x7rdGJ#BxCWxD@H~-<8%IJpO zCkSOa3Yj_z#+qQqf{54?1B^K7qyb^`X$=6wCPoBh@!LAT(te^$t|6|qSfwC2}6^vpxyRmsNvO?r0 zvd`wsEJ-a&EXmBzo2<_GmBX43dNLzePW?rh9#^gjnh0SmH_0fbkCkifNMA)&JP56Qs08p$uPXGV_ diff --git a/re2c/test/control_flow_yymarker_ok.--skeleton.c b/re2c/test/control_flow_yymarker_ok.--skeleton.c index dc7ee08b8f7477ad37650109ba5385ee03bcc5b3..10ed61983553c50ebc519b61ce9300fc1b983007 100644 GIT binary patch delta 479 zcmdn!Fv)qtB^Fk#g6zzS$=6wCiUMVlXL?JaVzcf8V0cd-1 zOrDY^LGc(^gM&86^khb`o%)C@{jme5a3Y*OZmY@l5Run2h69TLJE!@P2uzGWY H=zCQF)7C@^ diff --git a/re2c/test/control_flow_yymarker_yyaccept_ok.--skeleton.c b/re2c/test/control_flow_yymarker_yyaccept_ok.--skeleton.c index 0395e80a46bd9f1aa0e2b3150e8beb34849084a1..1408512232ce68dd335d026d8484a3091b826537 100644 GIT binary patch delta 575 zcmaDK*O|285(}$VL3U=v2UHIcHQp@F=E2AeQk%j)n>jnRaxw?UTrhtbM{9j?Nn%N6 zvO;EFi9&KlYI1fwP(gfheraAwd`@Ows<{T-5gCbPsX7X9ZfS993KBOjH8n+(s~YTp z%rpfJkTlRuAYla?TLqA2O@*S=lG36)1p|mX(+Y|*C$kI7E9K>vD5U1)m!@YZ0BtXh z$y3sVsDP?BwBD@Fd6sGN5AOf+$)!cb`9%sg3aR;N3TkQ!nLs8;6U5Edo4I(i7~Qb@ z1ffhvAyY@eSQG46P>6v+O^rfga!F=>9@OJ%n;ZEiP|K{zjeH85?F53UYTiD^MBqfM&86^khb`o%)C@{jm_)%C!h&UUeB+vd8uG9HsLtoCPswSn;(m) G$p8R3ennIO diff --git a/re2c/test/ctx.--skeleton.c b/re2c/test/ctx.--skeleton.c index 2b0978f96ac6b97cd9d9fe0600fa300639ba7926..c12f3910f4270d5ce43c2582a134926ba396ffbd 100644 GIT binary patch delta 750 zcmccA#rU+3al?HUR;_~U%!x)Yg zOEQxcGV@9lk~311v*UpZ;*;}B^Gf1#GV@Z+j5Xk{$VeV6dWHhf z_Trd4B~6F|sB%N=&1Rfam?ppB;+lMe`>T9%X;E>0k%EmvYJQr6nwml;kO|TVakus6 z2Ru$p9yol1P^Y7isiR=533f0j*ubEsMj mGjVgEpg%L!Oapm%^Er_M>bVbWVvbk~Fcqd&ZvH7AsS5z)OY;c; delta 251 zcmaFb$9SoWal?HU*37&Th0MuMSY}V2&zixm5N)iW1>|$HY4JeW3fc-rv73Y0JQ-Ob za`V~eaAuaI7A2Ns=I2eet;=^2~5mDC5w0PFbZcX*eGPDRu;!6=a=S{ zSSx62XKudE>%_#Dm<-YupOcxFYG$l4IZ+@UQ%GU6hF}{bHgPdweP(RpYsCt%s&AEO NVMI7~GmliHE&#|sQD^`F diff --git a/re2c/test/input_custom_default.--skeleton--input(custom).c b/re2c/test/input_custom_default.--skeleton--input(custom).c index 01e70e835a1835dc33c1026c0d6e4213ca74655b..02ef6fd0786b75a5a35c097fa73da63c114ef1bb 100644 GIT binary patch delta 481 zcmezVkLgY$^9D6mR;_~U%!|acT+@H!n3cMU$%<(H;sC;)9Qj>%Kf zgeZV2H?-bd%XyV)av0Blp5)S^;`|~78->*Tw8??I!kaUAgBU$v+#Dw*xfB2`37+8q delta 195 zcmcc9$o%~u(*`wG*37&Th0Mv?tg|O?mlB@*lQoo2A=+3$OCeK1Tfs2anrrewc9F@s zZ2UY3VWZg1v)DWtS;5LCKVzT6nOTxrlvt9PpEtRcV=iOnWL3`A%>`T+nV5k}7CZ1V z3TG*V&qFq25F1W$;?YNG}o9cBc-reQeZbHn)qfJ PsU?gETQ(n-mRt$|ZG%2$ diff --git a/re2c/test/input_custom_fgetc.--skeleton--input(custom).c b/re2c/test/input_custom_fgetc.--skeleton--input(custom).c index 4c1c0c49f0514b99c0cc0a9de92bb7ea7ff651fb..85e2b7364e088567755aaa9e7be669a7c084f9f2 100644 GIT binary patch delta 501 zcmezTkLgAu^9D6mR;_~U%!R^NKUm^HNh3fC37(3SbFquE}~Rc>g#xt8-H)8rtY|MJPDMaB6=3N{L<`DqGjY6_V^CP)*+&DNV!c!L-{ zaQFnFPDdeAN5NPV>{w8cfk91;LSk}BW_}*b=W3JJN+@i8!nd1~Y9?-8E3pI^8L5?< JqogF40swb;q;LQL delta 191 zcmcc7$o%;q(*`wG*37&Th0Mv?tg|OSW6j`Gh&EQxQpi-$RxpgU=9+wvU1V}D8$S<1 z*eG`MEH+O@R`CT5_L#WuW*!kG#- z3fZZZ#qr7crFkXR3fkJ4o1^)H82J*DLE7STGV@Z6%rquTNGWU<71+&*CcarhY6&C4 Lmd*R6C6@vKL!3Oz diff --git a/re2c/test/input_custom_istringstream.--skeleton--input(custom).c b/re2c/test/input_custom_istringstream.--skeleton--input(custom).c index a7906ab0ca93ae97771c44498b1923757f89b4f8..da1f67ea25f92332d4fbae88eab9f374cc3f47c6 100644 GIT binary patch delta 505 zcmZqv&-9{^d4n1&t5!jFX2oP}*4bjEdBvIOd8sK1Kmi3?1+auQ*JM9Q*~vFqLs_Ch z>P*?Rn=_5;re3HAR!F z8tj71GzATiG|*8XVFepo1(0St@d*W?_Yuky*IMaB6=3N{L<`DqGjY6_V^CP*X1-PW5+ zc!L-{aQFtHPDdeAN5NPV>|ju^fk91;LSk}BW_}*b_iB^(N+@jp!nd1~Y9?;pE3pI^ NA*q#{v!o=K0swddrL6z} delta 191 zcmaFS$lUy&X@eRoYi3@FLgr*`*4dMvv1afoL>nt;DP$^WD;UOFb4@MwS*C2 K%jWaal1l*;T|D3b diff --git a/re2c/test/input_custom_mjson.--skeleton--input(custom).c b/re2c/test/input_custom_mjson.--skeleton--input(custom).c index d4a10d28..f2d29bb1 100644 --- a/re2c/test/input_custom_mjson.--skeleton--input(custom).c +++ b/re2c/test/input_custom_mjson.--skeleton--input(custom).c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line626 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line626 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line626 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line626: at position %ld (iteration %u):\n" + , "error: lex_line626: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line626 } } +static int check_key_count_line626(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line626: not enough keys\n"); + return 1; +} + int lex_line626() { const size_t padding = 6; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line626() keys = (YYKEYTYPE *) read_file ("input_custom_mjson.--skeleton--input(custom).c.line626.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line626() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -232,12 +241,14 @@ int lex_line626() } yy2: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 20); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 20); continue; yy4: YYSKIP (); yy5: - status = action_line626(i, keys, input, token, &cursor, 22); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 22); continue; yy6: YYSKIP (); @@ -251,7 +262,8 @@ yy6: default: goto yy8; } yy8: - status = action_line626(i, keys, input, token, &cursor, 0); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 0); continue; yy9: yyaccept = 0; @@ -281,7 +293,8 @@ yy10: } yy11: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 9); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 9); continue; yy13: YYSKIP (); @@ -379,7 +392,8 @@ yy15: default: goto yy16; } yy16: - status = action_line626(i, keys, input, token, &cursor, 12); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 12); continue; yy17: YYSKIP (); @@ -454,11 +468,13 @@ yy17: } yy19: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 7); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 7); continue; yy21: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 8); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 8); continue; yy23: YYSKIP (); @@ -532,15 +548,18 @@ yy24: default: goto yy25; } yy25: - status = action_line626(i, keys, input, token, &cursor, 17); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 17); continue; yy26: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 5); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 5); continue; yy28: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 6); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 6); continue; yy30: YYSKIP (); @@ -565,11 +584,13 @@ yy32: } yy33: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 3); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 3); continue; yy35: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 4); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 4); continue; yy37: YYSKIP (); @@ -593,7 +614,8 @@ yy39: } yy40: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 18); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 18); continue; yy42: YYSKIP (); @@ -692,7 +714,8 @@ yy47: default: goto yy49; } yy49: - status = action_line626(i, keys, input, token, &cursor, 13); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 13); continue; yy50: YYSKIP (); @@ -784,7 +807,8 @@ yy54: default: goto yy56; } yy56: - status = action_line626(i, keys, input, token, &cursor, 10); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 10); continue; yy57: YYSKIP (); @@ -858,7 +882,8 @@ yy57: default: goto yy59; } yy59: - status = action_line626(i, keys, input, token, &cursor, 21); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 21); continue; yy60: YYSKIP (); @@ -1182,7 +1207,8 @@ yy73: } yy74: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 1); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 1); continue; yy76: YYSKIP (); @@ -1342,7 +1368,8 @@ yy80: default: goto yy81; } yy81: - status = action_line626(i, keys, input, token, &cursor, 11); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 11); continue; yy82: YYSKIP (); @@ -1367,7 +1394,8 @@ yy84: } yy85: YYSKIP (); - status = action_line626(i, keys, input, token, &cursor, 19); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 19); continue; yy87: YYSKIP (); @@ -1428,7 +1456,8 @@ yy90: yy92: YYSKIP (); yy93: - status = action_line626(i, keys, input, token, &cursor, 2); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 2); continue; yy94: YYSKIP (); @@ -1506,7 +1535,8 @@ yy95: default: goto yy96; } yy96: - status = action_line626(i, keys, input, token, &cursor, 16); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 16); continue; yy97: YYSKIP (); @@ -1577,7 +1607,8 @@ yy97: default: goto yy98; } yy98: - status = action_line626(i, keys, input, token, &cursor, 14); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 14); continue; yy99: YYSKIP (); @@ -1688,7 +1719,8 @@ yy101: default: goto yy102; } yy102: - status = action_line626(i, keys, input, token, &cursor, 15); + status = check_key_count_line626(keys_count, i, 3) + || action_line626(&i, keys, input, token, &cursor, 15); continue; yy103: YYSKIP (); @@ -1729,7 +1761,7 @@ yy103: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line626: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line626: unused keys left after %u keys\n", i); } } @@ -1759,7 +1791,7 @@ end: #define YYFILL(n) { break; } static int action_line813 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1767,10 +1799,12 @@ static int action_line813 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1780,17 +1814,17 @@ static int action_line813 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line813: at position %ld (iteration %u):\n" + , "error: lex_line813: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1800,6 +1834,13 @@ static int action_line813 } } +static int check_key_count_line813(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line813: not enough keys\n"); + return 1; +} + int lex_line813() { const size_t padding = 6; /* YYMAXFILL */ @@ -1827,7 +1868,7 @@ int lex_line813() keys = (YYKEYTYPE *) read_file ("input_custom_mjson.--skeleton--input(custom).c.line813.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1840,7 +1881,7 @@ int lex_line813() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1856,7 +1897,8 @@ int lex_line813() yy106: YYSKIP (); yy107: - status = action_line813(i, keys, input, token, &cursor, 4); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 4); continue; yy108: YYSKIP (); @@ -1869,11 +1911,13 @@ yy108: default: goto yy108; } yy110: - status = action_line813(i, keys, input, token, &cursor, 0); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 0); continue; yy111: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 3); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 3); continue; yy113: YYSKIP (); @@ -1893,7 +1937,8 @@ yy113: } yy114: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 1); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 1); continue; yy116: YYSKIP (); @@ -2012,7 +2057,8 @@ yy120: } yy121: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 2); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 2); continue; } @@ -2024,7 +2070,7 @@ yy121: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line813: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line813: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_parse_iso_intervals.ig--skeleton.c b/re2c/test/php20150211_parse_iso_intervals.ig--skeleton.c index 8b8c44c2..69529ea7 100644 --- a/re2c/test/php20150211_parse_iso_intervals.ig--skeleton.c +++ b/re2c/test/php20150211_parse_iso_intervals.ig--skeleton.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line393 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line393 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line393 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line393: at position %ld (iteration %u):\n" + , "error: lex_line393: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line393 } } +static int check_key_count_line393(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line393: not enough keys\n"); + return 1; +} + int lex_line393() { const size_t padding = 20; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line393() keys = (YYKEYTYPE *) read_file ("php20150211_parse_iso_intervals.ig--skeleton.c.line393.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line393() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -220,16 +229,19 @@ int lex_line393() } yy2: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 5); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 5); continue; yy4: YYSKIP (); yy5: - status = action_line393(i, keys, input, token, &cursor, 6); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 6); continue; yy6: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 4); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 4); continue; yy8: yyaccept = 0; @@ -248,7 +260,8 @@ yy9: if (yych <= '9') goto yy14; if (yych == 'T') goto yy15; yy10: - status = action_line393(i, keys, input, token, &cursor, 2); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 2); continue; yy11: YYSKIP (); @@ -324,7 +337,8 @@ yy16: if (yybm[0+yych] & 128) { goto yy16; } - status = action_line393(i, keys, input, token, &cursor, 0); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 0); continue; yy19: YYSKIP (); @@ -913,7 +927,8 @@ yy88: goto yy13; yy89: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 1); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 1); continue; yy91: YYSKIP (); @@ -932,7 +947,8 @@ yy91: if (yych <= '/') goto yy13; if (yych >= ':') goto yy13; YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 3); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 3); continue; } @@ -944,7 +960,7 @@ yy91: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line393: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line393: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_pdo_sql_parser.ig--skeleton.c b/re2c/test/php20150211_pdo_sql_parser.ig--skeleton.c index dd4fb4e7..6a899cd2 100644 --- a/re2c/test/php20150211_pdo_sql_parser.ig--skeleton.c +++ b/re2c/test/php20150211_pdo_sql_parser.ig--skeleton.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line66 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line66 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line66 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line66: at position %ld (iteration %u):\n" + , "error: lex_line66: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line66 } } +static int check_key_count_line66(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line66: not enough keys\n"); + return 1; +} + int lex_line66() { const size_t padding = 2; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line66() keys = (YYKEYTYPE *) read_file ("php20150211_pdo_sql_parser.ig--skeleton.c.line66.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line66() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -262,7 +271,8 @@ yy4: if (yybm[256+yych] & 32) { goto yy3; } - status = action_line66(i, keys, input, token, &cursor, 7); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 7); continue; yy6: YYSKIP (); @@ -270,7 +280,8 @@ yy6: yych = YYPEEK (); if (yych >= 0x01) goto yy15; yy7: - status = action_line66(i, keys, input, token, &cursor, 5); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 5); continue; yy8: YYSKIP (); @@ -302,7 +313,8 @@ yy12: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy35; } - status = action_line66(i, keys, input, token, &cursor, 4); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 4); continue; yy14: YYSKIP (); @@ -315,7 +327,8 @@ yy15: if (yych <= 0x00) goto yy2; if (yych >= '#') goto yy18; YYSKIP (); - status = action_line66(i, keys, input, token, &cursor, 0); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 0); continue; yy18: YYSKIP (); @@ -334,7 +347,8 @@ yy20: if (yych <= 0x00) goto yy2; if (yych >= '(') goto yy23; YYSKIP (); - status = action_line66(i, keys, input, token, &cursor, 1); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 1); continue; yy23: YYSKIP (); @@ -353,7 +367,8 @@ yy24: if (yych <= '\r') goto yy3; goto yy37; yy26: - status = action_line66(i, keys, input, token, &cursor, 6); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 6); continue; yy27: YYSKIP (); @@ -372,7 +387,8 @@ yy29: if (yybm[0+yych] & 4) { goto yy29; } - status = action_line66(i, keys, input, token, &cursor, 3); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 3); continue; yy32: YYSKIP (); @@ -382,7 +398,8 @@ yy32: goto yy32; } yy34: - status = action_line66(i, keys, input, token, &cursor, 2); + status = check_key_count_line66(keys_count, i, 3) + || action_line66(&i, keys, input, token, &cursor, 2); continue; yy35: YYSKIP (); @@ -477,7 +494,7 @@ yy46: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line66: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line66: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_pdo_sql_parser_trimmed.ig--skeleton.c b/re2c/test/php20150211_pdo_sql_parser_trimmed.ig--skeleton.c index 732feab3..0d8584a3 100644 --- a/re2c/test/php20150211_pdo_sql_parser_trimmed.ig--skeleton.c +++ b/re2c/test/php20150211_pdo_sql_parser_trimmed.ig--skeleton.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line20 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line20 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line20 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line20: at position %ld (iteration %u):\n" + , "error: lex_line20: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line20 } } +static int check_key_count_line20(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line20: not enough keys\n"); + return 1; +} + int lex_line20() { const size_t padding = 2; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line20() keys = (YYKEYTYPE *) read_file ("php20150211_pdo_sql_parser_trimmed.ig--skeleton.c.line20.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line20() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -253,7 +262,8 @@ int lex_line20() } yy2: YYSKIP (); - status = action_line20(i, keys, input, token, &cursor, 254); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 254); continue; yy4: YYSKIP (); @@ -263,7 +273,8 @@ yy5: if (yybm[256+yych] & 32) { goto yy4; } - status = action_line20(i, keys, input, token, &cursor, 7); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 7); continue; yy7: YYSKIP (); @@ -271,7 +282,8 @@ yy7: yych = YYPEEK (); if (yych >= 0x01) goto yy16; yy8: - status = action_line20(i, keys, input, token, &cursor, 5); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 5); continue; yy9: YYSKIP (); @@ -303,7 +315,8 @@ yy13: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy37; } - status = action_line20(i, keys, input, token, &cursor, 4); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 4); continue; yy15: YYSKIP (); @@ -321,7 +334,8 @@ yy17: goto yy8; yy18: YYSKIP (); - status = action_line20(i, keys, input, token, &cursor, 0); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 0); continue; yy20: YYSKIP (); @@ -340,7 +354,8 @@ yy22: if (yych <= 0x00) goto yy17; if (yych >= '(') goto yy25; YYSKIP (); - status = action_line20(i, keys, input, token, &cursor, 1); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 1); continue; yy25: YYSKIP (); @@ -359,7 +374,8 @@ yy26: if (yych <= '\r') goto yy4; goto yy39; yy28: - status = action_line20(i, keys, input, token, &cursor, 6); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 6); continue; yy29: YYSKIP (); @@ -378,7 +394,8 @@ yy31: if (yybm[0+yych] & 4) { goto yy31; } - status = action_line20(i, keys, input, token, &cursor, 3); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 3); continue; yy34: YYSKIP (); @@ -388,7 +405,8 @@ yy34: goto yy34; } yy36: - status = action_line20(i, keys, input, token, &cursor, 2); + status = check_key_count_line20(keys_count, i, 3) + || action_line20(&i, keys, input, token, &cursor, 2); continue; yy37: YYSKIP (); @@ -483,7 +501,7 @@ yy48: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line20: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line20: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_phar_path_check.ig--skeleton.c b/re2c/test/php20150211_phar_path_check.ig--skeleton.c index 8015faf7..873ea425 100644 --- a/re2c/test/php20150211_phar_path_check.ig--skeleton.c +++ b/re2c/test/php20150211_phar_path_check.ig--skeleton.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line108 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line108 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line108 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line108: at position %ld (iteration %u):\n" + , "error: lex_line108: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line108 } } +static int check_key_count_line108(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line108: not enough keys\n"); + return 1; +} + int lex_line108() { const size_t padding = 4; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line108() keys = (YYKEYTYPE *) read_file ("php20150211_phar_path_check.ig--skeleton.c.line108.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line108() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -193,21 +202,25 @@ yy2: } yy3: YYSKIP (); - status = action_line108(i, keys, input, token, &cursor, 7); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 7); continue; yy5: YYSKIP (); yy6: - status = action_line108(i, keys, input, token, &cursor, 8); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 8); continue; yy7: YYSKIP (); yy8: - status = action_line108(i, keys, input, token, &cursor, 6); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 6); continue; yy9: YYSKIP (); - status = action_line108(i, keys, input, token, &cursor, 4); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 4); continue; yy11: yyaccept = 0; @@ -220,11 +233,13 @@ yy11: goto yy8; yy12: YYSKIP (); - status = action_line108(i, keys, input, token, &cursor, 5); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 5); continue; yy14: YYSKIP (); - status = action_line108(i, keys, input, token, &cursor, 3); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 3); continue; yy16: YYSKIP (); @@ -290,7 +305,8 @@ yy23: goto yy2; yy24: YYSKIP (); - status = action_line108(i, keys, input, token, &cursor, 0); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 0); continue; yy26: YYSKIP (); @@ -306,7 +322,8 @@ yy27: goto yy2; yy28: YYSKIP (); - status = action_line108(i, keys, input, token, &cursor, 2); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 2); continue; yy30: YYSKIP (); @@ -315,7 +332,8 @@ yy30: if (yych != '/') goto yy2; yy31: YYSKIP (); - status = action_line108(i, keys, input, token, &cursor, 1); + status = check_key_count_line108(keys_count, i, 3) + || action_line108(&i, keys, input, token, &cursor, 1); continue; } @@ -327,7 +345,7 @@ yy31: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line108: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line108: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_url_scanner_ex.ig--skeleton.c b/re2c/test/php20150211_url_scanner_ex.ig--skeleton.c index 5231e807..eb059f26 100644 --- a/re2c/test/php20150211_url_scanner_ex.ig--skeleton.c +++ b/re2c/test/php20150211_url_scanner_ex.ig--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line129 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line129 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line129 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line129: at position %ld (iteration %u):\n" + , "error: lex_line129: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line129 } } +static int check_key_count_line129(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line129: not enough keys\n"); + return 1; +} + int lex_line129() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line129() keys = (YYKEYTYPE *) read_file ("php20150211_url_scanner_ex.ig--skeleton.c.line129.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line129() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -190,19 +199,23 @@ yy2: if (yybm[0+yych] & 128) { goto yy2; } - status = action_line129(i, keys, input, token, &cursor, 3); + status = check_key_count_line129(keys_count, i, 3) + || action_line129(&i, keys, input, token, &cursor, 3); continue; yy5: YYSKIP (); - status = action_line129(i, keys, input, token, &cursor, 2); + status = check_key_count_line129(keys_count, i, 3) + || action_line129(&i, keys, input, token, &cursor, 2); continue; yy7: YYSKIP (); - status = action_line129(i, keys, input, token, &cursor, 0); + status = check_key_count_line129(keys_count, i, 3) + || action_line129(&i, keys, input, token, &cursor, 0); continue; yy9: YYSKIP (); - status = action_line129(i, keys, input, token, &cursor, 1); + status = check_key_count_line129(keys_count, i, 3) + || action_line129(&i, keys, input, token, &cursor, 1); continue; } @@ -214,7 +227,7 @@ yy9: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line129: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line129: unused keys left after %u keys\n", i); } } @@ -240,7 +253,7 @@ end: #define YYFILL(n) { break; } static int action_line315 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -248,10 +261,12 @@ static int action_line315 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -261,17 +276,17 @@ static int action_line315 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line315: at position %ld (iteration %u):\n" + , "error: lex_line315: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -281,6 +296,13 @@ static int action_line315 } } +static int check_key_count_line315(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line315: not enough keys\n"); + return 1; +} + int lex_line315() { const size_t padding = 1; /* YYMAXFILL */ @@ -308,7 +330,7 @@ int lex_line315() keys = (YYKEYTYPE *) read_file ("php20150211_url_scanner_ex.ig--skeleton.c.line315.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -321,7 +343,7 @@ int lex_line315() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -372,11 +394,13 @@ yy13: if (yybm[0+yych] & 128) { goto yy13; } - status = action_line315(i, keys, input, token, &cursor, 1); + status = check_key_count_line315(keys_count, i, 3) + || action_line315(&i, keys, input, token, &cursor, 1); continue; yy16: YYSKIP (); - status = action_line315(i, keys, input, token, &cursor, 0); + status = check_key_count_line315(keys_count, i, 3) + || action_line315(&i, keys, input, token, &cursor, 0); continue; } @@ -388,7 +412,7 @@ yy16: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line315: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line315: unused keys left after %u keys\n", i); } } @@ -414,7 +438,7 @@ end: #define YYFILL(n) { break; } static int action_line322 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -422,10 +446,12 @@ static int action_line322 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -435,17 +461,17 @@ static int action_line322 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line322: at position %ld (iteration %u):\n" + , "error: lex_line322: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -455,6 +481,13 @@ static int action_line322 } } +static int check_key_count_line322(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line322: not enough keys\n"); + return 1; +} + int lex_line322() { const size_t padding = 1; /* YYMAXFILL */ @@ -482,7 +515,7 @@ int lex_line322() keys = (YYKEYTYPE *) read_file ("php20150211_url_scanner_ex.ig--skeleton.c.line322.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -495,7 +528,7 @@ int lex_line322() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -539,7 +572,8 @@ int lex_line322() goto yy22; } YYSKIP (); - status = action_line322(i, keys, input, token, &cursor, 1); + status = check_key_count_line322(keys_count, i, 3) + || action_line322(&i, keys, input, token, &cursor, 1); continue; yy22: YYSKIP (); @@ -548,7 +582,8 @@ yy22: if (yybm[0+yych] & 128) { goto yy22; } - status = action_line322(i, keys, input, token, &cursor, 0); + status = check_key_count_line322(keys_count, i, 3) + || action_line322(&i, keys, input, token, &cursor, 0); continue; } @@ -560,7 +595,7 @@ yy22: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line322: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line322: unused keys left after %u keys\n", i); } } @@ -586,7 +621,7 @@ end: #define YYFILL(n) { break; } static int action_line334 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -594,10 +629,12 @@ static int action_line334 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -607,17 +644,17 @@ static int action_line334 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line334: at position %ld (iteration %u):\n" + , "error: lex_line334: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -627,6 +664,13 @@ static int action_line334 } } +static int check_key_count_line334(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line334: not enough keys\n"); + return 1; +} + int lex_line334() { const size_t padding = 2; /* YYMAXFILL */ @@ -654,7 +698,7 @@ int lex_line334() keys = (YYKEYTYPE *) read_file ("php20150211_url_scanner_ex.ig--skeleton.c.line334.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -667,7 +711,7 @@ int lex_line334() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -747,7 +791,8 @@ int lex_line334() yy27: YYSKIP (); yy28: - status = action_line334(i, keys, input, token, &cursor, 3); + status = check_key_count_line334(keys_count, i, 3) + || action_line334(&i, keys, input, token, &cursor, 3); continue; yy29: YYSKIP (); @@ -756,7 +801,8 @@ yy29: if (yybm[0+yych] & 128) { goto yy29; } - status = action_line334(i, keys, input, token, &cursor, 1); + status = check_key_count_line334(keys_count, i, 3) + || action_line334(&i, keys, input, token, &cursor, 1); continue; yy32: YYSKIP (); @@ -764,11 +810,13 @@ yy32: if (yych != '>') goto yy28; yy33: YYSKIP (); - status = action_line334(i, keys, input, token, &cursor, 0); + status = check_key_count_line334(keys_count, i, 3) + || action_line334(&i, keys, input, token, &cursor, 0); continue; yy35: YYSKIP (); - status = action_line334(i, keys, input, token, &cursor, 2); + status = check_key_count_line334(keys_count, i, 3) + || action_line334(&i, keys, input, token, &cursor, 2); continue; } @@ -780,7 +828,7 @@ yy35: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line334: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line334: unused keys left after %u keys\n", i); } } @@ -806,7 +854,7 @@ end: #define YYFILL(n) { break; } static int action_line341 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -814,10 +862,12 @@ static int action_line341 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -827,17 +877,17 @@ static int action_line341 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line341: at position %ld (iteration %u):\n" + , "error: lex_line341: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -847,6 +897,13 @@ static int action_line341 } } +static int check_key_count_line341(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line341: not enough keys\n"); + return 1; +} + int lex_line341() { const size_t padding = 1; /* YYMAXFILL */ @@ -874,7 +931,7 @@ int lex_line341() keys = (YYKEYTYPE *) read_file ("php20150211_url_scanner_ex.ig--skeleton.c.line341.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -887,7 +944,7 @@ int lex_line341() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -933,7 +990,8 @@ int lex_line341() if (yych <= 'z') goto yy41; yy39: YYSKIP (); - status = action_line341(i, keys, input, token, &cursor, 1); + status = check_key_count_line341(keys_count, i, 3) + || action_line341(&i, keys, input, token, &cursor, 1); continue; yy41: YYSKIP (); @@ -942,7 +1000,8 @@ yy41: if (yybm[0+yych] & 128) { goto yy41; } - status = action_line341(i, keys, input, token, &cursor, 0); + status = check_key_count_line341(keys_count, i, 3) + || action_line341(&i, keys, input, token, &cursor, 0); continue; } @@ -954,7 +1013,7 @@ yy41: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line341: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line341: unused keys left after %u keys\n", i); } } @@ -982,7 +1041,7 @@ end: #define YYFILL(n) { break; } static int action_line348 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -990,10 +1049,12 @@ static int action_line348 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1003,17 +1064,17 @@ static int action_line348 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line348: at position %ld (iteration %u):\n" + , "error: lex_line348: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1023,6 +1084,13 @@ static int action_line348 } } +static int check_key_count_line348(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line348: not enough keys\n"); + return 1; +} + int lex_line348() { const size_t padding = 2; /* YYMAXFILL */ @@ -1050,7 +1118,7 @@ int lex_line348() keys = (YYKEYTYPE *) read_file ("php20150211_url_scanner_ex.ig--skeleton.c.line348.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1063,7 +1131,7 @@ int lex_line348() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1108,7 +1176,8 @@ int lex_line348() if (yych == '=') goto yy49; YYSKIP (); yy47: - status = action_line348(i, keys, input, token, &cursor, 1); + status = check_key_count_line348(keys_count, i, 3) + || action_line348(&i, keys, input, token, &cursor, 1); continue; yy48: YYSKIP (); @@ -1123,7 +1192,8 @@ yy49: if (yybm[0+yych] & 128) { goto yy49; } - status = action_line348(i, keys, input, token, &cursor, 0); + status = check_key_count_line348(keys_count, i, 3) + || action_line348(&i, keys, input, token, &cursor, 0); continue; yy52: YYSKIP (); @@ -1143,7 +1213,7 @@ yy52: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line348: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line348: unused keys left after %u keys\n", i); } } @@ -1173,7 +1243,7 @@ end: #define YYFILL(n) { break; } static int action_line358 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1181,10 +1251,12 @@ static int action_line358 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1194,17 +1266,17 @@ static int action_line358 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line358: at position %ld (iteration %u):\n" + , "error: lex_line358: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1214,6 +1286,13 @@ static int action_line358 } } +static int check_key_count_line358(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line358: not enough keys\n"); + return 1; +} + int lex_line358() { const size_t padding = 2; /* YYMAXFILL */ @@ -1241,7 +1320,7 @@ int lex_line358() keys = (YYKEYTYPE *) read_file ("php20150211_url_scanner_ex.ig--skeleton.c.line358.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1254,7 +1333,7 @@ int lex_line358() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1309,12 +1388,14 @@ yy57: if (yybm[0+yych] & 32) { goto yy57; } - status = action_line358(i, keys, input, token, &cursor, 2); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 2); continue; yy60: YYSKIP (); yy61: - status = action_line358(i, keys, input, token, &cursor, 3); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 3); continue; yy62: YYSKIP (); @@ -1342,7 +1423,8 @@ yy66: goto yy61; yy67: YYSKIP (); - status = action_line358(i, keys, input, token, &cursor, 0); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 0); continue; yy69: YYSKIP (); @@ -1354,7 +1436,8 @@ yy70: } if (yych >= '(') goto yy66; YYSKIP (); - status = action_line358(i, keys, input, token, &cursor, 1); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 1); continue; } @@ -1366,7 +1449,7 @@ yy70: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line358: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line358: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_var_unserializer.ig--skeleton.c b/re2c/test/php20150211_var_unserializer.ig--skeleton.c index 9df27799..82a44f2c 100644 --- a/re2c/test/php20150211_var_unserializer.ig--skeleton.c +++ b/re2c/test/php20150211_var_unserializer.ig--skeleton.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line875 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line875 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line875 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line875: at position %ld (iteration %u):\n" + , "error: lex_line875: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line875 } } +static int check_key_count_line875(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line875: not enough keys\n"); + return 1; +} + int lex_line875() { const size_t padding = 7; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line875() keys = (YYKEYTYPE *) read_file ("php20150211_var_unserializer.ig--skeleton.c.line875.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line875() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -220,7 +229,8 @@ int lex_line875() yy2: YYSKIP (); yy3: - status = action_line875(i, keys, input, token, &cursor, 13); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 13); continue; yy4: YYSKIP (); @@ -289,7 +299,8 @@ yy14: goto yy3; yy15: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 12); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 12); continue; yy17: YYSKIP (); @@ -303,7 +314,8 @@ yy18: goto yy3; yy19: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 2); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 2); continue; yy21: YYSKIP (); @@ -614,7 +626,8 @@ yy62: goto yy18; yy63: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 0); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 0); continue; yy65: YYSKIP (); @@ -628,7 +641,8 @@ yy66: goto yy18; yy67: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 3); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 3); continue; yy69: YYSKIP (); @@ -673,7 +687,8 @@ yy69: } yy71: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 6); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 6); continue; yy73: YYSKIP (); @@ -699,7 +714,8 @@ yy75: goto yy18; yy76: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 4); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 4); continue; yy78: YYSKIP (); @@ -708,7 +724,8 @@ yy78: goto yy18; yy79: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 1); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 1); continue; yy81: YYSKIP (); @@ -717,15 +734,18 @@ yy81: goto yy18; yy82: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 11); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 11); continue; yy84: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 8); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 8); continue; yy86: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 9); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 9); continue; yy88: YYSKIP (); @@ -753,11 +773,13 @@ yy91: goto yy18; yy92: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 10); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 10); continue; yy94: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 7); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 7); continue; yy96: YYSKIP (); @@ -767,7 +789,8 @@ yy96: goto yy18; yy97: YYSKIP (); - status = action_line875(i, keys, input, token, &cursor, 5); + status = check_key_count_line875(keys_count, i, 3) + || action_line875(&i, keys, input, token, &cursor, 5); continue; } @@ -779,7 +802,7 @@ yy97: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line875: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line875: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c b/re2c/test/php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c index 0f41ef15..bcdd49cd 100644 --- a/re2c/test/php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c +++ b/re2c/test/php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line652_INITIAL - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line652_INITIAL , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line652_INITIAL ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_INITIAL: at position %ld (iteration %u):\n" + , "error: lex_line652_INITIAL: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line652_INITIAL } } +static int check_key_count_line652_INITIAL(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_INITIAL: not enough keys\n"); + return 1; +} + int lex_line652_INITIAL() { const size_t padding = 5; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line652_INITIAL() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_INITIAL.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line652_INITIAL() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -257,7 +266,8 @@ yy4: goto *yytarget[yych]; } yy5: - status = action_line652_INITIAL(i, keys, input, token, &cursor, 5); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 5); continue; yy6: YYSKIP (); @@ -301,12 +311,14 @@ yy6: goto *yytarget[yych]; } yy8: - status = action_line652_INITIAL(i, keys, input, token, &cursor, 8); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 8); continue; yy9: YYSKIP (); yy10: - status = action_line652_INITIAL(i, keys, input, token, &cursor, 9); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 9); continue; yy11: YYSKIP (); @@ -356,7 +368,8 @@ yy12: } yy14: YYSKIP (); - status = action_line652_INITIAL(i, keys, input, token, &cursor, 7); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 7); continue; yy16: YYSKIP (); @@ -373,7 +386,8 @@ yy18: yych = YYPEEK (); if (yych == '\t') goto yy18; if (yych == ' ') goto yy18; - status = action_line652_INITIAL(i, keys, input, token, &cursor, 6); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 6); continue; yy21: YYSKIP (); @@ -475,7 +489,8 @@ yy25: goto yy4; yy26: YYSKIP (); - status = action_line652_INITIAL(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 0); continue; yy28: YYSKIP (); @@ -483,12 +498,14 @@ yy28: yych = YYPEEK (); if (yych == '\t') goto yy28; if (yych == ' ') goto yy28; - status = action_line652_INITIAL(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 1); continue; yy31: YYSKIP (); yy32: - status = action_line652_INITIAL(i, keys, input, token, &cursor, 10); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 10); continue; yy33: YYSKIP (); @@ -541,7 +558,8 @@ yy35: goto *yytarget[(yych = YYPEEK ())]; } yy36: - status = action_line652_INITIAL(i, keys, input, token, &cursor, 3); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 3); continue; yy37: YYSKIP (); @@ -597,7 +615,8 @@ yy39: goto *yytarget[yych]; } yy41: - status = action_line652_INITIAL(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 2); continue; yy42: YYSKIP (); @@ -732,7 +751,8 @@ yy54: goto *yytarget[yych]; } yy56: - status = action_line652_INITIAL(i, keys, input, token, &cursor, 4); + status = check_key_count_line652_INITIAL(keys_count, i, 3) + || action_line652_INITIAL(&i, keys, input, token, &cursor, 4); continue; yy57: YYSKIP (); @@ -751,7 +771,7 @@ yy57: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_INITIAL: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_INITIAL: unused keys left after %u keys\n", i); } } @@ -777,7 +797,7 @@ end: #define YYFILL(n) { break; } static int action_line652_ST_DOUBLE_QUOTES - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -785,10 +805,12 @@ static int action_line652_ST_DOUBLE_QUOTES , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -798,17 +820,17 @@ static int action_line652_ST_DOUBLE_QUOTES ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_ST_DOUBLE_QUOTES: at position %ld (iteration %u):\n" + , "error: lex_line652_ST_DOUBLE_QUOTES: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -818,6 +840,13 @@ static int action_line652_ST_DOUBLE_QUOTES } } +static int check_key_count_line652_ST_DOUBLE_QUOTES(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_ST_DOUBLE_QUOTES: not enough keys\n"); + return 1; +} + int lex_line652_ST_DOUBLE_QUOTES() { const size_t padding = 2; /* YYMAXFILL */ @@ -845,7 +874,7 @@ int lex_line652_ST_DOUBLE_QUOTES() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_ST_DOUBLE_QUOTES.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -858,7 +887,7 @@ int lex_line652_ST_DOUBLE_QUOTES() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -902,7 +931,8 @@ int lex_line652_ST_DOUBLE_QUOTES() if (yych == '$') goto yy67; YYSKIP (); yy63: - status = action_line652_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line652_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 2); continue; yy64: YYSKIP (); @@ -911,14 +941,16 @@ yy64: if (yybm[0+yych] & 128) { goto yy64; } - status = action_line652_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line652_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 1); continue; yy67: YYSKIP (); yych = YYPEEK (); if (yych != '{') goto yy63; YYSKIP (); - status = action_line652_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line652_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 0); continue; } @@ -930,7 +962,7 @@ yy67: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_ST_DOUBLE_QUOTES: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_ST_DOUBLE_QUOTES: unused keys left after %u keys\n", i); } } @@ -958,7 +990,7 @@ end: #define YYFILL(n) { break; } static int action_line652_ST_OFFSET - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -966,10 +998,12 @@ static int action_line652_ST_OFFSET , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -979,17 +1013,17 @@ static int action_line652_ST_OFFSET ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_ST_OFFSET: at position %ld (iteration %u):\n" + , "error: lex_line652_ST_OFFSET: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -999,6 +1033,13 @@ static int action_line652_ST_OFFSET } } +static int check_key_count_line652_ST_OFFSET(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_ST_OFFSET: not enough keys\n"); + return 1; +} + int lex_line652_ST_OFFSET() { const size_t padding = 2; /* YYMAXFILL */ @@ -1026,7 +1067,7 @@ int lex_line652_ST_OFFSET() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_ST_OFFSET.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1039,7 +1080,7 @@ int lex_line652_ST_OFFSET() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1133,7 +1174,8 @@ yy74: if (yych <= ';') goto yy75; if (yych <= '\\') goto yy91; yy75: - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 5); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 5); continue; yy76: yyaccept = 0; @@ -1181,11 +1223,13 @@ yy76: yy78: YYSKIP (); yy79: - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 8); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 8); continue; yy80: YYSKIP (); - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 6); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 6); continue; yy82: YYSKIP (); @@ -1257,7 +1301,8 @@ yy85: goto *yytarget[yych]; } yy87: - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 4); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 4); continue; yy88: yyaccept = 2; @@ -1303,7 +1348,8 @@ yy88: goto *yytarget[yych]; } yy90: - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 3); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 3); continue; yy91: YYSKIP (); @@ -1312,7 +1358,8 @@ yy91: goto yy73; yy92: YYSKIP (); - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 1); continue; yy94: YYSKIP (); @@ -1346,7 +1393,8 @@ yy96: goto yy73; yy98: YYSKIP (); - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 2); continue; yy100: YYSKIP (); @@ -1401,7 +1449,8 @@ yy102: } yy104: YYSKIP (); - status = action_line652_ST_OFFSET(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_ST_OFFSET(keys_count, i, 3) + || action_line652_ST_OFFSET(&i, keys, input, token, &cursor, 0); continue; } @@ -1413,7 +1462,7 @@ yy104: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_ST_OFFSET: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_ST_OFFSET: unused keys left after %u keys\n", i); } } @@ -1441,7 +1490,7 @@ end: #define YYFILL(n) { break; } static int action_line652_ST_RAW - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1449,10 +1498,12 @@ static int action_line652_ST_RAW , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1462,17 +1513,17 @@ static int action_line652_ST_RAW ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_ST_RAW: at position %ld (iteration %u):\n" + , "error: lex_line652_ST_RAW: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1482,6 +1533,13 @@ static int action_line652_ST_RAW } } +static int check_key_count_line652_ST_RAW(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_ST_RAW: not enough keys\n"); + return 1; +} + int lex_line652_ST_RAW() { const size_t padding = 3; /* YYMAXFILL */ @@ -1509,7 +1567,7 @@ int lex_line652_ST_RAW() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_ST_RAW.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1522,7 +1580,7 @@ int lex_line652_ST_RAW() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -1601,12 +1659,14 @@ int lex_line652_ST_RAW() } yy109: YYSKIP (); - status = action_line652_ST_RAW(i, keys, input, token, &cursor, 4); + status = check_key_count_line652_ST_RAW(keys_count, i, 3) + || action_line652_ST_RAW(&i, keys, input, token, &cursor, 4); continue; yy111: YYSKIP (); yy112: - status = action_line652_ST_RAW(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_ST_RAW(keys_count, i, 3) + || action_line652_ST_RAW(&i, keys, input, token, &cursor, 0); continue; yy113: YYSKIP (); @@ -1651,7 +1711,8 @@ yy113: yy114: YYSKIP (); yy115: - status = action_line652_ST_RAW(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_ST_RAW(keys_count, i, 3) + || action_line652_ST_RAW(&i, keys, input, token, &cursor, 1); continue; yy116: YYSKIP (); @@ -1683,12 +1744,14 @@ yy120: if (yych == ';') goto yy117; } yy121: - status = action_line652_ST_RAW(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_ST_RAW(keys_count, i, 3) + || action_line652_ST_RAW(&i, keys, input, token, &cursor, 2); continue; yy122: YYSKIP (); yy123: - status = action_line652_ST_RAW(i, keys, input, token, &cursor, 3); + status = check_key_count_line652_ST_RAW(keys_count, i, 3) + || action_line652_ST_RAW(&i, keys, input, token, &cursor, 3); continue; yy124: YYSKIP (); @@ -1704,7 +1767,7 @@ yy124: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_ST_RAW: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_ST_RAW: unused keys left after %u keys\n", i); } } @@ -1730,7 +1793,7 @@ end: #define YYFILL(n) { break; } static int action_line652_ST_SECTION_RAW - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1738,10 +1801,12 @@ static int action_line652_ST_SECTION_RAW , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1751,17 +1816,17 @@ static int action_line652_ST_SECTION_RAW ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_ST_SECTION_RAW: at position %ld (iteration %u):\n" + , "error: lex_line652_ST_SECTION_RAW: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1771,6 +1836,13 @@ static int action_line652_ST_SECTION_RAW } } +static int check_key_count_line652_ST_SECTION_RAW(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_ST_SECTION_RAW: not enough keys\n"); + return 1; +} + int lex_line652_ST_SECTION_RAW() { const size_t padding = 2; /* YYMAXFILL */ @@ -1798,7 +1870,7 @@ int lex_line652_ST_SECTION_RAW() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_ST_SECTION_RAW.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1811,7 +1883,7 @@ int lex_line652_ST_SECTION_RAW() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -1863,11 +1935,13 @@ yy128: if (yybm[0+yych] & 64) { goto yy128; } - status = action_line652_ST_SECTION_RAW(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_ST_SECTION_RAW(keys_count, i, 3) + || action_line652_ST_SECTION_RAW(&i, keys, input, token, &cursor, 1); continue; yy131: YYSKIP (); - status = action_line652_ST_SECTION_RAW(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_ST_SECTION_RAW(keys_count, i, 3) + || action_line652_ST_SECTION_RAW(&i, keys, input, token, &cursor, 2); continue; yy133: YYSKIP (); @@ -1880,7 +1954,8 @@ yy133: if (yych <= '\n') goto yy136; if (yych == '\r') goto yy137; yy135: - status = action_line652_ST_SECTION_RAW(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_ST_SECTION_RAW(keys_count, i, 3) + || action_line652_ST_SECTION_RAW(&i, keys, input, token, &cursor, 0); continue; yy136: YYSKIP (); @@ -1900,7 +1975,7 @@ yy137: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_ST_SECTION_RAW: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_ST_SECTION_RAW: unused keys left after %u keys\n", i); } } @@ -1928,7 +2003,7 @@ end: #define YYFILL(n) { break; } static int action_line652_ST_SECTION_VALUE - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1936,10 +2011,12 @@ static int action_line652_ST_SECTION_VALUE , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1949,17 +2026,17 @@ static int action_line652_ST_SECTION_VALUE ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_ST_SECTION_VALUE: at position %ld (iteration %u):\n" + , "error: lex_line652_ST_SECTION_VALUE: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1969,6 +2046,13 @@ static int action_line652_ST_SECTION_VALUE } } +static int check_key_count_line652_ST_SECTION_VALUE(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_ST_SECTION_VALUE: not enough keys\n"); + return 1; +} + int lex_line652_ST_SECTION_VALUE() { const size_t padding = 2; /* YYMAXFILL */ @@ -1996,7 +2080,7 @@ int lex_line652_ST_SECTION_VALUE() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_ST_SECTION_VALUE.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2009,7 +2093,7 @@ int lex_line652_ST_SECTION_VALUE() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -2103,7 +2187,8 @@ yy142: if (yych <= ';') goto yy143; if (yych <= '\\') goto yy159; yy143: - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 5); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 5); continue; yy144: yyaccept = 0; @@ -2151,11 +2236,13 @@ yy144: yy146: YYSKIP (); yy147: - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 8); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 8); continue; yy148: YYSKIP (); - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 6); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 6); continue; yy150: YYSKIP (); @@ -2227,7 +2314,8 @@ yy153: goto *yytarget[yych]; } yy155: - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 4); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 4); continue; yy156: yyaccept = 2; @@ -2273,7 +2361,8 @@ yy156: goto *yytarget[yych]; } yy158: - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 3); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 3); continue; yy159: YYSKIP (); @@ -2293,7 +2382,8 @@ yy160: if (yych == ' ') goto yy160; } yy162: - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 1); continue; yy163: YYSKIP (); @@ -2327,7 +2417,8 @@ yy165: goto yy141; yy167: YYSKIP (); - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 2); continue; yy169: YYSKIP (); @@ -2391,7 +2482,8 @@ yy174: goto yy162; yy175: YYSKIP (); - status = action_line652_ST_SECTION_VALUE(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_ST_SECTION_VALUE(keys_count, i, 3) + || action_line652_ST_SECTION_VALUE(&i, keys, input, token, &cursor, 0); continue; } @@ -2403,7 +2495,7 @@ yy175: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_ST_SECTION_VALUE: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_ST_SECTION_VALUE: unused keys left after %u keys\n", i); } } @@ -2433,7 +2525,7 @@ end: #define YYFILL(n) { break; } static int action_line652_ST_VALUE - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2441,10 +2533,12 @@ static int action_line652_ST_VALUE , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2454,17 +2548,17 @@ static int action_line652_ST_VALUE ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_ST_VALUE: at position %ld (iteration %u):\n" + , "error: lex_line652_ST_VALUE: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2474,6 +2568,13 @@ static int action_line652_ST_VALUE } } +static int check_key_count_line652_ST_VALUE(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_ST_VALUE: not enough keys\n"); + return 1; +} + int lex_line652_ST_VALUE() { const size_t padding = 6; /* YYMAXFILL */ @@ -2501,7 +2602,7 @@ int lex_line652_ST_VALUE() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_ST_VALUE.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2514,7 +2615,7 @@ int lex_line652_ST_VALUE() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -2596,7 +2697,8 @@ int lex_line652_ST_VALUE() yy180: YYSKIP (); yy181: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 14); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 14); continue; yy182: yyaccept = 0; @@ -2643,7 +2745,8 @@ yy183: goto *yytarget[yych]; } yy184: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 10); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 10); continue; yy185: YYSKIP (); @@ -2687,12 +2790,14 @@ yy185: goto *yytarget[yych]; } yy187: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 12); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 12); continue; yy188: YYSKIP (); yy189: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 5); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 5); continue; yy190: YYSKIP (); @@ -2705,11 +2810,13 @@ yy191: yych = YYPEEK (); if (yych == '\t') goto yy191; if (yych == ' ') goto yy191; - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 8); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 8); continue; yy194: YYSKIP (); - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 11); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 11); continue; yy196: YYSKIP (); @@ -2781,7 +2888,8 @@ yy199: goto *yytarget[yych]; } yy201: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 7); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 7); continue; yy202: YYSKIP (); @@ -2794,7 +2902,8 @@ yy202: goto yy225; yy204: YYSKIP (); - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 9); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 9); continue; yy206: yyaccept = 2; @@ -2840,7 +2949,8 @@ yy206: goto *yytarget[yych]; } yy208: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 6); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 6); continue; yy209: yyaccept = 2; @@ -3096,7 +3206,8 @@ yy216: goto yy182; yy217: YYSKIP (); - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 1); continue; yy219: YYSKIP (); @@ -3152,7 +3263,8 @@ yy221: yy223: YYSKIP (); yy224: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 13); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 13); continue; yy225: YYSKIP (); @@ -3244,7 +3356,8 @@ yy227: goto *yytarget[yych]; } yy228: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 3); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 3); continue; yy229: yyaccept = 2; @@ -3373,7 +3486,8 @@ yy231: goto *yytarget[yych]; } yy232: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 2); continue; yy233: yyaccept = 2; @@ -3471,7 +3585,8 @@ yy235: goto yy182; yy237: YYSKIP (); - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 0); continue; yy239: yyaccept = 2; @@ -3740,7 +3855,8 @@ yy248: goto *yytarget[yych]; } yy249: - status = action_line652_ST_VALUE(i, keys, input, token, &cursor, 4); + status = check_key_count_line652_ST_VALUE(keys_count, i, 3) + || action_line652_ST_VALUE(&i, keys, input, token, &cursor, 4); continue; yy250: YYSKIP (); @@ -3759,7 +3875,7 @@ yy250: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_ST_VALUE: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_ST_VALUE: unused keys left after %u keys\n", i); } } @@ -3787,7 +3903,7 @@ end: #define YYFILL(n) { break; } static int action_line652_ST_VARNAME - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3795,10 +3911,12 @@ static int action_line652_ST_VARNAME , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3808,17 +3926,17 @@ static int action_line652_ST_VARNAME ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652_ST_VARNAME: at position %ld (iteration %u):\n" + , "error: lex_line652_ST_VARNAME: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3828,6 +3946,13 @@ static int action_line652_ST_VARNAME } } +static int check_key_count_line652_ST_VARNAME(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652_ST_VARNAME: not enough keys\n"); + return 1; +} + int lex_line652_ST_VARNAME() { const size_t padding = 1; /* YYMAXFILL */ @@ -3855,7 +3980,7 @@ int lex_line652_ST_VARNAME() keys = (YYKEYTYPE *) read_file ("php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line652_ST_VARNAME.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3868,7 +3993,7 @@ int lex_line652_ST_VARNAME() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3953,15 +4078,18 @@ yy255: goto *yytarget[yych]; } yy257: - status = action_line652_ST_VARNAME(i, keys, input, token, &cursor, 0); + status = check_key_count_line652_ST_VARNAME(keys_count, i, 3) + || action_line652_ST_VARNAME(&i, keys, input, token, &cursor, 0); continue; yy258: YYSKIP (); - status = action_line652_ST_VARNAME(i, keys, input, token, &cursor, 2); + status = check_key_count_line652_ST_VARNAME(keys_count, i, 3) + || action_line652_ST_VARNAME(&i, keys, input, token, &cursor, 2); continue; yy260: YYSKIP (); - status = action_line652_ST_VARNAME(i, keys, input, token, &cursor, 1); + status = check_key_count_line652_ST_VARNAME(keys_count, i, 3) + || action_line652_ST_VARNAME(&i, keys, input, token, &cursor, 1); continue; } @@ -3973,7 +4101,7 @@ yy260: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652_ST_VARNAME: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652_ST_VARNAME: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c b/re2c/test/php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c index 08924b72..674ac1d3 100644 --- a/re2c/test/php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c +++ b/re2c/test/php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line2358_INITIAL - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line2358_INITIAL , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line2358_INITIAL ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_INITIAL: at position %ld (iteration %u):\n" + , "error: lex_line2358_INITIAL: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line2358_INITIAL } } +static int check_key_count_line2358_INITIAL(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_INITIAL: not enough keys\n"); + return 1; +} + int lex_line2358_INITIAL() { const size_t padding = 7; /* YYMAXFILL */ @@ -126,7 +135,7 @@ int lex_line2358_INITIAL() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_INITIAL.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line2358_INITIAL() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -149,7 +158,8 @@ int lex_line2358_INITIAL() if (yych == '<') goto yy5; YYSKIP (); yy4: - status = action_line2358_INITIAL(i, keys, input, token, &cursor, 3); + status = check_key_count_line2358_INITIAL(keys_count, i, 3) + || action_line2358_INITIAL(&i, keys, input, token, &cursor, 3); continue; yy5: YYSKIP (); @@ -165,11 +175,13 @@ yy5: if (yych == 'p') goto yy10; } yy7: - status = action_line2358_INITIAL(i, keys, input, token, &cursor, 2); + status = check_key_count_line2358_INITIAL(keys_count, i, 3) + || action_line2358_INITIAL(&i, keys, input, token, &cursor, 2); continue; yy8: YYSKIP (); - status = action_line2358_INITIAL(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_INITIAL(keys_count, i, 3) + || action_line2358_INITIAL(&i, keys, input, token, &cursor, 0); continue; yy10: YYSKIP (); @@ -197,7 +209,8 @@ yy13: yy14: YYSKIP (); yy15: - status = action_line2358_INITIAL(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_INITIAL(keys_count, i, 3) + || action_line2358_INITIAL(&i, keys, input, token, &cursor, 1); continue; yy16: YYSKIP (); @@ -213,7 +226,7 @@ yy16: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_INITIAL: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_INITIAL: unused keys left after %u keys\n", i); } } @@ -243,7 +256,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_BACKQUOTE - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -251,10 +264,12 @@ static int action_line2358_ST_BACKQUOTE , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -264,17 +279,17 @@ static int action_line2358_ST_BACKQUOTE ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_BACKQUOTE: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_BACKQUOTE: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -284,6 +299,13 @@ static int action_line2358_ST_BACKQUOTE } } +static int check_key_count_line2358_ST_BACKQUOTE(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_BACKQUOTE: not enough keys\n"); + return 1; +} + int lex_line2358_ST_BACKQUOTE() { const size_t padding = 3; /* YYMAXFILL */ @@ -311,7 +333,7 @@ int lex_line2358_ST_BACKQUOTE() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_BACKQUOTE.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -324,7 +346,7 @@ int lex_line2358_ST_BACKQUOTE() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -373,7 +395,8 @@ int lex_line2358_ST_BACKQUOTE() } YYSKIP (); yy21: - status = action_line2358_ST_BACKQUOTE(i, keys, input, token, &cursor, 6); + status = check_key_count_line2358_ST_BACKQUOTE(keys_count, i, 3) + || action_line2358_ST_BACKQUOTE(&i, keys, input, token, &cursor, 6); continue; yy22: YYSKIP (); @@ -417,7 +440,8 @@ yy22: } yy23: YYSKIP (); - status = action_line2358_ST_BACKQUOTE(i, keys, input, token, &cursor, 5); + status = check_key_count_line2358_ST_BACKQUOTE(keys_count, i, 3) + || action_line2358_ST_BACKQUOTE(&i, keys, input, token, &cursor, 5); continue; yy25: YYSKIP (); @@ -436,15 +460,18 @@ yy26: if (yych <= '@') goto yy28; if (yych <= '[') goto yy35; yy28: - status = action_line2358_ST_BACKQUOTE(i, keys, input, token, &cursor, 3); + status = check_key_count_line2358_ST_BACKQUOTE(keys_count, i, 3) + || action_line2358_ST_BACKQUOTE(&i, keys, input, token, &cursor, 3); continue; yy29: YYSKIP (); - status = action_line2358_ST_BACKQUOTE(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_BACKQUOTE(keys_count, i, 3) + || action_line2358_ST_BACKQUOTE(&i, keys, input, token, &cursor, 0); continue; yy31: YYSKIP (); - status = action_line2358_ST_BACKQUOTE(i, keys, input, token, &cursor, 4); + status = check_key_count_line2358_ST_BACKQUOTE(keys_count, i, 3) + || action_line2358_ST_BACKQUOTE(&i, keys, input, token, &cursor, 4); continue; yy33: YYSKIP (); @@ -455,7 +482,8 @@ yy34: goto yy28; yy35: YYSKIP (); - status = action_line2358_ST_BACKQUOTE(i, keys, input, token, &cursor, 2); + status = check_key_count_line2358_ST_BACKQUOTE(keys_count, i, 3) + || action_line2358_ST_BACKQUOTE(&i, keys, input, token, &cursor, 2); continue; yy37: YYSKIP (); @@ -471,7 +499,8 @@ yy37: } yy38: YYSKIP (); - status = action_line2358_ST_BACKQUOTE(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_ST_BACKQUOTE(keys_count, i, 3) + || action_line2358_ST_BACKQUOTE(&i, keys, input, token, &cursor, 1); continue; } @@ -483,7 +512,7 @@ yy38: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_BACKQUOTE: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_BACKQUOTE: unused keys left after %u keys\n", i); } } @@ -513,7 +542,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_DOUBLE_QUOTES - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -521,10 +550,12 @@ static int action_line2358_ST_DOUBLE_QUOTES , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -534,17 +565,17 @@ static int action_line2358_ST_DOUBLE_QUOTES ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_DOUBLE_QUOTES: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_DOUBLE_QUOTES: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -554,6 +585,13 @@ static int action_line2358_ST_DOUBLE_QUOTES } } +static int check_key_count_line2358_ST_DOUBLE_QUOTES(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_DOUBLE_QUOTES: not enough keys\n"); + return 1; +} + int lex_line2358_ST_DOUBLE_QUOTES() { const size_t padding = 3; /* YYMAXFILL */ @@ -581,7 +619,7 @@ int lex_line2358_ST_DOUBLE_QUOTES() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_DOUBLE_QUOTES.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -594,7 +632,7 @@ int lex_line2358_ST_DOUBLE_QUOTES() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -643,11 +681,13 @@ int lex_line2358_ST_DOUBLE_QUOTES() } YYSKIP (); yy44: - status = action_line2358_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 6); + status = check_key_count_line2358_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line2358_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 6); continue; yy45: YYSKIP (); - status = action_line2358_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 5); + status = check_key_count_line2358_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line2358_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 5); continue; yy47: YYSKIP (); @@ -706,15 +746,18 @@ yy49: if (yych <= '@') goto yy51; if (yych <= '[') goto yy58; yy51: - status = action_line2358_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 3); + status = check_key_count_line2358_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line2358_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 3); continue; yy52: YYSKIP (); - status = action_line2358_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line2358_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 0); continue; yy54: YYSKIP (); - status = action_line2358_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 4); + status = check_key_count_line2358_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line2358_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 4); continue; yy56: YYSKIP (); @@ -725,7 +768,8 @@ yy57: goto yy51; yy58: YYSKIP (); - status = action_line2358_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 2); + status = check_key_count_line2358_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line2358_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 2); continue; yy60: YYSKIP (); @@ -741,7 +785,8 @@ yy60: } yy61: YYSKIP (); - status = action_line2358_ST_DOUBLE_QUOTES(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_ST_DOUBLE_QUOTES(keys_count, i, 3) + || action_line2358_ST_DOUBLE_QUOTES(&i, keys, input, token, &cursor, 1); continue; } @@ -753,7 +798,7 @@ yy61: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_DOUBLE_QUOTES: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_DOUBLE_QUOTES: unused keys left after %u keys\n", i); } } @@ -781,7 +826,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_END_HEREDOC - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -789,10 +834,12 @@ static int action_line2358_ST_END_HEREDOC , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -802,17 +849,17 @@ static int action_line2358_ST_END_HEREDOC ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_END_HEREDOC: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_END_HEREDOC: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -822,6 +869,13 @@ static int action_line2358_ST_END_HEREDOC } } +static int check_key_count_line2358_ST_END_HEREDOC(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_END_HEREDOC: not enough keys\n"); + return 1; +} + int lex_line2358_ST_END_HEREDOC() { const size_t padding = 1; /* YYMAXFILL */ @@ -849,7 +903,7 @@ int lex_line2358_ST_END_HEREDOC() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_END_HEREDOC.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -862,14 +916,15 @@ int lex_line2358_ST_END_HEREDOC() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; if (YYLESSTHAN (1)) YYFILL(1); yych = YYPEEK (); YYSKIP (); - status = action_line2358_ST_END_HEREDOC(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_END_HEREDOC(keys_count, i, 3) + || action_line2358_ST_END_HEREDOC(&i, keys, input, token, &cursor, 0); continue; } @@ -881,7 +936,7 @@ int lex_line2358_ST_END_HEREDOC() } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_END_HEREDOC: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_END_HEREDOC: unused keys left after %u keys\n", i); } } @@ -909,7 +964,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_HEREDOC - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -917,10 +972,12 @@ static int action_line2358_ST_HEREDOC , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -930,17 +987,17 @@ static int action_line2358_ST_HEREDOC ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_HEREDOC: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_HEREDOC: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -950,6 +1007,13 @@ static int action_line2358_ST_HEREDOC } } +static int check_key_count_line2358_ST_HEREDOC(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_HEREDOC: not enough keys\n"); + return 1; +} + int lex_line2358_ST_HEREDOC() { const size_t padding = 3; /* YYMAXFILL */ @@ -977,7 +1041,7 @@ int lex_line2358_ST_HEREDOC() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_HEREDOC.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -990,7 +1054,7 @@ int lex_line2358_ST_HEREDOC() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1035,7 +1099,8 @@ int lex_line2358_ST_HEREDOC() if (yych == '{') goto yy74; YYSKIP (); yy72: - status = action_line2358_ST_HEREDOC(i, keys, input, token, &cursor, 5); + status = check_key_count_line2358_ST_HEREDOC(keys_count, i, 3) + || action_line2358_ST_HEREDOC(&i, keys, input, token, &cursor, 5); continue; yy73: YYSKIP (); @@ -1094,15 +1159,18 @@ yy75: if (yych <= '@') goto yy77; if (yych <= '[') goto yy84; yy77: - status = action_line2358_ST_HEREDOC(i, keys, input, token, &cursor, 3); + status = check_key_count_line2358_ST_HEREDOC(keys_count, i, 3) + || action_line2358_ST_HEREDOC(&i, keys, input, token, &cursor, 3); continue; yy78: YYSKIP (); - status = action_line2358_ST_HEREDOC(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_HEREDOC(keys_count, i, 3) + || action_line2358_ST_HEREDOC(&i, keys, input, token, &cursor, 0); continue; yy80: YYSKIP (); - status = action_line2358_ST_HEREDOC(i, keys, input, token, &cursor, 4); + status = check_key_count_line2358_ST_HEREDOC(keys_count, i, 3) + || action_line2358_ST_HEREDOC(&i, keys, input, token, &cursor, 4); continue; yy82: YYSKIP (); @@ -1113,7 +1181,8 @@ yy83: goto yy77; yy84: YYSKIP (); - status = action_line2358_ST_HEREDOC(i, keys, input, token, &cursor, 2); + status = check_key_count_line2358_ST_HEREDOC(keys_count, i, 3) + || action_line2358_ST_HEREDOC(&i, keys, input, token, &cursor, 2); continue; yy86: YYSKIP (); @@ -1129,7 +1198,8 @@ yy86: } yy87: YYSKIP (); - status = action_line2358_ST_HEREDOC(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_ST_HEREDOC(keys_count, i, 3) + || action_line2358_ST_HEREDOC(&i, keys, input, token, &cursor, 1); continue; } @@ -1141,7 +1211,7 @@ yy87: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_HEREDOC: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_HEREDOC: unused keys left after %u keys\n", i); } } @@ -1171,7 +1241,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_IN_SCRIPTING - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1179,10 +1249,12 @@ static int action_line2358_ST_IN_SCRIPTING , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1192,17 +1264,17 @@ static int action_line2358_ST_IN_SCRIPTING ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_IN_SCRIPTING: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_IN_SCRIPTING: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1212,6 +1284,13 @@ static int action_line2358_ST_IN_SCRIPTING } } +static int check_key_count_line2358_ST_IN_SCRIPTING(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_IN_SCRIPTING: not enough keys\n"); + return 1; +} + int lex_line2358_ST_IN_SCRIPTING() { const size_t padding = 16; /* YYMAXFILL */ @@ -1239,7 +1318,7 @@ int lex_line2358_ST_IN_SCRIPTING() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_IN_SCRIPTING.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1252,7 +1331,7 @@ int lex_line2358_ST_IN_SCRIPTING() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1333,7 +1412,8 @@ int lex_line2358_ST_IN_SCRIPTING() } yy92: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 130); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 130); continue; yy94: YYSKIP (); @@ -1342,21 +1422,25 @@ yy94: if (yybm[0+yych] & 4) { goto yy94; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 40); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 40); continue; yy97: YYSKIP (); if ((yych = YYPEEK ()) == '=') goto yy158; yy98: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 106); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 106); continue; yy99: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 127); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 127); continue; yy101: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 123); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 123); continue; yy103: YYSKIP (); @@ -1385,7 +1469,8 @@ yy105: goto yy98; yy106: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 126); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 126); continue; yy108: yyaccept = 0; @@ -1523,7 +1608,8 @@ yy115: goto *yytarget[yych]; } yy116: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 110); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 110); continue; yy117: yyaccept = 1; @@ -1616,7 +1702,8 @@ yy124: goto *yytarget[(yych = YYPEEK ())]; } yy125: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 122); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 122); continue; yy126: yyaccept = 2; @@ -2153,7 +2240,8 @@ yy146: goto yy133; yy147: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 42); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 42); continue; yy149: YYSKIP (); @@ -2167,11 +2255,13 @@ yy150: goto yy133; yy151: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 129); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 129); continue; yy153: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 107); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 107); continue; yy155: YYSKIP (); @@ -2181,13 +2271,15 @@ yy155: goto yy98; yy156: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 108); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 108); continue; yy158: YYSKIP (); if ((yych = YYPEEK ()) == '=') goto yy282; yy159: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 83); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 83); continue; yy160: YYSKIP (); @@ -2231,19 +2323,23 @@ yy160: goto *yytarget[yych]; } yy162: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 121); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 121); continue; yy163: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 93); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 93); continue; yy165: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 100); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 100); continue; yy167: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 96); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 96); continue; yy169: YYSKIP (); @@ -2401,31 +2497,38 @@ yy180: yy181: YYSKIP (); if ((yych = YYPEEK ()) == '=') goto yy294; - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 89); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 89); continue; yy183: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 88); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 88); continue; yy185: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 78); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 78); continue; yy187: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 86); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 86); continue; yy189: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 79); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 79); continue; yy191: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 87); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 87); continue; yy193: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 39); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 39); continue; yy195: YYSKIP (); @@ -2446,11 +2549,13 @@ yy196: if (yych == 'e') goto yy206; } yy198: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 112); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 112); continue; yy199: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 92); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 92); continue; yy201: yyaccept = 4; @@ -2459,11 +2564,13 @@ yy201: yych = YYPEEK (); if (yych == '*') goto yy298; yy202: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 124); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 124); continue; yy203: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 91); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 91); continue; yy205: YYSKIP (); @@ -2493,7 +2600,8 @@ yy207: goto yy171; yy208: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 41); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 41); continue; yy210: yyaccept = 5; @@ -2504,11 +2612,13 @@ yy210: if (yych <= '<') goto yy308; if (yych <= '=') goto yy310; yy211: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 104); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 104); continue; yy212: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 84); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 84); continue; yy214: YYSKIP (); @@ -2517,31 +2627,37 @@ yy214: yy215: YYSKIP (); if ((yych = YYPEEK ()) == '=') goto yy312; - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 82); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 82); continue; yy217: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 74); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 74); continue; yy219: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 85); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 85); continue; yy221: YYSKIP (); if ((yych = YYPEEK ()) == '=') goto yy314; - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 105); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 105); continue; yy223: YYSKIP (); if ((yych = YYPEEK ()) == '\n') goto yy316; if (yych == '\r') goto yy317; yy224: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 125); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 125); continue; yy225: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 44); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 44); continue; yy227: YYSKIP (); @@ -2566,7 +2682,8 @@ yy230: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 24); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 24); continue; yy232: YYSKIP (); @@ -2716,7 +2833,8 @@ yy239: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 16); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 16); continue; yy241: YYSKIP (); @@ -2823,7 +2941,8 @@ yy252: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 10); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 10); continue; yy254: YYSKIP (); @@ -2900,7 +3019,8 @@ yy260: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 101); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 101); continue; yy262: YYSKIP (); @@ -3084,7 +3204,8 @@ yy274: goto yy133; yy275: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 98); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 98); continue; yy277: YYSKIP (); @@ -3128,15 +3249,18 @@ yy277: } yy278: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 97); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 97); continue; yy280: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 99); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 99); continue; yy282: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 81); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 81); continue; yy284: YYSKIP (); @@ -3200,11 +3324,13 @@ yy293: goto yy171; yy294: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 90); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 90); continue; yy296: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 43); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 43); continue; yy298: YYSKIP (); @@ -3225,7 +3351,8 @@ yy299: if (yybm[0+yych] & 64) { goto yy299; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 109); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 109); continue; yy302: YYSKIP (); @@ -3246,7 +3373,8 @@ yy305: if (yybm[0+yych] & 128) { goto yy305; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 111); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 111); continue; yy308: YYSKIP (); @@ -3291,15 +3419,18 @@ yy308: } yy310: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 94); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 94); continue; yy312: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 80); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 80); continue; yy314: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 95); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 95); continue; yy316: YYSKIP (); @@ -3321,7 +3452,8 @@ yy319: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 102); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 102); continue; yy321: YYSKIP (); @@ -3400,7 +3532,8 @@ yy332: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 1); continue; yy334: YYSKIP (); @@ -3524,7 +3657,8 @@ yy342: goto *yytarget[(yych = YYPEEK ())]; } yy343: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 17); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 17); continue; yy344: YYSKIP (); @@ -3591,7 +3725,8 @@ yy354: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 45); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 45); continue; yy356: YYSKIP (); @@ -3686,7 +3821,8 @@ yy365: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 6); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 6); continue; yy367: YYSKIP (); @@ -3699,14 +3835,16 @@ yy368: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 61); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 61); continue; yy370: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 47); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 47); continue; yy372: YYSKIP (); @@ -3719,7 +3857,8 @@ yy373: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 103); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 103); continue; yy375: YYSKIP (); @@ -3966,7 +4105,8 @@ yy404: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 27); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 27); continue; yy406: YYSKIP (); @@ -4015,7 +4155,8 @@ yy413: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 32); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 32); continue; yy415: YYSKIP (); @@ -4057,7 +4198,8 @@ yy415: goto *yytarget[(yych = YYPEEK ())]; } yy416: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 13); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 13); continue; yy417: YYSKIP (); @@ -4100,14 +4242,16 @@ yy423: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 55); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 55); continue; yy425: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 0); continue; yy427: YYSKIP (); @@ -4144,7 +4288,8 @@ yy432: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 31); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 31); continue; yy434: YYSKIP (); @@ -4215,7 +4360,8 @@ yy439: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 75); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 75); continue; yy441: YYSKIP (); @@ -4398,7 +4544,8 @@ yy470: if (yych != ')') goto yy171; } YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 48); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 48); continue; yy473: YYSKIP (); @@ -4523,7 +4670,8 @@ yy482: yy483: YYSKIP (); yy484: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 128); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 128); continue; yy485: YYSKIP (); @@ -4541,14 +4689,16 @@ yy487: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 76); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 76); continue; yy489: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 29); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 29); continue; yy491: YYSKIP (); @@ -4561,28 +4711,32 @@ yy492: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 7); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 7); continue; yy494: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 34); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 34); continue; yy496: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 46); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 46); continue; yy498: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 3); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 3); continue; yy500: YYSKIP (); @@ -4613,7 +4767,8 @@ yy504: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 65); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 65); continue; yy506: YYSKIP (); @@ -4632,7 +4787,8 @@ yy508: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 12); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 12); continue; yy510: YYSKIP (); @@ -4692,7 +4848,8 @@ yy513: goto *yytarget[(yych = YYPEEK ())]; } yy514: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 69); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 69); continue; yy515: YYSKIP (); @@ -4747,7 +4904,8 @@ yy523: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 64); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 64); continue; yy525: YYSKIP (); @@ -4760,7 +4918,8 @@ yy526: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 33); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 33); continue; yy528: YYSKIP (); @@ -4809,35 +4968,40 @@ yy535: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 9); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 9); continue; yy537: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 36); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 36); continue; yy539: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 73); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 73); continue; yy541: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 14); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 14); continue; yy543: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 5); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 5); continue; yy545: YYSKIP (); @@ -4923,7 +5087,8 @@ yy558: if (yych != ')') goto yy171; } YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 53); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 53); continue; yy561: YYSKIP (); @@ -4951,7 +5116,8 @@ yy564: goto yy171; yy565: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 49); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 49); continue; yy567: YYSKIP (); @@ -5012,7 +5178,8 @@ yy576: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 11); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 11); continue; yy578: YYSKIP (); @@ -5060,7 +5227,8 @@ yy579: goto *yytarget[(yych = YYPEEK ())]; } yy580: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 18); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 18); continue; yy581: YYSKIP (); @@ -5103,7 +5271,8 @@ yy587: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 63); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 63); continue; yy589: YYSKIP (); @@ -5158,7 +5327,8 @@ yy597: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 72); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 72); continue; yy599: YYSKIP (); @@ -5171,21 +5341,24 @@ yy600: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 4); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 4); continue; yy602: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 67); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 67); continue; yy604: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 25); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 25); continue; yy606: YYSKIP (); @@ -5239,7 +5412,8 @@ yy614: goto yy133; yy615: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 51); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 51); continue; yy617: YYSKIP (); @@ -5279,7 +5453,8 @@ yy621: } yy623: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 54); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 54); continue; yy625: YYSKIP (); @@ -5304,14 +5479,16 @@ yy628: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 21); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 21); continue; yy630: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 28); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 28); continue; yy632: YYSKIP (); @@ -5342,21 +5519,24 @@ yy636: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 37); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 37); continue; yy638: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 8); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 8); continue; yy640: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 19); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 19); continue; yy642: YYSKIP (); @@ -5410,7 +5590,8 @@ yy644: goto *yytarget[(yych = YYPEEK ())]; } yy645: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 56); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 56); continue; yy646: YYSKIP (); @@ -5441,7 +5622,8 @@ yy650: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 70); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 70); continue; yy652: YYSKIP (); @@ -5489,7 +5671,8 @@ yy653: goto *yytarget[(yych = YYPEEK ())]; } yy654: - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 58); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 58); continue; yy655: YYSKIP (); @@ -5501,7 +5684,8 @@ yy656: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 119); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 119); continue; yy658: YYSKIP (); @@ -5544,32 +5728,37 @@ yy664: goto yy133; yy665: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 50); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 50); continue; yy667: YYSKIP (); - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 52); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 52); continue; yy669: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 68); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 68); continue; yy671: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 77); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 77); continue; yy673: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 30); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 30); continue; yy675: YYSKIP (); @@ -5594,14 +5783,16 @@ yy678: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 15); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 15); continue; yy680: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 2); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 2); continue; yy682: YYSKIP (); @@ -5661,7 +5852,8 @@ yy691: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 118); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 118); continue; yy693: YYSKIP (); @@ -5680,7 +5872,8 @@ yy695: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 117); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 117); continue; yy697: YYSKIP (); @@ -5715,7 +5908,8 @@ yy702: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 26); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 26); continue; yy704: YYSKIP (); @@ -5740,28 +5934,32 @@ yy707: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 62); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 62); continue; yy709: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 35); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 35); continue; yy711: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 60); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 60); continue; yy713: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 71); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 71); continue; yy715: YYSKIP (); @@ -5774,7 +5972,8 @@ yy716: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 113); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 113); continue; yy718: YYSKIP (); @@ -5804,28 +6003,32 @@ yy722: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 114); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 114); continue; yy724: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 22); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 22); continue; yy726: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 20); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 20); continue; yy728: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 38); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 38); continue; yy730: YYSKIP (); @@ -5838,7 +6041,8 @@ yy731: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 23); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 23); continue; yy733: YYSKIP (); @@ -5862,7 +6066,8 @@ yy736: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 116); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 116); continue; yy738: YYSKIP (); @@ -5903,21 +6108,24 @@ yy744: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 57); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 57); continue; yy746: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 59); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 59); continue; yy748: YYSKIP (); if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 115); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 115); continue; yy750: YYSKIP (); @@ -5941,7 +6149,8 @@ yy753: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 120); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 120); continue; yy755: YYSKIP (); @@ -5953,7 +6162,8 @@ yy756: if (yybm[0+(yych = YYPEEK ())] & 16) { goto yy132; } - status = action_line2358_ST_IN_SCRIPTING(i, keys, input, token, &cursor, 66); + status = check_key_count_line2358_ST_IN_SCRIPTING(keys_count, i, 3) + || action_line2358_ST_IN_SCRIPTING(&i, keys, input, token, &cursor, 66); continue; } @@ -5965,7 +6175,7 @@ yy756: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_IN_SCRIPTING: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_IN_SCRIPTING: unused keys left after %u keys\n", i); } } @@ -5993,7 +6203,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_LOOKING_FOR_PROPERTY - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6001,10 +6211,12 @@ static int action_line2358_ST_LOOKING_FOR_PROPERTY , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6014,17 +6226,17 @@ static int action_line2358_ST_LOOKING_FOR_PROPERTY ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_LOOKING_FOR_PROPERTY: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_LOOKING_FOR_PROPERTY: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6034,6 +6246,13 @@ static int action_line2358_ST_LOOKING_FOR_PROPERTY } } +static int check_key_count_line2358_ST_LOOKING_FOR_PROPERTY(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_LOOKING_FOR_PROPERTY: not enough keys\n"); + return 1; +} + int lex_line2358_ST_LOOKING_FOR_PROPERTY() { const size_t padding = 2; /* YYMAXFILL */ @@ -6061,7 +6280,7 @@ int lex_line2358_ST_LOOKING_FOR_PROPERTY() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_LOOKING_FOR_PROPERTY.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6074,7 +6293,7 @@ int lex_line2358_ST_LOOKING_FOR_PROPERTY() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; static const unsigned char yybm[] = { @@ -6154,7 +6373,8 @@ int lex_line2358_ST_LOOKING_FOR_PROPERTY() yy761: YYSKIP (); yy762: - status = action_line2358_ST_LOOKING_FOR_PROPERTY(i, keys, input, token, &cursor, 3); + status = check_key_count_line2358_ST_LOOKING_FOR_PROPERTY(keys_count, i, 3) + || action_line2358_ST_LOOKING_FOR_PROPERTY(&i, keys, input, token, &cursor, 3); continue; yy763: YYSKIP (); @@ -6163,7 +6383,8 @@ yy763: if (yybm[0+yych] & 64) { goto yy763; } - status = action_line2358_ST_LOOKING_FOR_PROPERTY(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_LOOKING_FOR_PROPERTY(keys_count, i, 3) + || action_line2358_ST_LOOKING_FOR_PROPERTY(&i, keys, input, token, &cursor, 0); continue; yy766: YYSKIP (); @@ -6177,11 +6398,13 @@ yy767: if (yybm[0+yych] & 128) { goto yy767; } - status = action_line2358_ST_LOOKING_FOR_PROPERTY(i, keys, input, token, &cursor, 2); + status = check_key_count_line2358_ST_LOOKING_FOR_PROPERTY(keys_count, i, 3) + || action_line2358_ST_LOOKING_FOR_PROPERTY(&i, keys, input, token, &cursor, 2); continue; yy770: YYSKIP (); - status = action_line2358_ST_LOOKING_FOR_PROPERTY(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_ST_LOOKING_FOR_PROPERTY(keys_count, i, 3) + || action_line2358_ST_LOOKING_FOR_PROPERTY(&i, keys, input, token, &cursor, 1); continue; } @@ -6193,7 +6416,7 @@ yy770: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_LOOKING_FOR_PROPERTY: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_LOOKING_FOR_PROPERTY: unused keys left after %u keys\n", i); } } @@ -6221,7 +6444,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_LOOKING_FOR_VARNAME - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6229,10 +6452,12 @@ static int action_line2358_ST_LOOKING_FOR_VARNAME , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6242,17 +6467,17 @@ static int action_line2358_ST_LOOKING_FOR_VARNAME ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_LOOKING_FOR_VARNAME: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_LOOKING_FOR_VARNAME: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6262,6 +6487,13 @@ static int action_line2358_ST_LOOKING_FOR_VARNAME } } +static int check_key_count_line2358_ST_LOOKING_FOR_VARNAME(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_LOOKING_FOR_VARNAME: not enough keys\n"); + return 1; +} + int lex_line2358_ST_LOOKING_FOR_VARNAME() { const size_t padding = 2; /* YYMAXFILL */ @@ -6289,7 +6521,7 @@ int lex_line2358_ST_LOOKING_FOR_VARNAME() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_LOOKING_FOR_VARNAME.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6302,7 +6534,7 @@ int lex_line2358_ST_LOOKING_FOR_VARNAME() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -6355,7 +6587,8 @@ int lex_line2358_ST_LOOKING_FOR_VARNAME() yy775: YYSKIP (); yy776: - status = action_line2358_ST_LOOKING_FOR_VARNAME(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_ST_LOOKING_FOR_VARNAME(keys_count, i, 3) + || action_line2358_ST_LOOKING_FOR_VARNAME(&i, keys, input, token, &cursor, 1); continue; yy777: YYSKIP (); @@ -6414,7 +6647,8 @@ yy780: goto yy776; yy781: YYSKIP (); - status = action_line2358_ST_LOOKING_FOR_VARNAME(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_LOOKING_FOR_VARNAME(keys_count, i, 3) + || action_line2358_ST_LOOKING_FOR_VARNAME(&i, keys, input, token, &cursor, 0); continue; } @@ -6426,7 +6660,7 @@ yy781: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_LOOKING_FOR_VARNAME: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_LOOKING_FOR_VARNAME: unused keys left after %u keys\n", i); } } @@ -6454,7 +6688,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_NOWDOC - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6462,10 +6696,12 @@ static int action_line2358_ST_NOWDOC , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6475,17 +6711,17 @@ static int action_line2358_ST_NOWDOC ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_NOWDOC: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_NOWDOC: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6495,6 +6731,13 @@ static int action_line2358_ST_NOWDOC } } +static int check_key_count_line2358_ST_NOWDOC(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_NOWDOC: not enough keys\n"); + return 1; +} + int lex_line2358_ST_NOWDOC() { const size_t padding = 1; /* YYMAXFILL */ @@ -6522,7 +6765,7 @@ int lex_line2358_ST_NOWDOC() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_NOWDOC.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6535,14 +6778,15 @@ int lex_line2358_ST_NOWDOC() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; if (YYLESSTHAN (1)) YYFILL(1); yych = YYPEEK (); YYSKIP (); - status = action_line2358_ST_NOWDOC(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_NOWDOC(keys_count, i, 3) + || action_line2358_ST_NOWDOC(&i, keys, input, token, &cursor, 0); continue; } @@ -6554,7 +6798,7 @@ int lex_line2358_ST_NOWDOC() } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_NOWDOC: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_NOWDOC: unused keys left after %u keys\n", i); } } @@ -6582,7 +6826,7 @@ end: #define YYFILL(n) { break; } static int action_line2358_ST_VAR_OFFSET - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6590,10 +6834,12 @@ static int action_line2358_ST_VAR_OFFSET , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6603,17 +6849,17 @@ static int action_line2358_ST_VAR_OFFSET ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line2358_ST_VAR_OFFSET: at position %ld (iteration %u):\n" + , "error: lex_line2358_ST_VAR_OFFSET: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6623,6 +6869,13 @@ static int action_line2358_ST_VAR_OFFSET } } +static int check_key_count_line2358_ST_VAR_OFFSET(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line2358_ST_VAR_OFFSET: not enough keys\n"); + return 1; +} + int lex_line2358_ST_VAR_OFFSET() { const size_t padding = 3; /* YYMAXFILL */ @@ -6650,7 +6903,7 @@ int lex_line2358_ST_VAR_OFFSET() keys = (YYKEYTYPE *) read_file ("php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c.line2358_ST_VAR_OFFSET.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6663,7 +6916,7 @@ int lex_line2358_ST_VAR_OFFSET() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -6743,16 +6996,19 @@ int lex_line2358_ST_VAR_OFFSET() } yy791: YYSKIP (); - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 7); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 7); continue; yy793: YYSKIP (); - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 5); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 5); continue; yy795: YYSKIP (); yy796: - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 4); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 4); continue; yy797: YYSKIP (); @@ -6810,7 +7066,8 @@ yy798: goto *yytarget[yych]; } yy799: - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 0); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 0); continue; yy800: YYSKIP (); @@ -6827,11 +7084,13 @@ yy802: if (yybm[0+yych] & 32) { goto yy802; } - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 6); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 6); continue; yy805: YYSKIP (); - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 3); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 3); continue; yy807: YYSKIP (); @@ -6875,7 +7134,8 @@ yy807: goto *yytarget[yych]; } yy809: - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 2); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 2); continue; yy810: YYSKIP (); @@ -6884,7 +7144,8 @@ yy810: if (yych <= '/') goto yy812; if (yych <= '9') goto yy810; yy812: - status = action_line2358_ST_VAR_OFFSET(i, keys, input, token, &cursor, 1); + status = check_key_count_line2358_ST_VAR_OFFSET(keys_count, i, 3) + || action_line2358_ST_VAR_OFFSET(&i, keys, input, token, &cursor, 1); continue; yy813: YYSKIP (); @@ -6928,7 +7189,7 @@ yy818: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line2358_ST_VAR_OFFSET: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line2358_ST_VAR_OFFSET: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/push.--skeleton.c b/re2c/test/push.--skeleton.c index 6a3d8d11..034c012b 100644 --- a/re2c/test/push.--skeleton.c +++ b/re2c/test/push.--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line261 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line261 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line261 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line261: at position %ld (iteration %u):\n" + , "error: lex_line261: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line261 } } +static int check_key_count_line261(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line261: not enough keys\n"); + return 1; +} + int lex_line261() { const size_t padding = 7; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line261() keys = (YYKEYTYPE *) read_file ("push.--skeleton.c.line261.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line261() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -226,43 +235,53 @@ yy0: } yy2: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 18); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 18); continue; yy4: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 19); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 19); continue; yy6: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 17); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 17); continue; yy8: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 16); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 16); continue; yy10: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 10); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 10); continue; yy12: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 11); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 11); continue; yy14: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 14); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 14); continue; yy16: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 13); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 13); continue; yy18: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 12); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 12); continue; yy20: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 15); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 15); continue; yy22: YYSKIP (); @@ -282,11 +301,13 @@ yy22: default: goto yy24; } yy24: - status = action_line261(i, keys, input, token, &cursor, 8); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 8); continue; yy25: YYSKIP (); - status = action_line261(i, keys, input, token, &cursor, 9); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 9); continue; yy27: YYSKIP (); @@ -360,7 +381,8 @@ yy28: default: goto yy29; } yy29: - status = action_line261(i, keys, input, token, &cursor, 7); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 7); continue; yy30: YYSKIP (); @@ -508,7 +530,8 @@ yy41: default: goto yy42; } yy42: - status = action_line261(i, keys, input, token, &cursor, 0); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 0); continue; yy43: YYSKIP (); @@ -607,7 +630,8 @@ yy47: default: goto yy48; } yy48: - status = action_line261(i, keys, input, token, &cursor, 1); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 1); continue; yy49: YYSKIP (); @@ -706,7 +730,8 @@ yy53: default: goto yy54; } yy54: - status = action_line261(i, keys, input, token, &cursor, 2); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 2); continue; yy55: YYSKIP (); @@ -777,7 +802,8 @@ yy55: default: goto yy56; } yy56: - status = action_line261(i, keys, input, token, &cursor, 3); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 3); continue; yy57: YYSKIP (); @@ -862,7 +888,8 @@ yy59: default: goto yy60; } yy60: - status = action_line261(i, keys, input, token, &cursor, 4); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 4); continue; yy61: YYSKIP (); @@ -940,7 +967,8 @@ yy62: default: goto yy63; } yy63: - status = action_line261(i, keys, input, token, &cursor, 5); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 5); continue; yy64: YYSKIP (); @@ -1011,7 +1039,8 @@ yy64: default: goto yy65; } yy65: - status = action_line261(i, keys, input, token, &cursor, 6); + status = check_key_count_line261(keys_count, i, 3) + || action_line261(&i, keys, input, token, &cursor, 6); continue; } @@ -1023,7 +1052,7 @@ yy65: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line261: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line261: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/repeat-01.cgir--skeleton.c b/re2c/test/repeat-01.cgir--skeleton.c index 770df780..eb4178ee 100644 --- a/re2c/test/repeat-01.cgir--skeleton.c +++ b/re2c/test/repeat-01.cgir--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line13_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line13_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line13_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line13_r1: at position %ld (iteration %u):\n" + , "error: lex_line13_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line13_r1 } } +static int check_key_count_line13_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line13_r1: not enough keys\n"); + return 1; +} + int lex_line13_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line13_r1() keys = (YYKEYTYPE *) read_file ("repeat-01.cgir--skeleton.c.line13_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line13_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -155,19 +164,23 @@ int lex_line13_r1() yy3: yy4: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 2); continue; yy6: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 3); continue; yy8: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 0); continue; yy10: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -179,7 +192,7 @@ yy10: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line13_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line13_r1: unused keys left after %u keys\n", i); } } @@ -205,7 +218,7 @@ end: #define YYFILL(n) { break; } static int action_line13_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -213,10 +226,12 @@ static int action_line13_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -226,17 +241,17 @@ static int action_line13_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line13_r2: at position %ld (iteration %u):\n" + , "error: lex_line13_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -246,6 +261,13 @@ static int action_line13_r2 } } +static int check_key_count_line13_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line13_r2: not enough keys\n"); + return 1; +} + int lex_line13_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -273,7 +295,7 @@ int lex_line13_r2() keys = (YYKEYTYPE *) read_file ("repeat-01.cgir--skeleton.c.line13_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -286,7 +308,7 @@ int lex_line13_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -302,15 +324,18 @@ int lex_line13_r2() yy15: yy16: YYSKIP (); - status = action_line13_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line13_r2(keys_count, i, 3) + || action_line13_r2(&i, keys, input, token, &cursor, 1); continue; yy18: YYSKIP (); - status = action_line13_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line13_r2(keys_count, i, 3) + || action_line13_r2(&i, keys, input, token, &cursor, 2); continue; yy20: YYSKIP (); - status = action_line13_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line13_r2(keys_count, i, 3) + || action_line13_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -322,7 +347,7 @@ yy20: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line13_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line13_r2: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/repeat-02.cgir--skeleton.c b/re2c/test/repeat-02.cgir--skeleton.c index 6892278a..2159dbc7 100644 --- a/re2c/test/repeat-02.cgir--skeleton.c +++ b/re2c/test/repeat-02.cgir--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line13_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line13_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line13_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line13_r1: at position %ld (iteration %u):\n" + , "error: lex_line13_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line13_r1 } } +static int check_key_count_line13_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line13_r1: not enough keys\n"); + return 1; +} + int lex_line13_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line13_r1() keys = (YYKEYTYPE *) read_file ("repeat-02.cgir--skeleton.c.line13_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line13_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -155,19 +164,23 @@ int lex_line13_r1() yy3: yy4: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 2); continue; yy6: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 3); continue; yy8: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 0); continue; yy10: YYSKIP (); - status = action_line13_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line13_r1(keys_count, i, 3) + || action_line13_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -179,7 +192,7 @@ yy10: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line13_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line13_r1: unused keys left after %u keys\n", i); } } @@ -205,7 +218,7 @@ end: #define YYFILL(n) { break; } static int action_line13_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -213,10 +226,12 @@ static int action_line13_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -226,17 +241,17 @@ static int action_line13_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line13_r2: at position %ld (iteration %u):\n" + , "error: lex_line13_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -246,6 +261,13 @@ static int action_line13_r2 } } +static int check_key_count_line13_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line13_r2: not enough keys\n"); + return 1; +} + int lex_line13_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -273,7 +295,7 @@ int lex_line13_r2() keys = (YYKEYTYPE *) read_file ("repeat-02.cgir--skeleton.c.line13_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -286,7 +308,7 @@ int lex_line13_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -302,15 +324,18 @@ int lex_line13_r2() yy15: yy16: YYSKIP (); - status = action_line13_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line13_r2(keys_count, i, 3) + || action_line13_r2(&i, keys, input, token, &cursor, 1); continue; yy18: YYSKIP (); - status = action_line13_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line13_r2(keys_count, i, 3) + || action_line13_r2(&i, keys, input, token, &cursor, 2); continue; yy20: YYSKIP (); - status = action_line13_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line13_r2(keys_count, i, 3) + || action_line13_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -322,7 +347,7 @@ yy20: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line13_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line13_r2: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/repeat-03.cgir--skeleton.c b/re2c/test/repeat-03.cgir--skeleton.c index c325269b..85b85551 100644 --- a/re2c/test/repeat-03.cgir--skeleton.c +++ b/re2c/test/repeat-03.cgir--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line18_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line18_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line18_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line18_r1: at position %ld (iteration %u):\n" + , "error: lex_line18_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line18_r1 } } +static int check_key_count_line18_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line18_r1: not enough keys\n"); + return 1; +} + int lex_line18_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line18_r1() keys = (YYKEYTYPE *) read_file ("repeat-03.cgir--skeleton.c.line18_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line18_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -183,23 +192,28 @@ int lex_line18_r1() yy3: yy4: YYSKIP (); - status = action_line18_r1(i, keys, input, token, &cursor, 4); + status = check_key_count_line18_r1(keys_count, i, 3) + || action_line18_r1(&i, keys, input, token, &cursor, 4); continue; yy6: YYSKIP (); - status = action_line18_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line18_r1(keys_count, i, 3) + || action_line18_r1(&i, keys, input, token, &cursor, 2); continue; yy8: YYSKIP (); - status = action_line18_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line18_r1(keys_count, i, 3) + || action_line18_r1(&i, keys, input, token, &cursor, 3); continue; yy10: YYSKIP (); - status = action_line18_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line18_r1(keys_count, i, 3) + || action_line18_r1(&i, keys, input, token, &cursor, 0); continue; yy12: YYSKIP (); - status = action_line18_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line18_r1(keys_count, i, 3) + || action_line18_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -211,7 +225,7 @@ yy12: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line18_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line18_r1: unused keys left after %u keys\n", i); } } @@ -237,7 +251,7 @@ end: #define YYFILL(n) { break; } static int action_line18_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -245,10 +259,12 @@ static int action_line18_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -258,17 +274,17 @@ static int action_line18_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line18_r2: at position %ld (iteration %u):\n" + , "error: lex_line18_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -278,6 +294,13 @@ static int action_line18_r2 } } +static int check_key_count_line18_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line18_r2: not enough keys\n"); + return 1; +} + int lex_line18_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -305,7 +328,7 @@ int lex_line18_r2() keys = (YYKEYTYPE *) read_file ("repeat-03.cgir--skeleton.c.line18_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -318,7 +341,7 @@ int lex_line18_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -333,15 +356,18 @@ int lex_line18_r2() } yy18: YYSKIP (); - status = action_line18_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line18_r2(keys_count, i, 3) + || action_line18_r2(&i, keys, input, token, &cursor, 2); continue; yy20: YYSKIP (); - status = action_line18_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line18_r2(keys_count, i, 3) + || action_line18_r2(&i, keys, input, token, &cursor, 1); continue; yy22: YYSKIP (); - status = action_line18_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line18_r2(keys_count, i, 3) + || action_line18_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -353,7 +379,7 @@ yy22: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line18_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line18_r2: unused keys left after %u keys\n", i); } } @@ -379,7 +405,7 @@ end: #define YYFILL(n) { break; } static int action_line28_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -387,10 +413,12 @@ static int action_line28_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -400,17 +428,17 @@ static int action_line28_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line28_r1: at position %ld (iteration %u):\n" + , "error: lex_line28_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -420,6 +448,13 @@ static int action_line28_r1 } } +static int check_key_count_line28_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line28_r1: not enough keys\n"); + return 1; +} + int lex_line28_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -447,7 +482,7 @@ int lex_line28_r1() keys = (YYKEYTYPE *) read_file ("repeat-03.cgir--skeleton.c.line28_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -460,7 +495,7 @@ int lex_line28_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -506,23 +541,28 @@ int lex_line28_r1() yy3: yy4: YYSKIP (); - status = action_line28_r1(i, keys, input, token, &cursor, 4); + status = check_key_count_line28_r1(keys_count, i, 3) + || action_line28_r1(&i, keys, input, token, &cursor, 4); continue; yy6: YYSKIP (); - status = action_line28_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line28_r1(keys_count, i, 3) + || action_line28_r1(&i, keys, input, token, &cursor, 2); continue; yy8: YYSKIP (); - status = action_line28_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line28_r1(keys_count, i, 3) + || action_line28_r1(&i, keys, input, token, &cursor, 3); continue; yy10: YYSKIP (); - status = action_line28_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line28_r1(keys_count, i, 3) + || action_line28_r1(&i, keys, input, token, &cursor, 0); continue; yy12: YYSKIP (); - status = action_line28_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line28_r1(keys_count, i, 3) + || action_line28_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -534,7 +574,7 @@ yy12: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line28_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line28_r1: unused keys left after %u keys\n", i); } } @@ -560,7 +600,7 @@ end: #define YYFILL(n) { break; } static int action_line28_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -568,10 +608,12 @@ static int action_line28_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -581,17 +623,17 @@ static int action_line28_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line28_r2: at position %ld (iteration %u):\n" + , "error: lex_line28_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -601,6 +643,13 @@ static int action_line28_r2 } } +static int check_key_count_line28_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line28_r2: not enough keys\n"); + return 1; +} + int lex_line28_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -628,7 +677,7 @@ int lex_line28_r2() keys = (YYKEYTYPE *) read_file ("repeat-03.cgir--skeleton.c.line28_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -641,7 +690,7 @@ int lex_line28_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -656,15 +705,18 @@ int lex_line28_r2() } yy18: YYSKIP (); - status = action_line28_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line28_r2(keys_count, i, 3) + || action_line28_r2(&i, keys, input, token, &cursor, 2); continue; yy20: YYSKIP (); - status = action_line28_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line28_r2(keys_count, i, 3) + || action_line28_r2(&i, keys, input, token, &cursor, 1); continue; yy22: YYSKIP (); - status = action_line28_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line28_r2(keys_count, i, 3) + || action_line28_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -676,7 +728,7 @@ yy22: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line28_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line28_r2: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/repeat-06.gir--skeleton.c b/re2c/test/repeat-06.gir--skeleton.c index 2dc07e38..cc92d880 100644 --- a/re2c/test/repeat-06.gir--skeleton.c +++ b/re2c/test/repeat-06.gir--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line24 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line24 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line24 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line24: at position %ld (iteration %u):\n" + , "error: lex_line24: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line24 } } +static int check_key_count_line24(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line24: not enough keys\n"); + return 1; +} + int lex_line24() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line24() keys = (YYKEYTYPE *) read_file ("repeat-06.gir--skeleton.c.line24.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line24() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -183,27 +192,33 @@ int lex_line24() yy2: yy3: YYSKIP (); - status = action_line24(i, keys, input, token, &cursor, 5); + status = check_key_count_line24(keys_count, i, 3) + || action_line24(&i, keys, input, token, &cursor, 5); continue; yy5: YYSKIP (); - status = action_line24(i, keys, input, token, &cursor, 4); + status = check_key_count_line24(keys_count, i, 3) + || action_line24(&i, keys, input, token, &cursor, 4); continue; yy7: YYSKIP (); - status = action_line24(i, keys, input, token, &cursor, 0); + status = check_key_count_line24(keys_count, i, 3) + || action_line24(&i, keys, input, token, &cursor, 0); continue; yy9: YYSKIP (); - status = action_line24(i, keys, input, token, &cursor, 1); + status = check_key_count_line24(keys_count, i, 3) + || action_line24(&i, keys, input, token, &cursor, 1); continue; yy11: YYSKIP (); - status = action_line24(i, keys, input, token, &cursor, 2); + status = check_key_count_line24(keys_count, i, 3) + || action_line24(&i, keys, input, token, &cursor, 2); continue; yy13: YYSKIP (); - status = action_line24(i, keys, input, token, &cursor, 3); + status = check_key_count_line24(keys_count, i, 3) + || action_line24(&i, keys, input, token, &cursor, 3); continue; } @@ -215,7 +230,7 @@ yy13: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line24: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line24: unused keys left after %u keys\n", i); } } @@ -241,7 +256,7 @@ end: #define YYFILL(n) { break; } static int action_line39 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -249,10 +264,12 @@ static int action_line39 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -262,17 +279,17 @@ static int action_line39 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line39: at position %ld (iteration %u):\n" + , "error: lex_line39: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -282,6 +299,13 @@ static int action_line39 } } +static int check_key_count_line39(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line39: not enough keys\n"); + return 1; +} + int lex_line39() { const size_t padding = 1; /* YYMAXFILL */ @@ -309,7 +333,7 @@ int lex_line39() keys = (YYKEYTYPE *) read_file ("repeat-06.gir--skeleton.c.line39.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -322,7 +346,7 @@ int lex_line39() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -368,27 +392,33 @@ int lex_line39() yy2: yy3: YYSKIP (); - status = action_line39(i, keys, input, token, &cursor, 5); + status = check_key_count_line39(keys_count, i, 3) + || action_line39(&i, keys, input, token, &cursor, 5); continue; yy5: YYSKIP (); - status = action_line39(i, keys, input, token, &cursor, 4); + status = check_key_count_line39(keys_count, i, 3) + || action_line39(&i, keys, input, token, &cursor, 4); continue; yy7: YYSKIP (); - status = action_line39(i, keys, input, token, &cursor, 0); + status = check_key_count_line39(keys_count, i, 3) + || action_line39(&i, keys, input, token, &cursor, 0); continue; yy9: YYSKIP (); - status = action_line39(i, keys, input, token, &cursor, 1); + status = check_key_count_line39(keys_count, i, 3) + || action_line39(&i, keys, input, token, &cursor, 1); continue; yy11: YYSKIP (); - status = action_line39(i, keys, input, token, &cursor, 2); + status = check_key_count_line39(keys_count, i, 3) + || action_line39(&i, keys, input, token, &cursor, 2); continue; yy13: YYSKIP (); - status = action_line39(i, keys, input, token, &cursor, 3); + status = check_key_count_line39(keys_count, i, 3) + || action_line39(&i, keys, input, token, &cursor, 3); continue; } @@ -400,7 +430,7 @@ yy13: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line39: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line39: unused keys left after %u keys\n", i); } } @@ -426,7 +456,7 @@ end: #define YYFILL(n) { break; } static int action_line54 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -434,10 +464,12 @@ static int action_line54 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -447,17 +479,17 @@ static int action_line54 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line54: at position %ld (iteration %u):\n" + , "error: lex_line54: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -467,6 +499,13 @@ static int action_line54 } } +static int check_key_count_line54(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line54: not enough keys\n"); + return 1; +} + int lex_line54() { const size_t padding = 1; /* YYMAXFILL */ @@ -494,7 +533,7 @@ int lex_line54() keys = (YYKEYTYPE *) read_file ("repeat-06.gir--skeleton.c.line54.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -507,7 +546,7 @@ int lex_line54() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -553,27 +592,33 @@ int lex_line54() yy2: yy3: YYSKIP (); - status = action_line54(i, keys, input, token, &cursor, 5); + status = check_key_count_line54(keys_count, i, 3) + || action_line54(&i, keys, input, token, &cursor, 5); continue; yy5: YYSKIP (); - status = action_line54(i, keys, input, token, &cursor, 4); + status = check_key_count_line54(keys_count, i, 3) + || action_line54(&i, keys, input, token, &cursor, 4); continue; yy7: YYSKIP (); - status = action_line54(i, keys, input, token, &cursor, 0); + status = check_key_count_line54(keys_count, i, 3) + || action_line54(&i, keys, input, token, &cursor, 0); continue; yy9: YYSKIP (); - status = action_line54(i, keys, input, token, &cursor, 1); + status = check_key_count_line54(keys_count, i, 3) + || action_line54(&i, keys, input, token, &cursor, 1); continue; yy11: YYSKIP (); - status = action_line54(i, keys, input, token, &cursor, 2); + status = check_key_count_line54(keys_count, i, 3) + || action_line54(&i, keys, input, token, &cursor, 2); continue; yy13: YYSKIP (); - status = action_line54(i, keys, input, token, &cursor, 3); + status = check_key_count_line54(keys_count, i, 3) + || action_line54(&i, keys, input, token, &cursor, 3); continue; } @@ -585,7 +630,7 @@ yy13: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line54: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line54: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/repeat-07_default.gir--skeleton.c b/re2c/test/repeat-07_default.gir--skeleton.c index 6e633600..0701c69a 100644 --- a/re2c/test/repeat-07_default.gir--skeleton.c +++ b/re2c/test/repeat-07_default.gir--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line28 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line28 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line28 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line28: at position %ld (iteration %u):\n" + , "error: lex_line28: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line28 } } +static int check_key_count_line28(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line28: not enough keys\n"); + return 1; +} + int lex_line28() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line28() keys = (YYKEYTYPE *) read_file ("repeat-07_default.gir--skeleton.c.line28.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line28() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -182,31 +191,38 @@ int lex_line28() } yy2: YYSKIP (); - status = action_line28(i, keys, input, token, &cursor, 5); + status = check_key_count_line28(keys_count, i, 3) + || action_line28(&i, keys, input, token, &cursor, 5); continue; yy4: YYSKIP (); - status = action_line28(i, keys, input, token, &cursor, 254); + status = check_key_count_line28(keys_count, i, 3) + || action_line28(&i, keys, input, token, &cursor, 254); continue; yy6: YYSKIP (); - status = action_line28(i, keys, input, token, &cursor, 4); + status = check_key_count_line28(keys_count, i, 3) + || action_line28(&i, keys, input, token, &cursor, 4); continue; yy8: YYSKIP (); - status = action_line28(i, keys, input, token, &cursor, 0); + status = check_key_count_line28(keys_count, i, 3) + || action_line28(&i, keys, input, token, &cursor, 0); continue; yy10: YYSKIP (); - status = action_line28(i, keys, input, token, &cursor, 1); + status = check_key_count_line28(keys_count, i, 3) + || action_line28(&i, keys, input, token, &cursor, 1); continue; yy12: YYSKIP (); - status = action_line28(i, keys, input, token, &cursor, 2); + status = check_key_count_line28(keys_count, i, 3) + || action_line28(&i, keys, input, token, &cursor, 2); continue; yy14: YYSKIP (); - status = action_line28(i, keys, input, token, &cursor, 3); + status = check_key_count_line28(keys_count, i, 3) + || action_line28(&i, keys, input, token, &cursor, 3); continue; } @@ -218,7 +234,7 @@ yy14: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line28: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line28: unused keys left after %u keys\n", i); } } @@ -244,7 +260,7 @@ end: #define YYFILL(n) { break; } static int action_line46 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -252,10 +268,12 @@ static int action_line46 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -265,17 +283,17 @@ static int action_line46 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line46: at position %ld (iteration %u):\n" + , "error: lex_line46: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -285,6 +303,13 @@ static int action_line46 } } +static int check_key_count_line46(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line46: not enough keys\n"); + return 1; +} + int lex_line46() { const size_t padding = 1; /* YYMAXFILL */ @@ -318,7 +343,7 @@ int lex_line46() keys = (YYKEYTYPE *) read_file ("repeat-07_default.gir--skeleton.c.line46.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -331,7 +356,7 @@ int lex_line46() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -377,31 +402,38 @@ int lex_line46() } yy2: YYSKIP (); - status = action_line46(i, keys, input, token, &cursor, 5); + status = check_key_count_line46(keys_count, i, 3) + || action_line46(&i, keys, input, token, &cursor, 5); continue; yy4: YYSKIP (); - status = action_line46(i, keys, input, token, &cursor, 254); + status = check_key_count_line46(keys_count, i, 3) + || action_line46(&i, keys, input, token, &cursor, 254); continue; yy6: YYSKIP (); - status = action_line46(i, keys, input, token, &cursor, 4); + status = check_key_count_line46(keys_count, i, 3) + || action_line46(&i, keys, input, token, &cursor, 4); continue; yy8: YYSKIP (); - status = action_line46(i, keys, input, token, &cursor, 0); + status = check_key_count_line46(keys_count, i, 3) + || action_line46(&i, keys, input, token, &cursor, 0); continue; yy10: YYSKIP (); - status = action_line46(i, keys, input, token, &cursor, 1); + status = check_key_count_line46(keys_count, i, 3) + || action_line46(&i, keys, input, token, &cursor, 1); continue; yy12: YYSKIP (); - status = action_line46(i, keys, input, token, &cursor, 2); + status = check_key_count_line46(keys_count, i, 3) + || action_line46(&i, keys, input, token, &cursor, 2); continue; yy14: YYSKIP (); - status = action_line46(i, keys, input, token, &cursor, 3); + status = check_key_count_line46(keys_count, i, 3) + || action_line46(&i, keys, input, token, &cursor, 3); continue; } @@ -413,7 +445,7 @@ yy14: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line46: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line46: unused keys left after %u keys\n", i); } } @@ -439,7 +471,7 @@ end: #define YYFILL(n) { break; } static int action_line64 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -447,10 +479,12 @@ static int action_line64 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -460,17 +494,17 @@ static int action_line64 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line64: at position %ld (iteration %u):\n" + , "error: lex_line64: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -480,6 +514,13 @@ static int action_line64 } } +static int check_key_count_line64(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line64: not enough keys\n"); + return 1; +} + int lex_line64() { const size_t padding = 1; /* YYMAXFILL */ @@ -513,7 +554,7 @@ int lex_line64() keys = (YYKEYTYPE *) read_file ("repeat-07_default.gir--skeleton.c.line64.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -526,7 +567,7 @@ int lex_line64() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -572,31 +613,38 @@ int lex_line64() } yy2: YYSKIP (); - status = action_line64(i, keys, input, token, &cursor, 5); + status = check_key_count_line64(keys_count, i, 3) + || action_line64(&i, keys, input, token, &cursor, 5); continue; yy4: YYSKIP (); - status = action_line64(i, keys, input, token, &cursor, 254); + status = check_key_count_line64(keys_count, i, 3) + || action_line64(&i, keys, input, token, &cursor, 254); continue; yy6: YYSKIP (); - status = action_line64(i, keys, input, token, &cursor, 4); + status = check_key_count_line64(keys_count, i, 3) + || action_line64(&i, keys, input, token, &cursor, 4); continue; yy8: YYSKIP (); - status = action_line64(i, keys, input, token, &cursor, 0); + status = check_key_count_line64(keys_count, i, 3) + || action_line64(&i, keys, input, token, &cursor, 0); continue; yy10: YYSKIP (); - status = action_line64(i, keys, input, token, &cursor, 1); + status = check_key_count_line64(keys_count, i, 3) + || action_line64(&i, keys, input, token, &cursor, 1); continue; yy12: YYSKIP (); - status = action_line64(i, keys, input, token, &cursor, 2); + status = check_key_count_line64(keys_count, i, 3) + || action_line64(&i, keys, input, token, &cursor, 2); continue; yy14: YYSKIP (); - status = action_line64(i, keys, input, token, &cursor, 3); + status = check_key_count_line64(keys_count, i, 3) + || action_line64(&i, keys, input, token, &cursor, 3); continue; } @@ -608,7 +656,7 @@ yy14: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line64: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line64: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/reuse_conds_default_0.cgir--skeleton.c b/re2c/test/reuse_conds_default_0.cgir--skeleton.c index 2f56a23e..0b147c57 100644 --- a/re2c/test/reuse_conds_default_0.cgir--skeleton.c +++ b/re2c/test/reuse_conds_default_0.cgir--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line15_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line15_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line15_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line15_r1: at position %ld (iteration %u):\n" + , "error: lex_line15_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line15_r1 } } +static int check_key_count_line15_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line15_r1: not enough keys\n"); + return 1; +} + int lex_line15_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line15_r1() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_0.cgir--skeleton.c.line15_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line15_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -182,27 +191,33 @@ int lex_line15_r1() } yy3: YYSKIP (); - status = action_line15_r1(i, keys, input, token, &cursor, 4); + status = check_key_count_line15_r1(keys_count, i, 3) + || action_line15_r1(&i, keys, input, token, &cursor, 4); continue; yy5: YYSKIP (); - status = action_line15_r1(i, keys, input, token, &cursor, 254); + status = check_key_count_line15_r1(keys_count, i, 3) + || action_line15_r1(&i, keys, input, token, &cursor, 254); continue; yy7: YYSKIP (); - status = action_line15_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line15_r1(keys_count, i, 3) + || action_line15_r1(&i, keys, input, token, &cursor, 2); continue; yy9: YYSKIP (); - status = action_line15_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line15_r1(keys_count, i, 3) + || action_line15_r1(&i, keys, input, token, &cursor, 3); continue; yy11: YYSKIP (); - status = action_line15_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line15_r1(keys_count, i, 3) + || action_line15_r1(&i, keys, input, token, &cursor, 0); continue; yy13: YYSKIP (); - status = action_line15_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line15_r1(keys_count, i, 3) + || action_line15_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -214,7 +229,7 @@ yy13: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line15_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line15_r1: unused keys left after %u keys\n", i); } } @@ -240,7 +255,7 @@ end: #define YYFILL(n) { break; } static int action_line15_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -248,10 +263,12 @@ static int action_line15_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -261,17 +278,17 @@ static int action_line15_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line15_r2: at position %ld (iteration %u):\n" + , "error: lex_line15_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -281,6 +298,13 @@ static int action_line15_r2 } } +static int check_key_count_line15_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line15_r2: not enough keys\n"); + return 1; +} + int lex_line15_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -308,7 +332,7 @@ int lex_line15_r2() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_0.cgir--skeleton.c.line15_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -321,7 +345,7 @@ int lex_line15_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -336,15 +360,18 @@ int lex_line15_r2() } yy19: YYSKIP (); - status = action_line15_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line15_r2(keys_count, i, 3) + || action_line15_r2(&i, keys, input, token, &cursor, 2); continue; yy21: YYSKIP (); - status = action_line15_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line15_r2(keys_count, i, 3) + || action_line15_r2(&i, keys, input, token, &cursor, 1); continue; yy23: YYSKIP (); - status = action_line15_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line15_r2(keys_count, i, 3) + || action_line15_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -356,7 +383,7 @@ yy23: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line15_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line15_r2: unused keys left after %u keys\n", i); } } @@ -382,7 +409,7 @@ end: #define YYFILL(n) { break; } static int action_line20_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -390,10 +417,12 @@ static int action_line20_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -403,17 +432,17 @@ static int action_line20_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line20_r1: at position %ld (iteration %u):\n" + , "error: lex_line20_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -423,6 +452,13 @@ static int action_line20_r1 } } +static int check_key_count_line20_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line20_r1: not enough keys\n"); + return 1; +} + int lex_line20_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -450,7 +486,7 @@ int lex_line20_r1() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_0.cgir--skeleton.c.line20_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -463,7 +499,7 @@ int lex_line20_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -509,23 +545,28 @@ int lex_line20_r1() yy3: yy4: YYSKIP (); - status = action_line20_r1(i, keys, input, token, &cursor, 4); + status = check_key_count_line20_r1(keys_count, i, 3) + || action_line20_r1(&i, keys, input, token, &cursor, 4); continue; yy6: YYSKIP (); - status = action_line20_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line20_r1(keys_count, i, 3) + || action_line20_r1(&i, keys, input, token, &cursor, 2); continue; yy8: YYSKIP (); - status = action_line20_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line20_r1(keys_count, i, 3) + || action_line20_r1(&i, keys, input, token, &cursor, 3); continue; yy10: YYSKIP (); - status = action_line20_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line20_r1(keys_count, i, 3) + || action_line20_r1(&i, keys, input, token, &cursor, 0); continue; yy12: YYSKIP (); - status = action_line20_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line20_r1(keys_count, i, 3) + || action_line20_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -537,7 +578,7 @@ yy12: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line20_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line20_r1: unused keys left after %u keys\n", i); } } @@ -563,7 +604,7 @@ end: #define YYFILL(n) { break; } static int action_line20_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -571,10 +612,12 @@ static int action_line20_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -584,17 +627,17 @@ static int action_line20_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line20_r2: at position %ld (iteration %u):\n" + , "error: lex_line20_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -604,6 +647,13 @@ static int action_line20_r2 } } +static int check_key_count_line20_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line20_r2: not enough keys\n"); + return 1; +} + int lex_line20_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -631,7 +681,7 @@ int lex_line20_r2() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_0.cgir--skeleton.c.line20_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -644,7 +694,7 @@ int lex_line20_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -657,19 +707,23 @@ int lex_line20_r2() if (yych == 'c') goto yy23; } YYSKIP (); - status = action_line20_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line20_r2(keys_count, i, 3) + || action_line20_r2(&i, keys, input, token, &cursor, 2); continue; yy19: YYSKIP (); - status = action_line20_r2(i, keys, input, token, &cursor, 254); + status = check_key_count_line20_r2(keys_count, i, 3) + || action_line20_r2(&i, keys, input, token, &cursor, 254); continue; yy21: YYSKIP (); - status = action_line20_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line20_r2(keys_count, i, 3) + || action_line20_r2(&i, keys, input, token, &cursor, 1); continue; yy23: YYSKIP (); - status = action_line20_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line20_r2(keys_count, i, 3) + || action_line20_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -681,7 +735,7 @@ yy23: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line20_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line20_r2: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/reuse_conds_default_1.cgir--skeleton.c b/re2c/test/reuse_conds_default_1.cgir--skeleton.c index 80976bfd..a52dbdb2 100644 --- a/re2c/test/reuse_conds_default_1.cgir--skeleton.c +++ b/re2c/test/reuse_conds_default_1.cgir--skeleton.c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line22_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line22_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line22_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line22_r1: at position %ld (iteration %u):\n" + , "error: lex_line22_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line22_r1 } } +static int check_key_count_line22_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line22_r1: not enough keys\n"); + return 1; +} + int lex_line22_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line22_r1() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_1.cgir--skeleton.c.line22_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line22_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -182,27 +191,33 @@ int lex_line22_r1() } yy3: YYSKIP (); - status = action_line22_r1(i, keys, input, token, &cursor, 4); + status = check_key_count_line22_r1(keys_count, i, 3) + || action_line22_r1(&i, keys, input, token, &cursor, 4); continue; yy5: YYSKIP (); - status = action_line22_r1(i, keys, input, token, &cursor, 254); + status = check_key_count_line22_r1(keys_count, i, 3) + || action_line22_r1(&i, keys, input, token, &cursor, 254); continue; yy7: YYSKIP (); - status = action_line22_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line22_r1(keys_count, i, 3) + || action_line22_r1(&i, keys, input, token, &cursor, 2); continue; yy9: YYSKIP (); - status = action_line22_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line22_r1(keys_count, i, 3) + || action_line22_r1(&i, keys, input, token, &cursor, 3); continue; yy11: YYSKIP (); - status = action_line22_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line22_r1(keys_count, i, 3) + || action_line22_r1(&i, keys, input, token, &cursor, 0); continue; yy13: YYSKIP (); - status = action_line22_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line22_r1(keys_count, i, 3) + || action_line22_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -214,7 +229,7 @@ yy13: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line22_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line22_r1: unused keys left after %u keys\n", i); } } @@ -240,7 +255,7 @@ end: #define YYFILL(n) { break; } static int action_line22_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -248,10 +263,12 @@ static int action_line22_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -261,17 +278,17 @@ static int action_line22_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line22_r2: at position %ld (iteration %u):\n" + , "error: lex_line22_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -281,6 +298,13 @@ static int action_line22_r2 } } +static int check_key_count_line22_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line22_r2: not enough keys\n"); + return 1; +} + int lex_line22_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -308,7 +332,7 @@ int lex_line22_r2() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_1.cgir--skeleton.c.line22_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -321,7 +345,7 @@ int lex_line22_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -334,19 +358,23 @@ int lex_line22_r2() if (yych == 'c') goto yy24; } YYSKIP (); - status = action_line22_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line22_r2(keys_count, i, 3) + || action_line22_r2(&i, keys, input, token, &cursor, 2); continue; yy20: YYSKIP (); - status = action_line22_r2(i, keys, input, token, &cursor, 254); + status = check_key_count_line22_r2(keys_count, i, 3) + || action_line22_r2(&i, keys, input, token, &cursor, 254); continue; yy22: YYSKIP (); - status = action_line22_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line22_r2(keys_count, i, 3) + || action_line22_r2(&i, keys, input, token, &cursor, 1); continue; yy24: YYSKIP (); - status = action_line22_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line22_r2(keys_count, i, 3) + || action_line22_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -358,7 +386,7 @@ yy24: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line22_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line22_r2: unused keys left after %u keys\n", i); } } @@ -384,7 +412,7 @@ end: #define YYFILL(n) { break; } static int action_line32_r1 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -392,10 +420,12 @@ static int action_line32_r1 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -405,17 +435,17 @@ static int action_line32_r1 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line32_r1: at position %ld (iteration %u):\n" + , "error: lex_line32_r1: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -425,6 +455,13 @@ static int action_line32_r1 } } +static int check_key_count_line32_r1(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line32_r1: not enough keys\n"); + return 1; +} + int lex_line32_r1() { const size_t padding = 1; /* YYMAXFILL */ @@ -452,7 +489,7 @@ int lex_line32_r1() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_1.cgir--skeleton.c.line32_r1.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -465,7 +502,7 @@ int lex_line32_r1() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -510,27 +547,33 @@ int lex_line32_r1() } yy3: YYSKIP (); - status = action_line32_r1(i, keys, input, token, &cursor, 4); + status = check_key_count_line32_r1(keys_count, i, 3) + || action_line32_r1(&i, keys, input, token, &cursor, 4); continue; yy5: YYSKIP (); - status = action_line32_r1(i, keys, input, token, &cursor, 254); + status = check_key_count_line32_r1(keys_count, i, 3) + || action_line32_r1(&i, keys, input, token, &cursor, 254); continue; yy7: YYSKIP (); - status = action_line32_r1(i, keys, input, token, &cursor, 2); + status = check_key_count_line32_r1(keys_count, i, 3) + || action_line32_r1(&i, keys, input, token, &cursor, 2); continue; yy9: YYSKIP (); - status = action_line32_r1(i, keys, input, token, &cursor, 3); + status = check_key_count_line32_r1(keys_count, i, 3) + || action_line32_r1(&i, keys, input, token, &cursor, 3); continue; yy11: YYSKIP (); - status = action_line32_r1(i, keys, input, token, &cursor, 0); + status = check_key_count_line32_r1(keys_count, i, 3) + || action_line32_r1(&i, keys, input, token, &cursor, 0); continue; yy13: YYSKIP (); - status = action_line32_r1(i, keys, input, token, &cursor, 1); + status = check_key_count_line32_r1(keys_count, i, 3) + || action_line32_r1(&i, keys, input, token, &cursor, 1); continue; } @@ -542,7 +585,7 @@ yy13: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line32_r1: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line32_r1: unused keys left after %u keys\n", i); } } @@ -568,7 +611,7 @@ end: #define YYFILL(n) { break; } static int action_line32_r2 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -576,10 +619,12 @@ static int action_line32_r2 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -589,17 +634,17 @@ static int action_line32_r2 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line32_r2: at position %ld (iteration %u):\n" + , "error: lex_line32_r2: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -609,6 +654,13 @@ static int action_line32_r2 } } +static int check_key_count_line32_r2(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line32_r2: not enough keys\n"); + return 1; +} + int lex_line32_r2() { const size_t padding = 1; /* YYMAXFILL */ @@ -636,7 +688,7 @@ int lex_line32_r2() keys = (YYKEYTYPE *) read_file ("reuse_conds_default_1.cgir--skeleton.c.line32_r2.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -649,7 +701,7 @@ int lex_line32_r2() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -664,15 +716,18 @@ int lex_line32_r2() } yy19: YYSKIP (); - status = action_line32_r2(i, keys, input, token, &cursor, 2); + status = check_key_count_line32_r2(keys_count, i, 3) + || action_line32_r2(&i, keys, input, token, &cursor, 2); continue; yy21: YYSKIP (); - status = action_line32_r2(i, keys, input, token, &cursor, 1); + status = check_key_count_line32_r2(keys_count, i, 3) + || action_line32_r2(&i, keys, input, token, &cursor, 1); continue; yy23: YYSKIP (); - status = action_line32_r2(i, keys, input, token, &cursor, 0); + status = check_key_count_line32_r2(keys_count, i, 3) + || action_line32_r2(&i, keys, input, token, &cursor, 0); continue; } @@ -684,7 +739,7 @@ yy23: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line32_r2: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line32_r2: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/rexx.--skeleton.c b/re2c/test/rexx.--skeleton.c index 3d8b0e7d..a26e1c5a 100644 --- a/re2c/test/rexx.--skeleton.c +++ b/re2c/test/rexx.--skeleton.c @@ -60,7 +60,7 @@ error: #define YYFILL(n) { break; } static int action_line265 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -68,10 +68,12 @@ static int action_line265 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -81,17 +83,17 @@ static int action_line265 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line265: at position %ld (iteration %u):\n" + , "error: lex_line265: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -101,6 +103,13 @@ static int action_line265 } } +static int check_key_count_line265(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line265: not enough keys\n"); + return 1; +} + int lex_line265() { const size_t padding = 13; /* YYMAXFILL */ @@ -128,7 +137,7 @@ int lex_line265() keys = (YYKEYTYPE *) read_file ("rexx.--skeleton.c.line265.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -141,7 +150,7 @@ int lex_line265() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; const YYCTYPE *ctxmarker = NULL; @@ -241,20 +250,24 @@ int lex_line265() default: goto yy5; } yy2: - status = action_line265(i, keys, input, token, &cursor, 89); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 89); continue; yy3: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 93); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 93); continue; yy5: YYSKIP (); yy6: - status = action_line265(i, keys, input, token, &cursor, 94); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 94); continue; yy7: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 0); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 0); continue; yy9: YYSKIP (); @@ -331,7 +344,8 @@ yy10: default: goto yy11; } yy11: - status = action_line265(i, keys, input, token, &cursor, 87); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 87); continue; yy12: yyaccept = 0; @@ -345,7 +359,8 @@ yy12: } yy13: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 6); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 6); continue; yy15: yyaccept = 1; @@ -359,7 +374,8 @@ yy15: default: goto yy16; } yy16: - status = action_line265(i, keys, input, token, &cursor, 21); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 21); continue; yy17: yyaccept = 0; @@ -373,11 +389,13 @@ yy17: } yy18: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 27); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 27); continue; yy20: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 28); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 28); continue; yy22: yyaccept = 2; @@ -391,19 +409,23 @@ yy22: default: goto yy23; } yy23: - status = action_line265(i, keys, input, token, &cursor, 4); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 4); continue; yy24: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 2); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 2); continue; yy26: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 26); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 26); continue; yy28: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 3); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 3); continue; yy30: YYSKIP (); @@ -479,7 +501,8 @@ yy30: default: goto yy32; } yy32: - status = action_line265(i, keys, input, token, &cursor, 86); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 86); continue; yy33: yyaccept = 3; @@ -493,15 +516,18 @@ yy33: default: goto yy34; } yy34: - status = action_line265(i, keys, input, token, &cursor, 5); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 5); continue; yy35: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 25); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 25); continue; yy37: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 29); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 29); continue; yy39: yyaccept = 4; @@ -517,7 +543,8 @@ yy39: default: goto yy40; } yy40: - status = action_line265(i, keys, input, token, &cursor, 12); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 12); continue; yy41: yyaccept = 5; @@ -531,7 +558,8 @@ yy41: default: goto yy42; } yy42: - status = action_line265(i, keys, input, token, &cursor, 9); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 9); continue; yy43: yyaccept = 6; @@ -547,7 +575,8 @@ yy43: default: goto yy44; } yy44: - status = action_line265(i, keys, input, token, &cursor, 11); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 11); continue; yy45: YYSKIP (); @@ -771,7 +800,8 @@ yy64: default: goto yy65; } yy65: - status = action_line265(i, keys, input, token, &cursor, 24); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 24); continue; yy66: yyaccept = 8; @@ -785,7 +815,8 @@ yy66: default: goto yy67; } yy67: - status = action_line265(i, keys, input, token, &cursor, 22); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 22); continue; yy68: YYSKIP (); @@ -859,7 +890,8 @@ yy68: default: goto yy69; } yy69: - status = action_line265(i, keys, input, token, &cursor, 88); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 88); continue; yy70: YYSKIP (); @@ -907,7 +939,8 @@ yy73: default: goto yy74; } yy74: - status = action_line265(i, keys, input, token, &cursor, 90); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 90); continue; yy75: YYSKIP (); @@ -921,7 +954,8 @@ yy75: } yy77: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 23); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 23); continue; yy79: YYSKIP (); @@ -960,7 +994,8 @@ yy82: } yy84: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 8); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 8); continue; yy86: yyaccept = 10; @@ -1051,7 +1086,8 @@ yy88: } yy90: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 7); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 7); continue; yy92: YYSKIP (); @@ -1078,17 +1114,20 @@ yy94: default: goto yy95; } yy95: - status = action_line265(i, keys, input, token, &cursor, 18); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 18); continue; yy96: YYSKIP (); yy97: - status = action_line265(i, keys, input, token, &cursor, 14); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 14); continue; yy98: YYSKIP (); yy99: - status = action_line265(i, keys, input, token, &cursor, 10); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 10); continue; yy100: YYSKIP (); @@ -1102,7 +1141,8 @@ yy100: } yy102: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 15); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 15); continue; yy104: YYSKIP (); @@ -1120,7 +1160,8 @@ yy105: yy106: YYSKIP (); yy107: - status = action_line265(i, keys, input, token, &cursor, 13); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 13); continue; yy108: yyaccept = 12; @@ -1134,7 +1175,8 @@ yy108: default: goto yy109; } yy109: - status = action_line265(i, keys, input, token, &cursor, 17); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 17); continue; yy110: YYSKIP (); @@ -1224,7 +1266,8 @@ yy112: default: goto yy113; } yy113: - status = action_line265(i, keys, input, token, &cursor, 60); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 60); continue; yy114: YYSKIP (); @@ -1314,7 +1357,8 @@ yy116: default: goto yy117; } yy117: - status = action_line265(i, keys, input, token, &cursor, 33); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 33); continue; yy118: YYSKIP (); @@ -1464,7 +1508,8 @@ yy127: default: goto yy128; } yy128: - status = action_line265(i, keys, input, token, &cursor, 38); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 38); continue; yy129: YYSKIP (); @@ -1606,7 +1651,8 @@ yy137: default: goto yy138; } yy138: - status = action_line265(i, keys, input, token, &cursor, 59); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 59); continue; yy139: YYSKIP (); @@ -1794,7 +1840,8 @@ yy153: default: goto yy154; } yy154: - status = action_line265(i, keys, input, token, &cursor, 78); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 78); continue; yy155: YYSKIP (); @@ -1914,7 +1961,8 @@ yy167: } yy169: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 1); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 1); continue; yy171: YYSKIP (); @@ -2165,7 +2213,8 @@ yy176: } yy178: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 20); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 20); continue; yy180: YYSKIP (); @@ -2179,7 +2228,8 @@ yy180: } yy182: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 19); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 19); continue; yy184: YYSKIP (); @@ -2261,7 +2311,8 @@ yy185: default: goto yy186; } yy186: - status = action_line265(i, keys, input, token, &cursor, 31); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 31); continue; yy187: YYSKIP (); @@ -2367,7 +2418,8 @@ yy191: default: goto yy192; } yy192: - status = action_line265(i, keys, input, token, &cursor, 36); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 36); continue; yy193: YYSKIP (); @@ -2481,7 +2533,8 @@ yy198: default: goto yy199; } yy199: - status = action_line265(i, keys, input, token, &cursor, 66); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 66); continue; yy200: YYSKIP (); @@ -2611,7 +2664,8 @@ yy207: default: goto yy208; } yy208: - status = action_line265(i, keys, input, token, &cursor, 42); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 42); continue; yy209: YYSKIP (); @@ -2709,7 +2763,8 @@ yy212: default: goto yy213; } yy213: - status = action_line265(i, keys, input, token, &cursor, 58); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 58); continue; yy214: YYSKIP (); @@ -2847,7 +2902,8 @@ yy222: default: goto yy223; } yy223: - status = action_line265(i, keys, input, token, &cursor, 52); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 52); continue; yy224: YYSKIP (); @@ -3001,7 +3057,8 @@ yy234: default: goto yy235; } yy235: - status = action_line265(i, keys, input, token, &cursor, 82); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 82); continue; yy236: YYSKIP (); @@ -3057,7 +3114,8 @@ yy242: } yy244: YYSKIP (); - status = action_line265(i, keys, input, token, &cursor, 16); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 16); continue; yy246: YYSKIP (); @@ -3072,12 +3130,14 @@ yy246: yy248: YYSKIP (); YYRESTORECTX (); - status = action_line265(i, keys, input, token, &cursor, 91); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 91); continue; yy250: YYSKIP (); YYRESTORECTX (); - status = action_line265(i, keys, input, token, &cursor, 92); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 92); continue; yy252: YYSKIP (); @@ -3176,7 +3236,8 @@ yy255: default: goto yy256; } yy256: - status = action_line265(i, keys, input, token, &cursor, 32); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 32); continue; yy257: YYSKIP (); @@ -3258,7 +3319,8 @@ yy258: default: goto yy259; } yy259: - status = action_line265(i, keys, input, token, &cursor, 34); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 34); continue; yy260: YYSKIP (); @@ -3332,7 +3394,8 @@ yy260: default: goto yy261; } yy261: - status = action_line265(i, keys, input, token, &cursor, 35); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 35); continue; yy262: YYSKIP (); @@ -3422,7 +3485,8 @@ yy264: default: goto yy265; } yy265: - status = action_line265(i, keys, input, token, &cursor, 37); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 37); continue; yy266: YYSKIP (); @@ -3520,7 +3584,8 @@ yy269: default: goto yy270; } yy270: - status = action_line265(i, keys, input, token, &cursor, 68); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 68); continue; yy271: YYSKIP (); @@ -3594,7 +3659,8 @@ yy271: default: goto yy272; } yy272: - status = action_line265(i, keys, input, token, &cursor, 69); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 69); continue; yy273: YYSKIP (); @@ -3668,7 +3734,8 @@ yy273: default: goto yy274; } yy274: - status = action_line265(i, keys, input, token, &cursor, 70); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 70); continue; yy275: YYSKIP (); @@ -3774,7 +3841,8 @@ yy279: default: goto yy280; } yy280: - status = action_line265(i, keys, input, token, &cursor, 72); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 72); continue; yy281: YYSKIP (); @@ -3904,7 +3972,8 @@ yy288: default: goto yy289; } yy289: - status = action_line265(i, keys, input, token, &cursor, 48); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 48); continue; yy290: YYSKIP (); @@ -3978,7 +4047,8 @@ yy290: default: goto yy291; } yy291: - status = action_line265(i, keys, input, token, &cursor, 49); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 49); continue; yy292: YYSKIP (); @@ -4108,7 +4178,8 @@ yy299: default: goto yy300; } yy300: - status = action_line265(i, keys, input, token, &cursor, 55); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 55); continue; yy301: YYSKIP (); @@ -4222,7 +4293,8 @@ yy306: default: goto yy307; } yy307: - status = action_line265(i, keys, input, token, &cursor, 57); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 57); continue; yy308: YYSKIP (); @@ -4304,7 +4376,8 @@ yy309: default: goto yy310; } yy310: - status = action_line265(i, keys, input, token, &cursor, 85); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 85); continue; yy311: YYSKIP (); @@ -4402,7 +4475,8 @@ yy314: default: goto yy315; } yy315: - status = action_line265(i, keys, input, token, &cursor, 63); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 63); continue; yy316: YYSKIP (); @@ -4516,7 +4590,8 @@ yy321: default: goto yy322; } yy322: - status = action_line265(i, keys, input, token, &cursor, 41); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 41); continue; yy323: YYSKIP (); @@ -4638,7 +4713,8 @@ yy329: default: goto yy330; } yy330: - status = action_line265(i, keys, input, token, &cursor, 46); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 46); continue; yy331: YYSKIP (); @@ -4720,7 +4796,8 @@ yy332: default: goto yy333; } yy333: - status = action_line265(i, keys, input, token, &cursor, 50); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 50); continue; yy334: YYSKIP (); @@ -4842,7 +4919,8 @@ yy340: default: goto yy341; } yy341: - status = action_line265(i, keys, input, token, &cursor, 56); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 56); continue; yy342: YYSKIP (); @@ -4916,7 +4994,8 @@ yy342: default: goto yy343; } yy343: - status = action_line265(i, keys, input, token, &cursor, 79); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 79); continue; yy344: YYSKIP (); @@ -4990,7 +5069,8 @@ yy344: default: goto yy345; } yy345: - status = action_line265(i, keys, input, token, &cursor, 80); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 80); continue; yy346: YYSKIP (); @@ -5064,7 +5144,8 @@ yy346: default: goto yy347; } yy347: - status = action_line265(i, keys, input, token, &cursor, 81); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 81); continue; yy348: YYSKIP (); @@ -5146,7 +5227,8 @@ yy349: default: goto yy350; } yy350: - status = action_line265(i, keys, input, token, &cursor, 84); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 84); continue; yy351: YYSKIP (); @@ -5228,7 +5310,8 @@ yy352: default: goto yy353; } yy353: - status = action_line265(i, keys, input, token, &cursor, 61); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 61); continue; yy354: YYSKIP (); @@ -5310,7 +5393,8 @@ yy355: default: goto yy356; } yy356: - status = action_line265(i, keys, input, token, &cursor, 64); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 64); continue; yy357: YYSKIP (); @@ -5416,7 +5500,8 @@ yy361: default: goto yy362; } yy362: - status = action_line265(i, keys, input, token, &cursor, 71); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 71); continue; yy363: YYSKIP (); @@ -5538,7 +5623,8 @@ yy369: default: goto yy370; } yy370: - status = action_line265(i, keys, input, token, &cursor, 51); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 51); continue; yy371: YYSKIP (); @@ -5620,7 +5706,8 @@ yy372: default: goto yy373; } yy373: - status = action_line265(i, keys, input, token, &cursor, 53); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 53); continue; yy374: YYSKIP (); @@ -5694,7 +5781,8 @@ yy374: default: goto yy375; } yy375: - status = action_line265(i, keys, input, token, &cursor, 54); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 54); continue; yy376: YYSKIP (); @@ -5768,7 +5856,8 @@ yy376: default: goto yy377; } yy377: - status = action_line265(i, keys, input, token, &cursor, 76); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 76); continue; yy378: YYSKIP (); @@ -5842,7 +5931,8 @@ yy378: default: goto yy379; } yy379: - status = action_line265(i, keys, input, token, &cursor, 77); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 77); continue; yy380: YYSKIP (); @@ -5924,7 +6014,8 @@ yy381: default: goto yy382; } yy382: - status = action_line265(i, keys, input, token, &cursor, 30); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 30); continue; yy383: YYSKIP (); @@ -6006,7 +6097,8 @@ yy384: default: goto yy385; } yy385: - status = action_line265(i, keys, input, token, &cursor, 65); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 65); continue; yy386: YYSKIP (); @@ -6080,7 +6172,8 @@ yy386: default: goto yy387; } yy387: - status = action_line265(i, keys, input, token, &cursor, 67); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 67); continue; yy388: YYSKIP (); @@ -6162,7 +6255,8 @@ yy389: default: goto yy390; } yy390: - status = action_line265(i, keys, input, token, &cursor, 40); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 40); continue; yy391: YYSKIP (); @@ -6244,7 +6338,8 @@ yy392: default: goto yy393; } yy393: - status = action_line265(i, keys, input, token, &cursor, 74); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 74); continue; yy394: YYSKIP (); @@ -6318,7 +6413,8 @@ yy394: default: goto yy395; } yy395: - status = action_line265(i, keys, input, token, &cursor, 43); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 43); continue; yy396: YYSKIP (); @@ -6392,7 +6488,8 @@ yy396: default: goto yy397; } yy397: - status = action_line265(i, keys, input, token, &cursor, 44); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 44); continue; yy398: YYSKIP (); @@ -6490,7 +6587,8 @@ yy401: default: goto yy402; } yy402: - status = action_line265(i, keys, input, token, &cursor, 83); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 83); continue; yy403: YYSKIP (); @@ -6580,7 +6678,8 @@ yy405: default: goto yy406; } yy406: - status = action_line265(i, keys, input, token, &cursor, 73); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 73); continue; yy407: YYSKIP (); @@ -6686,7 +6785,8 @@ yy411: default: goto yy412; } yy412: - status = action_line265(i, keys, input, token, &cursor, 39); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 39); continue; yy413: YYSKIP (); @@ -6760,7 +6860,8 @@ yy413: default: goto yy414; } yy414: - status = action_line265(i, keys, input, token, &cursor, 45); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 45); continue; yy415: YYSKIP (); @@ -6834,7 +6935,8 @@ yy415: default: goto yy416; } yy416: - status = action_line265(i, keys, input, token, &cursor, 47); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 47); continue; yy417: YYSKIP (); @@ -6924,7 +7026,8 @@ yy419: default: goto yy420; } yy420: - status = action_line265(i, keys, input, token, &cursor, 75); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 75); continue; yy421: YYSKIP (); @@ -6998,7 +7101,8 @@ yy421: default: goto yy422; } yy422: - status = action_line265(i, keys, input, token, &cursor, 62); + status = check_key_count_line265(keys_count, i, 3) + || action_line265(&i, keys, input, token, &cursor, 62); continue; } @@ -7010,7 +7114,7 @@ yy422: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line265: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line265: unused keys left after %u keys\n", i); } } @@ -7042,7 +7146,7 @@ end: #define YYFILL(n) { break; } static int action_line290 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7050,10 +7154,12 @@ static int action_line290 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7063,17 +7169,17 @@ static int action_line290 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line290: at position %ld (iteration %u):\n" + , "error: lex_line290: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7083,6 +7189,13 @@ static int action_line290 } } +static int check_key_count_line290(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line290: not enough keys\n"); + return 1; +} + int lex_line290() { const size_t padding = 2; /* YYMAXFILL */ @@ -7110,7 +7223,7 @@ int lex_line290() keys = (YYKEYTYPE *) read_file ("rexx.--skeleton.c.line290.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7123,7 +7236,7 @@ int lex_line290() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *ctxmarker = NULL; YYCTYPE yych; @@ -7145,15 +7258,18 @@ yy425: YYSKIP (); yy426: YYRESTORECTX (); - status = action_line290(i, keys, input, token, &cursor, 3); + status = check_key_count_line290(keys_count, i, 3) + || action_line290(&i, keys, input, token, &cursor, 3); continue; yy427: YYSKIP (); - status = action_line290(i, keys, input, token, &cursor, 2); + status = check_key_count_line290(keys_count, i, 3) + || action_line290(&i, keys, input, token, &cursor, 2); continue; yy429: YYSKIP (); - status = action_line290(i, keys, input, token, &cursor, 1); + status = check_key_count_line290(keys_count, i, 3) + || action_line290(&i, keys, input, token, &cursor, 1); continue; yy431: YYSKIP (); @@ -7164,7 +7280,8 @@ yy431: } yy432: YYSKIP (); - status = action_line290(i, keys, input, token, &cursor, 0); + status = check_key_count_line290(keys_count, i, 3) + || action_line290(&i, keys, input, token, &cursor, 0); continue; } @@ -7176,7 +7293,7 @@ yy432: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line290: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line290: unused keys left after %u keys\n", i); } } @@ -7204,7 +7321,7 @@ end: #define YYFILL(n) { break; } static int action_line318 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7212,10 +7329,12 @@ static int action_line318 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7225,17 +7344,17 @@ static int action_line318 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line318: at position %ld (iteration %u):\n" + , "error: lex_line318: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7245,6 +7364,13 @@ static int action_line318 } } +static int check_key_count_line318(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line318: not enough keys\n"); + return 1; +} + int lex_line318() { const size_t padding = 2; /* YYMAXFILL */ @@ -7272,7 +7398,7 @@ int lex_line318() keys = (YYKEYTYPE *) read_file ("rexx.--skeleton.c.line318.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7285,7 +7411,7 @@ int lex_line318() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7300,16 +7426,19 @@ int lex_line318() } yy436: YYSKIP (); - status = action_line318(i, keys, input, token, &cursor, 3); + status = check_key_count_line318(keys_count, i, 3) + || action_line318(&i, keys, input, token, &cursor, 3); continue; yy438: YYSKIP (); yy439: - status = action_line318(i, keys, input, token, &cursor, 4); + status = check_key_count_line318(keys_count, i, 3) + || action_line318(&i, keys, input, token, &cursor, 4); continue; yy440: YYSKIP (); - status = action_line318(i, keys, input, token, &cursor, 1); + status = check_key_count_line318(keys_count, i, 3) + || action_line318(&i, keys, input, token, &cursor, 1); continue; yy442: YYSKIP (); @@ -7327,11 +7456,13 @@ yy443: } yy444: YYSKIP (); - status = action_line318(i, keys, input, token, &cursor, 0); + status = check_key_count_line318(keys_count, i, 3) + || action_line318(&i, keys, input, token, &cursor, 0); continue; yy446: YYSKIP (); - status = action_line318(i, keys, input, token, &cursor, 2); + status = check_key_count_line318(keys_count, i, 3) + || action_line318(&i, keys, input, token, &cursor, 2); continue; } @@ -7343,7 +7474,7 @@ yy446: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line318: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line318: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/scanner.--skeleton.c b/re2c/test/scanner.--skeleton.c index 92cce7e2..078f84f9 100644 --- a/re2c/test/scanner.--skeleton.c +++ b/re2c/test/scanner.--skeleton.c @@ -58,7 +58,7 @@ error: #define YYFILL(n) { break; } static int action_line144 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -66,10 +66,12 @@ static int action_line144 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -79,17 +81,17 @@ static int action_line144 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line144: at position %ld (iteration %u):\n" + , "error: lex_line144: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -99,6 +101,13 @@ static int action_line144 } } +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 */ @@ -126,7 +135,7 @@ int lex_line144() keys = (YYKEYTYPE *) read_file ("scanner.--skeleton.c.line144.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -139,7 +148,7 @@ int lex_line144() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -155,16 +164,19 @@ int lex_line144() } yy2: YYSKIP (); - status = action_line144(i, keys, input, token, &cursor, 4); + status = check_key_count_line144(keys_count, i, 3) + || action_line144(&i, keys, input, token, &cursor, 4); continue; yy4: YYSKIP (); yy5: - status = action_line144(i, keys, input, token, &cursor, 5); + status = check_key_count_line144(keys_count, i, 3) + || action_line144(&i, keys, input, token, &cursor, 5); continue; yy6: YYSKIP (); - status = action_line144(i, keys, input, token, &cursor, 3); + status = check_key_count_line144(keys_count, i, 3) + || action_line144(&i, keys, input, token, &cursor, 3); continue; yy8: YYSKIP (); @@ -183,7 +195,8 @@ yy9: } yy10: YYSKIP (); - status = action_line144(i, keys, input, token, &cursor, 2); + status = check_key_count_line144(keys_count, i, 3) + || action_line144(&i, keys, input, token, &cursor, 2); continue; yy12: YYSKIP (); @@ -254,7 +267,8 @@ yy21: } yy22: YYSKIP (); - status = action_line144(i, keys, input, token, &cursor, 0); + status = check_key_count_line144(keys_count, i, 3) + || action_line144(&i, keys, input, token, &cursor, 0); continue; yy24: YYSKIP (); @@ -279,7 +293,8 @@ yy26: } yy27: YYSKIP (); - status = action_line144(i, keys, input, token, &cursor, 1); + status = check_key_count_line144(keys_count, i, 3) + || action_line144(&i, keys, input, token, &cursor, 1); continue; } @@ -291,7 +306,7 @@ yy27: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line144: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line144: unused keys left after %u keys\n", i); } } @@ -321,7 +336,7 @@ end: #define YYFILL(n) { break; } static int action_line247 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -329,10 +344,12 @@ static int action_line247 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -342,17 +359,17 @@ static int action_line247 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line247: at position %ld (iteration %u):\n" + , "error: lex_line247: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -362,6 +379,13 @@ static int action_line247 } } +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 */ @@ -389,7 +413,7 @@ int lex_line247() keys = (YYKEYTYPE *) read_file ("scanner.--skeleton.c.line247.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -402,7 +426,7 @@ int lex_line247() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -487,7 +511,8 @@ int lex_line247() yy31: YYSKIP (); yy32: - status = action_line247(i, keys, input, token, &cursor, 22); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 22); continue; yy33: YYSKIP (); @@ -499,11 +524,13 @@ yy33: default: goto yy35; } yy35: - status = action_line247(i, keys, input, token, &cursor, 20); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 20); continue; yy36: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 21); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 21); continue; yy38: YYSKIP (); @@ -522,7 +549,8 @@ yy39: default: goto yy60; } yy40: - status = action_line247(i, keys, input, token, &cursor, 5); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 5); continue; yy41: yyaccept = 1; @@ -534,12 +562,14 @@ yy41: default: goto yy66; } yy42: - status = action_line247(i, keys, input, token, &cursor, 6); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 6); continue; yy43: YYSKIP (); yy44: - status = action_line247(i, keys, input, token, &cursor, 10); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 10); continue; yy45: YYSKIP (); @@ -548,7 +578,8 @@ yy45: default: goto yy46; } yy46: - status = action_line247(i, keys, input, token, &cursor, 11); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 11); continue; yy47: YYSKIP (); @@ -556,7 +587,8 @@ yy47: goto yy46; yy48: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 19); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 19); continue; yy50: YYSKIP (); @@ -636,7 +668,8 @@ yy52: default: goto yy53; } yy53: - status = action_line247(i, keys, input, token, &cursor, 18); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 18); continue; yy54: yyaccept = 2; @@ -649,7 +682,8 @@ yy54: default: goto yy75; } yy55: - status = action_line247(i, keys, input, token, &cursor, 9); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 9); continue; yy56: YYSKIP (); @@ -678,7 +712,8 @@ yy57: default: goto yy58; } yy58: - status = action_line247(i, keys, input, token, &cursor, 0); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 0); continue; yy59: YYSKIP (); @@ -704,7 +739,8 @@ yy61: } yy62: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 3); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 3); continue; yy64: YYSKIP (); @@ -727,7 +763,8 @@ yy66: } yy67: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 4); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 4); continue; yy69: YYSKIP (); @@ -739,11 +776,13 @@ yy69: } yy70: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 2); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 2); continue; yy72: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 1); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 1); continue; yy74: YYSKIP (); @@ -766,7 +805,8 @@ yy76: } yy77: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 8); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 8); continue; yy79: YYSKIP (); @@ -788,7 +828,8 @@ yy81: yy82: YYSKIP (); yy83: - status = action_line247(i, keys, input, token, &cursor, 16); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 16); continue; yy84: YYSKIP (); @@ -827,7 +868,8 @@ yy87: } yy88: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 7); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 7); continue; yy90: YYSKIP (); @@ -857,7 +899,8 @@ yy91: } yy92: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 13); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 13); continue; yy94: yyaccept = 4; @@ -907,11 +950,13 @@ yy96: } yy98: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 12); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 12); continue; yy100: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 15); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 15); continue; yy102: YYSKIP (); @@ -974,7 +1019,8 @@ yy102: } yy103: YYSKIP (); - status = action_line247(i, keys, input, token, &cursor, 14); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 14); continue; yy105: yyaccept = 6; @@ -1050,7 +1096,8 @@ yy105: default: goto yy107; } yy107: - status = action_line247(i, keys, input, token, &cursor, 17); + status = check_key_count_line247(keys_count, i, 3) + || action_line247(&i, keys, input, token, &cursor, 17); continue; } @@ -1062,7 +1109,7 @@ yy107: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line247: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line247: unused keys left after %u keys\n", i); } } @@ -1092,7 +1139,7 @@ end: #define YYFILL(n) { break; } static int action_line264 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1100,10 +1147,12 @@ static int action_line264 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1113,17 +1162,17 @@ static int action_line264 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line264: at position %ld (iteration %u):\n" + , "error: lex_line264: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1133,6 +1182,13 @@ static int action_line264 } } +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 */ @@ -1160,7 +1216,7 @@ int lex_line264() keys = (YYKEYTYPE *) read_file ("scanner.--skeleton.c.line264.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1173,7 +1229,7 @@ int lex_line264() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1191,11 +1247,13 @@ int lex_line264() yy110: YYSKIP (); yy111: - status = action_line264(i, keys, input, token, &cursor, 3); + status = check_key_count_line264(keys_count, i, 3) + || action_line264(&i, keys, input, token, &cursor, 3); continue; yy112: YYSKIP (); - status = action_line264(i, keys, input, token, &cursor, 2); + status = check_key_count_line264(keys_count, i, 3) + || action_line264(&i, keys, input, token, &cursor, 2); continue; yy114: YYSKIP (); @@ -1215,11 +1273,13 @@ yy115: } yy116: YYSKIP (); - status = action_line264(i, keys, input, token, &cursor, 1); + status = check_key_count_line264(keys_count, i, 3) + || action_line264(&i, keys, input, token, &cursor, 1); continue; yy118: YYSKIP (); - status = action_line264(i, keys, input, token, &cursor, 0); + status = check_key_count_line264(keys_count, i, 3) + || action_line264(&i, keys, input, token, &cursor, 0); continue; yy120: YYSKIP (); @@ -1272,7 +1332,7 @@ yy126: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line264: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line264: unused keys left after %u keys\n", i); } } @@ -1300,7 +1360,7 @@ end: #define YYFILL(n) { break; } static int action_line281 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1308,10 +1368,12 @@ static int action_line281 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1321,17 +1383,17 @@ static int action_line281 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line281: at position %ld (iteration %u):\n" + , "error: lex_line281: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1341,6 +1403,13 @@ static int action_line281 } } +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 */ @@ -1368,7 +1437,7 @@ int lex_line281() keys = (YYKEYTYPE *) read_file ("scanner.--skeleton.c.line281.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1381,7 +1450,7 @@ int lex_line281() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1396,11 +1465,13 @@ int lex_line281() yy129: YYSKIP (); yy130: - status = action_line281(i, keys, input, token, &cursor, 3); + status = check_key_count_line281(keys_count, i, 3) + || action_line281(&i, keys, input, token, &cursor, 3); continue; yy131: YYSKIP (); - status = action_line281(i, keys, input, token, &cursor, 2); + status = check_key_count_line281(keys_count, i, 3) + || action_line281(&i, keys, input, token, &cursor, 2); continue; yy133: YYSKIP (); @@ -1418,11 +1489,13 @@ yy134: } yy135: YYSKIP (); - status = action_line281(i, keys, input, token, &cursor, 0); + status = check_key_count_line281(keys_count, i, 3) + || action_line281(&i, keys, input, token, &cursor, 0); continue; yy137: YYSKIP (); - status = action_line281(i, keys, input, token, &cursor, 1); + status = check_key_count_line281(keys_count, i, 3) + || action_line281(&i, keys, input, token, &cursor, 1); continue; } @@ -1434,7 +1507,7 @@ yy137: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line281: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line281: unused keys left after %u keys\n", i); } } @@ -1460,7 +1533,7 @@ end: #define YYFILL(n) { break; } static int action_line291 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1468,10 +1541,12 @@ static int action_line291 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1481,17 +1556,17 @@ static int action_line291 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line291: at position %ld (iteration %u):\n" + , "error: lex_line291: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1501,6 +1576,13 @@ static int action_line291 } } +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 */ @@ -1528,7 +1610,7 @@ int lex_line291() keys = (YYKEYTYPE *) read_file ("scanner.--skeleton.c.line291.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1541,7 +1623,7 @@ int lex_line291() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1555,7 +1637,8 @@ int lex_line291() } yy141: YYSKIP (); - status = action_line291(i, keys, input, token, &cursor, 2); + status = check_key_count_line291(keys_count, i, 3) + || action_line291(&i, keys, input, token, &cursor, 2); continue; yy143: YYSKIP (); @@ -1567,7 +1650,8 @@ yy143: default: goto yy145; } yy145: - status = action_line291(i, keys, input, token, &cursor, 0); + status = check_key_count_line291(keys_count, i, 3) + || action_line291(&i, keys, input, token, &cursor, 0); continue; yy146: YYSKIP (); @@ -1579,7 +1663,8 @@ yy146: default: goto yy148; } yy148: - status = action_line291(i, keys, input, token, &cursor, 1); + status = check_key_count_line291(keys_count, i, 3) + || action_line291(&i, keys, input, token, &cursor, 1); continue; } @@ -1591,7 +1676,7 @@ yy148: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line291: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line291: unused keys left after %u keys\n", i); } } @@ -1619,7 +1704,7 @@ end: #define YYFILL(n) { break; } static int action_line305 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1627,10 +1712,12 @@ static int action_line305 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1640,17 +1727,17 @@ static int action_line305 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line305: at position %ld (iteration %u):\n" + , "error: lex_line305: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1660,6 +1747,13 @@ static int action_line305 } } +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 */ @@ -1687,7 +1781,7 @@ int lex_line305() keys = (YYKEYTYPE *) read_file ("scanner.--skeleton.c.line305.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1700,7 +1794,7 @@ int lex_line305() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -1729,7 +1823,8 @@ int lex_line305() default: goto yy152; } yy151: - status = action_line305(i, keys, input, token, &cursor, 1); + status = check_key_count_line305(keys_count, i, 3) + || action_line305(&i, keys, input, token, &cursor, 1); continue; yy152: YYSKIP (); @@ -1800,7 +1895,8 @@ yy159: default: goto yy152; } yy160: - status = action_line305(i, keys, input, token, &cursor, 0); + status = check_key_count_line305(keys_count, i, 3) + || action_line305(&i, keys, input, token, &cursor, 0); continue; yy161: YYSKIP (); @@ -1903,7 +1999,7 @@ yy172: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line305: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line305: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/strip_003.b--skeleton.c b/re2c/test/strip_003.b--skeleton.c index e1866e15..e88618af 100644 --- a/re2c/test/strip_003.b--skeleton.c +++ b/re2c/test/strip_003.b--skeleton.c @@ -61,7 +61,7 @@ error: #define YYFILL(n) { break; } static int action_line131 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -69,10 +69,12 @@ static int action_line131 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -82,17 +84,17 @@ static int action_line131 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line131: at position %ld (iteration %u):\n" + , "error: lex_line131: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -102,6 +104,13 @@ static int action_line131 } } +static int check_key_count_line131(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line131: not enough keys\n"); + return 1; +} + int lex_line131() { const size_t padding = 4; /* YYMAXFILL */ @@ -129,7 +138,7 @@ int lex_line131() keys = (YYKEYTYPE *) read_file ("strip_003.b--skeleton.c.line131.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -142,7 +151,7 @@ int lex_line131() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; const YYCTYPE *ctxmarker = NULL; @@ -158,7 +167,8 @@ int lex_line131() } YYSKIP (); yy3: - status = action_line131(i, keys, input, token, &cursor, 3); + status = check_key_count_line131(keys_count, i, 3) + || action_line131(&i, keys, input, token, &cursor, 3); continue; yy4: YYSKIP (); @@ -198,16 +208,19 @@ yy9: goto yy8; yy10: YYSKIP (); - status = action_line131(i, keys, input, token, &cursor, 2); + status = check_key_count_line131(keys_count, i, 3) + || action_line131(&i, keys, input, token, &cursor, 2); continue; yy12: YYSKIP (); - status = action_line131(i, keys, input, token, &cursor, 0); + status = check_key_count_line131(keys_count, i, 3) + || action_line131(&i, keys, input, token, &cursor, 0); continue; yy14: YYSKIP (); YYRESTORECTX (); - status = action_line131(i, keys, input, token, &cursor, 1); + status = check_key_count_line131(keys_count, i, 3) + || action_line131(&i, keys, input, token, &cursor, 1); continue; } @@ -219,7 +232,7 @@ yy14: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line131: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line131: unused keys left after %u keys\n", i); } } @@ -249,7 +262,7 @@ end: #define YYFILL(n) { break; } static int action_line137 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -257,10 +270,12 @@ static int action_line137 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -270,17 +285,17 @@ static int action_line137 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line137: at position %ld (iteration %u):\n" + , "error: lex_line137: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -290,6 +305,13 @@ static int action_line137 } } +static int check_key_count_line137(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line137: not enough keys\n"); + return 1; +} + int lex_line137() { const size_t padding = 2; /* YYMAXFILL */ @@ -317,7 +339,7 @@ int lex_line137() keys = (YYKEYTYPE *) read_file ("strip_003.b--skeleton.c.line137.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -330,7 +352,7 @@ int lex_line137() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -339,14 +361,16 @@ int lex_line137() if (yych == '*') goto yy20; YYSKIP (); yy19: - status = action_line137(i, keys, input, token, &cursor, 1); + status = check_key_count_line137(keys_count, i, 3) + || action_line137(&i, keys, input, token, &cursor, 1); continue; yy20: YYSKIP (); yych = YYPEEK (); if (yych != '/') goto yy19; YYSKIP (); - status = action_line137(i, keys, input, token, &cursor, 0); + status = check_key_count_line137(keys_count, i, 3) + || action_line137(&i, keys, input, token, &cursor, 0); continue; } @@ -358,7 +382,7 @@ yy20: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line137: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line137: unused keys left after %u keys\n", i); } } @@ -386,7 +410,7 @@ end: #define YYFILL(n) { break; } static int action_line152 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -394,10 +418,12 @@ static int action_line152 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -407,17 +433,17 @@ static int action_line152 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line152: at position %ld (iteration %u):\n" + , "error: lex_line152: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -427,6 +453,13 @@ static int action_line152 } } +static int check_key_count_line152(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line152: not enough keys\n"); + return 1; +} + int lex_line152() { const size_t padding = 4; /* YYMAXFILL */ @@ -454,7 +487,7 @@ int lex_line152() keys = (YYKEYTYPE *) read_file ("strip_003.b--skeleton.c.line152.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -467,7 +500,7 @@ int lex_line152() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -490,12 +523,14 @@ int lex_line152() } YYSKIP (); yy26: - status = action_line152(i, keys, input, token, &cursor, 3); + status = check_key_count_line152(keys_count, i, 3) + || action_line152(&i, keys, input, token, &cursor, 3); continue; yy27: YYSKIP (); yy28: - status = action_line152(i, keys, input, token, &cursor, 2); + status = check_key_count_line152(keys_count, i, 3) + || action_line152(&i, keys, input, token, &cursor, 2); continue; yy29: YYSKIP (); @@ -503,7 +538,8 @@ yy29: yych = YYPEEK (); if (yych == '/') goto yy33; yy30: - status = action_line152(i, keys, input, token, &cursor, 1); + status = check_key_count_line152(keys_count, i, 3) + || action_line152(&i, keys, input, token, &cursor, 1); continue; yy31: YYSKIP (); @@ -523,7 +559,8 @@ yy33: goto yy30; yy35: YYSKIP (); - status = action_line152(i, keys, input, token, &cursor, 0); + status = check_key_count_line152(keys_count, i, 3) + || action_line152(&i, keys, input, token, &cursor, 0); continue; } @@ -535,7 +572,7 @@ yy35: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line152: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line152: unused keys left after %u keys\n", i); } } @@ -563,7 +600,7 @@ end: #define YYFILL(n) { break; } static int action_line158 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -571,10 +608,12 @@ static int action_line158 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -584,17 +623,17 @@ static int action_line158 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line158: at position %ld (iteration %u):\n" + , "error: lex_line158: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -604,6 +643,13 @@ static int action_line158 } } +static int check_key_count_line158(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line158: not enough keys\n"); + return 1; +} + int lex_line158() { const size_t padding = 2; /* YYMAXFILL */ @@ -631,7 +677,7 @@ int lex_line158() keys = (YYKEYTYPE *) read_file ("strip_003.b--skeleton.c.line158.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -644,7 +690,7 @@ int lex_line158() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -654,11 +700,13 @@ int lex_line158() if (yych == '\r') goto yy43; YYSKIP (); yy40: - status = action_line158(i, keys, input, token, &cursor, 1); + status = check_key_count_line158(keys_count, i, 3) + || action_line158(&i, keys, input, token, &cursor, 1); continue; yy41: YYSKIP (); - status = action_line158(i, keys, input, token, &cursor, 0); + status = check_key_count_line158(keys_count, i, 3) + || action_line158(&i, keys, input, token, &cursor, 0); continue; yy43: YYSKIP (); @@ -674,7 +722,7 @@ yy43: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line158: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line158: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/unicode_blocks.8--skeleton--encoding-policy(ignore).c b/re2c/test/unicode_blocks.8--skeleton--encoding-policy(ignore).c index cb3407cd..8c101b6e 100644 --- a/re2c/test/unicode_blocks.8--skeleton--encoding-policy(ignore).c +++ b/re2c/test/unicode_blocks.8--skeleton--encoding-policy(ignore).c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line344 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line344 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line344 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line344: at position %ld (iteration %u):\n" + , "error: lex_line344: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line344 } } +static int check_key_count_line344(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line344: not enough keys\n"); + return 1; +} + int lex_line344() { const size_t padding = 1; /* YYMAXFILL */ @@ -124,7 +133,7 @@ int lex_line344() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line344.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -137,7 +146,7 @@ int lex_line344() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -145,11 +154,13 @@ int lex_line344() yych = YYPEEK (); if (yych >= 0x80) goto yy4; YYSKIP (); - status = action_line344(i, keys, input, token, &cursor, 0); + status = check_key_count_line344(keys_count, i, 3) + || action_line344(&i, keys, input, token, &cursor, 0); continue; yy4: YYSKIP (); - status = action_line344(i, keys, input, token, &cursor, 254); + status = check_key_count_line344(keys_count, i, 3) + || action_line344(&i, keys, input, token, &cursor, 254); continue; } @@ -161,7 +172,7 @@ yy4: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line344: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line344: unused keys left after %u keys\n", i); } } @@ -187,7 +198,7 @@ end: #define YYFILL(n) { break; } static int action_line351 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -195,10 +206,12 @@ static int action_line351 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -208,17 +221,17 @@ static int action_line351 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line351: at position %ld (iteration %u):\n" + , "error: lex_line351: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -228,6 +241,13 @@ static int action_line351 } } +static int check_key_count_line351(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line351: not enough keys\n"); + return 1; +} + int lex_line351() { const size_t padding = 2; /* YYMAXFILL */ @@ -255,7 +275,7 @@ int lex_line351() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line351.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -268,7 +288,7 @@ int lex_line351() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -282,7 +302,8 @@ int lex_line351() yy8: YYSKIP (); yy9: - status = action_line351(i, keys, input, token, &cursor, 254); + status = check_key_count_line351(keys_count, i, 3) + || action_line351(&i, keys, input, token, &cursor, 254); continue; yy10: YYSKIP (); @@ -356,7 +377,8 @@ yy10: } yy11: YYSKIP (); - status = action_line351(i, keys, input, token, &cursor, 0); + status = check_key_count_line351(keys_count, i, 3) + || action_line351(&i, keys, input, token, &cursor, 0); continue; } @@ -368,7 +390,7 @@ yy11: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line351: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line351: unused keys left after %u keys\n", i); } } @@ -394,7 +416,7 @@ end: #define YYFILL(n) { break; } static int action_line358 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -402,10 +424,12 @@ static int action_line358 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -415,17 +439,17 @@ static int action_line358 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line358: at position %ld (iteration %u):\n" + , "error: lex_line358: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -435,6 +459,13 @@ static int action_line358 } } +static int check_key_count_line358(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line358: not enough keys\n"); + return 1; +} + int lex_line358() { const size_t padding = 2; /* YYMAXFILL */ @@ -462,7 +493,7 @@ int lex_line358() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line358.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -475,7 +506,7 @@ int lex_line358() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -489,7 +520,8 @@ int lex_line358() yy15: YYSKIP (); yy16: - status = action_line358(i, keys, input, token, &cursor, 254); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 254); continue; yy17: YYSKIP (); @@ -563,7 +595,8 @@ yy17: } yy18: YYSKIP (); - status = action_line358(i, keys, input, token, &cursor, 0); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 0); continue; } @@ -575,7 +608,7 @@ yy18: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line358: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line358: unused keys left after %u keys\n", i); } } @@ -601,7 +634,7 @@ end: #define YYFILL(n) { break; } static int action_line365 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -609,10 +642,12 @@ static int action_line365 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -622,17 +657,17 @@ static int action_line365 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line365: at position %ld (iteration %u):\n" + , "error: lex_line365: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -642,6 +677,13 @@ static int action_line365 } } +static int check_key_count_line365(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line365: not enough keys\n"); + return 1; +} + int lex_line365() { const size_t padding = 2; /* YYMAXFILL */ @@ -669,7 +711,7 @@ int lex_line365() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line365.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -682,7 +724,7 @@ int lex_line365() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -698,7 +740,8 @@ int lex_line365() yy22: YYSKIP (); yy23: - status = action_line365(i, keys, input, token, &cursor, 254); + status = check_key_count_line365(keys_count, i, 3) + || action_line365(&i, keys, input, token, &cursor, 254); continue; yy24: YYSKIP (); @@ -794,7 +837,8 @@ yy25: } yy26: YYSKIP (); - status = action_line365(i, keys, input, token, &cursor, 0); + status = check_key_count_line365(keys_count, i, 3) + || action_line365(&i, keys, input, token, &cursor, 0); continue; } @@ -806,7 +850,7 @@ yy26: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line365: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line365: unused keys left after %u keys\n", i); } } @@ -832,7 +876,7 @@ end: #define YYFILL(n) { break; } static int action_line372 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -840,10 +884,12 @@ static int action_line372 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -853,17 +899,17 @@ static int action_line372 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line372: at position %ld (iteration %u):\n" + , "error: lex_line372: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -873,6 +919,13 @@ static int action_line372 } } +static int check_key_count_line372(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line372: not enough keys\n"); + return 1; +} + int lex_line372() { const size_t padding = 2; /* YYMAXFILL */ @@ -900,7 +953,7 @@ int lex_line372() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line372.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -913,7 +966,7 @@ int lex_line372() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -927,7 +980,8 @@ int lex_line372() yy30: YYSKIP (); yy31: - status = action_line372(i, keys, input, token, &cursor, 254); + status = check_key_count_line372(keys_count, i, 3) + || action_line372(&i, keys, input, token, &cursor, 254); continue; yy32: YYSKIP (); @@ -1039,7 +1093,8 @@ yy33: } yy34: YYSKIP (); - status = action_line372(i, keys, input, token, &cursor, 0); + status = check_key_count_line372(keys_count, i, 3) + || action_line372(&i, keys, input, token, &cursor, 0); continue; } @@ -1051,7 +1106,7 @@ yy34: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line372: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line372: unused keys left after %u keys\n", i); } } @@ -1077,7 +1132,7 @@ end: #define YYFILL(n) { break; } static int action_line379 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1085,10 +1140,12 @@ static int action_line379 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1098,17 +1155,17 @@ static int action_line379 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line379: at position %ld (iteration %u):\n" + , "error: lex_line379: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1118,6 +1175,13 @@ static int action_line379 } } +static int check_key_count_line379(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line379: not enough keys\n"); + return 1; +} + int lex_line379() { const size_t padding = 2; /* YYMAXFILL */ @@ -1145,7 +1209,7 @@ int lex_line379() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line379.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1158,7 +1222,7 @@ int lex_line379() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1172,7 +1236,8 @@ int lex_line379() yy38: YYSKIP (); yy39: - status = action_line379(i, keys, input, token, &cursor, 254); + status = check_key_count_line379(keys_count, i, 3) + || action_line379(&i, keys, input, token, &cursor, 254); continue; yy40: YYSKIP (); @@ -1268,7 +1333,8 @@ yy41: } yy42: YYSKIP (); - status = action_line379(i, keys, input, token, &cursor, 0); + status = check_key_count_line379(keys_count, i, 3) + || action_line379(&i, keys, input, token, &cursor, 0); continue; } @@ -1280,7 +1346,7 @@ yy42: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line379: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line379: unused keys left after %u keys\n", i); } } @@ -1306,7 +1372,7 @@ end: #define YYFILL(n) { break; } static int action_line386 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1314,10 +1380,12 @@ static int action_line386 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1327,17 +1395,17 @@ static int action_line386 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line386: at position %ld (iteration %u):\n" + , "error: lex_line386: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1347,6 +1415,13 @@ static int action_line386 } } +static int check_key_count_line386(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line386: not enough keys\n"); + return 1; +} + int lex_line386() { const size_t padding = 2; /* YYMAXFILL */ @@ -1374,7 +1449,7 @@ int lex_line386() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line386.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1387,7 +1462,7 @@ int lex_line386() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1401,7 +1476,8 @@ int lex_line386() yy46: YYSKIP (); yy47: - status = action_line386(i, keys, input, token, &cursor, 254); + status = check_key_count_line386(keys_count, i, 3) + || action_line386(&i, keys, input, token, &cursor, 254); continue; yy48: YYSKIP (); @@ -1529,7 +1605,8 @@ yy49: } yy50: YYSKIP (); - status = action_line386(i, keys, input, token, &cursor, 0); + status = check_key_count_line386(keys_count, i, 3) + || action_line386(&i, keys, input, token, &cursor, 0); continue; } @@ -1541,7 +1618,7 @@ yy50: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line386: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line386: unused keys left after %u keys\n", i); } } @@ -1567,7 +1644,7 @@ end: #define YYFILL(n) { break; } static int action_line393 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1575,10 +1652,12 @@ static int action_line393 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1588,17 +1667,17 @@ static int action_line393 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line393: at position %ld (iteration %u):\n" + , "error: lex_line393: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1608,6 +1687,13 @@ static int action_line393 } } +static int check_key_count_line393(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line393: not enough keys\n"); + return 1; +} + int lex_line393() { const size_t padding = 2; /* YYMAXFILL */ @@ -1635,7 +1721,7 @@ int lex_line393() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line393.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1648,7 +1734,7 @@ int lex_line393() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1663,7 +1749,8 @@ int lex_line393() yy54: YYSKIP (); yy55: - status = action_line393(i, keys, input, token, &cursor, 254); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 254); continue; yy56: YYSKIP (); @@ -1759,7 +1846,8 @@ yy57: } yy58: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 0); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 0); continue; } @@ -1771,7 +1859,7 @@ yy58: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line393: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line393: unused keys left after %u keys\n", i); } } @@ -1797,7 +1885,7 @@ end: #define YYFILL(n) { break; } static int action_line400 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1805,10 +1893,12 @@ static int action_line400 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1818,17 +1908,17 @@ static int action_line400 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line400: at position %ld (iteration %u):\n" + , "error: lex_line400: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1838,6 +1928,13 @@ static int action_line400 } } +static int check_key_count_line400(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line400: not enough keys\n"); + return 1; +} + int lex_line400() { const size_t padding = 2; /* YYMAXFILL */ @@ -1865,7 +1962,7 @@ int lex_line400() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line400.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1878,7 +1975,7 @@ int lex_line400() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1894,7 +1991,8 @@ int lex_line400() yy62: YYSKIP (); yy63: - status = action_line400(i, keys, input, token, &cursor, 254); + status = check_key_count_line400(keys_count, i, 3) + || action_line400(&i, keys, input, token, &cursor, 254); continue; yy64: YYSKIP (); @@ -1968,7 +2066,8 @@ yy64: } yy65: YYSKIP (); - status = action_line400(i, keys, input, token, &cursor, 0); + status = check_key_count_line400(keys_count, i, 3) + || action_line400(&i, keys, input, token, &cursor, 0); continue; } @@ -1980,7 +2079,7 @@ yy65: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line400: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line400: unused keys left after %u keys\n", i); } } @@ -2006,7 +2105,7 @@ end: #define YYFILL(n) { break; } static int action_line407 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2014,10 +2113,12 @@ static int action_line407 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2027,17 +2128,17 @@ static int action_line407 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line407: at position %ld (iteration %u):\n" + , "error: lex_line407: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2047,6 +2148,13 @@ static int action_line407 } } +static int check_key_count_line407(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line407: not enough keys\n"); + return 1; +} + int lex_line407() { const size_t padding = 2; /* YYMAXFILL */ @@ -2074,7 +2182,7 @@ int lex_line407() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line407.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2087,7 +2195,7 @@ int lex_line407() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2100,7 +2208,8 @@ int lex_line407() yy69: YYSKIP (); yy70: - status = action_line407(i, keys, input, token, &cursor, 254); + status = check_key_count_line407(keys_count, i, 3) + || action_line407(&i, keys, input, token, &cursor, 254); continue; yy71: YYSKIP (); @@ -2158,7 +2267,8 @@ yy71: } yy72: YYSKIP (); - status = action_line407(i, keys, input, token, &cursor, 0); + status = check_key_count_line407(keys_count, i, 3) + || action_line407(&i, keys, input, token, &cursor, 0); continue; } @@ -2170,7 +2280,7 @@ yy72: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line407: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line407: unused keys left after %u keys\n", i); } } @@ -2196,7 +2306,7 @@ end: #define YYFILL(n) { break; } static int action_line414 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2204,10 +2314,12 @@ static int action_line414 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2217,17 +2329,17 @@ static int action_line414 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line414: at position %ld (iteration %u):\n" + , "error: lex_line414: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2237,6 +2349,13 @@ static int action_line414 } } +static int check_key_count_line414(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line414: not enough keys\n"); + return 1; +} + int lex_line414() { const size_t padding = 2; /* YYMAXFILL */ @@ -2264,7 +2383,7 @@ int lex_line414() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line414.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2277,7 +2396,7 @@ int lex_line414() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2292,7 +2411,8 @@ int lex_line414() yy76: YYSKIP (); yy77: - status = action_line414(i, keys, input, token, &cursor, 254); + status = check_key_count_line414(keys_count, i, 3) + || action_line414(&i, keys, input, token, &cursor, 254); continue; yy78: YYSKIP (); @@ -2410,7 +2530,8 @@ yy80: } yy81: YYSKIP (); - status = action_line414(i, keys, input, token, &cursor, 0); + status = check_key_count_line414(keys_count, i, 3) + || action_line414(&i, keys, input, token, &cursor, 0); continue; } @@ -2422,7 +2543,7 @@ yy81: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line414: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line414: unused keys left after %u keys\n", i); } } @@ -2448,7 +2569,7 @@ end: #define YYFILL(n) { break; } static int action_line421 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2456,10 +2577,12 @@ static int action_line421 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2469,17 +2592,17 @@ static int action_line421 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line421: at position %ld (iteration %u):\n" + , "error: lex_line421: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2489,6 +2612,13 @@ static int action_line421 } } +static int check_key_count_line421(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line421: not enough keys\n"); + return 1; +} + int lex_line421() { const size_t padding = 2; /* YYMAXFILL */ @@ -2516,7 +2646,7 @@ int lex_line421() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line421.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2529,7 +2659,7 @@ int lex_line421() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2543,7 +2673,8 @@ int lex_line421() yy85: YYSKIP (); yy86: - status = action_line421(i, keys, input, token, &cursor, 254); + status = check_key_count_line421(keys_count, i, 3) + || action_line421(&i, keys, input, token, &cursor, 254); continue; yy87: YYSKIP (); @@ -2671,7 +2802,8 @@ yy88: } yy89: YYSKIP (); - status = action_line421(i, keys, input, token, &cursor, 0); + status = check_key_count_line421(keys_count, i, 3) + || action_line421(&i, keys, input, token, &cursor, 0); continue; } @@ -2683,7 +2815,7 @@ yy89: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line421: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line421: unused keys left after %u keys\n", i); } } @@ -2709,7 +2841,7 @@ end: #define YYFILL(n) { break; } static int action_line428 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2717,10 +2849,12 @@ static int action_line428 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2730,17 +2864,17 @@ static int action_line428 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line428: at position %ld (iteration %u):\n" + , "error: lex_line428: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2750,6 +2884,13 @@ static int action_line428 } } +static int check_key_count_line428(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line428: not enough keys\n"); + return 1; +} + int lex_line428() { const size_t padding = 2; /* YYMAXFILL */ @@ -2777,7 +2918,7 @@ int lex_line428() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line428.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2790,7 +2931,7 @@ int lex_line428() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2806,7 +2947,8 @@ int lex_line428() yy93: YYSKIP (); yy94: - status = action_line428(i, keys, input, token, &cursor, 254); + status = check_key_count_line428(keys_count, i, 3) + || action_line428(&i, keys, input, token, &cursor, 254); continue; yy95: YYSKIP (); @@ -2880,7 +3022,8 @@ yy95: } yy96: YYSKIP (); - status = action_line428(i, keys, input, token, &cursor, 0); + status = check_key_count_line428(keys_count, i, 3) + || action_line428(&i, keys, input, token, &cursor, 0); continue; } @@ -2892,7 +3035,7 @@ yy96: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line428: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line428: unused keys left after %u keys\n", i); } } @@ -2918,7 +3061,7 @@ end: #define YYFILL(n) { break; } static int action_line435 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2926,10 +3069,12 @@ static int action_line435 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2939,17 +3084,17 @@ static int action_line435 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line435: at position %ld (iteration %u):\n" + , "error: lex_line435: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2959,6 +3104,13 @@ static int action_line435 } } +static int check_key_count_line435(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line435: not enough keys\n"); + return 1; +} + int lex_line435() { const size_t padding = 2; /* YYMAXFILL */ @@ -2986,7 +3138,7 @@ int lex_line435() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line435.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2999,7 +3151,7 @@ int lex_line435() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3013,7 +3165,8 @@ int lex_line435() yy100: YYSKIP (); yy101: - status = action_line435(i, keys, input, token, &cursor, 254); + status = check_key_count_line435(keys_count, i, 3) + || action_line435(&i, keys, input, token, &cursor, 254); continue; yy102: YYSKIP (); @@ -3109,7 +3262,8 @@ yy103: } yy104: YYSKIP (); - status = action_line435(i, keys, input, token, &cursor, 0); + status = check_key_count_line435(keys_count, i, 3) + || action_line435(&i, keys, input, token, &cursor, 0); continue; } @@ -3121,7 +3275,7 @@ yy104: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line435: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line435: unused keys left after %u keys\n", i); } } @@ -3147,7 +3301,7 @@ end: #define YYFILL(n) { break; } static int action_line442 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3155,10 +3309,12 @@ static int action_line442 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3168,17 +3324,17 @@ static int action_line442 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line442: at position %ld (iteration %u):\n" + , "error: lex_line442: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3188,6 +3344,13 @@ static int action_line442 } } +static int check_key_count_line442(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line442: not enough keys\n"); + return 1; +} + int lex_line442() { const size_t padding = 2; /* YYMAXFILL */ @@ -3215,7 +3378,7 @@ int lex_line442() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line442.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3228,7 +3391,7 @@ int lex_line442() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3241,7 +3404,8 @@ int lex_line442() yy108: YYSKIP (); yy109: - status = action_line442(i, keys, input, token, &cursor, 254); + status = check_key_count_line442(keys_count, i, 3) + || action_line442(&i, keys, input, token, &cursor, 254); continue; yy110: YYSKIP (); @@ -3315,7 +3479,8 @@ yy110: } yy111: YYSKIP (); - status = action_line442(i, keys, input, token, &cursor, 0); + status = check_key_count_line442(keys_count, i, 3) + || action_line442(&i, keys, input, token, &cursor, 0); continue; } @@ -3327,7 +3492,7 @@ yy111: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line442: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line442: unused keys left after %u keys\n", i); } } @@ -3355,7 +3520,7 @@ end: #define YYFILL(n) { break; } static int action_line449 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3363,10 +3528,12 @@ static int action_line449 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3376,17 +3543,17 @@ static int action_line449 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line449: at position %ld (iteration %u):\n" + , "error: lex_line449: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3396,6 +3563,13 @@ static int action_line449 } } +static int check_key_count_line449(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line449: not enough keys\n"); + return 1; +} + int lex_line449() { const size_t padding = 3; /* YYMAXFILL */ @@ -3423,7 +3597,7 @@ int lex_line449() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line449.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3436,7 +3610,7 @@ int lex_line449() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -3450,7 +3624,8 @@ int lex_line449() yy115: YYSKIP (); yy116: - status = action_line449(i, keys, input, token, &cursor, 254); + status = check_key_count_line449(keys_count, i, 3) + || action_line449(&i, keys, input, token, &cursor, 254); continue; yy117: YYSKIP (); @@ -3536,7 +3711,8 @@ yy119: goto yy116; yy120: YYSKIP (); - status = action_line449(i, keys, input, token, &cursor, 0); + status = check_key_count_line449(keys_count, i, 3) + || action_line449(&i, keys, input, token, &cursor, 0); continue; } @@ -3548,7 +3724,7 @@ yy120: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line449: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line449: unused keys left after %u keys\n", i); } } @@ -3578,7 +3754,7 @@ end: #define YYFILL(n) { break; } static int action_line456 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3586,10 +3762,12 @@ static int action_line456 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3599,17 +3777,17 @@ static int action_line456 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line456: at position %ld (iteration %u):\n" + , "error: lex_line456: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3619,6 +3797,13 @@ static int action_line456 } } +static int check_key_count_line456(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line456: not enough keys\n"); + return 1; +} + int lex_line456() { const size_t padding = 3; /* YYMAXFILL */ @@ -3646,7 +3831,7 @@ int lex_line456() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line456.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3659,7 +3844,7 @@ int lex_line456() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -3673,7 +3858,8 @@ int lex_line456() yy124: YYSKIP (); yy125: - status = action_line456(i, keys, input, token, &cursor, 254); + status = check_key_count_line456(keys_count, i, 3) + || action_line456(&i, keys, input, token, &cursor, 254); continue; yy126: YYSKIP (); @@ -3759,7 +3945,8 @@ yy128: goto yy125; yy129: YYSKIP (); - status = action_line456(i, keys, input, token, &cursor, 0); + status = check_key_count_line456(keys_count, i, 3) + || action_line456(&i, keys, input, token, &cursor, 0); continue; } @@ -3771,7 +3958,7 @@ yy129: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line456: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line456: unused keys left after %u keys\n", i); } } @@ -3801,7 +3988,7 @@ end: #define YYFILL(n) { break; } static int action_line463 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3809,10 +3996,12 @@ static int action_line463 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3822,17 +4011,17 @@ static int action_line463 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line463: at position %ld (iteration %u):\n" + , "error: lex_line463: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3842,6 +4031,13 @@ static int action_line463 } } +static int check_key_count_line463(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line463: not enough keys\n"); + return 1; +} + int lex_line463() { const size_t padding = 3; /* YYMAXFILL */ @@ -3869,7 +4065,7 @@ int lex_line463() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line463.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3882,7 +4078,7 @@ int lex_line463() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -3896,7 +4092,8 @@ int lex_line463() yy133: YYSKIP (); yy134: - status = action_line463(i, keys, input, token, &cursor, 254); + status = check_key_count_line463(keys_count, i, 3) + || action_line463(&i, keys, input, token, &cursor, 254); continue; yy135: YYSKIP (); @@ -3982,7 +4179,8 @@ yy137: goto yy134; yy138: YYSKIP (); - status = action_line463(i, keys, input, token, &cursor, 0); + status = check_key_count_line463(keys_count, i, 3) + || action_line463(&i, keys, input, token, &cursor, 0); continue; } @@ -3994,7 +4192,7 @@ yy138: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line463: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line463: unused keys left after %u keys\n", i); } } @@ -4024,7 +4222,7 @@ end: #define YYFILL(n) { break; } static int action_line470 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4032,10 +4230,12 @@ static int action_line470 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4045,17 +4245,17 @@ static int action_line470 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line470: at position %ld (iteration %u):\n" + , "error: lex_line470: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4065,6 +4265,13 @@ static int action_line470 } } +static int check_key_count_line470(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line470: not enough keys\n"); + return 1; +} + int lex_line470() { const size_t padding = 3; /* YYMAXFILL */ @@ -4092,7 +4299,7 @@ int lex_line470() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line470.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4105,7 +4312,7 @@ int lex_line470() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -4119,7 +4326,8 @@ int lex_line470() yy142: YYSKIP (); yy143: - status = action_line470(i, keys, input, token, &cursor, 254); + status = check_key_count_line470(keys_count, i, 3) + || action_line470(&i, keys, input, token, &cursor, 254); continue; yy144: YYSKIP (); @@ -4205,7 +4413,8 @@ yy146: goto yy143; yy147: YYSKIP (); - status = action_line470(i, keys, input, token, &cursor, 0); + status = check_key_count_line470(keys_count, i, 3) + || action_line470(&i, keys, input, token, &cursor, 0); continue; } @@ -4217,7 +4426,7 @@ yy147: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line470: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line470: unused keys left after %u keys\n", i); } } @@ -4247,7 +4456,7 @@ end: #define YYFILL(n) { break; } static int action_line477 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4255,10 +4464,12 @@ static int action_line477 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4268,17 +4479,17 @@ static int action_line477 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line477: at position %ld (iteration %u):\n" + , "error: lex_line477: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4288,6 +4499,13 @@ static int action_line477 } } +static int check_key_count_line477(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line477: not enough keys\n"); + return 1; +} + int lex_line477() { const size_t padding = 3; /* YYMAXFILL */ @@ -4315,7 +4533,7 @@ int lex_line477() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line477.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4328,7 +4546,7 @@ int lex_line477() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -4342,7 +4560,8 @@ int lex_line477() yy151: YYSKIP (); yy152: - status = action_line477(i, keys, input, token, &cursor, 254); + status = check_key_count_line477(keys_count, i, 3) + || action_line477(&i, keys, input, token, &cursor, 254); continue; yy153: YYSKIP (); @@ -4428,7 +4647,8 @@ yy155: goto yy152; yy156: YYSKIP (); - status = action_line477(i, keys, input, token, &cursor, 0); + status = check_key_count_line477(keys_count, i, 3) + || action_line477(&i, keys, input, token, &cursor, 0); continue; } @@ -4440,7 +4660,7 @@ yy156: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line477: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line477: unused keys left after %u keys\n", i); } } @@ -4470,7 +4690,7 @@ end: #define YYFILL(n) { break; } static int action_line484 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4478,10 +4698,12 @@ static int action_line484 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4491,17 +4713,17 @@ static int action_line484 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line484: at position %ld (iteration %u):\n" + , "error: lex_line484: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4511,6 +4733,13 @@ static int action_line484 } } +static int check_key_count_line484(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line484: not enough keys\n"); + return 1; +} + int lex_line484() { const size_t padding = 3; /* YYMAXFILL */ @@ -4538,7 +4767,7 @@ int lex_line484() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line484.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4551,7 +4780,7 @@ int lex_line484() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -4565,7 +4794,8 @@ int lex_line484() yy160: YYSKIP (); yy161: - status = action_line484(i, keys, input, token, &cursor, 254); + status = check_key_count_line484(keys_count, i, 3) + || action_line484(&i, keys, input, token, &cursor, 254); continue; yy162: YYSKIP (); @@ -4651,7 +4881,8 @@ yy164: goto yy161; yy165: YYSKIP (); - status = action_line484(i, keys, input, token, &cursor, 0); + status = check_key_count_line484(keys_count, i, 3) + || action_line484(&i, keys, input, token, &cursor, 0); continue; } @@ -4663,7 +4894,7 @@ yy165: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line484: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line484: unused keys left after %u keys\n", i); } } @@ -4693,7 +4924,7 @@ end: #define YYFILL(n) { break; } static int action_line491 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4701,10 +4932,12 @@ static int action_line491 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4714,17 +4947,17 @@ static int action_line491 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line491: at position %ld (iteration %u):\n" + , "error: lex_line491: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4734,6 +4967,13 @@ static int action_line491 } } +static int check_key_count_line491(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line491: not enough keys\n"); + return 1; +} + int lex_line491() { const size_t padding = 3; /* YYMAXFILL */ @@ -4761,7 +5001,7 @@ int lex_line491() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line491.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4774,7 +5014,7 @@ int lex_line491() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -4788,7 +5028,8 @@ int lex_line491() yy169: YYSKIP (); yy170: - status = action_line491(i, keys, input, token, &cursor, 254); + status = check_key_count_line491(keys_count, i, 3) + || action_line491(&i, keys, input, token, &cursor, 254); continue; yy171: YYSKIP (); @@ -4874,7 +5115,8 @@ yy173: goto yy170; yy174: YYSKIP (); - status = action_line491(i, keys, input, token, &cursor, 0); + status = check_key_count_line491(keys_count, i, 3) + || action_line491(&i, keys, input, token, &cursor, 0); continue; } @@ -4886,7 +5128,7 @@ yy174: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line491: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line491: unused keys left after %u keys\n", i); } } @@ -4916,7 +5158,7 @@ end: #define YYFILL(n) { break; } static int action_line498 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4924,10 +5166,12 @@ static int action_line498 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4937,17 +5181,17 @@ static int action_line498 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line498: at position %ld (iteration %u):\n" + , "error: lex_line498: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4957,6 +5201,13 @@ static int action_line498 } } +static int check_key_count_line498(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line498: not enough keys\n"); + return 1; +} + int lex_line498() { const size_t padding = 3; /* YYMAXFILL */ @@ -4984,7 +5235,7 @@ int lex_line498() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line498.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4997,7 +5248,7 @@ int lex_line498() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -5011,7 +5262,8 @@ int lex_line498() yy178: YYSKIP (); yy179: - status = action_line498(i, keys, input, token, &cursor, 254); + status = check_key_count_line498(keys_count, i, 3) + || action_line498(&i, keys, input, token, &cursor, 254); continue; yy180: YYSKIP (); @@ -5097,7 +5349,8 @@ yy182: goto yy179; yy183: YYSKIP (); - status = action_line498(i, keys, input, token, &cursor, 0); + status = check_key_count_line498(keys_count, i, 3) + || action_line498(&i, keys, input, token, &cursor, 0); continue; } @@ -5109,7 +5362,7 @@ yy183: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line498: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line498: unused keys left after %u keys\n", i); } } @@ -5139,7 +5392,7 @@ end: #define YYFILL(n) { break; } static int action_line505 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5147,10 +5400,12 @@ static int action_line505 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5160,17 +5415,17 @@ static int action_line505 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line505: at position %ld (iteration %u):\n" + , "error: lex_line505: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5180,6 +5435,13 @@ static int action_line505 } } +static int check_key_count_line505(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line505: not enough keys\n"); + return 1; +} + int lex_line505() { const size_t padding = 3; /* YYMAXFILL */ @@ -5207,7 +5469,7 @@ int lex_line505() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line505.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5220,7 +5482,7 @@ int lex_line505() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -5234,7 +5496,8 @@ int lex_line505() yy187: YYSKIP (); yy188: - status = action_line505(i, keys, input, token, &cursor, 254); + status = check_key_count_line505(keys_count, i, 3) + || action_line505(&i, keys, input, token, &cursor, 254); continue; yy189: YYSKIP (); @@ -5320,7 +5583,8 @@ yy191: goto yy188; yy192: YYSKIP (); - status = action_line505(i, keys, input, token, &cursor, 0); + status = check_key_count_line505(keys_count, i, 3) + || action_line505(&i, keys, input, token, &cursor, 0); continue; } @@ -5332,7 +5596,7 @@ yy192: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line505: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line505: unused keys left after %u keys\n", i); } } @@ -5362,7 +5626,7 @@ end: #define YYFILL(n) { break; } static int action_line512 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5370,10 +5634,12 @@ static int action_line512 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5383,17 +5649,17 @@ static int action_line512 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line512: at position %ld (iteration %u):\n" + , "error: lex_line512: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5403,6 +5669,13 @@ static int action_line512 } } +static int check_key_count_line512(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line512: not enough keys\n"); + return 1; +} + int lex_line512() { const size_t padding = 3; /* YYMAXFILL */ @@ -5430,7 +5703,7 @@ int lex_line512() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line512.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5443,7 +5716,7 @@ int lex_line512() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -5457,7 +5730,8 @@ int lex_line512() yy196: YYSKIP (); yy197: - status = action_line512(i, keys, input, token, &cursor, 254); + status = check_key_count_line512(keys_count, i, 3) + || action_line512(&i, keys, input, token, &cursor, 254); continue; yy198: YYSKIP (); @@ -5543,7 +5817,8 @@ yy200: goto yy197; yy201: YYSKIP (); - status = action_line512(i, keys, input, token, &cursor, 0); + status = check_key_count_line512(keys_count, i, 3) + || action_line512(&i, keys, input, token, &cursor, 0); continue; } @@ -5555,7 +5830,7 @@ yy201: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line512: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line512: unused keys left after %u keys\n", i); } } @@ -5585,7 +5860,7 @@ end: #define YYFILL(n) { break; } static int action_line519 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5593,10 +5868,12 @@ static int action_line519 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5606,17 +5883,17 @@ static int action_line519 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line519: at position %ld (iteration %u):\n" + , "error: lex_line519: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5626,6 +5903,13 @@ static int action_line519 } } +static int check_key_count_line519(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line519: not enough keys\n"); + return 1; +} + int lex_line519() { const size_t padding = 3; /* YYMAXFILL */ @@ -5653,7 +5937,7 @@ int lex_line519() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line519.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5666,7 +5950,7 @@ int lex_line519() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -5680,7 +5964,8 @@ int lex_line519() yy205: YYSKIP (); yy206: - status = action_line519(i, keys, input, token, &cursor, 254); + status = check_key_count_line519(keys_count, i, 3) + || action_line519(&i, keys, input, token, &cursor, 254); continue; yy207: YYSKIP (); @@ -5766,7 +6051,8 @@ yy209: goto yy206; yy210: YYSKIP (); - status = action_line519(i, keys, input, token, &cursor, 0); + status = check_key_count_line519(keys_count, i, 3) + || action_line519(&i, keys, input, token, &cursor, 0); continue; } @@ -5778,7 +6064,7 @@ yy210: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line519: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line519: unused keys left after %u keys\n", i); } } @@ -5808,7 +6094,7 @@ end: #define YYFILL(n) { break; } static int action_line526 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5816,10 +6102,12 @@ static int action_line526 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5829,17 +6117,17 @@ static int action_line526 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line526: at position %ld (iteration %u):\n" + , "error: lex_line526: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5849,6 +6137,13 @@ static int action_line526 } } +static int check_key_count_line526(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line526: not enough keys\n"); + return 1; +} + int lex_line526() { const size_t padding = 3; /* YYMAXFILL */ @@ -5876,7 +6171,7 @@ int lex_line526() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line526.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5889,7 +6184,7 @@ int lex_line526() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -5903,7 +6198,8 @@ int lex_line526() yy214: YYSKIP (); yy215: - status = action_line526(i, keys, input, token, &cursor, 254); + status = check_key_count_line526(keys_count, i, 3) + || action_line526(&i, keys, input, token, &cursor, 254); continue; yy216: YYSKIP (); @@ -5989,7 +6285,8 @@ yy218: goto yy215; yy219: YYSKIP (); - status = action_line526(i, keys, input, token, &cursor, 0); + status = check_key_count_line526(keys_count, i, 3) + || action_line526(&i, keys, input, token, &cursor, 0); continue; } @@ -6001,7 +6298,7 @@ yy219: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line526: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line526: unused keys left after %u keys\n", i); } } @@ -6031,7 +6328,7 @@ end: #define YYFILL(n) { break; } static int action_line533 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6039,10 +6336,12 @@ static int action_line533 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6052,17 +6351,17 @@ static int action_line533 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line533: at position %ld (iteration %u):\n" + , "error: lex_line533: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6072,6 +6371,13 @@ static int action_line533 } } +static int check_key_count_line533(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line533: not enough keys\n"); + return 1; +} + int lex_line533() { const size_t padding = 3; /* YYMAXFILL */ @@ -6099,7 +6405,7 @@ int lex_line533() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line533.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6112,7 +6418,7 @@ int lex_line533() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -6126,7 +6432,8 @@ int lex_line533() yy223: YYSKIP (); yy224: - status = action_line533(i, keys, input, token, &cursor, 254); + status = check_key_count_line533(keys_count, i, 3) + || action_line533(&i, keys, input, token, &cursor, 254); continue; yy225: YYSKIP (); @@ -6214,7 +6521,8 @@ yy227: goto yy224; yy228: YYSKIP (); - status = action_line533(i, keys, input, token, &cursor, 0); + status = check_key_count_line533(keys_count, i, 3) + || action_line533(&i, keys, input, token, &cursor, 0); continue; } @@ -6226,7 +6534,7 @@ yy228: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line533: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line533: unused keys left after %u keys\n", i); } } @@ -6256,7 +6564,7 @@ end: #define YYFILL(n) { break; } static int action_line540 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6264,10 +6572,12 @@ static int action_line540 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6277,17 +6587,17 @@ static int action_line540 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line540: at position %ld (iteration %u):\n" + , "error: lex_line540: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6297,6 +6607,13 @@ static int action_line540 } } +static int check_key_count_line540(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line540: not enough keys\n"); + return 1; +} + int lex_line540() { const size_t padding = 3; /* YYMAXFILL */ @@ -6324,7 +6641,7 @@ int lex_line540() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line540.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6337,7 +6654,7 @@ int lex_line540() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -6351,7 +6668,8 @@ int lex_line540() yy232: YYSKIP (); yy233: - status = action_line540(i, keys, input, token, &cursor, 254); + status = check_key_count_line540(keys_count, i, 3) + || action_line540(&i, keys, input, token, &cursor, 254); continue; yy234: YYSKIP (); @@ -6476,7 +6794,8 @@ yy237: } yy238: YYSKIP (); - status = action_line540(i, keys, input, token, &cursor, 0); + status = check_key_count_line540(keys_count, i, 3) + || action_line540(&i, keys, input, token, &cursor, 0); continue; } @@ -6488,7 +6807,7 @@ yy238: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line540: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line540: unused keys left after %u keys\n", i); } } @@ -6518,7 +6837,7 @@ end: #define YYFILL(n) { break; } static int action_line547 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6526,10 +6845,12 @@ static int action_line547 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6539,17 +6860,17 @@ static int action_line547 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line547: at position %ld (iteration %u):\n" + , "error: lex_line547: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6559,6 +6880,13 @@ static int action_line547 } } +static int check_key_count_line547(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line547: not enough keys\n"); + return 1; +} + int lex_line547() { const size_t padding = 3; /* YYMAXFILL */ @@ -6586,7 +6914,7 @@ int lex_line547() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line547.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6599,7 +6927,7 @@ int lex_line547() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -6613,7 +6941,8 @@ int lex_line547() yy242: YYSKIP (); yy243: - status = action_line547(i, keys, input, token, &cursor, 254); + status = check_key_count_line547(keys_count, i, 3) + || action_line547(&i, keys, input, token, &cursor, 254); continue; yy244: YYSKIP (); @@ -6737,7 +7066,8 @@ yy247: } yy248: YYSKIP (); - status = action_line547(i, keys, input, token, &cursor, 0); + status = check_key_count_line547(keys_count, i, 3) + || action_line547(&i, keys, input, token, &cursor, 0); continue; } @@ -6749,7 +7079,7 @@ yy248: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line547: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line547: unused keys left after %u keys\n", i); } } @@ -6779,7 +7109,7 @@ end: #define YYFILL(n) { break; } static int action_line554 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6787,10 +7117,12 @@ static int action_line554 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6800,17 +7132,17 @@ static int action_line554 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line554: at position %ld (iteration %u):\n" + , "error: lex_line554: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6820,6 +7152,13 @@ static int action_line554 } } +static int check_key_count_line554(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line554: not enough keys\n"); + return 1; +} + int lex_line554() { const size_t padding = 3; /* YYMAXFILL */ @@ -6847,7 +7186,7 @@ int lex_line554() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line554.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6860,7 +7199,7 @@ int lex_line554() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -6874,7 +7213,8 @@ int lex_line554() yy252: YYSKIP (); yy253: - status = action_line554(i, keys, input, token, &cursor, 254); + status = check_key_count_line554(keys_count, i, 3) + || action_line554(&i, keys, input, token, &cursor, 254); continue; yy254: YYSKIP (); @@ -6962,7 +7302,8 @@ yy256: goto yy253; yy257: YYSKIP (); - status = action_line554(i, keys, input, token, &cursor, 0); + status = check_key_count_line554(keys_count, i, 3) + || action_line554(&i, keys, input, token, &cursor, 0); continue; } @@ -6974,7 +7315,7 @@ yy257: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line554: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line554: unused keys left after %u keys\n", i); } } @@ -7004,7 +7345,7 @@ end: #define YYFILL(n) { break; } static int action_line561 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7012,10 +7353,12 @@ static int action_line561 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7025,17 +7368,17 @@ static int action_line561 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line561: at position %ld (iteration %u):\n" + , "error: lex_line561: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7045,6 +7388,13 @@ static int action_line561 } } +static int check_key_count_line561(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line561: not enough keys\n"); + return 1; +} + int lex_line561() { const size_t padding = 3; /* YYMAXFILL */ @@ -7072,7 +7422,7 @@ int lex_line561() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line561.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7085,7 +7435,7 @@ int lex_line561() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -7099,7 +7449,8 @@ int lex_line561() yy261: YYSKIP (); yy262: - status = action_line561(i, keys, input, token, &cursor, 254); + status = check_key_count_line561(keys_count, i, 3) + || action_line561(&i, keys, input, token, &cursor, 254); continue; yy263: YYSKIP (); @@ -7189,7 +7540,8 @@ yy265: goto yy262; yy266: YYSKIP (); - status = action_line561(i, keys, input, token, &cursor, 0); + status = check_key_count_line561(keys_count, i, 3) + || action_line561(&i, keys, input, token, &cursor, 0); continue; } @@ -7201,7 +7553,7 @@ yy266: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line561: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line561: unused keys left after %u keys\n", i); } } @@ -7231,7 +7583,7 @@ end: #define YYFILL(n) { break; } static int action_line568 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7239,10 +7591,12 @@ static int action_line568 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7252,17 +7606,17 @@ static int action_line568 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line568: at position %ld (iteration %u):\n" + , "error: lex_line568: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7272,6 +7626,13 @@ static int action_line568 } } +static int check_key_count_line568(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line568: not enough keys\n"); + return 1; +} + int lex_line568() { const size_t padding = 3; /* YYMAXFILL */ @@ -7299,7 +7660,7 @@ int lex_line568() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line568.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7312,7 +7673,7 @@ int lex_line568() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -7326,7 +7687,8 @@ int lex_line568() yy270: YYSKIP (); yy271: - status = action_line568(i, keys, input, token, &cursor, 254); + status = check_key_count_line568(keys_count, i, 3) + || action_line568(&i, keys, input, token, &cursor, 254); continue; yy272: YYSKIP (); @@ -7450,7 +7812,8 @@ yy275: } yy276: YYSKIP (); - status = action_line568(i, keys, input, token, &cursor, 0); + status = check_key_count_line568(keys_count, i, 3) + || action_line568(&i, keys, input, token, &cursor, 0); continue; } @@ -7462,7 +7825,7 @@ yy276: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line568: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line568: unused keys left after %u keys\n", i); } } @@ -7492,7 +7855,7 @@ end: #define YYFILL(n) { break; } static int action_line575 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7500,10 +7863,12 @@ static int action_line575 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7513,17 +7878,17 @@ static int action_line575 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line575: at position %ld (iteration %u):\n" + , "error: lex_line575: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7533,6 +7898,13 @@ static int action_line575 } } +static int check_key_count_line575(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line575: not enough keys\n"); + return 1; +} + int lex_line575() { const size_t padding = 3; /* YYMAXFILL */ @@ -7560,7 +7932,7 @@ int lex_line575() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line575.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7573,7 +7945,7 @@ int lex_line575() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -7587,7 +7959,8 @@ int lex_line575() yy280: YYSKIP (); yy281: - status = action_line575(i, keys, input, token, &cursor, 254); + status = check_key_count_line575(keys_count, i, 3) + || action_line575(&i, keys, input, token, &cursor, 254); continue; yy282: YYSKIP (); @@ -7681,7 +8054,8 @@ yy284: goto yy281; yy285: YYSKIP (); - status = action_line575(i, keys, input, token, &cursor, 0); + status = check_key_count_line575(keys_count, i, 3) + || action_line575(&i, keys, input, token, &cursor, 0); continue; } @@ -7693,7 +8067,7 @@ yy285: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line575: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line575: unused keys left after %u keys\n", i); } } @@ -7723,7 +8097,7 @@ end: #define YYFILL(n) { break; } static int action_line582 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7731,10 +8105,12 @@ static int action_line582 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7744,17 +8120,17 @@ static int action_line582 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line582: at position %ld (iteration %u):\n" + , "error: lex_line582: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7764,6 +8140,13 @@ static int action_line582 } } +static int check_key_count_line582(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line582: not enough keys\n"); + return 1; +} + int lex_line582() { const size_t padding = 3; /* YYMAXFILL */ @@ -7791,7 +8174,7 @@ int lex_line582() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line582.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7804,7 +8187,7 @@ int lex_line582() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -7818,7 +8201,8 @@ int lex_line582() yy289: YYSKIP (); yy290: - status = action_line582(i, keys, input, token, &cursor, 254); + status = check_key_count_line582(keys_count, i, 3) + || action_line582(&i, keys, input, token, &cursor, 254); continue; yy291: YYSKIP (); @@ -7871,7 +8255,8 @@ yy293: goto yy290; yy294: YYSKIP (); - status = action_line582(i, keys, input, token, &cursor, 0); + status = check_key_count_line582(keys_count, i, 3) + || action_line582(&i, keys, input, token, &cursor, 0); continue; } @@ -7883,7 +8268,7 @@ yy294: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line582: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line582: unused keys left after %u keys\n", i); } } @@ -7913,7 +8298,7 @@ end: #define YYFILL(n) { break; } static int action_line589 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7921,10 +8306,12 @@ static int action_line589 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7934,17 +8321,17 @@ static int action_line589 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line589: at position %ld (iteration %u):\n" + , "error: lex_line589: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7954,6 +8341,13 @@ static int action_line589 } } +static int check_key_count_line589(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line589: not enough keys\n"); + return 1; +} + int lex_line589() { const size_t padding = 3; /* YYMAXFILL */ @@ -7981,7 +8375,7 @@ int lex_line589() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line589.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7994,7 +8388,7 @@ int lex_line589() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -8008,7 +8402,8 @@ int lex_line589() yy298: YYSKIP (); yy299: - status = action_line589(i, keys, input, token, &cursor, 254); + status = check_key_count_line589(keys_count, i, 3) + || action_line589(&i, keys, input, token, &cursor, 254); continue; yy300: YYSKIP (); @@ -8132,7 +8527,8 @@ yy303: } yy304: YYSKIP (); - status = action_line589(i, keys, input, token, &cursor, 0); + status = check_key_count_line589(keys_count, i, 3) + || action_line589(&i, keys, input, token, &cursor, 0); continue; } @@ -8144,7 +8540,7 @@ yy304: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line589: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line589: unused keys left after %u keys\n", i); } } @@ -8174,7 +8570,7 @@ end: #define YYFILL(n) { break; } static int action_line596 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8182,10 +8578,12 @@ static int action_line596 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8195,17 +8593,17 @@ static int action_line596 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line596: at position %ld (iteration %u):\n" + , "error: lex_line596: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8215,6 +8613,13 @@ static int action_line596 } } +static int check_key_count_line596(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line596: not enough keys\n"); + return 1; +} + int lex_line596() { const size_t padding = 3; /* YYMAXFILL */ @@ -8242,7 +8647,7 @@ int lex_line596() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line596.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8255,7 +8660,7 @@ int lex_line596() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -8269,7 +8674,8 @@ int lex_line596() yy308: YYSKIP (); yy309: - status = action_line596(i, keys, input, token, &cursor, 254); + status = check_key_count_line596(keys_count, i, 3) + || action_line596(&i, keys, input, token, &cursor, 254); continue; yy310: YYSKIP (); @@ -8322,7 +8728,8 @@ yy312: goto yy309; yy313: YYSKIP (); - status = action_line596(i, keys, input, token, &cursor, 0); + status = check_key_count_line596(keys_count, i, 3) + || action_line596(&i, keys, input, token, &cursor, 0); continue; } @@ -8334,7 +8741,7 @@ yy313: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line596: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line596: unused keys left after %u keys\n", i); } } @@ -8364,7 +8771,7 @@ end: #define YYFILL(n) { break; } static int action_line603 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8372,10 +8779,12 @@ static int action_line603 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8385,17 +8794,17 @@ static int action_line603 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line603: at position %ld (iteration %u):\n" + , "error: lex_line603: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8405,6 +8814,13 @@ static int action_line603 } } +static int check_key_count_line603(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line603: not enough keys\n"); + return 1; +} + int lex_line603() { const size_t padding = 3; /* YYMAXFILL */ @@ -8432,7 +8848,7 @@ int lex_line603() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line603.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8445,7 +8861,7 @@ int lex_line603() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -8459,7 +8875,8 @@ int lex_line603() yy317: YYSKIP (); yy318: - status = action_line603(i, keys, input, token, &cursor, 254); + status = check_key_count_line603(keys_count, i, 3) + || action_line603(&i, keys, input, token, &cursor, 254); continue; yy319: YYSKIP (); @@ -8512,7 +8929,8 @@ yy321: goto yy318; yy322: YYSKIP (); - status = action_line603(i, keys, input, token, &cursor, 0); + status = check_key_count_line603(keys_count, i, 3) + || action_line603(&i, keys, input, token, &cursor, 0); continue; } @@ -8524,7 +8942,7 @@ yy322: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line603: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line603: unused keys left after %u keys\n", i); } } @@ -8554,7 +8972,7 @@ end: #define YYFILL(n) { break; } static int action_line610 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8562,10 +8980,12 @@ static int action_line610 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8575,17 +8995,17 @@ static int action_line610 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line610: at position %ld (iteration %u):\n" + , "error: lex_line610: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8595,6 +9015,13 @@ static int action_line610 } } +static int check_key_count_line610(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line610: not enough keys\n"); + return 1; +} + int lex_line610() { const size_t padding = 3; /* YYMAXFILL */ @@ -8622,7 +9049,7 @@ int lex_line610() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line610.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8635,7 +9062,7 @@ int lex_line610() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -8649,7 +9076,8 @@ int lex_line610() yy326: YYSKIP (); yy327: - status = action_line610(i, keys, input, token, &cursor, 254); + status = check_key_count_line610(keys_count, i, 3) + || action_line610(&i, keys, input, token, &cursor, 254); continue; yy328: YYSKIP (); @@ -8702,7 +9130,8 @@ yy330: goto yy327; yy331: YYSKIP (); - status = action_line610(i, keys, input, token, &cursor, 0); + status = check_key_count_line610(keys_count, i, 3) + || action_line610(&i, keys, input, token, &cursor, 0); continue; } @@ -8714,7 +9143,7 @@ yy331: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line610: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line610: unused keys left after %u keys\n", i); } } @@ -8744,7 +9173,7 @@ end: #define YYFILL(n) { break; } static int action_line617 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8752,10 +9181,12 @@ static int action_line617 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8765,17 +9196,17 @@ static int action_line617 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line617: at position %ld (iteration %u):\n" + , "error: lex_line617: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8785,6 +9216,13 @@ static int action_line617 } } +static int check_key_count_line617(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line617: not enough keys\n"); + return 1; +} + int lex_line617() { const size_t padding = 3; /* YYMAXFILL */ @@ -8812,7 +9250,7 @@ int lex_line617() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line617.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8825,7 +9263,7 @@ int lex_line617() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -8839,7 +9277,8 @@ int lex_line617() yy335: YYSKIP (); yy336: - status = action_line617(i, keys, input, token, &cursor, 254); + status = check_key_count_line617(keys_count, i, 3) + || action_line617(&i, keys, input, token, &cursor, 254); continue; yy337: YYSKIP (); @@ -8892,7 +9331,8 @@ yy339: goto yy336; yy340: YYSKIP (); - status = action_line617(i, keys, input, token, &cursor, 0); + status = check_key_count_line617(keys_count, i, 3) + || action_line617(&i, keys, input, token, &cursor, 0); continue; } @@ -8904,7 +9344,7 @@ yy340: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line617: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line617: unused keys left after %u keys\n", i); } } @@ -8934,7 +9374,7 @@ end: #define YYFILL(n) { break; } static int action_line624 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8942,10 +9382,12 @@ static int action_line624 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8955,17 +9397,17 @@ static int action_line624 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line624: at position %ld (iteration %u):\n" + , "error: lex_line624: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8975,6 +9417,13 @@ static int action_line624 } } +static int check_key_count_line624(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line624: not enough keys\n"); + return 1; +} + int lex_line624() { const size_t padding = 3; /* YYMAXFILL */ @@ -9002,7 +9451,7 @@ int lex_line624() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line624.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9015,7 +9464,7 @@ int lex_line624() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -9029,7 +9478,8 @@ int lex_line624() yy344: YYSKIP (); yy345: - status = action_line624(i, keys, input, token, &cursor, 254); + status = check_key_count_line624(keys_count, i, 3) + || action_line624(&i, keys, input, token, &cursor, 254); continue; yy346: YYSKIP (); @@ -9115,7 +9565,8 @@ yy348: goto yy345; yy349: YYSKIP (); - status = action_line624(i, keys, input, token, &cursor, 0); + status = check_key_count_line624(keys_count, i, 3) + || action_line624(&i, keys, input, token, &cursor, 0); continue; } @@ -9127,7 +9578,7 @@ yy349: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line624: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line624: unused keys left after %u keys\n", i); } } @@ -9157,7 +9608,7 @@ end: #define YYFILL(n) { break; } static int action_line631 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9165,10 +9616,12 @@ static int action_line631 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9178,17 +9631,17 @@ static int action_line631 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line631: at position %ld (iteration %u):\n" + , "error: lex_line631: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9198,6 +9651,13 @@ static int action_line631 } } +static int check_key_count_line631(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line631: not enough keys\n"); + return 1; +} + int lex_line631() { const size_t padding = 3; /* YYMAXFILL */ @@ -9225,7 +9685,7 @@ int lex_line631() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line631.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9238,7 +9698,7 @@ int lex_line631() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -9252,7 +9712,8 @@ int lex_line631() yy353: YYSKIP (); yy354: - status = action_line631(i, keys, input, token, &cursor, 254); + status = check_key_count_line631(keys_count, i, 3) + || action_line631(&i, keys, input, token, &cursor, 254); continue; yy355: YYSKIP (); @@ -9393,7 +9854,8 @@ yy358: } yy359: YYSKIP (); - status = action_line631(i, keys, input, token, &cursor, 0); + status = check_key_count_line631(keys_count, i, 3) + || action_line631(&i, keys, input, token, &cursor, 0); continue; } @@ -9405,7 +9867,7 @@ yy359: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line631: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line631: unused keys left after %u keys\n", i); } } @@ -9435,7 +9897,7 @@ end: #define YYFILL(n) { break; } static int action_line638 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9443,10 +9905,12 @@ static int action_line638 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9456,17 +9920,17 @@ static int action_line638 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line638: at position %ld (iteration %u):\n" + , "error: lex_line638: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9476,6 +9940,13 @@ static int action_line638 } } +static int check_key_count_line638(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line638: not enough keys\n"); + return 1; +} + int lex_line638() { const size_t padding = 3; /* YYMAXFILL */ @@ -9503,7 +9974,7 @@ int lex_line638() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line638.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9516,7 +9987,7 @@ int lex_line638() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -9530,7 +10001,8 @@ int lex_line638() yy363: YYSKIP (); yy364: - status = action_line638(i, keys, input, token, &cursor, 254); + status = check_key_count_line638(keys_count, i, 3) + || action_line638(&i, keys, input, token, &cursor, 254); continue; yy365: YYSKIP (); @@ -9638,7 +10110,8 @@ yy368: } yy369: YYSKIP (); - status = action_line638(i, keys, input, token, &cursor, 0); + status = check_key_count_line638(keys_count, i, 3) + || action_line638(&i, keys, input, token, &cursor, 0); continue; } @@ -9650,7 +10123,7 @@ yy369: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line638: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line638: unused keys left after %u keys\n", i); } } @@ -9680,7 +10153,7 @@ end: #define YYFILL(n) { break; } static int action_line645 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9688,10 +10161,12 @@ static int action_line645 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9701,17 +10176,17 @@ static int action_line645 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line645: at position %ld (iteration %u):\n" + , "error: lex_line645: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9721,6 +10196,13 @@ static int action_line645 } } +static int check_key_count_line645(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line645: not enough keys\n"); + return 1; +} + int lex_line645() { const size_t padding = 3; /* YYMAXFILL */ @@ -9748,7 +10230,7 @@ int lex_line645() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line645.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9761,7 +10243,7 @@ int lex_line645() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -9775,7 +10257,8 @@ int lex_line645() yy373: YYSKIP (); yy374: - status = action_line645(i, keys, input, token, &cursor, 254); + status = check_key_count_line645(keys_count, i, 3) + || action_line645(&i, keys, input, token, &cursor, 254); continue; yy375: YYSKIP (); @@ -9844,7 +10327,8 @@ yy377: goto yy374; yy378: YYSKIP (); - status = action_line645(i, keys, input, token, &cursor, 0); + status = check_key_count_line645(keys_count, i, 3) + || action_line645(&i, keys, input, token, &cursor, 0); continue; } @@ -9856,7 +10340,7 @@ yy378: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line645: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line645: unused keys left after %u keys\n", i); } } @@ -9886,7 +10370,7 @@ end: #define YYFILL(n) { break; } static int action_line652 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9894,10 +10378,12 @@ static int action_line652 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9907,17 +10393,17 @@ static int action_line652 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652: at position %ld (iteration %u):\n" + , "error: lex_line652: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9927,6 +10413,13 @@ static int action_line652 } } +static int check_key_count_line652(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652: not enough keys\n"); + return 1; +} + int lex_line652() { const size_t padding = 3; /* YYMAXFILL */ @@ -9954,7 +10447,7 @@ int lex_line652() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line652.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9967,7 +10460,7 @@ int lex_line652() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -9981,7 +10474,8 @@ int lex_line652() yy382: YYSKIP (); yy383: - status = action_line652(i, keys, input, token, &cursor, 254); + status = check_key_count_line652(keys_count, i, 3) + || action_line652(&i, keys, input, token, &cursor, 254); continue; yy384: YYSKIP (); @@ -10034,7 +10528,8 @@ yy386: goto yy383; yy387: YYSKIP (); - status = action_line652(i, keys, input, token, &cursor, 0); + status = check_key_count_line652(keys_count, i, 3) + || action_line652(&i, keys, input, token, &cursor, 0); continue; } @@ -10046,7 +10541,7 @@ yy387: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652: unused keys left after %u keys\n", i); } } @@ -10076,7 +10571,7 @@ end: #define YYFILL(n) { break; } static int action_line659 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10084,10 +10579,12 @@ static int action_line659 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10097,17 +10594,17 @@ static int action_line659 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line659: at position %ld (iteration %u):\n" + , "error: lex_line659: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10117,6 +10614,13 @@ static int action_line659 } } +static int check_key_count_line659(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line659: not enough keys\n"); + return 1; +} + int lex_line659() { const size_t padding = 3; /* YYMAXFILL */ @@ -10144,7 +10648,7 @@ int lex_line659() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line659.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10157,7 +10661,7 @@ int lex_line659() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -10171,7 +10675,8 @@ int lex_line659() yy391: YYSKIP (); yy392: - status = action_line659(i, keys, input, token, &cursor, 254); + status = check_key_count_line659(keys_count, i, 3) + || action_line659(&i, keys, input, token, &cursor, 254); continue; yy393: YYSKIP (); @@ -10257,7 +10762,8 @@ yy395: goto yy392; yy396: YYSKIP (); - status = action_line659(i, keys, input, token, &cursor, 0); + status = check_key_count_line659(keys_count, i, 3) + || action_line659(&i, keys, input, token, &cursor, 0); continue; } @@ -10269,7 +10775,7 @@ yy396: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line659: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line659: unused keys left after %u keys\n", i); } } @@ -10299,7 +10805,7 @@ end: #define YYFILL(n) { break; } static int action_line666 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10307,10 +10813,12 @@ static int action_line666 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10320,17 +10828,17 @@ static int action_line666 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line666: at position %ld (iteration %u):\n" + , "error: lex_line666: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10340,6 +10848,13 @@ static int action_line666 } } +static int check_key_count_line666(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line666: not enough keys\n"); + return 1; +} + int lex_line666() { const size_t padding = 3; /* YYMAXFILL */ @@ -10367,7 +10882,7 @@ int lex_line666() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line666.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10380,7 +10895,7 @@ int lex_line666() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -10394,7 +10909,8 @@ int lex_line666() yy400: YYSKIP (); yy401: - status = action_line666(i, keys, input, token, &cursor, 254); + status = check_key_count_line666(keys_count, i, 3) + || action_line666(&i, keys, input, token, &cursor, 254); continue; yy402: YYSKIP (); @@ -10482,7 +10998,8 @@ yy404: goto yy401; yy405: YYSKIP (); - status = action_line666(i, keys, input, token, &cursor, 0); + status = check_key_count_line666(keys_count, i, 3) + || action_line666(&i, keys, input, token, &cursor, 0); continue; } @@ -10494,7 +11011,7 @@ yy405: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line666: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line666: unused keys left after %u keys\n", i); } } @@ -10524,7 +11041,7 @@ end: #define YYFILL(n) { break; } static int action_line673 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10532,10 +11049,12 @@ static int action_line673 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10545,17 +11064,17 @@ static int action_line673 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line673: at position %ld (iteration %u):\n" + , "error: lex_line673: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10565,6 +11084,13 @@ static int action_line673 } } +static int check_key_count_line673(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line673: not enough keys\n"); + return 1; +} + int lex_line673() { const size_t padding = 3; /* YYMAXFILL */ @@ -10592,7 +11118,7 @@ int lex_line673() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line673.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10605,7 +11131,7 @@ int lex_line673() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -10619,7 +11145,8 @@ int lex_line673() yy409: YYSKIP (); yy410: - status = action_line673(i, keys, input, token, &cursor, 254); + status = check_key_count_line673(keys_count, i, 3) + || action_line673(&i, keys, input, token, &cursor, 254); continue; yy411: YYSKIP (); @@ -10707,7 +11234,8 @@ yy413: goto yy410; yy414: YYSKIP (); - status = action_line673(i, keys, input, token, &cursor, 0); + status = check_key_count_line673(keys_count, i, 3) + || action_line673(&i, keys, input, token, &cursor, 0); continue; } @@ -10719,7 +11247,7 @@ yy414: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line673: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line673: unused keys left after %u keys\n", i); } } @@ -10749,7 +11277,7 @@ end: #define YYFILL(n) { break; } static int action_line680 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10757,10 +11285,12 @@ static int action_line680 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10770,17 +11300,17 @@ static int action_line680 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line680: at position %ld (iteration %u):\n" + , "error: lex_line680: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10790,6 +11320,13 @@ static int action_line680 } } +static int check_key_count_line680(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line680: not enough keys\n"); + return 1; +} + int lex_line680() { const size_t padding = 3; /* YYMAXFILL */ @@ -10817,7 +11354,7 @@ int lex_line680() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line680.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10830,7 +11367,7 @@ int lex_line680() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -10844,7 +11381,8 @@ int lex_line680() yy418: YYSKIP (); yy419: - status = action_line680(i, keys, input, token, &cursor, 254); + status = check_key_count_line680(keys_count, i, 3) + || action_line680(&i, keys, input, token, &cursor, 254); continue; yy420: YYSKIP (); @@ -10984,7 +11522,8 @@ yy423: } yy424: YYSKIP (); - status = action_line680(i, keys, input, token, &cursor, 0); + status = check_key_count_line680(keys_count, i, 3) + || action_line680(&i, keys, input, token, &cursor, 0); continue; } @@ -10996,7 +11535,7 @@ yy424: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line680: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line680: unused keys left after %u keys\n", i); } } @@ -11026,7 +11565,7 @@ end: #define YYFILL(n) { break; } static int action_line687 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11034,10 +11573,12 @@ static int action_line687 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11047,17 +11588,17 @@ static int action_line687 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line687: at position %ld (iteration %u):\n" + , "error: lex_line687: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11067,6 +11608,13 @@ static int action_line687 } } +static int check_key_count_line687(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line687: not enough keys\n"); + return 1; +} + int lex_line687() { const size_t padding = 3; /* YYMAXFILL */ @@ -11094,7 +11642,7 @@ int lex_line687() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line687.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11107,7 +11655,7 @@ int lex_line687() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -11121,7 +11669,8 @@ int lex_line687() yy428: YYSKIP (); yy429: - status = action_line687(i, keys, input, token, &cursor, 254); + status = check_key_count_line687(keys_count, i, 3) + || action_line687(&i, keys, input, token, &cursor, 254); continue; yy430: YYSKIP (); @@ -11197,7 +11746,8 @@ yy433: } yy434: YYSKIP (); - status = action_line687(i, keys, input, token, &cursor, 0); + status = check_key_count_line687(keys_count, i, 3) + || action_line687(&i, keys, input, token, &cursor, 0); continue; } @@ -11209,7 +11759,7 @@ yy434: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line687: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line687: unused keys left after %u keys\n", i); } } @@ -11239,7 +11789,7 @@ end: #define YYFILL(n) { break; } static int action_line694 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11247,10 +11797,12 @@ static int action_line694 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11260,17 +11812,17 @@ static int action_line694 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line694: at position %ld (iteration %u):\n" + , "error: lex_line694: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11280,6 +11832,13 @@ static int action_line694 } } +static int check_key_count_line694(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line694: not enough keys\n"); + return 1; +} + int lex_line694() { const size_t padding = 3; /* YYMAXFILL */ @@ -11307,7 +11866,7 @@ int lex_line694() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line694.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11320,7 +11879,7 @@ int lex_line694() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -11334,7 +11893,8 @@ int lex_line694() yy438: YYSKIP (); yy439: - status = action_line694(i, keys, input, token, &cursor, 254); + status = check_key_count_line694(keys_count, i, 3) + || action_line694(&i, keys, input, token, &cursor, 254); continue; yy440: YYSKIP (); @@ -11410,7 +11970,8 @@ yy443: } yy444: YYSKIP (); - status = action_line694(i, keys, input, token, &cursor, 0); + status = check_key_count_line694(keys_count, i, 3) + || action_line694(&i, keys, input, token, &cursor, 0); continue; } @@ -11422,7 +11983,7 @@ yy444: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line694: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line694: unused keys left after %u keys\n", i); } } @@ -11452,7 +12013,7 @@ end: #define YYFILL(n) { break; } static int action_line701 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11460,10 +12021,12 @@ static int action_line701 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11473,17 +12036,17 @@ static int action_line701 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line701: at position %ld (iteration %u):\n" + , "error: lex_line701: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11493,6 +12056,13 @@ static int action_line701 } } +static int check_key_count_line701(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line701: not enough keys\n"); + return 1; +} + int lex_line701() { const size_t padding = 3; /* YYMAXFILL */ @@ -11520,7 +12090,7 @@ int lex_line701() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line701.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11533,7 +12103,7 @@ int lex_line701() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -11547,7 +12117,8 @@ int lex_line701() yy448: YYSKIP (); yy449: - status = action_line701(i, keys, input, token, &cursor, 254); + status = check_key_count_line701(keys_count, i, 3) + || action_line701(&i, keys, input, token, &cursor, 254); continue; yy450: YYSKIP (); @@ -11616,7 +12187,8 @@ yy452: goto yy449; yy453: YYSKIP (); - status = action_line701(i, keys, input, token, &cursor, 0); + status = check_key_count_line701(keys_count, i, 3) + || action_line701(&i, keys, input, token, &cursor, 0); continue; } @@ -11628,7 +12200,7 @@ yy453: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line701: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line701: unused keys left after %u keys\n", i); } } @@ -11658,7 +12230,7 @@ end: #define YYFILL(n) { break; } static int action_line708 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11666,10 +12238,12 @@ static int action_line708 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11679,17 +12253,17 @@ static int action_line708 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line708: at position %ld (iteration %u):\n" + , "error: lex_line708: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11699,6 +12273,13 @@ static int action_line708 } } +static int check_key_count_line708(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line708: not enough keys\n"); + return 1; +} + int lex_line708() { const size_t padding = 3; /* YYMAXFILL */ @@ -11726,7 +12307,7 @@ int lex_line708() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line708.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11739,7 +12320,7 @@ int lex_line708() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -11753,7 +12334,8 @@ int lex_line708() yy457: YYSKIP (); yy458: - status = action_line708(i, keys, input, token, &cursor, 254); + status = check_key_count_line708(keys_count, i, 3) + || action_line708(&i, keys, input, token, &cursor, 254); continue; yy459: YYSKIP (); @@ -11861,7 +12443,8 @@ yy462: } yy463: YYSKIP (); - status = action_line708(i, keys, input, token, &cursor, 0); + status = check_key_count_line708(keys_count, i, 3) + || action_line708(&i, keys, input, token, &cursor, 0); continue; } @@ -11873,7 +12456,7 @@ yy463: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line708: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line708: unused keys left after %u keys\n", i); } } @@ -11903,7 +12486,7 @@ end: #define YYFILL(n) { break; } static int action_line715 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11911,10 +12494,12 @@ static int action_line715 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11924,17 +12509,17 @@ static int action_line715 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line715: at position %ld (iteration %u):\n" + , "error: lex_line715: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11944,6 +12529,13 @@ static int action_line715 } } +static int check_key_count_line715(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line715: not enough keys\n"); + return 1; +} + int lex_line715() { const size_t padding = 3; /* YYMAXFILL */ @@ -11971,7 +12563,7 @@ int lex_line715() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line715.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11984,7 +12576,7 @@ int lex_line715() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -11998,7 +12590,8 @@ int lex_line715() yy467: YYSKIP (); yy468: - status = action_line715(i, keys, input, token, &cursor, 254); + status = check_key_count_line715(keys_count, i, 3) + || action_line715(&i, keys, input, token, &cursor, 254); continue; yy469: YYSKIP (); @@ -12090,7 +12683,8 @@ yy472: } yy473: YYSKIP (); - status = action_line715(i, keys, input, token, &cursor, 0); + status = check_key_count_line715(keys_count, i, 3) + || action_line715(&i, keys, input, token, &cursor, 0); continue; } @@ -12102,7 +12696,7 @@ yy473: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line715: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line715: unused keys left after %u keys\n", i); } } @@ -12132,7 +12726,7 @@ end: #define YYFILL(n) { break; } static int action_line722 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12140,10 +12734,12 @@ static int action_line722 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12153,17 +12749,17 @@ static int action_line722 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line722: at position %ld (iteration %u):\n" + , "error: lex_line722: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12173,6 +12769,13 @@ static int action_line722 } } +static int check_key_count_line722(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line722: not enough keys\n"); + return 1; +} + int lex_line722() { const size_t padding = 3; /* YYMAXFILL */ @@ -12200,7 +12803,7 @@ int lex_line722() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line722.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12213,7 +12816,7 @@ int lex_line722() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -12227,7 +12830,8 @@ int lex_line722() yy477: YYSKIP (); yy478: - status = action_line722(i, keys, input, token, &cursor, 254); + status = check_key_count_line722(keys_count, i, 3) + || action_line722(&i, keys, input, token, &cursor, 254); continue; yy479: YYSKIP (); @@ -12367,7 +12971,8 @@ yy482: } yy483: YYSKIP (); - status = action_line722(i, keys, input, token, &cursor, 0); + status = check_key_count_line722(keys_count, i, 3) + || action_line722(&i, keys, input, token, &cursor, 0); continue; } @@ -12379,7 +12984,7 @@ yy483: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line722: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line722: unused keys left after %u keys\n", i); } } @@ -12409,7 +13014,7 @@ end: #define YYFILL(n) { break; } static int action_line729 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12417,10 +13022,12 @@ static int action_line729 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12430,17 +13037,17 @@ static int action_line729 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line729: at position %ld (iteration %u):\n" + , "error: lex_line729: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12450,6 +13057,13 @@ static int action_line729 } } +static int check_key_count_line729(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line729: not enough keys\n"); + return 1; +} + int lex_line729() { const size_t padding = 3; /* YYMAXFILL */ @@ -12477,7 +13091,7 @@ int lex_line729() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line729.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12490,7 +13104,7 @@ int lex_line729() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -12504,7 +13118,8 @@ int lex_line729() yy487: YYSKIP (); yy488: - status = action_line729(i, keys, input, token, &cursor, 254); + status = check_key_count_line729(keys_count, i, 3) + || action_line729(&i, keys, input, token, &cursor, 254); continue; yy489: YYSKIP (); @@ -12592,7 +13207,8 @@ yy491: goto yy488; yy492: YYSKIP (); - status = action_line729(i, keys, input, token, &cursor, 0); + status = check_key_count_line729(keys_count, i, 3) + || action_line729(&i, keys, input, token, &cursor, 0); continue; } @@ -12604,7 +13220,7 @@ yy492: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line729: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line729: unused keys left after %u keys\n", i); } } @@ -12634,7 +13250,7 @@ end: #define YYFILL(n) { break; } static int action_line736 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12642,10 +13258,12 @@ static int action_line736 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12655,17 +13273,17 @@ static int action_line736 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line736: at position %ld (iteration %u):\n" + , "error: lex_line736: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12675,6 +13293,13 @@ static int action_line736 } } +static int check_key_count_line736(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line736: not enough keys\n"); + return 1; +} + int lex_line736() { const size_t padding = 3; /* YYMAXFILL */ @@ -12702,7 +13327,7 @@ int lex_line736() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line736.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12715,7 +13340,7 @@ int lex_line736() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -12729,7 +13354,8 @@ int lex_line736() yy496: YYSKIP (); yy497: - status = action_line736(i, keys, input, token, &cursor, 254); + status = check_key_count_line736(keys_count, i, 3) + || action_line736(&i, keys, input, token, &cursor, 254); continue; yy498: YYSKIP (); @@ -12817,7 +13443,8 @@ yy500: goto yy497; yy501: YYSKIP (); - status = action_line736(i, keys, input, token, &cursor, 0); + status = check_key_count_line736(keys_count, i, 3) + || action_line736(&i, keys, input, token, &cursor, 0); continue; } @@ -12829,7 +13456,7 @@ yy501: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line736: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line736: unused keys left after %u keys\n", i); } } @@ -12859,7 +13486,7 @@ end: #define YYFILL(n) { break; } static int action_line743 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12867,10 +13494,12 @@ static int action_line743 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12880,17 +13509,17 @@ static int action_line743 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line743: at position %ld (iteration %u):\n" + , "error: lex_line743: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12900,6 +13529,13 @@ static int action_line743 } } +static int check_key_count_line743(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line743: not enough keys\n"); + return 1; +} + int lex_line743() { const size_t padding = 3; /* YYMAXFILL */ @@ -12927,7 +13563,7 @@ int lex_line743() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line743.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12940,7 +13576,7 @@ int lex_line743() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -12954,7 +13590,8 @@ int lex_line743() yy505: YYSKIP (); yy506: - status = action_line743(i, keys, input, token, &cursor, 254); + status = check_key_count_line743(keys_count, i, 3) + || action_line743(&i, keys, input, token, &cursor, 254); continue; yy507: YYSKIP (); @@ -13039,7 +13676,8 @@ yy509: goto yy506; yy510: YYSKIP (); - status = action_line743(i, keys, input, token, &cursor, 0); + status = check_key_count_line743(keys_count, i, 3) + || action_line743(&i, keys, input, token, &cursor, 0); continue; } @@ -13051,7 +13689,7 @@ yy510: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line743: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line743: unused keys left after %u keys\n", i); } } @@ -13081,7 +13719,7 @@ end: #define YYFILL(n) { break; } static int action_line750 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13089,10 +13727,12 @@ static int action_line750 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13102,17 +13742,17 @@ static int action_line750 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line750: at position %ld (iteration %u):\n" + , "error: lex_line750: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13122,6 +13762,13 @@ static int action_line750 } } +static int check_key_count_line750(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line750: not enough keys\n"); + return 1; +} + int lex_line750() { const size_t padding = 3; /* YYMAXFILL */ @@ -13149,7 +13796,7 @@ int lex_line750() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line750.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13162,7 +13809,7 @@ int lex_line750() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -13176,7 +13823,8 @@ int lex_line750() yy514: YYSKIP (); yy515: - status = action_line750(i, keys, input, token, &cursor, 254); + status = check_key_count_line750(keys_count, i, 3) + || action_line750(&i, keys, input, token, &cursor, 254); continue; yy516: YYSKIP (); @@ -13229,7 +13877,8 @@ yy518: goto yy515; yy519: YYSKIP (); - status = action_line750(i, keys, input, token, &cursor, 0); + status = check_key_count_line750(keys_count, i, 3) + || action_line750(&i, keys, input, token, &cursor, 0); continue; } @@ -13241,7 +13890,7 @@ yy519: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line750: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line750: unused keys left after %u keys\n", i); } } @@ -13271,7 +13920,7 @@ end: #define YYFILL(n) { break; } static int action_line757 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13279,10 +13928,12 @@ static int action_line757 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13292,17 +13943,17 @@ static int action_line757 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line757: at position %ld (iteration %u):\n" + , "error: lex_line757: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13312,6 +13963,13 @@ static int action_line757 } } +static int check_key_count_line757(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line757: not enough keys\n"); + return 1; +} + int lex_line757() { const size_t padding = 3; /* YYMAXFILL */ @@ -13339,7 +13997,7 @@ int lex_line757() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line757.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13352,7 +14010,7 @@ int lex_line757() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -13366,7 +14024,8 @@ int lex_line757() yy523: YYSKIP (); yy524: - status = action_line757(i, keys, input, token, &cursor, 254); + status = check_key_count_line757(keys_count, i, 3) + || action_line757(&i, keys, input, token, &cursor, 254); continue; yy525: YYSKIP (); @@ -13491,7 +14150,8 @@ yy528: } yy529: YYSKIP (); - status = action_line757(i, keys, input, token, &cursor, 0); + status = check_key_count_line757(keys_count, i, 3) + || action_line757(&i, keys, input, token, &cursor, 0); continue; } @@ -13503,7 +14163,7 @@ yy529: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line757: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line757: unused keys left after %u keys\n", i); } } @@ -13533,7 +14193,7 @@ end: #define YYFILL(n) { break; } static int action_line764 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13541,10 +14201,12 @@ static int action_line764 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13554,17 +14216,17 @@ static int action_line764 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line764: at position %ld (iteration %u):\n" + , "error: lex_line764: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13574,6 +14236,13 @@ static int action_line764 } } +static int check_key_count_line764(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line764: not enough keys\n"); + return 1; +} + int lex_line764() { const size_t padding = 3; /* YYMAXFILL */ @@ -13601,7 +14270,7 @@ int lex_line764() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line764.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13614,7 +14283,7 @@ int lex_line764() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -13628,7 +14297,8 @@ int lex_line764() yy533: YYSKIP (); yy534: - status = action_line764(i, keys, input, token, &cursor, 254); + status = check_key_count_line764(keys_count, i, 3) + || action_line764(&i, keys, input, token, &cursor, 254); continue; yy535: YYSKIP (); @@ -13714,7 +14384,8 @@ yy537: goto yy534; yy538: YYSKIP (); - status = action_line764(i, keys, input, token, &cursor, 0); + status = check_key_count_line764(keys_count, i, 3) + || action_line764(&i, keys, input, token, &cursor, 0); continue; } @@ -13726,7 +14397,7 @@ yy538: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line764: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line764: unused keys left after %u keys\n", i); } } @@ -13756,7 +14427,7 @@ end: #define YYFILL(n) { break; } static int action_line771 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13764,10 +14435,12 @@ static int action_line771 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13777,17 +14450,17 @@ static int action_line771 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line771: at position %ld (iteration %u):\n" + , "error: lex_line771: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13797,6 +14470,13 @@ static int action_line771 } } +static int check_key_count_line771(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line771: not enough keys\n"); + return 1; +} + int lex_line771() { const size_t padding = 3; /* YYMAXFILL */ @@ -13824,7 +14504,7 @@ int lex_line771() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line771.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13837,7 +14517,7 @@ int lex_line771() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -13851,7 +14531,8 @@ int lex_line771() yy542: YYSKIP (); yy543: - status = action_line771(i, keys, input, token, &cursor, 254); + status = check_key_count_line771(keys_count, i, 3) + || action_line771(&i, keys, input, token, &cursor, 254); continue; yy544: YYSKIP (); @@ -13904,7 +14585,8 @@ yy546: goto yy543; yy547: YYSKIP (); - status = action_line771(i, keys, input, token, &cursor, 0); + status = check_key_count_line771(keys_count, i, 3) + || action_line771(&i, keys, input, token, &cursor, 0); continue; } @@ -13916,7 +14598,7 @@ yy547: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line771: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line771: unused keys left after %u keys\n", i); } } @@ -13946,7 +14628,7 @@ end: #define YYFILL(n) { break; } static int action_line778 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13954,10 +14636,12 @@ static int action_line778 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13967,17 +14651,17 @@ static int action_line778 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line778: at position %ld (iteration %u):\n" + , "error: lex_line778: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13987,6 +14671,13 @@ static int action_line778 } } +static int check_key_count_line778(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line778: not enough keys\n"); + return 1; +} + int lex_line778() { const size_t padding = 3; /* YYMAXFILL */ @@ -14014,7 +14705,7 @@ int lex_line778() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line778.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14027,7 +14718,7 @@ int lex_line778() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -14041,7 +14732,8 @@ int lex_line778() yy551: YYSKIP (); yy552: - status = action_line778(i, keys, input, token, &cursor, 254); + status = check_key_count_line778(keys_count, i, 3) + || action_line778(&i, keys, input, token, &cursor, 254); continue; yy553: YYSKIP (); @@ -14165,7 +14857,8 @@ yy556: } yy557: YYSKIP (); - status = action_line778(i, keys, input, token, &cursor, 0); + status = check_key_count_line778(keys_count, i, 3) + || action_line778(&i, keys, input, token, &cursor, 0); continue; } @@ -14177,7 +14870,7 @@ yy557: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line778: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line778: unused keys left after %u keys\n", i); } } @@ -14207,7 +14900,7 @@ end: #define YYFILL(n) { break; } static int action_line785 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14215,10 +14908,12 @@ static int action_line785 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14228,17 +14923,17 @@ static int action_line785 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line785: at position %ld (iteration %u):\n" + , "error: lex_line785: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14248,6 +14943,13 @@ static int action_line785 } } +static int check_key_count_line785(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line785: not enough keys\n"); + return 1; +} + int lex_line785() { const size_t padding = 3; /* YYMAXFILL */ @@ -14275,7 +14977,7 @@ int lex_line785() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line785.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14288,7 +14990,7 @@ int lex_line785() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -14302,7 +15004,8 @@ int lex_line785() yy561: YYSKIP (); yy562: - status = action_line785(i, keys, input, token, &cursor, 254); + status = check_key_count_line785(keys_count, i, 3) + || action_line785(&i, keys, input, token, &cursor, 254); continue; yy563: YYSKIP (); @@ -14390,7 +15093,8 @@ yy565: goto yy562; yy566: YYSKIP (); - status = action_line785(i, keys, input, token, &cursor, 0); + status = check_key_count_line785(keys_count, i, 3) + || action_line785(&i, keys, input, token, &cursor, 0); continue; } @@ -14402,7 +15106,7 @@ yy566: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line785: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line785: unused keys left after %u keys\n", i); } } @@ -14432,7 +15136,7 @@ end: #define YYFILL(n) { break; } static int action_line792 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14440,10 +15144,12 @@ static int action_line792 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14453,17 +15159,17 @@ static int action_line792 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line792: at position %ld (iteration %u):\n" + , "error: lex_line792: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14473,6 +15179,13 @@ static int action_line792 } } +static int check_key_count_line792(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line792: not enough keys\n"); + return 1; +} + int lex_line792() { const size_t padding = 3; /* YYMAXFILL */ @@ -14500,7 +15213,7 @@ int lex_line792() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line792.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14513,7 +15226,7 @@ int lex_line792() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -14527,7 +15240,8 @@ int lex_line792() yy570: YYSKIP (); yy571: - status = action_line792(i, keys, input, token, &cursor, 254); + status = check_key_count_line792(keys_count, i, 3) + || action_line792(&i, keys, input, token, &cursor, 254); continue; yy572: YYSKIP (); @@ -14614,7 +15328,8 @@ yy574: goto yy571; yy575: YYSKIP (); - status = action_line792(i, keys, input, token, &cursor, 0); + status = check_key_count_line792(keys_count, i, 3) + || action_line792(&i, keys, input, token, &cursor, 0); continue; } @@ -14626,7 +15341,7 @@ yy575: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line792: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line792: unused keys left after %u keys\n", i); } } @@ -14656,7 +15371,7 @@ end: #define YYFILL(n) { break; } static int action_line799 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14664,10 +15379,12 @@ static int action_line799 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14677,17 +15394,17 @@ static int action_line799 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line799: at position %ld (iteration %u):\n" + , "error: lex_line799: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14697,6 +15414,13 @@ static int action_line799 } } +static int check_key_count_line799(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line799: not enough keys\n"); + return 1; +} + int lex_line799() { const size_t padding = 3; /* YYMAXFILL */ @@ -14724,7 +15448,7 @@ int lex_line799() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line799.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14737,7 +15461,7 @@ int lex_line799() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -14751,7 +15475,8 @@ int lex_line799() yy579: YYSKIP (); yy580: - status = action_line799(i, keys, input, token, &cursor, 254); + status = check_key_count_line799(keys_count, i, 3) + || action_line799(&i, keys, input, token, &cursor, 254); continue; yy581: YYSKIP (); @@ -14820,7 +15545,8 @@ yy583: goto yy580; yy584: YYSKIP (); - status = action_line799(i, keys, input, token, &cursor, 0); + status = check_key_count_line799(keys_count, i, 3) + || action_line799(&i, keys, input, token, &cursor, 0); continue; } @@ -14832,7 +15558,7 @@ yy584: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line799: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line799: unused keys left after %u keys\n", i); } } @@ -14862,7 +15588,7 @@ end: #define YYFILL(n) { break; } static int action_line806 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14870,10 +15596,12 @@ static int action_line806 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14883,17 +15611,17 @@ static int action_line806 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line806: at position %ld (iteration %u):\n" + , "error: lex_line806: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14903,6 +15631,13 @@ static int action_line806 } } +static int check_key_count_line806(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line806: not enough keys\n"); + return 1; +} + int lex_line806() { const size_t padding = 3; /* YYMAXFILL */ @@ -14930,7 +15665,7 @@ int lex_line806() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line806.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14943,7 +15678,7 @@ int lex_line806() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -14957,7 +15692,8 @@ int lex_line806() yy588: YYSKIP (); yy589: - status = action_line806(i, keys, input, token, &cursor, 254); + status = check_key_count_line806(keys_count, i, 3) + || action_line806(&i, keys, input, token, &cursor, 254); continue; yy590: YYSKIP (); @@ -14994,7 +15730,8 @@ yy592: goto yy589; yy593: YYSKIP (); - status = action_line806(i, keys, input, token, &cursor, 0); + status = check_key_count_line806(keys_count, i, 3) + || action_line806(&i, keys, input, token, &cursor, 0); continue; } @@ -15006,7 +15743,7 @@ yy593: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line806: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line806: unused keys left after %u keys\n", i); } } @@ -15036,7 +15773,7 @@ end: #define YYFILL(n) { break; } static int action_line813 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -15044,10 +15781,12 @@ static int action_line813 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -15057,17 +15796,17 @@ static int action_line813 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line813: at position %ld (iteration %u):\n" + , "error: lex_line813: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -15077,6 +15816,13 @@ static int action_line813 } } +static int check_key_count_line813(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line813: not enough keys\n"); + return 1; +} + int lex_line813() { const size_t padding = 3; /* YYMAXFILL */ @@ -15104,7 +15850,7 @@ int lex_line813() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line813.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -15117,7 +15863,7 @@ int lex_line813() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -15131,7 +15877,8 @@ int lex_line813() yy597: YYSKIP (); yy598: - status = action_line813(i, keys, input, token, &cursor, 254); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 254); continue; yy599: YYSKIP (); @@ -15219,7 +15966,8 @@ yy601: goto yy598; yy602: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 0); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 0); continue; } @@ -15231,7 +15979,7 @@ yy602: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line813: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line813: unused keys left after %u keys\n", i); } } @@ -15261,7 +16009,7 @@ end: #define YYFILL(n) { break; } static int action_line820 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -15269,10 +16017,12 @@ static int action_line820 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -15282,17 +16032,17 @@ static int action_line820 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line820: at position %ld (iteration %u):\n" + , "error: lex_line820: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -15302,6 +16052,13 @@ static int action_line820 } } +static int check_key_count_line820(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line820: not enough keys\n"); + return 1; +} + int lex_line820() { const size_t padding = 3; /* YYMAXFILL */ @@ -15329,7 +16086,7 @@ int lex_line820() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line820.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -15342,7 +16099,7 @@ int lex_line820() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -15356,7 +16113,8 @@ int lex_line820() yy606: YYSKIP (); yy607: - status = action_line820(i, keys, input, token, &cursor, 254); + status = check_key_count_line820(keys_count, i, 3) + || action_line820(&i, keys, input, token, &cursor, 254); continue; yy608: YYSKIP (); @@ -15442,7 +16200,8 @@ yy610: goto yy607; yy611: YYSKIP (); - status = action_line820(i, keys, input, token, &cursor, 0); + status = check_key_count_line820(keys_count, i, 3) + || action_line820(&i, keys, input, token, &cursor, 0); continue; } @@ -15454,7 +16213,7 @@ yy611: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line820: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line820: unused keys left after %u keys\n", i); } } @@ -15484,7 +16243,7 @@ end: #define YYFILL(n) { break; } static int action_line827 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -15492,10 +16251,12 @@ static int action_line827 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -15505,17 +16266,17 @@ static int action_line827 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line827: at position %ld (iteration %u):\n" + , "error: lex_line827: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -15525,6 +16286,13 @@ static int action_line827 } } +static int check_key_count_line827(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line827: not enough keys\n"); + return 1; +} + int lex_line827() { const size_t padding = 3; /* YYMAXFILL */ @@ -15552,7 +16320,7 @@ int lex_line827() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line827.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -15565,7 +16333,7 @@ int lex_line827() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -15579,7 +16347,8 @@ int lex_line827() yy615: YYSKIP (); yy616: - status = action_line827(i, keys, input, token, &cursor, 254); + status = check_key_count_line827(keys_count, i, 3) + || action_line827(&i, keys, input, token, &cursor, 254); continue; yy617: YYSKIP (); @@ -15665,7 +16434,8 @@ yy619: goto yy616; yy620: YYSKIP (); - status = action_line827(i, keys, input, token, &cursor, 0); + status = check_key_count_line827(keys_count, i, 3) + || action_line827(&i, keys, input, token, &cursor, 0); continue; } @@ -15677,7 +16447,7 @@ yy620: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line827: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line827: unused keys left after %u keys\n", i); } } @@ -15707,7 +16477,7 @@ end: #define YYFILL(n) { break; } static int action_line834 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -15715,10 +16485,12 @@ static int action_line834 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -15728,17 +16500,17 @@ static int action_line834 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line834: at position %ld (iteration %u):\n" + , "error: lex_line834: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -15748,6 +16520,13 @@ static int action_line834 } } +static int check_key_count_line834(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line834: not enough keys\n"); + return 1; +} + int lex_line834() { const size_t padding = 3; /* YYMAXFILL */ @@ -15775,7 +16554,7 @@ int lex_line834() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line834.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -15788,7 +16567,7 @@ int lex_line834() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -15802,7 +16581,8 @@ int lex_line834() yy624: YYSKIP (); yy625: - status = action_line834(i, keys, input, token, &cursor, 254); + status = check_key_count_line834(keys_count, i, 3) + || action_line834(&i, keys, input, token, &cursor, 254); continue; yy626: YYSKIP (); @@ -15890,7 +16670,8 @@ yy628: goto yy625; yy629: YYSKIP (); - status = action_line834(i, keys, input, token, &cursor, 0); + status = check_key_count_line834(keys_count, i, 3) + || action_line834(&i, keys, input, token, &cursor, 0); continue; } @@ -15902,7 +16683,7 @@ yy629: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line834: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line834: unused keys left after %u keys\n", i); } } @@ -15932,7 +16713,7 @@ end: #define YYFILL(n) { break; } static int action_line841 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -15940,10 +16721,12 @@ static int action_line841 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -15953,17 +16736,17 @@ static int action_line841 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line841: at position %ld (iteration %u):\n" + , "error: lex_line841: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -15973,6 +16756,13 @@ static int action_line841 } } +static int check_key_count_line841(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line841: not enough keys\n"); + return 1; +} + int lex_line841() { const size_t padding = 3; /* YYMAXFILL */ @@ -16000,7 +16790,7 @@ int lex_line841() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line841.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -16013,7 +16803,7 @@ int lex_line841() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -16027,7 +16817,8 @@ int lex_line841() yy633: YYSKIP (); yy634: - status = action_line841(i, keys, input, token, &cursor, 254); + status = check_key_count_line841(keys_count, i, 3) + || action_line841(&i, keys, input, token, &cursor, 254); continue; yy635: YYSKIP (); @@ -16115,7 +16906,8 @@ yy637: goto yy634; yy638: YYSKIP (); - status = action_line841(i, keys, input, token, &cursor, 0); + status = check_key_count_line841(keys_count, i, 3) + || action_line841(&i, keys, input, token, &cursor, 0); continue; } @@ -16127,7 +16919,7 @@ yy638: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line841: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line841: unused keys left after %u keys\n", i); } } @@ -16157,7 +16949,7 @@ end: #define YYFILL(n) { break; } static int action_line848 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -16165,10 +16957,12 @@ static int action_line848 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -16178,17 +16972,17 @@ static int action_line848 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line848: at position %ld (iteration %u):\n" + , "error: lex_line848: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -16198,6 +16992,13 @@ static int action_line848 } } +static int check_key_count_line848(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line848: not enough keys\n"); + return 1; +} + int lex_line848() { const size_t padding = 3; /* YYMAXFILL */ @@ -16225,7 +17026,7 @@ int lex_line848() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line848.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -16238,7 +17039,7 @@ int lex_line848() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -16252,7 +17053,8 @@ int lex_line848() yy642: YYSKIP (); yy643: - status = action_line848(i, keys, input, token, &cursor, 254); + status = check_key_count_line848(keys_count, i, 3) + || action_line848(&i, keys, input, token, &cursor, 254); continue; yy644: YYSKIP (); @@ -16338,7 +17140,8 @@ yy646: goto yy643; yy647: YYSKIP (); - status = action_line848(i, keys, input, token, &cursor, 0); + status = check_key_count_line848(keys_count, i, 3) + || action_line848(&i, keys, input, token, &cursor, 0); continue; } @@ -16350,7 +17153,7 @@ yy647: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line848: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line848: unused keys left after %u keys\n", i); } } @@ -16380,7 +17183,7 @@ end: #define YYFILL(n) { break; } static int action_line855 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -16388,10 +17191,12 @@ static int action_line855 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -16401,17 +17206,17 @@ static int action_line855 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line855: at position %ld (iteration %u):\n" + , "error: lex_line855: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -16421,6 +17226,13 @@ static int action_line855 } } +static int check_key_count_line855(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line855: not enough keys\n"); + return 1; +} + int lex_line855() { const size_t padding = 3; /* YYMAXFILL */ @@ -16448,7 +17260,7 @@ int lex_line855() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line855.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -16461,7 +17273,7 @@ int lex_line855() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -16475,7 +17287,8 @@ int lex_line855() yy651: YYSKIP (); yy652: - status = action_line855(i, keys, input, token, &cursor, 254); + status = check_key_count_line855(keys_count, i, 3) + || action_line855(&i, keys, input, token, &cursor, 254); continue; yy653: YYSKIP (); @@ -16601,7 +17414,8 @@ yy656: } yy657: YYSKIP (); - status = action_line855(i, keys, input, token, &cursor, 0); + status = check_key_count_line855(keys_count, i, 3) + || action_line855(&i, keys, input, token, &cursor, 0); continue; } @@ -16613,7 +17427,7 @@ yy657: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line855: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line855: unused keys left after %u keys\n", i); } } @@ -16643,7 +17457,7 @@ end: #define YYFILL(n) { break; } static int action_line862 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -16651,10 +17465,12 @@ static int action_line862 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -16664,17 +17480,17 @@ static int action_line862 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line862: at position %ld (iteration %u):\n" + , "error: lex_line862: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -16684,6 +17500,13 @@ static int action_line862 } } +static int check_key_count_line862(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line862: not enough keys\n"); + return 1; +} + int lex_line862() { const size_t padding = 3; /* YYMAXFILL */ @@ -16711,7 +17534,7 @@ int lex_line862() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line862.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -16724,7 +17547,7 @@ int lex_line862() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -16738,7 +17561,8 @@ int lex_line862() yy661: YYSKIP (); yy662: - status = action_line862(i, keys, input, token, &cursor, 254); + status = check_key_count_line862(keys_count, i, 3) + || action_line862(&i, keys, input, token, &cursor, 254); continue; yy663: YYSKIP (); @@ -16775,7 +17599,8 @@ yy665: goto yy662; yy666: YYSKIP (); - status = action_line862(i, keys, input, token, &cursor, 0); + status = check_key_count_line862(keys_count, i, 3) + || action_line862(&i, keys, input, token, &cursor, 0); continue; } @@ -16787,7 +17612,7 @@ yy666: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line862: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line862: unused keys left after %u keys\n", i); } } @@ -16817,7 +17642,7 @@ end: #define YYFILL(n) { break; } static int action_line869 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -16825,10 +17650,12 @@ static int action_line869 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -16838,17 +17665,17 @@ static int action_line869 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line869: at position %ld (iteration %u):\n" + , "error: lex_line869: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -16858,6 +17685,13 @@ static int action_line869 } } +static int check_key_count_line869(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line869: not enough keys\n"); + return 1; +} + int lex_line869() { const size_t padding = 3; /* YYMAXFILL */ @@ -16885,7 +17719,7 @@ int lex_line869() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line869.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -16898,7 +17732,7 @@ int lex_line869() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -16912,7 +17746,8 @@ int lex_line869() yy670: YYSKIP (); yy671: - status = action_line869(i, keys, input, token, &cursor, 254); + status = check_key_count_line869(keys_count, i, 3) + || action_line869(&i, keys, input, token, &cursor, 254); continue; yy672: YYSKIP (); @@ -16997,7 +17832,8 @@ yy674: goto yy671; yy675: YYSKIP (); - status = action_line869(i, keys, input, token, &cursor, 0); + status = check_key_count_line869(keys_count, i, 3) + || action_line869(&i, keys, input, token, &cursor, 0); continue; } @@ -17009,7 +17845,7 @@ yy675: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line869: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line869: unused keys left after %u keys\n", i); } } @@ -17039,7 +17875,7 @@ end: #define YYFILL(n) { break; } static int action_line876 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -17047,10 +17883,12 @@ static int action_line876 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -17060,17 +17898,17 @@ static int action_line876 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line876: at position %ld (iteration %u):\n" + , "error: lex_line876: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -17080,6 +17918,13 @@ static int action_line876 } } +static int check_key_count_line876(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line876: not enough keys\n"); + return 1; +} + int lex_line876() { const size_t padding = 3; /* YYMAXFILL */ @@ -17107,7 +17952,7 @@ int lex_line876() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line876.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -17120,7 +17965,7 @@ int lex_line876() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -17134,7 +17979,8 @@ int lex_line876() yy679: YYSKIP (); yy680: - status = action_line876(i, keys, input, token, &cursor, 254); + status = check_key_count_line876(keys_count, i, 3) + || action_line876(&i, keys, input, token, &cursor, 254); continue; yy681: YYSKIP (); @@ -17258,7 +18104,8 @@ yy684: } yy685: YYSKIP (); - status = action_line876(i, keys, input, token, &cursor, 0); + status = check_key_count_line876(keys_count, i, 3) + || action_line876(&i, keys, input, token, &cursor, 0); continue; } @@ -17270,7 +18117,7 @@ yy685: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line876: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line876: unused keys left after %u keys\n", i); } } @@ -17300,7 +18147,7 @@ end: #define YYFILL(n) { break; } static int action_line883 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -17308,10 +18155,12 @@ static int action_line883 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -17321,17 +18170,17 @@ static int action_line883 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line883: at position %ld (iteration %u):\n" + , "error: lex_line883: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -17341,6 +18190,13 @@ static int action_line883 } } +static int check_key_count_line883(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line883: not enough keys\n"); + return 1; +} + int lex_line883() { const size_t padding = 3; /* YYMAXFILL */ @@ -17368,7 +18224,7 @@ int lex_line883() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line883.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -17381,7 +18237,7 @@ int lex_line883() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -17395,7 +18251,8 @@ int lex_line883() yy689: YYSKIP (); yy690: - status = action_line883(i, keys, input, token, &cursor, 254); + status = check_key_count_line883(keys_count, i, 3) + || action_line883(&i, keys, input, token, &cursor, 254); continue; yy691: YYSKIP (); @@ -17519,7 +18376,8 @@ yy694: } yy695: YYSKIP (); - status = action_line883(i, keys, input, token, &cursor, 0); + status = check_key_count_line883(keys_count, i, 3) + || action_line883(&i, keys, input, token, &cursor, 0); continue; } @@ -17531,7 +18389,7 @@ yy695: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line883: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line883: unused keys left after %u keys\n", i); } } @@ -17561,7 +18419,7 @@ end: #define YYFILL(n) { break; } static int action_line890 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -17569,10 +18427,12 @@ static int action_line890 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -17582,17 +18442,17 @@ static int action_line890 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line890: at position %ld (iteration %u):\n" + , "error: lex_line890: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -17602,6 +18462,13 @@ static int action_line890 } } +static int check_key_count_line890(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line890: not enough keys\n"); + return 1; +} + int lex_line890() { const size_t padding = 3; /* YYMAXFILL */ @@ -17629,7 +18496,7 @@ int lex_line890() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line890.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -17642,7 +18509,7 @@ int lex_line890() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -17656,7 +18523,8 @@ int lex_line890() yy699: YYSKIP (); yy700: - status = action_line890(i, keys, input, token, &cursor, 254); + status = check_key_count_line890(keys_count, i, 3) + || action_line890(&i, keys, input, token, &cursor, 254); continue; yy701: YYSKIP (); @@ -17725,7 +18593,8 @@ yy703: goto yy700; yy704: YYSKIP (); - status = action_line890(i, keys, input, token, &cursor, 0); + status = check_key_count_line890(keys_count, i, 3) + || action_line890(&i, keys, input, token, &cursor, 0); continue; } @@ -17737,7 +18606,7 @@ yy704: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line890: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line890: unused keys left after %u keys\n", i); } } @@ -17767,7 +18636,7 @@ end: #define YYFILL(n) { break; } static int action_line897 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -17775,10 +18644,12 @@ static int action_line897 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -17788,17 +18659,17 @@ static int action_line897 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line897: at position %ld (iteration %u):\n" + , "error: lex_line897: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -17808,6 +18679,13 @@ static int action_line897 } } +static int check_key_count_line897(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line897: not enough keys\n"); + return 1; +} + int lex_line897() { const size_t padding = 3; /* YYMAXFILL */ @@ -17835,7 +18713,7 @@ int lex_line897() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line897.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -17848,7 +18726,7 @@ int lex_line897() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -17862,7 +18740,8 @@ int lex_line897() yy708: YYSKIP (); yy709: - status = action_line897(i, keys, input, token, &cursor, 254); + status = check_key_count_line897(keys_count, i, 3) + || action_line897(&i, keys, input, token, &cursor, 254); continue; yy710: YYSKIP (); @@ -17993,7 +18872,8 @@ yy714: } yy715: YYSKIP (); - status = action_line897(i, keys, input, token, &cursor, 0); + status = check_key_count_line897(keys_count, i, 3) + || action_line897(&i, keys, input, token, &cursor, 0); continue; } @@ -18005,7 +18885,7 @@ yy715: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line897: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line897: unused keys left after %u keys\n", i); } } @@ -18035,7 +18915,7 @@ end: #define YYFILL(n) { break; } static int action_line904 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -18043,10 +18923,12 @@ static int action_line904 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -18056,17 +18938,17 @@ static int action_line904 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line904: at position %ld (iteration %u):\n" + , "error: lex_line904: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -18076,6 +18958,13 @@ static int action_line904 } } +static int check_key_count_line904(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line904: not enough keys\n"); + return 1; +} + int lex_line904() { const size_t padding = 3; /* YYMAXFILL */ @@ -18103,7 +18992,7 @@ int lex_line904() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line904.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -18116,7 +19005,7 @@ int lex_line904() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -18130,7 +19019,8 @@ int lex_line904() yy719: YYSKIP (); yy720: - status = action_line904(i, keys, input, token, &cursor, 254); + status = check_key_count_line904(keys_count, i, 3) + || action_line904(&i, keys, input, token, &cursor, 254); continue; yy721: YYSKIP (); @@ -18167,7 +19057,8 @@ yy723: goto yy720; yy724: YYSKIP (); - status = action_line904(i, keys, input, token, &cursor, 0); + status = check_key_count_line904(keys_count, i, 3) + || action_line904(&i, keys, input, token, &cursor, 0); continue; } @@ -18179,7 +19070,7 @@ yy724: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line904: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line904: unused keys left after %u keys\n", i); } } @@ -18209,7 +19100,7 @@ end: #define YYFILL(n) { break; } static int action_line911 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -18217,10 +19108,12 @@ static int action_line911 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -18230,17 +19123,17 @@ static int action_line911 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line911: at position %ld (iteration %u):\n" + , "error: lex_line911: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -18250,6 +19143,13 @@ static int action_line911 } } +static int check_key_count_line911(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line911: not enough keys\n"); + return 1; +} + int lex_line911() { const size_t padding = 3; /* YYMAXFILL */ @@ -18277,7 +19177,7 @@ int lex_line911() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line911.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -18290,7 +19190,7 @@ int lex_line911() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -18304,7 +19204,8 @@ int lex_line911() yy728: YYSKIP (); yy729: - status = action_line911(i, keys, input, token, &cursor, 254); + status = check_key_count_line911(keys_count, i, 3) + || action_line911(&i, keys, input, token, &cursor, 254); continue; yy730: YYSKIP (); @@ -18357,7 +19258,8 @@ yy732: goto yy729; yy733: YYSKIP (); - status = action_line911(i, keys, input, token, &cursor, 0); + status = check_key_count_line911(keys_count, i, 3) + || action_line911(&i, keys, input, token, &cursor, 0); continue; } @@ -18369,7 +19271,7 @@ yy733: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line911: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line911: unused keys left after %u keys\n", i); } } @@ -18399,7 +19301,7 @@ end: #define YYFILL(n) { break; } static int action_line918 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -18407,10 +19309,12 @@ static int action_line918 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -18420,17 +19324,17 @@ static int action_line918 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line918: at position %ld (iteration %u):\n" + , "error: lex_line918: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -18440,6 +19344,13 @@ static int action_line918 } } +static int check_key_count_line918(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line918: not enough keys\n"); + return 1; +} + int lex_line918() { const size_t padding = 3; /* YYMAXFILL */ @@ -18467,7 +19378,7 @@ int lex_line918() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line918.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -18480,7 +19391,7 @@ int lex_line918() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -18494,7 +19405,8 @@ int lex_line918() yy737: YYSKIP (); yy738: - status = action_line918(i, keys, input, token, &cursor, 254); + status = check_key_count_line918(keys_count, i, 3) + || action_line918(&i, keys, input, token, &cursor, 254); continue; yy739: YYSKIP (); @@ -18531,7 +19443,8 @@ yy741: goto yy738; yy742: YYSKIP (); - status = action_line918(i, keys, input, token, &cursor, 0); + status = check_key_count_line918(keys_count, i, 3) + || action_line918(&i, keys, input, token, &cursor, 0); continue; } @@ -18543,7 +19456,7 @@ yy742: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line918: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line918: unused keys left after %u keys\n", i); } } @@ -18573,7 +19486,7 @@ end: #define YYFILL(n) { break; } static int action_line925 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -18581,10 +19494,12 @@ static int action_line925 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -18594,17 +19509,17 @@ static int action_line925 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line925: at position %ld (iteration %u):\n" + , "error: lex_line925: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -18614,6 +19529,13 @@ static int action_line925 } } +static int check_key_count_line925(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line925: not enough keys\n"); + return 1; +} + int lex_line925() { const size_t padding = 3; /* YYMAXFILL */ @@ -18641,7 +19563,7 @@ int lex_line925() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line925.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -18654,7 +19576,7 @@ int lex_line925() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -18668,7 +19590,8 @@ int lex_line925() yy746: YYSKIP (); yy747: - status = action_line925(i, keys, input, token, &cursor, 254); + status = check_key_count_line925(keys_count, i, 3) + || action_line925(&i, keys, input, token, &cursor, 254); continue; yy748: YYSKIP (); @@ -18756,7 +19679,8 @@ yy750: goto yy747; yy751: YYSKIP (); - status = action_line925(i, keys, input, token, &cursor, 0); + status = check_key_count_line925(keys_count, i, 3) + || action_line925(&i, keys, input, token, &cursor, 0); continue; } @@ -18768,7 +19692,7 @@ yy751: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line925: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line925: unused keys left after %u keys\n", i); } } @@ -18798,7 +19722,7 @@ end: #define YYFILL(n) { break; } static int action_line932 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -18806,10 +19730,12 @@ static int action_line932 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -18819,17 +19745,17 @@ static int action_line932 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line932: at position %ld (iteration %u):\n" + , "error: lex_line932: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -18839,6 +19765,13 @@ static int action_line932 } } +static int check_key_count_line932(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line932: not enough keys\n"); + return 1; +} + int lex_line932() { const size_t padding = 3; /* YYMAXFILL */ @@ -18866,7 +19799,7 @@ int lex_line932() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line932.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -18879,7 +19812,7 @@ int lex_line932() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -18893,7 +19826,8 @@ int lex_line932() yy755: YYSKIP (); yy756: - status = action_line932(i, keys, input, token, &cursor, 254); + status = check_key_count_line932(keys_count, i, 3) + || action_line932(&i, keys, input, token, &cursor, 254); continue; yy757: YYSKIP (); @@ -18981,7 +19915,8 @@ yy759: goto yy756; yy760: YYSKIP (); - status = action_line932(i, keys, input, token, &cursor, 0); + status = check_key_count_line932(keys_count, i, 3) + || action_line932(&i, keys, input, token, &cursor, 0); continue; } @@ -18993,7 +19928,7 @@ yy760: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line932: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line932: unused keys left after %u keys\n", i); } } @@ -19023,7 +19958,7 @@ end: #define YYFILL(n) { break; } static int action_line939 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -19031,10 +19966,12 @@ static int action_line939 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -19044,17 +19981,17 @@ static int action_line939 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line939: at position %ld (iteration %u):\n" + , "error: lex_line939: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -19064,6 +20001,13 @@ static int action_line939 } } +static int check_key_count_line939(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line939: not enough keys\n"); + return 1; +} + int lex_line939() { const size_t padding = 3; /* YYMAXFILL */ @@ -19091,7 +20035,7 @@ int lex_line939() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line939.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -19104,7 +20048,7 @@ int lex_line939() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -19119,7 +20063,8 @@ int lex_line939() yy764: YYSKIP (); yy765: - status = action_line939(i, keys, input, token, &cursor, 254); + status = check_key_count_line939(keys_count, i, 3) + || action_line939(&i, keys, input, token, &cursor, 254); continue; yy766: YYSKIP (); @@ -19313,7 +20258,8 @@ yy769: goto yy765; yy770: YYSKIP (); - status = action_line939(i, keys, input, token, &cursor, 0); + status = check_key_count_line939(keys_count, i, 3) + || action_line939(&i, keys, input, token, &cursor, 0); continue; } @@ -19325,7 +20271,7 @@ yy770: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line939: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line939: unused keys left after %u keys\n", i); } } @@ -19355,7 +20301,7 @@ end: #define YYFILL(n) { break; } static int action_line946 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -19363,10 +20309,12 @@ static int action_line946 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -19376,17 +20324,17 @@ static int action_line946 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line946: at position %ld (iteration %u):\n" + , "error: lex_line946: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -19396,6 +20344,13 @@ static int action_line946 } } +static int check_key_count_line946(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line946: not enough keys\n"); + return 1; +} + int lex_line946() { const size_t padding = 3; /* YYMAXFILL */ @@ -19423,7 +20378,7 @@ int lex_line946() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line946.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -19436,7 +20391,7 @@ int lex_line946() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -19450,7 +20405,8 @@ int lex_line946() yy774: YYSKIP (); yy775: - status = action_line946(i, keys, input, token, &cursor, 254); + status = check_key_count_line946(keys_count, i, 3) + || action_line946(&i, keys, input, token, &cursor, 254); continue; yy776: YYSKIP (); @@ -19535,7 +20491,8 @@ yy778: goto yy775; yy779: YYSKIP (); - status = action_line946(i, keys, input, token, &cursor, 0); + status = check_key_count_line946(keys_count, i, 3) + || action_line946(&i, keys, input, token, &cursor, 0); continue; } @@ -19547,7 +20504,7 @@ yy779: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line946: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line946: unused keys left after %u keys\n", i); } } @@ -19577,7 +20534,7 @@ end: #define YYFILL(n) { break; } static int action_line953 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -19585,10 +20542,12 @@ static int action_line953 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -19598,17 +20557,17 @@ static int action_line953 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line953: at position %ld (iteration %u):\n" + , "error: lex_line953: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -19618,6 +20577,13 @@ static int action_line953 } } +static int check_key_count_line953(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line953: not enough keys\n"); + return 1; +} + int lex_line953() { const size_t padding = 3; /* YYMAXFILL */ @@ -19645,7 +20611,7 @@ int lex_line953() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line953.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -19658,7 +20624,7 @@ int lex_line953() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -19677,7 +20643,8 @@ int lex_line953() yy783: YYSKIP (); yy784: - status = action_line953(i, keys, input, token, &cursor, 254); + status = check_key_count_line953(keys_count, i, 3) + || action_line953(&i, keys, input, token, &cursor, 254); continue; yy785: YYSKIP (); @@ -19840,7 +20807,8 @@ yy788: goto yy784; yy789: YYSKIP (); - status = action_line953(i, keys, input, token, &cursor, 0); + status = check_key_count_line953(keys_count, i, 3) + || action_line953(&i, keys, input, token, &cursor, 0); continue; } @@ -19852,7 +20820,7 @@ yy789: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line953: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line953: unused keys left after %u keys\n", i); } } @@ -19882,7 +20850,7 @@ end: #define YYFILL(n) { break; } static int action_line960 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -19890,10 +20858,12 @@ static int action_line960 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -19903,17 +20873,17 @@ static int action_line960 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line960: at position %ld (iteration %u):\n" + , "error: lex_line960: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -19923,6 +20893,13 @@ static int action_line960 } } +static int check_key_count_line960(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line960: not enough keys\n"); + return 1; +} + int lex_line960() { const size_t padding = 3; /* YYMAXFILL */ @@ -19950,7 +20927,7 @@ int lex_line960() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line960.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -19963,7 +20940,7 @@ int lex_line960() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -19977,7 +20954,8 @@ int lex_line960() yy793: YYSKIP (); yy794: - status = action_line960(i, keys, input, token, &cursor, 254); + status = check_key_count_line960(keys_count, i, 3) + || action_line960(&i, keys, input, token, &cursor, 254); continue; yy795: YYSKIP (); @@ -20102,7 +21080,8 @@ yy798: } yy799: YYSKIP (); - status = action_line960(i, keys, input, token, &cursor, 0); + status = check_key_count_line960(keys_count, i, 3) + || action_line960(&i, keys, input, token, &cursor, 0); continue; } @@ -20114,7 +21093,7 @@ yy799: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line960: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line960: unused keys left after %u keys\n", i); } } @@ -20144,7 +21123,7 @@ end: #define YYFILL(n) { break; } static int action_line967 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -20152,10 +21131,12 @@ static int action_line967 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -20165,17 +21146,17 @@ static int action_line967 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line967: at position %ld (iteration %u):\n" + , "error: lex_line967: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -20185,6 +21166,13 @@ static int action_line967 } } +static int check_key_count_line967(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line967: not enough keys\n"); + return 1; +} + int lex_line967() { const size_t padding = 3; /* YYMAXFILL */ @@ -20212,7 +21200,7 @@ int lex_line967() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line967.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -20225,7 +21213,7 @@ int lex_line967() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -20239,7 +21227,8 @@ int lex_line967() yy803: YYSKIP (); yy804: - status = action_line967(i, keys, input, token, &cursor, 254); + status = check_key_count_line967(keys_count, i, 3) + || action_line967(&i, keys, input, token, &cursor, 254); continue; yy805: YYSKIP (); @@ -20331,7 +21320,8 @@ yy808: } yy809: YYSKIP (); - status = action_line967(i, keys, input, token, &cursor, 0); + status = check_key_count_line967(keys_count, i, 3) + || action_line967(&i, keys, input, token, &cursor, 0); continue; } @@ -20343,7 +21333,7 @@ yy809: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line967: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line967: unused keys left after %u keys\n", i); } } @@ -20373,7 +21363,7 @@ end: #define YYFILL(n) { break; } static int action_line974 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -20381,10 +21371,12 @@ static int action_line974 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -20394,17 +21386,17 @@ static int action_line974 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line974: at position %ld (iteration %u):\n" + , "error: lex_line974: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -20414,6 +21406,13 @@ static int action_line974 } } +static int check_key_count_line974(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line974: not enough keys\n"); + return 1; +} + int lex_line974() { const size_t padding = 3; /* YYMAXFILL */ @@ -20441,7 +21440,7 @@ int lex_line974() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line974.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -20454,7 +21453,7 @@ int lex_line974() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -20471,7 +21470,8 @@ int lex_line974() yy813: YYSKIP (); yy814: - status = action_line974(i, keys, input, token, &cursor, 254); + status = check_key_count_line974(keys_count, i, 3) + || action_line974(&i, keys, input, token, &cursor, 254); continue; yy815: YYSKIP (); @@ -20734,7 +21734,8 @@ yy820: } yy821: YYSKIP (); - status = action_line974(i, keys, input, token, &cursor, 0); + status = check_key_count_line974(keys_count, i, 3) + || action_line974(&i, keys, input, token, &cursor, 0); continue; } @@ -20746,7 +21747,7 @@ yy821: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line974: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line974: unused keys left after %u keys\n", i); } } @@ -20776,7 +21777,7 @@ end: #define YYFILL(n) { break; } static int action_line981 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -20784,10 +21785,12 @@ static int action_line981 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -20797,17 +21800,17 @@ static int action_line981 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line981: at position %ld (iteration %u):\n" + , "error: lex_line981: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -20817,6 +21820,13 @@ static int action_line981 } } +static int check_key_count_line981(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line981: not enough keys\n"); + return 1; +} + int lex_line981() { const size_t padding = 3; /* YYMAXFILL */ @@ -20844,7 +21854,7 @@ int lex_line981() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line981.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -20857,7 +21867,7 @@ int lex_line981() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -20871,7 +21881,8 @@ int lex_line981() yy825: YYSKIP (); yy826: - status = action_line981(i, keys, input, token, &cursor, 254); + status = check_key_count_line981(keys_count, i, 3) + || action_line981(&i, keys, input, token, &cursor, 254); continue; yy827: YYSKIP (); @@ -20969,7 +21980,8 @@ yy829: goto yy826; yy830: YYSKIP (); - status = action_line981(i, keys, input, token, &cursor, 0); + status = check_key_count_line981(keys_count, i, 3) + || action_line981(&i, keys, input, token, &cursor, 0); continue; } @@ -20981,7 +21993,7 @@ yy830: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line981: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line981: unused keys left after %u keys\n", i); } } @@ -21011,7 +22023,7 @@ end: #define YYFILL(n) { break; } static int action_line988 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -21019,10 +22031,12 @@ static int action_line988 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -21032,17 +22046,17 @@ static int action_line988 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line988: at position %ld (iteration %u):\n" + , "error: lex_line988: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -21052,6 +22066,13 @@ static int action_line988 } } +static int check_key_count_line988(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line988: not enough keys\n"); + return 1; +} + int lex_line988() { const size_t padding = 3; /* YYMAXFILL */ @@ -21079,7 +22100,7 @@ int lex_line988() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line988.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -21092,7 +22113,7 @@ int lex_line988() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -21106,7 +22127,8 @@ int lex_line988() yy834: YYSKIP (); yy835: - status = action_line988(i, keys, input, token, &cursor, 254); + status = check_key_count_line988(keys_count, i, 3) + || action_line988(&i, keys, input, token, &cursor, 254); continue; yy836: YYSKIP (); @@ -21192,7 +22214,8 @@ yy838: goto yy835; yy839: YYSKIP (); - status = action_line988(i, keys, input, token, &cursor, 0); + status = check_key_count_line988(keys_count, i, 3) + || action_line988(&i, keys, input, token, &cursor, 0); continue; } @@ -21204,7 +22227,7 @@ yy839: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line988: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line988: unused keys left after %u keys\n", i); } } @@ -21234,7 +22257,7 @@ end: #define YYFILL(n) { break; } static int action_line995 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -21242,10 +22265,12 @@ static int action_line995 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -21255,17 +22280,17 @@ static int action_line995 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line995: at position %ld (iteration %u):\n" + , "error: lex_line995: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -21275,6 +22300,13 @@ static int action_line995 } } +static int check_key_count_line995(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line995: not enough keys\n"); + return 1; +} + int lex_line995() { const size_t padding = 3; /* YYMAXFILL */ @@ -21302,7 +22334,7 @@ int lex_line995() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line995.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -21315,7 +22347,7 @@ int lex_line995() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -21329,7 +22361,8 @@ int lex_line995() yy843: YYSKIP (); yy844: - status = action_line995(i, keys, input, token, &cursor, 254); + status = check_key_count_line995(keys_count, i, 3) + || action_line995(&i, keys, input, token, &cursor, 254); continue; yy845: YYSKIP (); @@ -21429,7 +22462,8 @@ yy847: goto yy844; yy848: YYSKIP (); - status = action_line995(i, keys, input, token, &cursor, 0); + status = check_key_count_line995(keys_count, i, 3) + || action_line995(&i, keys, input, token, &cursor, 0); continue; } @@ -21441,7 +22475,7 @@ yy848: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line995: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line995: unused keys left after %u keys\n", i); } } @@ -21471,7 +22505,7 @@ end: #define YYFILL(n) { break; } static int action_line1002 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -21479,10 +22513,12 @@ static int action_line1002 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -21492,17 +22528,17 @@ static int action_line1002 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1002: at position %ld (iteration %u):\n" + , "error: lex_line1002: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -21512,6 +22548,13 @@ static int action_line1002 } } +static int check_key_count_line1002(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1002: not enough keys\n"); + return 1; +} + int lex_line1002() { const size_t padding = 3; /* YYMAXFILL */ @@ -21539,7 +22582,7 @@ int lex_line1002() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1002.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -21552,7 +22595,7 @@ int lex_line1002() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -21567,7 +22610,8 @@ int lex_line1002() yy852: YYSKIP (); yy853: - status = action_line1002(i, keys, input, token, &cursor, 254); + status = check_key_count_line1002(keys_count, i, 3) + || action_line1002(&i, keys, input, token, &cursor, 254); continue; yy854: YYSKIP (); @@ -21758,7 +22802,8 @@ yy857: goto yy853; yy858: YYSKIP (); - status = action_line1002(i, keys, input, token, &cursor, 0); + status = check_key_count_line1002(keys_count, i, 3) + || action_line1002(&i, keys, input, token, &cursor, 0); continue; } @@ -21770,7 +22815,7 @@ yy858: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1002: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1002: unused keys left after %u keys\n", i); } } @@ -21800,7 +22845,7 @@ end: #define YYFILL(n) { break; } static int action_line1009 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -21808,10 +22853,12 @@ static int action_line1009 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -21821,17 +22868,17 @@ static int action_line1009 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1009: at position %ld (iteration %u):\n" + , "error: lex_line1009: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -21841,6 +22888,13 @@ static int action_line1009 } } +static int check_key_count_line1009(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1009: not enough keys\n"); + return 1; +} + int lex_line1009() { const size_t padding = 3; /* YYMAXFILL */ @@ -21868,7 +22922,7 @@ int lex_line1009() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1009.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -21881,7 +22935,7 @@ int lex_line1009() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -21895,7 +22949,8 @@ int lex_line1009() yy862: YYSKIP (); yy863: - status = action_line1009(i, keys, input, token, &cursor, 254); + status = check_key_count_line1009(keys_count, i, 3) + || action_line1009(&i, keys, input, token, &cursor, 254); continue; yy864: YYSKIP (); @@ -21987,7 +23042,8 @@ yy866: goto yy863; yy867: YYSKIP (); - status = action_line1009(i, keys, input, token, &cursor, 0); + status = check_key_count_line1009(keys_count, i, 3) + || action_line1009(&i, keys, input, token, &cursor, 0); continue; } @@ -21999,7 +23055,7 @@ yy867: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1009: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1009: unused keys left after %u keys\n", i); } } @@ -22029,7 +23085,7 @@ end: #define YYFILL(n) { break; } static int action_line1016 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -22037,10 +23093,12 @@ static int action_line1016 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -22050,17 +23108,17 @@ static int action_line1016 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1016: at position %ld (iteration %u):\n" + , "error: lex_line1016: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -22070,6 +23128,13 @@ static int action_line1016 } } +static int check_key_count_line1016(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1016: not enough keys\n"); + return 1; +} + int lex_line1016() { const size_t padding = 3; /* YYMAXFILL */ @@ -22097,7 +23162,7 @@ int lex_line1016() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1016.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -22110,7 +23175,7 @@ int lex_line1016() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -22124,7 +23189,8 @@ int lex_line1016() yy871: YYSKIP (); yy872: - status = action_line1016(i, keys, input, token, &cursor, 254); + status = check_key_count_line1016(keys_count, i, 3) + || action_line1016(&i, keys, input, token, &cursor, 254); continue; yy873: YYSKIP (); @@ -22232,7 +23298,8 @@ yy876: } yy877: YYSKIP (); - status = action_line1016(i, keys, input, token, &cursor, 0); + status = check_key_count_line1016(keys_count, i, 3) + || action_line1016(&i, keys, input, token, &cursor, 0); continue; } @@ -22244,7 +23311,7 @@ yy877: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1016: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1016: unused keys left after %u keys\n", i); } } @@ -22274,7 +23341,7 @@ end: #define YYFILL(n) { break; } static int action_line1023 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -22282,10 +23349,12 @@ static int action_line1023 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -22295,17 +23364,17 @@ static int action_line1023 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1023: at position %ld (iteration %u):\n" + , "error: lex_line1023: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -22315,6 +23384,13 @@ static int action_line1023 } } +static int check_key_count_line1023(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1023: not enough keys\n"); + return 1; +} + int lex_line1023() { const size_t padding = 3; /* YYMAXFILL */ @@ -22342,7 +23418,7 @@ int lex_line1023() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1023.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -22355,7 +23431,7 @@ int lex_line1023() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -22369,7 +23445,8 @@ int lex_line1023() yy881: YYSKIP (); yy882: - status = action_line1023(i, keys, input, token, &cursor, 254); + status = check_key_count_line1023(keys_count, i, 3) + || action_line1023(&i, keys, input, token, &cursor, 254); continue; yy883: YYSKIP (); @@ -22518,7 +23595,8 @@ yy886: } yy887: YYSKIP (); - status = action_line1023(i, keys, input, token, &cursor, 0); + status = check_key_count_line1023(keys_count, i, 3) + || action_line1023(&i, keys, input, token, &cursor, 0); continue; } @@ -22530,7 +23608,7 @@ yy887: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1023: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1023: unused keys left after %u keys\n", i); } } @@ -22560,7 +23638,7 @@ end: #define YYFILL(n) { break; } static int action_line1030 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -22568,10 +23646,12 @@ static int action_line1030 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -22581,17 +23661,17 @@ static int action_line1030 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1030: at position %ld (iteration %u):\n" + , "error: lex_line1030: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -22601,6 +23681,13 @@ static int action_line1030 } } +static int check_key_count_line1030(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1030: not enough keys\n"); + return 1; +} + int lex_line1030() { const size_t padding = 3; /* YYMAXFILL */ @@ -22628,7 +23715,7 @@ int lex_line1030() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1030.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -22641,7 +23728,7 @@ int lex_line1030() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -22655,7 +23742,8 @@ int lex_line1030() yy891: YYSKIP (); yy892: - status = action_line1030(i, keys, input, token, &cursor, 254); + status = check_key_count_line1030(keys_count, i, 3) + || action_line1030(&i, keys, input, token, &cursor, 254); continue; yy893: YYSKIP (); @@ -22692,7 +23780,8 @@ yy895: goto yy892; yy896: YYSKIP (); - status = action_line1030(i, keys, input, token, &cursor, 0); + status = check_key_count_line1030(keys_count, i, 3) + || action_line1030(&i, keys, input, token, &cursor, 0); continue; } @@ -22704,7 +23793,7 @@ yy896: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1030: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1030: unused keys left after %u keys\n", i); } } @@ -22734,7 +23823,7 @@ end: #define YYFILL(n) { break; } static int action_line1037 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -22742,10 +23831,12 @@ static int action_line1037 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -22755,17 +23846,17 @@ static int action_line1037 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1037: at position %ld (iteration %u):\n" + , "error: lex_line1037: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -22775,6 +23866,13 @@ static int action_line1037 } } +static int check_key_count_line1037(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1037: not enough keys\n"); + return 1; +} + int lex_line1037() { const size_t padding = 3; /* YYMAXFILL */ @@ -22802,7 +23900,7 @@ int lex_line1037() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1037.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -22815,7 +23913,7 @@ int lex_line1037() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -22829,7 +23927,8 @@ int lex_line1037() yy900: YYSKIP (); yy901: - status = action_line1037(i, keys, input, token, &cursor, 254); + status = check_key_count_line1037(keys_count, i, 3) + || action_line1037(&i, keys, input, token, &cursor, 254); continue; yy902: YYSKIP (); @@ -22866,7 +23965,8 @@ yy904: goto yy901; yy905: YYSKIP (); - status = action_line1037(i, keys, input, token, &cursor, 0); + status = check_key_count_line1037(keys_count, i, 3) + || action_line1037(&i, keys, input, token, &cursor, 0); continue; } @@ -22878,7 +23978,7 @@ yy905: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1037: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1037: unused keys left after %u keys\n", i); } } @@ -22908,7 +24008,7 @@ end: #define YYFILL(n) { break; } static int action_line1044 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -22916,10 +24016,12 @@ static int action_line1044 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -22929,17 +24031,17 @@ static int action_line1044 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1044: at position %ld (iteration %u):\n" + , "error: lex_line1044: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -22949,6 +24051,13 @@ static int action_line1044 } } +static int check_key_count_line1044(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1044: not enough keys\n"); + return 1; +} + int lex_line1044() { const size_t padding = 3; /* YYMAXFILL */ @@ -22976,7 +24085,7 @@ int lex_line1044() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1044.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -22989,7 +24098,7 @@ int lex_line1044() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -23003,7 +24112,8 @@ int lex_line1044() yy909: YYSKIP (); yy910: - status = action_line1044(i, keys, input, token, &cursor, 254); + status = check_key_count_line1044(keys_count, i, 3) + || action_line1044(&i, keys, input, token, &cursor, 254); continue; yy911: YYSKIP (); @@ -23063,7 +24173,8 @@ yy914: } yy915: YYSKIP (); - status = action_line1044(i, keys, input, token, &cursor, 0); + status = check_key_count_line1044(keys_count, i, 3) + || action_line1044(&i, keys, input, token, &cursor, 0); continue; } @@ -23075,7 +24186,7 @@ yy915: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1044: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1044: unused keys left after %u keys\n", i); } } @@ -23105,7 +24216,7 @@ end: #define YYFILL(n) { break; } static int action_line1051 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -23113,10 +24224,12 @@ static int action_line1051 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -23126,17 +24239,17 @@ static int action_line1051 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1051: at position %ld (iteration %u):\n" + , "error: lex_line1051: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -23146,6 +24259,13 @@ static int action_line1051 } } +static int check_key_count_line1051(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1051: not enough keys\n"); + return 1; +} + int lex_line1051() { const size_t padding = 3; /* YYMAXFILL */ @@ -23173,7 +24293,7 @@ int lex_line1051() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1051.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -23186,7 +24306,7 @@ int lex_line1051() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -23200,7 +24320,8 @@ int lex_line1051() yy919: YYSKIP (); yy920: - status = action_line1051(i, keys, input, token, &cursor, 254); + status = check_key_count_line1051(keys_count, i, 3) + || action_line1051(&i, keys, input, token, &cursor, 254); continue; yy921: YYSKIP (); @@ -23253,7 +24374,8 @@ yy923: goto yy920; yy924: YYSKIP (); - status = action_line1051(i, keys, input, token, &cursor, 0); + status = check_key_count_line1051(keys_count, i, 3) + || action_line1051(&i, keys, input, token, &cursor, 0); continue; } @@ -23265,7 +24387,7 @@ yy924: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1051: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1051: unused keys left after %u keys\n", i); } } @@ -23295,7 +24417,7 @@ end: #define YYFILL(n) { break; } static int action_line1058 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -23303,10 +24425,12 @@ static int action_line1058 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -23316,17 +24440,17 @@ static int action_line1058 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1058: at position %ld (iteration %u):\n" + , "error: lex_line1058: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -23336,6 +24460,13 @@ static int action_line1058 } } +static int check_key_count_line1058(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1058: not enough keys\n"); + return 1; +} + int lex_line1058() { const size_t padding = 3; /* YYMAXFILL */ @@ -23363,7 +24494,7 @@ int lex_line1058() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1058.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -23376,7 +24507,7 @@ int lex_line1058() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -23390,7 +24521,8 @@ int lex_line1058() yy928: YYSKIP (); yy929: - status = action_line1058(i, keys, input, token, &cursor, 254); + status = check_key_count_line1058(keys_count, i, 3) + || action_line1058(&i, keys, input, token, &cursor, 254); continue; yy930: YYSKIP (); @@ -23499,7 +24631,8 @@ yy933: } yy934: YYSKIP (); - status = action_line1058(i, keys, input, token, &cursor, 0); + status = check_key_count_line1058(keys_count, i, 3) + || action_line1058(&i, keys, input, token, &cursor, 0); continue; } @@ -23511,7 +24644,7 @@ yy934: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1058: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1058: unused keys left after %u keys\n", i); } } @@ -23541,7 +24674,7 @@ end: #define YYFILL(n) { break; } static int action_line1065 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -23549,10 +24682,12 @@ static int action_line1065 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -23562,17 +24697,17 @@ static int action_line1065 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1065: at position %ld (iteration %u):\n" + , "error: lex_line1065: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -23582,6 +24717,13 @@ static int action_line1065 } } +static int check_key_count_line1065(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1065: not enough keys\n"); + return 1; +} + int lex_line1065() { const size_t padding = 3; /* YYMAXFILL */ @@ -23609,7 +24751,7 @@ int lex_line1065() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1065.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -23622,7 +24764,7 @@ int lex_line1065() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -23636,7 +24778,8 @@ int lex_line1065() yy938: YYSKIP (); yy939: - status = action_line1065(i, keys, input, token, &cursor, 254); + status = check_key_count_line1065(keys_count, i, 3) + || action_line1065(&i, keys, input, token, &cursor, 254); continue; yy940: YYSKIP (); @@ -23778,7 +24921,8 @@ yy943: } yy944: YYSKIP (); - status = action_line1065(i, keys, input, token, &cursor, 0); + status = check_key_count_line1065(keys_count, i, 3) + || action_line1065(&i, keys, input, token, &cursor, 0); continue; } @@ -23790,7 +24934,7 @@ yy944: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1065: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1065: unused keys left after %u keys\n", i); } } @@ -23820,7 +24964,7 @@ end: #define YYFILL(n) { break; } static int action_line1072 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -23828,10 +24972,12 @@ static int action_line1072 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -23841,17 +24987,17 @@ static int action_line1072 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1072: at position %ld (iteration %u):\n" + , "error: lex_line1072: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -23861,6 +25007,13 @@ static int action_line1072 } } +static int check_key_count_line1072(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1072: not enough keys\n"); + return 1; +} + int lex_line1072() { const size_t padding = 3; /* YYMAXFILL */ @@ -23888,7 +25041,7 @@ int lex_line1072() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1072.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -23901,7 +25054,7 @@ int lex_line1072() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -23915,7 +25068,8 @@ int lex_line1072() yy948: YYSKIP (); yy949: - status = action_line1072(i, keys, input, token, &cursor, 254); + status = check_key_count_line1072(keys_count, i, 3) + || action_line1072(&i, keys, input, token, &cursor, 254); continue; yy950: YYSKIP (); @@ -23952,7 +25106,8 @@ yy952: goto yy949; yy953: YYSKIP (); - status = action_line1072(i, keys, input, token, &cursor, 0); + status = check_key_count_line1072(keys_count, i, 3) + || action_line1072(&i, keys, input, token, &cursor, 0); continue; } @@ -23964,7 +25119,7 @@ yy953: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1072: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1072: unused keys left after %u keys\n", i); } } @@ -23994,7 +25149,7 @@ end: #define YYFILL(n) { break; } static int action_line1079 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -24002,10 +25157,12 @@ static int action_line1079 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -24015,17 +25172,17 @@ static int action_line1079 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1079: at position %ld (iteration %u):\n" + , "error: lex_line1079: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -24035,6 +25192,13 @@ static int action_line1079 } } +static int check_key_count_line1079(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1079: not enough keys\n"); + return 1; +} + int lex_line1079() { const size_t padding = 3; /* YYMAXFILL */ @@ -24062,7 +25226,7 @@ int lex_line1079() keys = (YYKEYTYPE *) read_file ("unicode_blocks.8--skeleton--encoding-policy(ignore).c.line1079.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -24075,7 +25239,7 @@ int lex_line1079() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; const YYCTYPE *marker = NULL; YYCTYPE yych; @@ -24260,12 +25424,14 @@ int lex_line1079() } yy957: YYSKIP (); - status = action_line1079(i, keys, input, token, &cursor, 0); + status = check_key_count_line1079(keys_count, i, 3) + || action_line1079(&i, keys, input, token, &cursor, 0); continue; yy959: YYSKIP (); yy960: - status = action_line1079(i, keys, input, token, &cursor, 254); + status = check_key_count_line1079(keys_count, i, 3) + || action_line1079(&i, keys, input, token, &cursor, 254); continue; yy961: YYSKIP (); @@ -25162,7 +26328,7 @@ yy978: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1079: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1079: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/unicode_blocks.u--skeleton--encoding-policy(ignore).c b/re2c/test/unicode_blocks.u--skeleton--encoding-policy(ignore).c index f7fdb9a2..1026bbab 100644 --- a/re2c/test/unicode_blocks.u--skeleton--encoding-policy(ignore).c +++ b/re2c/test/unicode_blocks.u--skeleton--encoding-policy(ignore).c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line344 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line344 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line344 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line344: at position %ld (iteration %u):\n" + , "error: lex_line344: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line344 } } +static int check_key_count_line344(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line344: not enough keys\n"); + return 1; +} + int lex_line344() { const size_t padding = 1; /* YYMAXFILL */ @@ -130,7 +139,7 @@ int lex_line344() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line344.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -143,7 +152,7 @@ int lex_line344() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -151,11 +160,13 @@ int lex_line344() yych = YYPEEK (); if (yych >= 0x00000080) goto yy4; YYSKIP (); - status = action_line344(i, keys, input, token, &cursor, 0); + status = check_key_count_line344(keys_count, i, 3) + || action_line344(&i, keys, input, token, &cursor, 0); continue; yy4: YYSKIP (); - status = action_line344(i, keys, input, token, &cursor, 254); + status = check_key_count_line344(keys_count, i, 3) + || action_line344(&i, keys, input, token, &cursor, 254); continue; } @@ -167,7 +178,7 @@ yy4: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line344: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line344: unused keys left after %u keys\n", i); } } @@ -193,7 +204,7 @@ end: #define YYFILL(n) { break; } static int action_line351 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -201,10 +212,12 @@ static int action_line351 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -214,17 +227,17 @@ static int action_line351 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line351: at position %ld (iteration %u):\n" + , "error: lex_line351: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -234,6 +247,13 @@ static int action_line351 } } +static int check_key_count_line351(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line351: not enough keys\n"); + return 1; +} + int lex_line351() { const size_t padding = 1; /* YYMAXFILL */ @@ -267,7 +287,7 @@ int lex_line351() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line351.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -280,7 +300,7 @@ int lex_line351() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -290,11 +310,13 @@ int lex_line351() if (yych <= 0x000000FF) goto yy10; yy8: YYSKIP (); - status = action_line351(i, keys, input, token, &cursor, 254); + status = check_key_count_line351(keys_count, i, 3) + || action_line351(&i, keys, input, token, &cursor, 254); continue; yy10: YYSKIP (); - status = action_line351(i, keys, input, token, &cursor, 0); + status = check_key_count_line351(keys_count, i, 3) + || action_line351(&i, keys, input, token, &cursor, 0); continue; } @@ -306,7 +328,7 @@ yy10: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line351: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line351: unused keys left after %u keys\n", i); } } @@ -332,7 +354,7 @@ end: #define YYFILL(n) { break; } static int action_line358 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -340,10 +362,12 @@ static int action_line358 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -353,17 +377,17 @@ static int action_line358 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line358: at position %ld (iteration %u):\n" + , "error: lex_line358: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -373,6 +397,13 @@ static int action_line358 } } +static int check_key_count_line358(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line358: not enough keys\n"); + return 1; +} + int lex_line358() { const size_t padding = 1; /* YYMAXFILL */ @@ -406,7 +437,7 @@ int lex_line358() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line358.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -419,7 +450,7 @@ int lex_line358() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -429,11 +460,13 @@ int lex_line358() if (yych <= 0x0000017F) goto yy16; yy14: YYSKIP (); - status = action_line358(i, keys, input, token, &cursor, 254); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 254); continue; yy16: YYSKIP (); - status = action_line358(i, keys, input, token, &cursor, 0); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 0); continue; } @@ -445,7 +478,7 @@ yy16: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line358: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line358: unused keys left after %u keys\n", i); } } @@ -471,7 +504,7 @@ end: #define YYFILL(n) { break; } static int action_line365 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -479,10 +512,12 @@ static int action_line365 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -492,17 +527,17 @@ static int action_line365 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line365: at position %ld (iteration %u):\n" + , "error: lex_line365: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -512,6 +547,13 @@ static int action_line365 } } +static int check_key_count_line365(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line365: not enough keys\n"); + return 1; +} + int lex_line365() { const size_t padding = 1; /* YYMAXFILL */ @@ -545,7 +587,7 @@ int lex_line365() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line365.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -558,7 +600,7 @@ int lex_line365() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -568,11 +610,13 @@ int lex_line365() if (yych <= 0x0000024F) goto yy22; yy20: YYSKIP (); - status = action_line365(i, keys, input, token, &cursor, 254); + status = check_key_count_line365(keys_count, i, 3) + || action_line365(&i, keys, input, token, &cursor, 254); continue; yy22: YYSKIP (); - status = action_line365(i, keys, input, token, &cursor, 0); + status = check_key_count_line365(keys_count, i, 3) + || action_line365(&i, keys, input, token, &cursor, 0); continue; } @@ -584,7 +628,7 @@ yy22: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line365: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line365: unused keys left after %u keys\n", i); } } @@ -610,7 +654,7 @@ end: #define YYFILL(n) { break; } static int action_line372 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -618,10 +662,12 @@ static int action_line372 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -631,17 +677,17 @@ static int action_line372 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line372: at position %ld (iteration %u):\n" + , "error: lex_line372: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -651,6 +697,13 @@ static int action_line372 } } +static int check_key_count_line372(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line372: not enough keys\n"); + return 1; +} + int lex_line372() { const size_t padding = 1; /* YYMAXFILL */ @@ -684,7 +737,7 @@ int lex_line372() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line372.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -697,7 +750,7 @@ int lex_line372() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -707,11 +760,13 @@ int lex_line372() if (yych <= 0x000002AF) goto yy28; yy26: YYSKIP (); - status = action_line372(i, keys, input, token, &cursor, 254); + status = check_key_count_line372(keys_count, i, 3) + || action_line372(&i, keys, input, token, &cursor, 254); continue; yy28: YYSKIP (); - status = action_line372(i, keys, input, token, &cursor, 0); + status = check_key_count_line372(keys_count, i, 3) + || action_line372(&i, keys, input, token, &cursor, 0); continue; } @@ -723,7 +778,7 @@ yy28: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line372: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line372: unused keys left after %u keys\n", i); } } @@ -749,7 +804,7 @@ end: #define YYFILL(n) { break; } static int action_line379 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -757,10 +812,12 @@ static int action_line379 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -770,17 +827,17 @@ static int action_line379 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line379: at position %ld (iteration %u):\n" + , "error: lex_line379: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -790,6 +847,13 @@ static int action_line379 } } +static int check_key_count_line379(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line379: not enough keys\n"); + return 1; +} + int lex_line379() { const size_t padding = 1; /* YYMAXFILL */ @@ -823,7 +887,7 @@ int lex_line379() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line379.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -836,7 +900,7 @@ int lex_line379() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -846,11 +910,13 @@ int lex_line379() if (yych <= 0x000002FF) goto yy34; yy32: YYSKIP (); - status = action_line379(i, keys, input, token, &cursor, 254); + status = check_key_count_line379(keys_count, i, 3) + || action_line379(&i, keys, input, token, &cursor, 254); continue; yy34: YYSKIP (); - status = action_line379(i, keys, input, token, &cursor, 0); + status = check_key_count_line379(keys_count, i, 3) + || action_line379(&i, keys, input, token, &cursor, 0); continue; } @@ -862,7 +928,7 @@ yy34: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line379: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line379: unused keys left after %u keys\n", i); } } @@ -888,7 +954,7 @@ end: #define YYFILL(n) { break; } static int action_line386 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -896,10 +962,12 @@ static int action_line386 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -909,17 +977,17 @@ static int action_line386 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line386: at position %ld (iteration %u):\n" + , "error: lex_line386: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -929,6 +997,13 @@ static int action_line386 } } +static int check_key_count_line386(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line386: not enough keys\n"); + return 1; +} + int lex_line386() { const size_t padding = 1; /* YYMAXFILL */ @@ -962,7 +1037,7 @@ int lex_line386() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line386.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -975,7 +1050,7 @@ int lex_line386() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -985,11 +1060,13 @@ int lex_line386() if (yych <= 0x0000036F) goto yy40; yy38: YYSKIP (); - status = action_line386(i, keys, input, token, &cursor, 254); + status = check_key_count_line386(keys_count, i, 3) + || action_line386(&i, keys, input, token, &cursor, 254); continue; yy40: YYSKIP (); - status = action_line386(i, keys, input, token, &cursor, 0); + status = check_key_count_line386(keys_count, i, 3) + || action_line386(&i, keys, input, token, &cursor, 0); continue; } @@ -1001,7 +1078,7 @@ yy40: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line386: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line386: unused keys left after %u keys\n", i); } } @@ -1027,7 +1104,7 @@ end: #define YYFILL(n) { break; } static int action_line393 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1035,10 +1112,12 @@ static int action_line393 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1048,17 +1127,17 @@ static int action_line393 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line393: at position %ld (iteration %u):\n" + , "error: lex_line393: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1068,6 +1147,13 @@ static int action_line393 } } +static int check_key_count_line393(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line393: not enough keys\n"); + return 1; +} + int lex_line393() { const size_t padding = 1; /* YYMAXFILL */ @@ -1101,7 +1187,7 @@ int lex_line393() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line393.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1114,7 +1200,7 @@ int lex_line393() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1124,11 +1210,13 @@ int lex_line393() if (yych <= 0x000003FF) goto yy46; yy44: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 254); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 254); continue; yy46: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 0); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 0); continue; } @@ -1140,7 +1228,7 @@ yy46: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line393: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line393: unused keys left after %u keys\n", i); } } @@ -1166,7 +1254,7 @@ end: #define YYFILL(n) { break; } static int action_line400 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1174,10 +1262,12 @@ static int action_line400 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1187,17 +1277,17 @@ static int action_line400 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line400: at position %ld (iteration %u):\n" + , "error: lex_line400: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1207,6 +1297,13 @@ static int action_line400 } } +static int check_key_count_line400(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line400: not enough keys\n"); + return 1; +} + int lex_line400() { const size_t padding = 1; /* YYMAXFILL */ @@ -1240,7 +1337,7 @@ int lex_line400() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line400.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1253,7 +1350,7 @@ int lex_line400() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1263,11 +1360,13 @@ int lex_line400() if (yych <= 0x000004FF) goto yy52; yy50: YYSKIP (); - status = action_line400(i, keys, input, token, &cursor, 254); + status = check_key_count_line400(keys_count, i, 3) + || action_line400(&i, keys, input, token, &cursor, 254); continue; yy52: YYSKIP (); - status = action_line400(i, keys, input, token, &cursor, 0); + status = check_key_count_line400(keys_count, i, 3) + || action_line400(&i, keys, input, token, &cursor, 0); continue; } @@ -1279,7 +1378,7 @@ yy52: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line400: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line400: unused keys left after %u keys\n", i); } } @@ -1305,7 +1404,7 @@ end: #define YYFILL(n) { break; } static int action_line407 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1313,10 +1412,12 @@ static int action_line407 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1326,17 +1427,17 @@ static int action_line407 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line407: at position %ld (iteration %u):\n" + , "error: lex_line407: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1346,6 +1447,13 @@ static int action_line407 } } +static int check_key_count_line407(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line407: not enough keys\n"); + return 1; +} + int lex_line407() { const size_t padding = 1; /* YYMAXFILL */ @@ -1379,7 +1487,7 @@ int lex_line407() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line407.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1392,7 +1500,7 @@ int lex_line407() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1402,11 +1510,13 @@ int lex_line407() if (yych <= 0x0000052F) goto yy58; yy56: YYSKIP (); - status = action_line407(i, keys, input, token, &cursor, 254); + status = check_key_count_line407(keys_count, i, 3) + || action_line407(&i, keys, input, token, &cursor, 254); continue; yy58: YYSKIP (); - status = action_line407(i, keys, input, token, &cursor, 0); + status = check_key_count_line407(keys_count, i, 3) + || action_line407(&i, keys, input, token, &cursor, 0); continue; } @@ -1418,7 +1528,7 @@ yy58: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line407: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line407: unused keys left after %u keys\n", i); } } @@ -1444,7 +1554,7 @@ end: #define YYFILL(n) { break; } static int action_line414 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1452,10 +1562,12 @@ static int action_line414 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1465,17 +1577,17 @@ static int action_line414 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line414: at position %ld (iteration %u):\n" + , "error: lex_line414: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1485,6 +1597,13 @@ static int action_line414 } } +static int check_key_count_line414(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line414: not enough keys\n"); + return 1; +} + int lex_line414() { const size_t padding = 1; /* YYMAXFILL */ @@ -1518,7 +1637,7 @@ int lex_line414() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line414.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1531,7 +1650,7 @@ int lex_line414() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1541,11 +1660,13 @@ int lex_line414() if (yych <= 0x0000058F) goto yy64; yy62: YYSKIP (); - status = action_line414(i, keys, input, token, &cursor, 254); + status = check_key_count_line414(keys_count, i, 3) + || action_line414(&i, keys, input, token, &cursor, 254); continue; yy64: YYSKIP (); - status = action_line414(i, keys, input, token, &cursor, 0); + status = check_key_count_line414(keys_count, i, 3) + || action_line414(&i, keys, input, token, &cursor, 0); continue; } @@ -1557,7 +1678,7 @@ yy64: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line414: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line414: unused keys left after %u keys\n", i); } } @@ -1583,7 +1704,7 @@ end: #define YYFILL(n) { break; } static int action_line421 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1591,10 +1712,12 @@ static int action_line421 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1604,17 +1727,17 @@ static int action_line421 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line421: at position %ld (iteration %u):\n" + , "error: lex_line421: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1624,6 +1747,13 @@ static int action_line421 } } +static int check_key_count_line421(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line421: not enough keys\n"); + return 1; +} + int lex_line421() { const size_t padding = 1; /* YYMAXFILL */ @@ -1657,7 +1787,7 @@ int lex_line421() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line421.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1670,7 +1800,7 @@ int lex_line421() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1680,11 +1810,13 @@ int lex_line421() if (yych <= 0x000005FF) goto yy70; yy68: YYSKIP (); - status = action_line421(i, keys, input, token, &cursor, 254); + status = check_key_count_line421(keys_count, i, 3) + || action_line421(&i, keys, input, token, &cursor, 254); continue; yy70: YYSKIP (); - status = action_line421(i, keys, input, token, &cursor, 0); + status = check_key_count_line421(keys_count, i, 3) + || action_line421(&i, keys, input, token, &cursor, 0); continue; } @@ -1696,7 +1828,7 @@ yy70: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line421: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line421: unused keys left after %u keys\n", i); } } @@ -1722,7 +1854,7 @@ end: #define YYFILL(n) { break; } static int action_line428 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1730,10 +1862,12 @@ static int action_line428 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1743,17 +1877,17 @@ static int action_line428 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line428: at position %ld (iteration %u):\n" + , "error: lex_line428: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1763,6 +1897,13 @@ static int action_line428 } } +static int check_key_count_line428(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line428: not enough keys\n"); + return 1; +} + int lex_line428() { const size_t padding = 1; /* YYMAXFILL */ @@ -1796,7 +1937,7 @@ int lex_line428() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line428.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1809,7 +1950,7 @@ int lex_line428() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1819,11 +1960,13 @@ int lex_line428() if (yych <= 0x000006FF) goto yy76; yy74: YYSKIP (); - status = action_line428(i, keys, input, token, &cursor, 254); + status = check_key_count_line428(keys_count, i, 3) + || action_line428(&i, keys, input, token, &cursor, 254); continue; yy76: YYSKIP (); - status = action_line428(i, keys, input, token, &cursor, 0); + status = check_key_count_line428(keys_count, i, 3) + || action_line428(&i, keys, input, token, &cursor, 0); continue; } @@ -1835,7 +1978,7 @@ yy76: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line428: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line428: unused keys left after %u keys\n", i); } } @@ -1861,7 +2004,7 @@ end: #define YYFILL(n) { break; } static int action_line435 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1869,10 +2012,12 @@ static int action_line435 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1882,17 +2027,17 @@ static int action_line435 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line435: at position %ld (iteration %u):\n" + , "error: lex_line435: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1902,6 +2047,13 @@ static int action_line435 } } +static int check_key_count_line435(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line435: not enough keys\n"); + return 1; +} + int lex_line435() { const size_t padding = 1; /* YYMAXFILL */ @@ -1935,7 +2087,7 @@ int lex_line435() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line435.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1948,7 +2100,7 @@ int lex_line435() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1958,11 +2110,13 @@ int lex_line435() if (yych <= 0x0000074F) goto yy82; yy80: YYSKIP (); - status = action_line435(i, keys, input, token, &cursor, 254); + status = check_key_count_line435(keys_count, i, 3) + || action_line435(&i, keys, input, token, &cursor, 254); continue; yy82: YYSKIP (); - status = action_line435(i, keys, input, token, &cursor, 0); + status = check_key_count_line435(keys_count, i, 3) + || action_line435(&i, keys, input, token, &cursor, 0); continue; } @@ -1974,7 +2128,7 @@ yy82: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line435: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line435: unused keys left after %u keys\n", i); } } @@ -2000,7 +2154,7 @@ end: #define YYFILL(n) { break; } static int action_line442 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2008,10 +2162,12 @@ static int action_line442 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2021,17 +2177,17 @@ static int action_line442 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line442: at position %ld (iteration %u):\n" + , "error: lex_line442: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2041,6 +2197,13 @@ static int action_line442 } } +static int check_key_count_line442(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line442: not enough keys\n"); + return 1; +} + int lex_line442() { const size_t padding = 1; /* YYMAXFILL */ @@ -2074,7 +2237,7 @@ int lex_line442() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line442.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2087,7 +2250,7 @@ int lex_line442() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2097,11 +2260,13 @@ int lex_line442() if (yych <= 0x000007BF) goto yy88; yy86: YYSKIP (); - status = action_line442(i, keys, input, token, &cursor, 254); + status = check_key_count_line442(keys_count, i, 3) + || action_line442(&i, keys, input, token, &cursor, 254); continue; yy88: YYSKIP (); - status = action_line442(i, keys, input, token, &cursor, 0); + status = check_key_count_line442(keys_count, i, 3) + || action_line442(&i, keys, input, token, &cursor, 0); continue; } @@ -2113,7 +2278,7 @@ yy88: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line442: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line442: unused keys left after %u keys\n", i); } } @@ -2139,7 +2304,7 @@ end: #define YYFILL(n) { break; } static int action_line449 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2147,10 +2312,12 @@ static int action_line449 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2160,17 +2327,17 @@ static int action_line449 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line449: at position %ld (iteration %u):\n" + , "error: lex_line449: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2180,6 +2347,13 @@ static int action_line449 } } +static int check_key_count_line449(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line449: not enough keys\n"); + return 1; +} + int lex_line449() { const size_t padding = 1; /* YYMAXFILL */ @@ -2213,7 +2387,7 @@ int lex_line449() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line449.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2226,7 +2400,7 @@ int lex_line449() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2236,11 +2410,13 @@ int lex_line449() if (yych <= 0x0000097F) goto yy94; yy92: YYSKIP (); - status = action_line449(i, keys, input, token, &cursor, 254); + status = check_key_count_line449(keys_count, i, 3) + || action_line449(&i, keys, input, token, &cursor, 254); continue; yy94: YYSKIP (); - status = action_line449(i, keys, input, token, &cursor, 0); + status = check_key_count_line449(keys_count, i, 3) + || action_line449(&i, keys, input, token, &cursor, 0); continue; } @@ -2252,7 +2428,7 @@ yy94: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line449: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line449: unused keys left after %u keys\n", i); } } @@ -2278,7 +2454,7 @@ end: #define YYFILL(n) { break; } static int action_line456 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2286,10 +2462,12 @@ static int action_line456 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2299,17 +2477,17 @@ static int action_line456 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line456: at position %ld (iteration %u):\n" + , "error: lex_line456: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2319,6 +2497,13 @@ static int action_line456 } } +static int check_key_count_line456(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line456: not enough keys\n"); + return 1; +} + int lex_line456() { const size_t padding = 1; /* YYMAXFILL */ @@ -2352,7 +2537,7 @@ int lex_line456() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line456.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2365,7 +2550,7 @@ int lex_line456() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2375,11 +2560,13 @@ int lex_line456() if (yych <= 0x000009FF) goto yy100; yy98: YYSKIP (); - status = action_line456(i, keys, input, token, &cursor, 254); + status = check_key_count_line456(keys_count, i, 3) + || action_line456(&i, keys, input, token, &cursor, 254); continue; yy100: YYSKIP (); - status = action_line456(i, keys, input, token, &cursor, 0); + status = check_key_count_line456(keys_count, i, 3) + || action_line456(&i, keys, input, token, &cursor, 0); continue; } @@ -2391,7 +2578,7 @@ yy100: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line456: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line456: unused keys left after %u keys\n", i); } } @@ -2417,7 +2604,7 @@ end: #define YYFILL(n) { break; } static int action_line463 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2425,10 +2612,12 @@ static int action_line463 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2438,17 +2627,17 @@ static int action_line463 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line463: at position %ld (iteration %u):\n" + , "error: lex_line463: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2458,6 +2647,13 @@ static int action_line463 } } +static int check_key_count_line463(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line463: not enough keys\n"); + return 1; +} + int lex_line463() { const size_t padding = 1; /* YYMAXFILL */ @@ -2491,7 +2687,7 @@ int lex_line463() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line463.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2504,7 +2700,7 @@ int lex_line463() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2514,11 +2710,13 @@ int lex_line463() if (yych <= 0x00000A7F) goto yy106; yy104: YYSKIP (); - status = action_line463(i, keys, input, token, &cursor, 254); + status = check_key_count_line463(keys_count, i, 3) + || action_line463(&i, keys, input, token, &cursor, 254); continue; yy106: YYSKIP (); - status = action_line463(i, keys, input, token, &cursor, 0); + status = check_key_count_line463(keys_count, i, 3) + || action_line463(&i, keys, input, token, &cursor, 0); continue; } @@ -2530,7 +2728,7 @@ yy106: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line463: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line463: unused keys left after %u keys\n", i); } } @@ -2556,7 +2754,7 @@ end: #define YYFILL(n) { break; } static int action_line470 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2564,10 +2762,12 @@ static int action_line470 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2577,17 +2777,17 @@ static int action_line470 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line470: at position %ld (iteration %u):\n" + , "error: lex_line470: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2597,6 +2797,13 @@ static int action_line470 } } +static int check_key_count_line470(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line470: not enough keys\n"); + return 1; +} + int lex_line470() { const size_t padding = 1; /* YYMAXFILL */ @@ -2630,7 +2837,7 @@ int lex_line470() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line470.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2643,7 +2850,7 @@ int lex_line470() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2653,11 +2860,13 @@ int lex_line470() if (yych <= 0x00000AFF) goto yy112; yy110: YYSKIP (); - status = action_line470(i, keys, input, token, &cursor, 254); + status = check_key_count_line470(keys_count, i, 3) + || action_line470(&i, keys, input, token, &cursor, 254); continue; yy112: YYSKIP (); - status = action_line470(i, keys, input, token, &cursor, 0); + status = check_key_count_line470(keys_count, i, 3) + || action_line470(&i, keys, input, token, &cursor, 0); continue; } @@ -2669,7 +2878,7 @@ yy112: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line470: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line470: unused keys left after %u keys\n", i); } } @@ -2695,7 +2904,7 @@ end: #define YYFILL(n) { break; } static int action_line477 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2703,10 +2912,12 @@ static int action_line477 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2716,17 +2927,17 @@ static int action_line477 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line477: at position %ld (iteration %u):\n" + , "error: lex_line477: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2736,6 +2947,13 @@ static int action_line477 } } +static int check_key_count_line477(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line477: not enough keys\n"); + return 1; +} + int lex_line477() { const size_t padding = 1; /* YYMAXFILL */ @@ -2769,7 +2987,7 @@ int lex_line477() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line477.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2782,7 +3000,7 @@ int lex_line477() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2792,11 +3010,13 @@ int lex_line477() if (yych <= 0x00000B7F) goto yy118; yy116: YYSKIP (); - status = action_line477(i, keys, input, token, &cursor, 254); + status = check_key_count_line477(keys_count, i, 3) + || action_line477(&i, keys, input, token, &cursor, 254); continue; yy118: YYSKIP (); - status = action_line477(i, keys, input, token, &cursor, 0); + status = check_key_count_line477(keys_count, i, 3) + || action_line477(&i, keys, input, token, &cursor, 0); continue; } @@ -2808,7 +3028,7 @@ yy118: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line477: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line477: unused keys left after %u keys\n", i); } } @@ -2834,7 +3054,7 @@ end: #define YYFILL(n) { break; } static int action_line484 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2842,10 +3062,12 @@ static int action_line484 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2855,17 +3077,17 @@ static int action_line484 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line484: at position %ld (iteration %u):\n" + , "error: lex_line484: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2875,6 +3097,13 @@ static int action_line484 } } +static int check_key_count_line484(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line484: not enough keys\n"); + return 1; +} + int lex_line484() { const size_t padding = 1; /* YYMAXFILL */ @@ -2908,7 +3137,7 @@ int lex_line484() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line484.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2921,7 +3150,7 @@ int lex_line484() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2931,11 +3160,13 @@ int lex_line484() if (yych <= 0x00000BFF) goto yy124; yy122: YYSKIP (); - status = action_line484(i, keys, input, token, &cursor, 254); + status = check_key_count_line484(keys_count, i, 3) + || action_line484(&i, keys, input, token, &cursor, 254); continue; yy124: YYSKIP (); - status = action_line484(i, keys, input, token, &cursor, 0); + status = check_key_count_line484(keys_count, i, 3) + || action_line484(&i, keys, input, token, &cursor, 0); continue; } @@ -2947,7 +3178,7 @@ yy124: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line484: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line484: unused keys left after %u keys\n", i); } } @@ -2973,7 +3204,7 @@ end: #define YYFILL(n) { break; } static int action_line491 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2981,10 +3212,12 @@ static int action_line491 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2994,17 +3227,17 @@ static int action_line491 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line491: at position %ld (iteration %u):\n" + , "error: lex_line491: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3014,6 +3247,13 @@ static int action_line491 } } +static int check_key_count_line491(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line491: not enough keys\n"); + return 1; +} + int lex_line491() { const size_t padding = 1; /* YYMAXFILL */ @@ -3047,7 +3287,7 @@ int lex_line491() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line491.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3060,7 +3300,7 @@ int lex_line491() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3070,11 +3310,13 @@ int lex_line491() if (yych <= 0x00000C7F) goto yy130; yy128: YYSKIP (); - status = action_line491(i, keys, input, token, &cursor, 254); + status = check_key_count_line491(keys_count, i, 3) + || action_line491(&i, keys, input, token, &cursor, 254); continue; yy130: YYSKIP (); - status = action_line491(i, keys, input, token, &cursor, 0); + status = check_key_count_line491(keys_count, i, 3) + || action_line491(&i, keys, input, token, &cursor, 0); continue; } @@ -3086,7 +3328,7 @@ yy130: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line491: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line491: unused keys left after %u keys\n", i); } } @@ -3112,7 +3354,7 @@ end: #define YYFILL(n) { break; } static int action_line498 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3120,10 +3362,12 @@ static int action_line498 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3133,17 +3377,17 @@ static int action_line498 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line498: at position %ld (iteration %u):\n" + , "error: lex_line498: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3153,6 +3397,13 @@ static int action_line498 } } +static int check_key_count_line498(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line498: not enough keys\n"); + return 1; +} + int lex_line498() { const size_t padding = 1; /* YYMAXFILL */ @@ -3186,7 +3437,7 @@ int lex_line498() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line498.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3199,7 +3450,7 @@ int lex_line498() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3209,11 +3460,13 @@ int lex_line498() if (yych <= 0x00000CFF) goto yy136; yy134: YYSKIP (); - status = action_line498(i, keys, input, token, &cursor, 254); + status = check_key_count_line498(keys_count, i, 3) + || action_line498(&i, keys, input, token, &cursor, 254); continue; yy136: YYSKIP (); - status = action_line498(i, keys, input, token, &cursor, 0); + status = check_key_count_line498(keys_count, i, 3) + || action_line498(&i, keys, input, token, &cursor, 0); continue; } @@ -3225,7 +3478,7 @@ yy136: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line498: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line498: unused keys left after %u keys\n", i); } } @@ -3251,7 +3504,7 @@ end: #define YYFILL(n) { break; } static int action_line505 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3259,10 +3512,12 @@ static int action_line505 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3272,17 +3527,17 @@ static int action_line505 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line505: at position %ld (iteration %u):\n" + , "error: lex_line505: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3292,6 +3547,13 @@ static int action_line505 } } +static int check_key_count_line505(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line505: not enough keys\n"); + return 1; +} + int lex_line505() { const size_t padding = 1; /* YYMAXFILL */ @@ -3325,7 +3587,7 @@ int lex_line505() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line505.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3338,7 +3600,7 @@ int lex_line505() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3348,11 +3610,13 @@ int lex_line505() if (yych <= 0x00000D7F) goto yy142; yy140: YYSKIP (); - status = action_line505(i, keys, input, token, &cursor, 254); + status = check_key_count_line505(keys_count, i, 3) + || action_line505(&i, keys, input, token, &cursor, 254); continue; yy142: YYSKIP (); - status = action_line505(i, keys, input, token, &cursor, 0); + status = check_key_count_line505(keys_count, i, 3) + || action_line505(&i, keys, input, token, &cursor, 0); continue; } @@ -3364,7 +3628,7 @@ yy142: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line505: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line505: unused keys left after %u keys\n", i); } } @@ -3390,7 +3654,7 @@ end: #define YYFILL(n) { break; } static int action_line512 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3398,10 +3662,12 @@ static int action_line512 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3411,17 +3677,17 @@ static int action_line512 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line512: at position %ld (iteration %u):\n" + , "error: lex_line512: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3431,6 +3697,13 @@ static int action_line512 } } +static int check_key_count_line512(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line512: not enough keys\n"); + return 1; +} + int lex_line512() { const size_t padding = 1; /* YYMAXFILL */ @@ -3464,7 +3737,7 @@ int lex_line512() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line512.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3477,7 +3750,7 @@ int lex_line512() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3487,11 +3760,13 @@ int lex_line512() if (yych <= 0x00000DFF) goto yy148; yy146: YYSKIP (); - status = action_line512(i, keys, input, token, &cursor, 254); + status = check_key_count_line512(keys_count, i, 3) + || action_line512(&i, keys, input, token, &cursor, 254); continue; yy148: YYSKIP (); - status = action_line512(i, keys, input, token, &cursor, 0); + status = check_key_count_line512(keys_count, i, 3) + || action_line512(&i, keys, input, token, &cursor, 0); continue; } @@ -3503,7 +3778,7 @@ yy148: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line512: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line512: unused keys left after %u keys\n", i); } } @@ -3529,7 +3804,7 @@ end: #define YYFILL(n) { break; } static int action_line519 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3537,10 +3812,12 @@ static int action_line519 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3550,17 +3827,17 @@ static int action_line519 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line519: at position %ld (iteration %u):\n" + , "error: lex_line519: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3570,6 +3847,13 @@ static int action_line519 } } +static int check_key_count_line519(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line519: not enough keys\n"); + return 1; +} + int lex_line519() { const size_t padding = 1; /* YYMAXFILL */ @@ -3603,7 +3887,7 @@ int lex_line519() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line519.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3616,7 +3900,7 @@ int lex_line519() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3626,11 +3910,13 @@ int lex_line519() if (yych <= 0x00000E7F) goto yy154; yy152: YYSKIP (); - status = action_line519(i, keys, input, token, &cursor, 254); + status = check_key_count_line519(keys_count, i, 3) + || action_line519(&i, keys, input, token, &cursor, 254); continue; yy154: YYSKIP (); - status = action_line519(i, keys, input, token, &cursor, 0); + status = check_key_count_line519(keys_count, i, 3) + || action_line519(&i, keys, input, token, &cursor, 0); continue; } @@ -3642,7 +3928,7 @@ yy154: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line519: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line519: unused keys left after %u keys\n", i); } } @@ -3668,7 +3954,7 @@ end: #define YYFILL(n) { break; } static int action_line526 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3676,10 +3962,12 @@ static int action_line526 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3689,17 +3977,17 @@ static int action_line526 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line526: at position %ld (iteration %u):\n" + , "error: lex_line526: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3709,6 +3997,13 @@ static int action_line526 } } +static int check_key_count_line526(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line526: not enough keys\n"); + return 1; +} + int lex_line526() { const size_t padding = 1; /* YYMAXFILL */ @@ -3742,7 +4037,7 @@ int lex_line526() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line526.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3755,7 +4050,7 @@ int lex_line526() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3765,11 +4060,13 @@ int lex_line526() if (yych <= 0x00000EFF) goto yy160; yy158: YYSKIP (); - status = action_line526(i, keys, input, token, &cursor, 254); + status = check_key_count_line526(keys_count, i, 3) + || action_line526(&i, keys, input, token, &cursor, 254); continue; yy160: YYSKIP (); - status = action_line526(i, keys, input, token, &cursor, 0); + status = check_key_count_line526(keys_count, i, 3) + || action_line526(&i, keys, input, token, &cursor, 0); continue; } @@ -3781,7 +4078,7 @@ yy160: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line526: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line526: unused keys left after %u keys\n", i); } } @@ -3807,7 +4104,7 @@ end: #define YYFILL(n) { break; } static int action_line533 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3815,10 +4112,12 @@ static int action_line533 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3828,17 +4127,17 @@ static int action_line533 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line533: at position %ld (iteration %u):\n" + , "error: lex_line533: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3848,6 +4147,13 @@ static int action_line533 } } +static int check_key_count_line533(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line533: not enough keys\n"); + return 1; +} + int lex_line533() { const size_t padding = 1; /* YYMAXFILL */ @@ -3881,7 +4187,7 @@ int lex_line533() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line533.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3894,7 +4200,7 @@ int lex_line533() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3904,11 +4210,13 @@ int lex_line533() if (yych <= 0x00000FFF) goto yy166; yy164: YYSKIP (); - status = action_line533(i, keys, input, token, &cursor, 254); + status = check_key_count_line533(keys_count, i, 3) + || action_line533(&i, keys, input, token, &cursor, 254); continue; yy166: YYSKIP (); - status = action_line533(i, keys, input, token, &cursor, 0); + status = check_key_count_line533(keys_count, i, 3) + || action_line533(&i, keys, input, token, &cursor, 0); continue; } @@ -3920,7 +4228,7 @@ yy166: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line533: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line533: unused keys left after %u keys\n", i); } } @@ -3946,7 +4254,7 @@ end: #define YYFILL(n) { break; } static int action_line540 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3954,10 +4262,12 @@ static int action_line540 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3967,17 +4277,17 @@ static int action_line540 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line540: at position %ld (iteration %u):\n" + , "error: lex_line540: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3987,6 +4297,13 @@ static int action_line540 } } +static int check_key_count_line540(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line540: not enough keys\n"); + return 1; +} + int lex_line540() { const size_t padding = 1; /* YYMAXFILL */ @@ -4020,7 +4337,7 @@ int lex_line540() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line540.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4033,7 +4350,7 @@ int lex_line540() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4043,11 +4360,13 @@ int lex_line540() if (yych <= 0x0000109F) goto yy172; yy170: YYSKIP (); - status = action_line540(i, keys, input, token, &cursor, 254); + status = check_key_count_line540(keys_count, i, 3) + || action_line540(&i, keys, input, token, &cursor, 254); continue; yy172: YYSKIP (); - status = action_line540(i, keys, input, token, &cursor, 0); + status = check_key_count_line540(keys_count, i, 3) + || action_line540(&i, keys, input, token, &cursor, 0); continue; } @@ -4059,7 +4378,7 @@ yy172: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line540: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line540: unused keys left after %u keys\n", i); } } @@ -4085,7 +4404,7 @@ end: #define YYFILL(n) { break; } static int action_line547 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4093,10 +4412,12 @@ static int action_line547 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4106,17 +4427,17 @@ static int action_line547 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line547: at position %ld (iteration %u):\n" + , "error: lex_line547: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4126,6 +4447,13 @@ static int action_line547 } } +static int check_key_count_line547(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line547: not enough keys\n"); + return 1; +} + int lex_line547() { const size_t padding = 1; /* YYMAXFILL */ @@ -4159,7 +4487,7 @@ int lex_line547() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line547.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4172,7 +4500,7 @@ int lex_line547() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4182,11 +4510,13 @@ int lex_line547() if (yych <= 0x000010FF) goto yy178; yy176: YYSKIP (); - status = action_line547(i, keys, input, token, &cursor, 254); + status = check_key_count_line547(keys_count, i, 3) + || action_line547(&i, keys, input, token, &cursor, 254); continue; yy178: YYSKIP (); - status = action_line547(i, keys, input, token, &cursor, 0); + status = check_key_count_line547(keys_count, i, 3) + || action_line547(&i, keys, input, token, &cursor, 0); continue; } @@ -4198,7 +4528,7 @@ yy178: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line547: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line547: unused keys left after %u keys\n", i); } } @@ -4224,7 +4554,7 @@ end: #define YYFILL(n) { break; } static int action_line554 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4232,10 +4562,12 @@ static int action_line554 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4245,17 +4577,17 @@ static int action_line554 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line554: at position %ld (iteration %u):\n" + , "error: lex_line554: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4265,6 +4597,13 @@ static int action_line554 } } +static int check_key_count_line554(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line554: not enough keys\n"); + return 1; +} + int lex_line554() { const size_t padding = 1; /* YYMAXFILL */ @@ -4298,7 +4637,7 @@ int lex_line554() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line554.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4311,7 +4650,7 @@ int lex_line554() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4321,11 +4660,13 @@ int lex_line554() if (yych <= 0x000011FF) goto yy184; yy182: YYSKIP (); - status = action_line554(i, keys, input, token, &cursor, 254); + status = check_key_count_line554(keys_count, i, 3) + || action_line554(&i, keys, input, token, &cursor, 254); continue; yy184: YYSKIP (); - status = action_line554(i, keys, input, token, &cursor, 0); + status = check_key_count_line554(keys_count, i, 3) + || action_line554(&i, keys, input, token, &cursor, 0); continue; } @@ -4337,7 +4678,7 @@ yy184: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line554: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line554: unused keys left after %u keys\n", i); } } @@ -4363,7 +4704,7 @@ end: #define YYFILL(n) { break; } static int action_line561 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4371,10 +4712,12 @@ static int action_line561 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4384,17 +4727,17 @@ static int action_line561 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line561: at position %ld (iteration %u):\n" + , "error: lex_line561: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4404,6 +4747,13 @@ static int action_line561 } } +static int check_key_count_line561(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line561: not enough keys\n"); + return 1; +} + int lex_line561() { const size_t padding = 1; /* YYMAXFILL */ @@ -4437,7 +4787,7 @@ int lex_line561() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line561.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4450,7 +4800,7 @@ int lex_line561() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4460,11 +4810,13 @@ int lex_line561() if (yych <= 0x0000137F) goto yy190; yy188: YYSKIP (); - status = action_line561(i, keys, input, token, &cursor, 254); + status = check_key_count_line561(keys_count, i, 3) + || action_line561(&i, keys, input, token, &cursor, 254); continue; yy190: YYSKIP (); - status = action_line561(i, keys, input, token, &cursor, 0); + status = check_key_count_line561(keys_count, i, 3) + || action_line561(&i, keys, input, token, &cursor, 0); continue; } @@ -4476,7 +4828,7 @@ yy190: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line561: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line561: unused keys left after %u keys\n", i); } } @@ -4502,7 +4854,7 @@ end: #define YYFILL(n) { break; } static int action_line568 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4510,10 +4862,12 @@ static int action_line568 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4523,17 +4877,17 @@ static int action_line568 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line568: at position %ld (iteration %u):\n" + , "error: lex_line568: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4543,6 +4897,13 @@ static int action_line568 } } +static int check_key_count_line568(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line568: not enough keys\n"); + return 1; +} + int lex_line568() { const size_t padding = 1; /* YYMAXFILL */ @@ -4576,7 +4937,7 @@ int lex_line568() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line568.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4589,7 +4950,7 @@ int lex_line568() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4599,11 +4960,13 @@ int lex_line568() if (yych <= 0x000013FF) goto yy196; yy194: YYSKIP (); - status = action_line568(i, keys, input, token, &cursor, 254); + status = check_key_count_line568(keys_count, i, 3) + || action_line568(&i, keys, input, token, &cursor, 254); continue; yy196: YYSKIP (); - status = action_line568(i, keys, input, token, &cursor, 0); + status = check_key_count_line568(keys_count, i, 3) + || action_line568(&i, keys, input, token, &cursor, 0); continue; } @@ -4615,7 +4978,7 @@ yy196: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line568: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line568: unused keys left after %u keys\n", i); } } @@ -4641,7 +5004,7 @@ end: #define YYFILL(n) { break; } static int action_line575 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4649,10 +5012,12 @@ static int action_line575 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4662,17 +5027,17 @@ static int action_line575 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line575: at position %ld (iteration %u):\n" + , "error: lex_line575: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4682,6 +5047,13 @@ static int action_line575 } } +static int check_key_count_line575(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line575: not enough keys\n"); + return 1; +} + int lex_line575() { const size_t padding = 1; /* YYMAXFILL */ @@ -4715,7 +5087,7 @@ int lex_line575() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line575.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4728,7 +5100,7 @@ int lex_line575() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4738,11 +5110,13 @@ int lex_line575() if (yych <= 0x0000167F) goto yy202; yy200: YYSKIP (); - status = action_line575(i, keys, input, token, &cursor, 254); + status = check_key_count_line575(keys_count, i, 3) + || action_line575(&i, keys, input, token, &cursor, 254); continue; yy202: YYSKIP (); - status = action_line575(i, keys, input, token, &cursor, 0); + status = check_key_count_line575(keys_count, i, 3) + || action_line575(&i, keys, input, token, &cursor, 0); continue; } @@ -4754,7 +5128,7 @@ yy202: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line575: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line575: unused keys left after %u keys\n", i); } } @@ -4780,7 +5154,7 @@ end: #define YYFILL(n) { break; } static int action_line582 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4788,10 +5162,12 @@ static int action_line582 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4801,17 +5177,17 @@ static int action_line582 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line582: at position %ld (iteration %u):\n" + , "error: lex_line582: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4821,6 +5197,13 @@ static int action_line582 } } +static int check_key_count_line582(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line582: not enough keys\n"); + return 1; +} + int lex_line582() { const size_t padding = 1; /* YYMAXFILL */ @@ -4854,7 +5237,7 @@ int lex_line582() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line582.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4867,7 +5250,7 @@ int lex_line582() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4877,11 +5260,13 @@ int lex_line582() if (yych <= 0x0000169F) goto yy208; yy206: YYSKIP (); - status = action_line582(i, keys, input, token, &cursor, 254); + status = check_key_count_line582(keys_count, i, 3) + || action_line582(&i, keys, input, token, &cursor, 254); continue; yy208: YYSKIP (); - status = action_line582(i, keys, input, token, &cursor, 0); + status = check_key_count_line582(keys_count, i, 3) + || action_line582(&i, keys, input, token, &cursor, 0); continue; } @@ -4893,7 +5278,7 @@ yy208: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line582: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line582: unused keys left after %u keys\n", i); } } @@ -4919,7 +5304,7 @@ end: #define YYFILL(n) { break; } static int action_line589 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4927,10 +5312,12 @@ static int action_line589 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4940,17 +5327,17 @@ static int action_line589 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line589: at position %ld (iteration %u):\n" + , "error: lex_line589: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4960,6 +5347,13 @@ static int action_line589 } } +static int check_key_count_line589(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line589: not enough keys\n"); + return 1; +} + int lex_line589() { const size_t padding = 1; /* YYMAXFILL */ @@ -4993,7 +5387,7 @@ int lex_line589() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line589.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5006,7 +5400,7 @@ int lex_line589() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5016,11 +5410,13 @@ int lex_line589() if (yych <= 0x000016FF) goto yy214; yy212: YYSKIP (); - status = action_line589(i, keys, input, token, &cursor, 254); + status = check_key_count_line589(keys_count, i, 3) + || action_line589(&i, keys, input, token, &cursor, 254); continue; yy214: YYSKIP (); - status = action_line589(i, keys, input, token, &cursor, 0); + status = check_key_count_line589(keys_count, i, 3) + || action_line589(&i, keys, input, token, &cursor, 0); continue; } @@ -5032,7 +5428,7 @@ yy214: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line589: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line589: unused keys left after %u keys\n", i); } } @@ -5058,7 +5454,7 @@ end: #define YYFILL(n) { break; } static int action_line596 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5066,10 +5462,12 @@ static int action_line596 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5079,17 +5477,17 @@ static int action_line596 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line596: at position %ld (iteration %u):\n" + , "error: lex_line596: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5099,6 +5497,13 @@ static int action_line596 } } +static int check_key_count_line596(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line596: not enough keys\n"); + return 1; +} + int lex_line596() { const size_t padding = 1; /* YYMAXFILL */ @@ -5132,7 +5537,7 @@ int lex_line596() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line596.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5145,7 +5550,7 @@ int lex_line596() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5155,11 +5560,13 @@ int lex_line596() if (yych <= 0x0000171F) goto yy220; yy218: YYSKIP (); - status = action_line596(i, keys, input, token, &cursor, 254); + status = check_key_count_line596(keys_count, i, 3) + || action_line596(&i, keys, input, token, &cursor, 254); continue; yy220: YYSKIP (); - status = action_line596(i, keys, input, token, &cursor, 0); + status = check_key_count_line596(keys_count, i, 3) + || action_line596(&i, keys, input, token, &cursor, 0); continue; } @@ -5171,7 +5578,7 @@ yy220: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line596: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line596: unused keys left after %u keys\n", i); } } @@ -5197,7 +5604,7 @@ end: #define YYFILL(n) { break; } static int action_line603 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5205,10 +5612,12 @@ static int action_line603 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5218,17 +5627,17 @@ static int action_line603 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line603: at position %ld (iteration %u):\n" + , "error: lex_line603: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5238,6 +5647,13 @@ static int action_line603 } } +static int check_key_count_line603(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line603: not enough keys\n"); + return 1; +} + int lex_line603() { const size_t padding = 1; /* YYMAXFILL */ @@ -5271,7 +5687,7 @@ int lex_line603() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line603.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5284,7 +5700,7 @@ int lex_line603() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5294,11 +5710,13 @@ int lex_line603() if (yych <= 0x0000173F) goto yy226; yy224: YYSKIP (); - status = action_line603(i, keys, input, token, &cursor, 254); + status = check_key_count_line603(keys_count, i, 3) + || action_line603(&i, keys, input, token, &cursor, 254); continue; yy226: YYSKIP (); - status = action_line603(i, keys, input, token, &cursor, 0); + status = check_key_count_line603(keys_count, i, 3) + || action_line603(&i, keys, input, token, &cursor, 0); continue; } @@ -5310,7 +5728,7 @@ yy226: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line603: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line603: unused keys left after %u keys\n", i); } } @@ -5336,7 +5754,7 @@ end: #define YYFILL(n) { break; } static int action_line610 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5344,10 +5762,12 @@ static int action_line610 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5357,17 +5777,17 @@ static int action_line610 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line610: at position %ld (iteration %u):\n" + , "error: lex_line610: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5377,6 +5797,13 @@ static int action_line610 } } +static int check_key_count_line610(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line610: not enough keys\n"); + return 1; +} + int lex_line610() { const size_t padding = 1; /* YYMAXFILL */ @@ -5410,7 +5837,7 @@ int lex_line610() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line610.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5423,7 +5850,7 @@ int lex_line610() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5433,11 +5860,13 @@ int lex_line610() if (yych <= 0x0000175F) goto yy232; yy230: YYSKIP (); - status = action_line610(i, keys, input, token, &cursor, 254); + status = check_key_count_line610(keys_count, i, 3) + || action_line610(&i, keys, input, token, &cursor, 254); continue; yy232: YYSKIP (); - status = action_line610(i, keys, input, token, &cursor, 0); + status = check_key_count_line610(keys_count, i, 3) + || action_line610(&i, keys, input, token, &cursor, 0); continue; } @@ -5449,7 +5878,7 @@ yy232: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line610: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line610: unused keys left after %u keys\n", i); } } @@ -5475,7 +5904,7 @@ end: #define YYFILL(n) { break; } static int action_line617 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5483,10 +5912,12 @@ static int action_line617 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5496,17 +5927,17 @@ static int action_line617 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line617: at position %ld (iteration %u):\n" + , "error: lex_line617: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5516,6 +5947,13 @@ static int action_line617 } } +static int check_key_count_line617(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line617: not enough keys\n"); + return 1; +} + int lex_line617() { const size_t padding = 1; /* YYMAXFILL */ @@ -5549,7 +5987,7 @@ int lex_line617() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line617.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5562,7 +6000,7 @@ int lex_line617() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5572,11 +6010,13 @@ int lex_line617() if (yych <= 0x0000177F) goto yy238; yy236: YYSKIP (); - status = action_line617(i, keys, input, token, &cursor, 254); + status = check_key_count_line617(keys_count, i, 3) + || action_line617(&i, keys, input, token, &cursor, 254); continue; yy238: YYSKIP (); - status = action_line617(i, keys, input, token, &cursor, 0); + status = check_key_count_line617(keys_count, i, 3) + || action_line617(&i, keys, input, token, &cursor, 0); continue; } @@ -5588,7 +6028,7 @@ yy238: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line617: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line617: unused keys left after %u keys\n", i); } } @@ -5614,7 +6054,7 @@ end: #define YYFILL(n) { break; } static int action_line624 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5622,10 +6062,12 @@ static int action_line624 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5635,17 +6077,17 @@ static int action_line624 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line624: at position %ld (iteration %u):\n" + , "error: lex_line624: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5655,6 +6097,13 @@ static int action_line624 } } +static int check_key_count_line624(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line624: not enough keys\n"); + return 1; +} + int lex_line624() { const size_t padding = 1; /* YYMAXFILL */ @@ -5688,7 +6137,7 @@ int lex_line624() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line624.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5701,7 +6150,7 @@ int lex_line624() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5711,11 +6160,13 @@ int lex_line624() if (yych <= 0x000017FF) goto yy244; yy242: YYSKIP (); - status = action_line624(i, keys, input, token, &cursor, 254); + status = check_key_count_line624(keys_count, i, 3) + || action_line624(&i, keys, input, token, &cursor, 254); continue; yy244: YYSKIP (); - status = action_line624(i, keys, input, token, &cursor, 0); + status = check_key_count_line624(keys_count, i, 3) + || action_line624(&i, keys, input, token, &cursor, 0); continue; } @@ -5727,7 +6178,7 @@ yy244: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line624: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line624: unused keys left after %u keys\n", i); } } @@ -5753,7 +6204,7 @@ end: #define YYFILL(n) { break; } static int action_line631 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5761,10 +6212,12 @@ static int action_line631 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5774,17 +6227,17 @@ static int action_line631 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line631: at position %ld (iteration %u):\n" + , "error: lex_line631: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5794,6 +6247,13 @@ static int action_line631 } } +static int check_key_count_line631(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line631: not enough keys\n"); + return 1; +} + int lex_line631() { const size_t padding = 1; /* YYMAXFILL */ @@ -5827,7 +6287,7 @@ int lex_line631() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line631.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5840,7 +6300,7 @@ int lex_line631() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5850,11 +6310,13 @@ int lex_line631() if (yych <= 0x000018AF) goto yy250; yy248: YYSKIP (); - status = action_line631(i, keys, input, token, &cursor, 254); + status = check_key_count_line631(keys_count, i, 3) + || action_line631(&i, keys, input, token, &cursor, 254); continue; yy250: YYSKIP (); - status = action_line631(i, keys, input, token, &cursor, 0); + status = check_key_count_line631(keys_count, i, 3) + || action_line631(&i, keys, input, token, &cursor, 0); continue; } @@ -5866,7 +6328,7 @@ yy250: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line631: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line631: unused keys left after %u keys\n", i); } } @@ -5892,7 +6354,7 @@ end: #define YYFILL(n) { break; } static int action_line638 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5900,10 +6362,12 @@ static int action_line638 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5913,17 +6377,17 @@ static int action_line638 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line638: at position %ld (iteration %u):\n" + , "error: lex_line638: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5933,6 +6397,13 @@ static int action_line638 } } +static int check_key_count_line638(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line638: not enough keys\n"); + return 1; +} + int lex_line638() { const size_t padding = 1; /* YYMAXFILL */ @@ -5966,7 +6437,7 @@ int lex_line638() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line638.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5979,7 +6450,7 @@ int lex_line638() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5989,11 +6460,13 @@ int lex_line638() if (yych <= 0x0000194F) goto yy256; yy254: YYSKIP (); - status = action_line638(i, keys, input, token, &cursor, 254); + status = check_key_count_line638(keys_count, i, 3) + || action_line638(&i, keys, input, token, &cursor, 254); continue; yy256: YYSKIP (); - status = action_line638(i, keys, input, token, &cursor, 0); + status = check_key_count_line638(keys_count, i, 3) + || action_line638(&i, keys, input, token, &cursor, 0); continue; } @@ -6005,7 +6478,7 @@ yy256: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line638: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line638: unused keys left after %u keys\n", i); } } @@ -6031,7 +6504,7 @@ end: #define YYFILL(n) { break; } static int action_line645 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6039,10 +6512,12 @@ static int action_line645 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6052,17 +6527,17 @@ static int action_line645 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line645: at position %ld (iteration %u):\n" + , "error: lex_line645: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6072,6 +6547,13 @@ static int action_line645 } } +static int check_key_count_line645(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line645: not enough keys\n"); + return 1; +} + int lex_line645() { const size_t padding = 1; /* YYMAXFILL */ @@ -6105,7 +6587,7 @@ int lex_line645() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line645.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6118,7 +6600,7 @@ int lex_line645() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6128,11 +6610,13 @@ int lex_line645() if (yych <= 0x0000197F) goto yy262; yy260: YYSKIP (); - status = action_line645(i, keys, input, token, &cursor, 254); + status = check_key_count_line645(keys_count, i, 3) + || action_line645(&i, keys, input, token, &cursor, 254); continue; yy262: YYSKIP (); - status = action_line645(i, keys, input, token, &cursor, 0); + status = check_key_count_line645(keys_count, i, 3) + || action_line645(&i, keys, input, token, &cursor, 0); continue; } @@ -6144,7 +6628,7 @@ yy262: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line645: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line645: unused keys left after %u keys\n", i); } } @@ -6170,7 +6654,7 @@ end: #define YYFILL(n) { break; } static int action_line652 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6178,10 +6662,12 @@ static int action_line652 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6191,17 +6677,17 @@ static int action_line652 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652: at position %ld (iteration %u):\n" + , "error: lex_line652: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6211,6 +6697,13 @@ static int action_line652 } } +static int check_key_count_line652(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652: not enough keys\n"); + return 1; +} + int lex_line652() { const size_t padding = 1; /* YYMAXFILL */ @@ -6244,7 +6737,7 @@ int lex_line652() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line652.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6257,7 +6750,7 @@ int lex_line652() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6267,11 +6760,13 @@ int lex_line652() if (yych <= 0x000019FF) goto yy268; yy266: YYSKIP (); - status = action_line652(i, keys, input, token, &cursor, 254); + status = check_key_count_line652(keys_count, i, 3) + || action_line652(&i, keys, input, token, &cursor, 254); continue; yy268: YYSKIP (); - status = action_line652(i, keys, input, token, &cursor, 0); + status = check_key_count_line652(keys_count, i, 3) + || action_line652(&i, keys, input, token, &cursor, 0); continue; } @@ -6283,7 +6778,7 @@ yy268: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652: unused keys left after %u keys\n", i); } } @@ -6309,7 +6804,7 @@ end: #define YYFILL(n) { break; } static int action_line659 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6317,10 +6812,12 @@ static int action_line659 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6330,17 +6827,17 @@ static int action_line659 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line659: at position %ld (iteration %u):\n" + , "error: lex_line659: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6350,6 +6847,13 @@ static int action_line659 } } +static int check_key_count_line659(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line659: not enough keys\n"); + return 1; +} + int lex_line659() { const size_t padding = 1; /* YYMAXFILL */ @@ -6383,7 +6887,7 @@ int lex_line659() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line659.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6396,7 +6900,7 @@ int lex_line659() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6406,11 +6910,13 @@ int lex_line659() if (yych <= 0x00001D7F) goto yy274; yy272: YYSKIP (); - status = action_line659(i, keys, input, token, &cursor, 254); + status = check_key_count_line659(keys_count, i, 3) + || action_line659(&i, keys, input, token, &cursor, 254); continue; yy274: YYSKIP (); - status = action_line659(i, keys, input, token, &cursor, 0); + status = check_key_count_line659(keys_count, i, 3) + || action_line659(&i, keys, input, token, &cursor, 0); continue; } @@ -6422,7 +6928,7 @@ yy274: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line659: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line659: unused keys left after %u keys\n", i); } } @@ -6448,7 +6954,7 @@ end: #define YYFILL(n) { break; } static int action_line666 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6456,10 +6962,12 @@ static int action_line666 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6469,17 +6977,17 @@ static int action_line666 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line666: at position %ld (iteration %u):\n" + , "error: lex_line666: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6489,6 +6997,13 @@ static int action_line666 } } +static int check_key_count_line666(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line666: not enough keys\n"); + return 1; +} + int lex_line666() { const size_t padding = 1; /* YYMAXFILL */ @@ -6522,7 +7037,7 @@ int lex_line666() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line666.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6535,7 +7050,7 @@ int lex_line666() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6545,11 +7060,13 @@ int lex_line666() if (yych <= 0x00001EFF) goto yy280; yy278: YYSKIP (); - status = action_line666(i, keys, input, token, &cursor, 254); + status = check_key_count_line666(keys_count, i, 3) + || action_line666(&i, keys, input, token, &cursor, 254); continue; yy280: YYSKIP (); - status = action_line666(i, keys, input, token, &cursor, 0); + status = check_key_count_line666(keys_count, i, 3) + || action_line666(&i, keys, input, token, &cursor, 0); continue; } @@ -6561,7 +7078,7 @@ yy280: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line666: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line666: unused keys left after %u keys\n", i); } } @@ -6587,7 +7104,7 @@ end: #define YYFILL(n) { break; } static int action_line673 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6595,10 +7112,12 @@ static int action_line673 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6608,17 +7127,17 @@ static int action_line673 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line673: at position %ld (iteration %u):\n" + , "error: lex_line673: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6628,6 +7147,13 @@ static int action_line673 } } +static int check_key_count_line673(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line673: not enough keys\n"); + return 1; +} + int lex_line673() { const size_t padding = 1; /* YYMAXFILL */ @@ -6661,7 +7187,7 @@ int lex_line673() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line673.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6674,7 +7200,7 @@ int lex_line673() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6684,11 +7210,13 @@ int lex_line673() if (yych <= 0x00001FFF) goto yy286; yy284: YYSKIP (); - status = action_line673(i, keys, input, token, &cursor, 254); + status = check_key_count_line673(keys_count, i, 3) + || action_line673(&i, keys, input, token, &cursor, 254); continue; yy286: YYSKIP (); - status = action_line673(i, keys, input, token, &cursor, 0); + status = check_key_count_line673(keys_count, i, 3) + || action_line673(&i, keys, input, token, &cursor, 0); continue; } @@ -6700,7 +7228,7 @@ yy286: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line673: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line673: unused keys left after %u keys\n", i); } } @@ -6726,7 +7254,7 @@ end: #define YYFILL(n) { break; } static int action_line680 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6734,10 +7262,12 @@ static int action_line680 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6747,17 +7277,17 @@ static int action_line680 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line680: at position %ld (iteration %u):\n" + , "error: lex_line680: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6767,6 +7297,13 @@ static int action_line680 } } +static int check_key_count_line680(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line680: not enough keys\n"); + return 1; +} + int lex_line680() { const size_t padding = 1; /* YYMAXFILL */ @@ -6800,7 +7337,7 @@ int lex_line680() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line680.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6813,7 +7350,7 @@ int lex_line680() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6823,11 +7360,13 @@ int lex_line680() if (yych <= 0x0000206F) goto yy292; yy290: YYSKIP (); - status = action_line680(i, keys, input, token, &cursor, 254); + status = check_key_count_line680(keys_count, i, 3) + || action_line680(&i, keys, input, token, &cursor, 254); continue; yy292: YYSKIP (); - status = action_line680(i, keys, input, token, &cursor, 0); + status = check_key_count_line680(keys_count, i, 3) + || action_line680(&i, keys, input, token, &cursor, 0); continue; } @@ -6839,7 +7378,7 @@ yy292: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line680: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line680: unused keys left after %u keys\n", i); } } @@ -6865,7 +7404,7 @@ end: #define YYFILL(n) { break; } static int action_line687 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6873,10 +7412,12 @@ static int action_line687 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6886,17 +7427,17 @@ static int action_line687 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line687: at position %ld (iteration %u):\n" + , "error: lex_line687: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6906,6 +7447,13 @@ static int action_line687 } } +static int check_key_count_line687(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line687: not enough keys\n"); + return 1; +} + int lex_line687() { const size_t padding = 1; /* YYMAXFILL */ @@ -6939,7 +7487,7 @@ int lex_line687() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line687.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6952,7 +7500,7 @@ int lex_line687() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6962,11 +7510,13 @@ int lex_line687() if (yych <= 0x0000209F) goto yy298; yy296: YYSKIP (); - status = action_line687(i, keys, input, token, &cursor, 254); + status = check_key_count_line687(keys_count, i, 3) + || action_line687(&i, keys, input, token, &cursor, 254); continue; yy298: YYSKIP (); - status = action_line687(i, keys, input, token, &cursor, 0); + status = check_key_count_line687(keys_count, i, 3) + || action_line687(&i, keys, input, token, &cursor, 0); continue; } @@ -6978,7 +7528,7 @@ yy298: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line687: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line687: unused keys left after %u keys\n", i); } } @@ -7004,7 +7554,7 @@ end: #define YYFILL(n) { break; } static int action_line694 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7012,10 +7562,12 @@ static int action_line694 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7025,17 +7577,17 @@ static int action_line694 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line694: at position %ld (iteration %u):\n" + , "error: lex_line694: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7045,6 +7597,13 @@ static int action_line694 } } +static int check_key_count_line694(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line694: not enough keys\n"); + return 1; +} + int lex_line694() { const size_t padding = 1; /* YYMAXFILL */ @@ -7078,7 +7637,7 @@ int lex_line694() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line694.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7091,7 +7650,7 @@ int lex_line694() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7101,11 +7660,13 @@ int lex_line694() if (yych <= 0x000020CF) goto yy304; yy302: YYSKIP (); - status = action_line694(i, keys, input, token, &cursor, 254); + status = check_key_count_line694(keys_count, i, 3) + || action_line694(&i, keys, input, token, &cursor, 254); continue; yy304: YYSKIP (); - status = action_line694(i, keys, input, token, &cursor, 0); + status = check_key_count_line694(keys_count, i, 3) + || action_line694(&i, keys, input, token, &cursor, 0); continue; } @@ -7117,7 +7678,7 @@ yy304: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line694: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line694: unused keys left after %u keys\n", i); } } @@ -7143,7 +7704,7 @@ end: #define YYFILL(n) { break; } static int action_line701 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7151,10 +7712,12 @@ static int action_line701 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7164,17 +7727,17 @@ static int action_line701 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line701: at position %ld (iteration %u):\n" + , "error: lex_line701: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7184,6 +7747,13 @@ static int action_line701 } } +static int check_key_count_line701(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line701: not enough keys\n"); + return 1; +} + int lex_line701() { const size_t padding = 1; /* YYMAXFILL */ @@ -7217,7 +7787,7 @@ int lex_line701() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line701.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7230,7 +7800,7 @@ int lex_line701() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7240,11 +7810,13 @@ int lex_line701() if (yych <= 0x000020FF) goto yy310; yy308: YYSKIP (); - status = action_line701(i, keys, input, token, &cursor, 254); + status = check_key_count_line701(keys_count, i, 3) + || action_line701(&i, keys, input, token, &cursor, 254); continue; yy310: YYSKIP (); - status = action_line701(i, keys, input, token, &cursor, 0); + status = check_key_count_line701(keys_count, i, 3) + || action_line701(&i, keys, input, token, &cursor, 0); continue; } @@ -7256,7 +7828,7 @@ yy310: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line701: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line701: unused keys left after %u keys\n", i); } } @@ -7282,7 +7854,7 @@ end: #define YYFILL(n) { break; } static int action_line708 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7290,10 +7862,12 @@ static int action_line708 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7303,17 +7877,17 @@ static int action_line708 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line708: at position %ld (iteration %u):\n" + , "error: lex_line708: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7323,6 +7897,13 @@ static int action_line708 } } +static int check_key_count_line708(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line708: not enough keys\n"); + return 1; +} + int lex_line708() { const size_t padding = 1; /* YYMAXFILL */ @@ -7356,7 +7937,7 @@ int lex_line708() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line708.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7369,7 +7950,7 @@ int lex_line708() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7379,11 +7960,13 @@ int lex_line708() if (yych <= 0x0000214F) goto yy316; yy314: YYSKIP (); - status = action_line708(i, keys, input, token, &cursor, 254); + status = check_key_count_line708(keys_count, i, 3) + || action_line708(&i, keys, input, token, &cursor, 254); continue; yy316: YYSKIP (); - status = action_line708(i, keys, input, token, &cursor, 0); + status = check_key_count_line708(keys_count, i, 3) + || action_line708(&i, keys, input, token, &cursor, 0); continue; } @@ -7395,7 +7978,7 @@ yy316: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line708: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line708: unused keys left after %u keys\n", i); } } @@ -7421,7 +8004,7 @@ end: #define YYFILL(n) { break; } static int action_line715 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7429,10 +8012,12 @@ static int action_line715 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7442,17 +8027,17 @@ static int action_line715 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line715: at position %ld (iteration %u):\n" + , "error: lex_line715: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7462,6 +8047,13 @@ static int action_line715 } } +static int check_key_count_line715(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line715: not enough keys\n"); + return 1; +} + int lex_line715() { const size_t padding = 1; /* YYMAXFILL */ @@ -7495,7 +8087,7 @@ int lex_line715() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line715.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7508,7 +8100,7 @@ int lex_line715() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7518,11 +8110,13 @@ int lex_line715() if (yych <= 0x0000218F) goto yy322; yy320: YYSKIP (); - status = action_line715(i, keys, input, token, &cursor, 254); + status = check_key_count_line715(keys_count, i, 3) + || action_line715(&i, keys, input, token, &cursor, 254); continue; yy322: YYSKIP (); - status = action_line715(i, keys, input, token, &cursor, 0); + status = check_key_count_line715(keys_count, i, 3) + || action_line715(&i, keys, input, token, &cursor, 0); continue; } @@ -7534,7 +8128,7 @@ yy322: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line715: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line715: unused keys left after %u keys\n", i); } } @@ -7560,7 +8154,7 @@ end: #define YYFILL(n) { break; } static int action_line722 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7568,10 +8162,12 @@ static int action_line722 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7581,17 +8177,17 @@ static int action_line722 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line722: at position %ld (iteration %u):\n" + , "error: lex_line722: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7601,6 +8197,13 @@ static int action_line722 } } +static int check_key_count_line722(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line722: not enough keys\n"); + return 1; +} + int lex_line722() { const size_t padding = 1; /* YYMAXFILL */ @@ -7634,7 +8237,7 @@ int lex_line722() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line722.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7647,7 +8250,7 @@ int lex_line722() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7657,11 +8260,13 @@ int lex_line722() if (yych <= 0x000021FF) goto yy328; yy326: YYSKIP (); - status = action_line722(i, keys, input, token, &cursor, 254); + status = check_key_count_line722(keys_count, i, 3) + || action_line722(&i, keys, input, token, &cursor, 254); continue; yy328: YYSKIP (); - status = action_line722(i, keys, input, token, &cursor, 0); + status = check_key_count_line722(keys_count, i, 3) + || action_line722(&i, keys, input, token, &cursor, 0); continue; } @@ -7673,7 +8278,7 @@ yy328: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line722: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line722: unused keys left after %u keys\n", i); } } @@ -7699,7 +8304,7 @@ end: #define YYFILL(n) { break; } static int action_line729 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7707,10 +8312,12 @@ static int action_line729 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7720,17 +8327,17 @@ static int action_line729 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line729: at position %ld (iteration %u):\n" + , "error: lex_line729: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7740,6 +8347,13 @@ static int action_line729 } } +static int check_key_count_line729(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line729: not enough keys\n"); + return 1; +} + int lex_line729() { const size_t padding = 1; /* YYMAXFILL */ @@ -7773,7 +8387,7 @@ int lex_line729() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line729.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7786,7 +8400,7 @@ int lex_line729() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7796,11 +8410,13 @@ int lex_line729() if (yych <= 0x000022FF) goto yy334; yy332: YYSKIP (); - status = action_line729(i, keys, input, token, &cursor, 254); + status = check_key_count_line729(keys_count, i, 3) + || action_line729(&i, keys, input, token, &cursor, 254); continue; yy334: YYSKIP (); - status = action_line729(i, keys, input, token, &cursor, 0); + status = check_key_count_line729(keys_count, i, 3) + || action_line729(&i, keys, input, token, &cursor, 0); continue; } @@ -7812,7 +8428,7 @@ yy334: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line729: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line729: unused keys left after %u keys\n", i); } } @@ -7838,7 +8454,7 @@ end: #define YYFILL(n) { break; } static int action_line736 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7846,10 +8462,12 @@ static int action_line736 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7859,17 +8477,17 @@ static int action_line736 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line736: at position %ld (iteration %u):\n" + , "error: lex_line736: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7879,6 +8497,13 @@ static int action_line736 } } +static int check_key_count_line736(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line736: not enough keys\n"); + return 1; +} + int lex_line736() { const size_t padding = 1; /* YYMAXFILL */ @@ -7912,7 +8537,7 @@ int lex_line736() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line736.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7925,7 +8550,7 @@ int lex_line736() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7935,11 +8560,13 @@ int lex_line736() if (yych <= 0x000023FF) goto yy340; yy338: YYSKIP (); - status = action_line736(i, keys, input, token, &cursor, 254); + status = check_key_count_line736(keys_count, i, 3) + || action_line736(&i, keys, input, token, &cursor, 254); continue; yy340: YYSKIP (); - status = action_line736(i, keys, input, token, &cursor, 0); + status = check_key_count_line736(keys_count, i, 3) + || action_line736(&i, keys, input, token, &cursor, 0); continue; } @@ -7951,7 +8578,7 @@ yy340: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line736: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line736: unused keys left after %u keys\n", i); } } @@ -7977,7 +8604,7 @@ end: #define YYFILL(n) { break; } static int action_line743 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7985,10 +8612,12 @@ static int action_line743 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7998,17 +8627,17 @@ static int action_line743 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line743: at position %ld (iteration %u):\n" + , "error: lex_line743: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8018,6 +8647,13 @@ static int action_line743 } } +static int check_key_count_line743(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line743: not enough keys\n"); + return 1; +} + int lex_line743() { const size_t padding = 1; /* YYMAXFILL */ @@ -8051,7 +8687,7 @@ int lex_line743() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line743.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8064,7 +8700,7 @@ int lex_line743() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8074,11 +8710,13 @@ int lex_line743() if (yych <= 0x0000243F) goto yy346; yy344: YYSKIP (); - status = action_line743(i, keys, input, token, &cursor, 254); + status = check_key_count_line743(keys_count, i, 3) + || action_line743(&i, keys, input, token, &cursor, 254); continue; yy346: YYSKIP (); - status = action_line743(i, keys, input, token, &cursor, 0); + status = check_key_count_line743(keys_count, i, 3) + || action_line743(&i, keys, input, token, &cursor, 0); continue; } @@ -8090,7 +8728,7 @@ yy346: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line743: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line743: unused keys left after %u keys\n", i); } } @@ -8116,7 +8754,7 @@ end: #define YYFILL(n) { break; } static int action_line750 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8124,10 +8762,12 @@ static int action_line750 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8137,17 +8777,17 @@ static int action_line750 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line750: at position %ld (iteration %u):\n" + , "error: lex_line750: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8157,6 +8797,13 @@ static int action_line750 } } +static int check_key_count_line750(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line750: not enough keys\n"); + return 1; +} + int lex_line750() { const size_t padding = 1; /* YYMAXFILL */ @@ -8190,7 +8837,7 @@ int lex_line750() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line750.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8203,7 +8850,7 @@ int lex_line750() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8213,11 +8860,13 @@ int lex_line750() if (yych <= 0x0000245F) goto yy352; yy350: YYSKIP (); - status = action_line750(i, keys, input, token, &cursor, 254); + status = check_key_count_line750(keys_count, i, 3) + || action_line750(&i, keys, input, token, &cursor, 254); continue; yy352: YYSKIP (); - status = action_line750(i, keys, input, token, &cursor, 0); + status = check_key_count_line750(keys_count, i, 3) + || action_line750(&i, keys, input, token, &cursor, 0); continue; } @@ -8229,7 +8878,7 @@ yy352: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line750: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line750: unused keys left after %u keys\n", i); } } @@ -8255,7 +8904,7 @@ end: #define YYFILL(n) { break; } static int action_line757 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8263,10 +8912,12 @@ static int action_line757 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8276,17 +8927,17 @@ static int action_line757 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line757: at position %ld (iteration %u):\n" + , "error: lex_line757: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8296,6 +8947,13 @@ static int action_line757 } } +static int check_key_count_line757(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line757: not enough keys\n"); + return 1; +} + int lex_line757() { const size_t padding = 1; /* YYMAXFILL */ @@ -8329,7 +8987,7 @@ int lex_line757() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line757.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8342,7 +9000,7 @@ int lex_line757() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8352,11 +9010,13 @@ int lex_line757() if (yych <= 0x000024FF) goto yy358; yy356: YYSKIP (); - status = action_line757(i, keys, input, token, &cursor, 254); + status = check_key_count_line757(keys_count, i, 3) + || action_line757(&i, keys, input, token, &cursor, 254); continue; yy358: YYSKIP (); - status = action_line757(i, keys, input, token, &cursor, 0); + status = check_key_count_line757(keys_count, i, 3) + || action_line757(&i, keys, input, token, &cursor, 0); continue; } @@ -8368,7 +9028,7 @@ yy358: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line757: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line757: unused keys left after %u keys\n", i); } } @@ -8394,7 +9054,7 @@ end: #define YYFILL(n) { break; } static int action_line764 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8402,10 +9062,12 @@ static int action_line764 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8415,17 +9077,17 @@ static int action_line764 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line764: at position %ld (iteration %u):\n" + , "error: lex_line764: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8435,6 +9097,13 @@ static int action_line764 } } +static int check_key_count_line764(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line764: not enough keys\n"); + return 1; +} + int lex_line764() { const size_t padding = 1; /* YYMAXFILL */ @@ -8468,7 +9137,7 @@ int lex_line764() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line764.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8481,7 +9150,7 @@ int lex_line764() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8491,11 +9160,13 @@ int lex_line764() if (yych <= 0x0000257F) goto yy364; yy362: YYSKIP (); - status = action_line764(i, keys, input, token, &cursor, 254); + status = check_key_count_line764(keys_count, i, 3) + || action_line764(&i, keys, input, token, &cursor, 254); continue; yy364: YYSKIP (); - status = action_line764(i, keys, input, token, &cursor, 0); + status = check_key_count_line764(keys_count, i, 3) + || action_line764(&i, keys, input, token, &cursor, 0); continue; } @@ -8507,7 +9178,7 @@ yy364: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line764: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line764: unused keys left after %u keys\n", i); } } @@ -8533,7 +9204,7 @@ end: #define YYFILL(n) { break; } static int action_line771 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8541,10 +9212,12 @@ static int action_line771 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8554,17 +9227,17 @@ static int action_line771 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line771: at position %ld (iteration %u):\n" + , "error: lex_line771: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8574,6 +9247,13 @@ static int action_line771 } } +static int check_key_count_line771(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line771: not enough keys\n"); + return 1; +} + int lex_line771() { const size_t padding = 1; /* YYMAXFILL */ @@ -8607,7 +9287,7 @@ int lex_line771() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line771.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8620,7 +9300,7 @@ int lex_line771() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8630,11 +9310,13 @@ int lex_line771() if (yych <= 0x0000259F) goto yy370; yy368: YYSKIP (); - status = action_line771(i, keys, input, token, &cursor, 254); + status = check_key_count_line771(keys_count, i, 3) + || action_line771(&i, keys, input, token, &cursor, 254); continue; yy370: YYSKIP (); - status = action_line771(i, keys, input, token, &cursor, 0); + status = check_key_count_line771(keys_count, i, 3) + || action_line771(&i, keys, input, token, &cursor, 0); continue; } @@ -8646,7 +9328,7 @@ yy370: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line771: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line771: unused keys left after %u keys\n", i); } } @@ -8672,7 +9354,7 @@ end: #define YYFILL(n) { break; } static int action_line778 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8680,10 +9362,12 @@ static int action_line778 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8693,17 +9377,17 @@ static int action_line778 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line778: at position %ld (iteration %u):\n" + , "error: lex_line778: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8713,6 +9397,13 @@ static int action_line778 } } +static int check_key_count_line778(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line778: not enough keys\n"); + return 1; +} + int lex_line778() { const size_t padding = 1; /* YYMAXFILL */ @@ -8746,7 +9437,7 @@ int lex_line778() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line778.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8759,7 +9450,7 @@ int lex_line778() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8769,11 +9460,13 @@ int lex_line778() if (yych <= 0x000025FF) goto yy376; yy374: YYSKIP (); - status = action_line778(i, keys, input, token, &cursor, 254); + status = check_key_count_line778(keys_count, i, 3) + || action_line778(&i, keys, input, token, &cursor, 254); continue; yy376: YYSKIP (); - status = action_line778(i, keys, input, token, &cursor, 0); + status = check_key_count_line778(keys_count, i, 3) + || action_line778(&i, keys, input, token, &cursor, 0); continue; } @@ -8785,7 +9478,7 @@ yy376: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line778: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line778: unused keys left after %u keys\n", i); } } @@ -8811,7 +9504,7 @@ end: #define YYFILL(n) { break; } static int action_line785 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8819,10 +9512,12 @@ static int action_line785 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8832,17 +9527,17 @@ static int action_line785 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line785: at position %ld (iteration %u):\n" + , "error: lex_line785: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8852,6 +9547,13 @@ static int action_line785 } } +static int check_key_count_line785(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line785: not enough keys\n"); + return 1; +} + int lex_line785() { const size_t padding = 1; /* YYMAXFILL */ @@ -8885,7 +9587,7 @@ int lex_line785() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line785.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8898,7 +9600,7 @@ int lex_line785() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8908,11 +9610,13 @@ int lex_line785() if (yych <= 0x000026FF) goto yy382; yy380: YYSKIP (); - status = action_line785(i, keys, input, token, &cursor, 254); + status = check_key_count_line785(keys_count, i, 3) + || action_line785(&i, keys, input, token, &cursor, 254); continue; yy382: YYSKIP (); - status = action_line785(i, keys, input, token, &cursor, 0); + status = check_key_count_line785(keys_count, i, 3) + || action_line785(&i, keys, input, token, &cursor, 0); continue; } @@ -8924,7 +9628,7 @@ yy382: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line785: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line785: unused keys left after %u keys\n", i); } } @@ -8950,7 +9654,7 @@ end: #define YYFILL(n) { break; } static int action_line792 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8958,10 +9662,12 @@ static int action_line792 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8971,17 +9677,17 @@ static int action_line792 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line792: at position %ld (iteration %u):\n" + , "error: lex_line792: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8991,6 +9697,13 @@ static int action_line792 } } +static int check_key_count_line792(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line792: not enough keys\n"); + return 1; +} + int lex_line792() { const size_t padding = 1; /* YYMAXFILL */ @@ -9024,7 +9737,7 @@ int lex_line792() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line792.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9037,7 +9750,7 @@ int lex_line792() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9047,11 +9760,13 @@ int lex_line792() if (yych <= 0x000027BF) goto yy388; yy386: YYSKIP (); - status = action_line792(i, keys, input, token, &cursor, 254); + status = check_key_count_line792(keys_count, i, 3) + || action_line792(&i, keys, input, token, &cursor, 254); continue; yy388: YYSKIP (); - status = action_line792(i, keys, input, token, &cursor, 0); + status = check_key_count_line792(keys_count, i, 3) + || action_line792(&i, keys, input, token, &cursor, 0); continue; } @@ -9063,7 +9778,7 @@ yy388: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line792: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line792: unused keys left after %u keys\n", i); } } @@ -9089,7 +9804,7 @@ end: #define YYFILL(n) { break; } static int action_line799 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9097,10 +9812,12 @@ static int action_line799 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9110,17 +9827,17 @@ static int action_line799 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line799: at position %ld (iteration %u):\n" + , "error: lex_line799: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9130,6 +9847,13 @@ static int action_line799 } } +static int check_key_count_line799(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line799: not enough keys\n"); + return 1; +} + int lex_line799() { const size_t padding = 1; /* YYMAXFILL */ @@ -9163,7 +9887,7 @@ int lex_line799() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line799.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9176,7 +9900,7 @@ int lex_line799() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9186,11 +9910,13 @@ int lex_line799() if (yych <= 0x000027EF) goto yy394; yy392: YYSKIP (); - status = action_line799(i, keys, input, token, &cursor, 254); + status = check_key_count_line799(keys_count, i, 3) + || action_line799(&i, keys, input, token, &cursor, 254); continue; yy394: YYSKIP (); - status = action_line799(i, keys, input, token, &cursor, 0); + status = check_key_count_line799(keys_count, i, 3) + || action_line799(&i, keys, input, token, &cursor, 0); continue; } @@ -9202,7 +9928,7 @@ yy394: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line799: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line799: unused keys left after %u keys\n", i); } } @@ -9228,7 +9954,7 @@ end: #define YYFILL(n) { break; } static int action_line806 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9236,10 +9962,12 @@ static int action_line806 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9249,17 +9977,17 @@ static int action_line806 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line806: at position %ld (iteration %u):\n" + , "error: lex_line806: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9269,6 +9997,13 @@ static int action_line806 } } +static int check_key_count_line806(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line806: not enough keys\n"); + return 1; +} + int lex_line806() { const size_t padding = 1; /* YYMAXFILL */ @@ -9302,7 +10037,7 @@ int lex_line806() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line806.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9315,7 +10050,7 @@ int lex_line806() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9325,11 +10060,13 @@ int lex_line806() if (yych <= 0x000027FF) goto yy400; yy398: YYSKIP (); - status = action_line806(i, keys, input, token, &cursor, 254); + status = check_key_count_line806(keys_count, i, 3) + || action_line806(&i, keys, input, token, &cursor, 254); continue; yy400: YYSKIP (); - status = action_line806(i, keys, input, token, &cursor, 0); + status = check_key_count_line806(keys_count, i, 3) + || action_line806(&i, keys, input, token, &cursor, 0); continue; } @@ -9341,7 +10078,7 @@ yy400: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line806: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line806: unused keys left after %u keys\n", i); } } @@ -9367,7 +10104,7 @@ end: #define YYFILL(n) { break; } static int action_line813 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9375,10 +10112,12 @@ static int action_line813 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9388,17 +10127,17 @@ static int action_line813 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line813: at position %ld (iteration %u):\n" + , "error: lex_line813: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9408,6 +10147,13 @@ static int action_line813 } } +static int check_key_count_line813(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line813: not enough keys\n"); + return 1; +} + int lex_line813() { const size_t padding = 1; /* YYMAXFILL */ @@ -9441,7 +10187,7 @@ int lex_line813() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line813.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9454,7 +10200,7 @@ int lex_line813() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9464,11 +10210,13 @@ int lex_line813() if (yych <= 0x000028FF) goto yy406; yy404: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 254); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 254); continue; yy406: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 0); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 0); continue; } @@ -9480,7 +10228,7 @@ yy406: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line813: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line813: unused keys left after %u keys\n", i); } } @@ -9506,7 +10254,7 @@ end: #define YYFILL(n) { break; } static int action_line820 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9514,10 +10262,12 @@ static int action_line820 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9527,17 +10277,17 @@ static int action_line820 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line820: at position %ld (iteration %u):\n" + , "error: lex_line820: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9547,6 +10297,13 @@ static int action_line820 } } +static int check_key_count_line820(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line820: not enough keys\n"); + return 1; +} + int lex_line820() { const size_t padding = 1; /* YYMAXFILL */ @@ -9580,7 +10337,7 @@ int lex_line820() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line820.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9593,7 +10350,7 @@ int lex_line820() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9603,11 +10360,13 @@ int lex_line820() if (yych <= 0x0000297F) goto yy412; yy410: YYSKIP (); - status = action_line820(i, keys, input, token, &cursor, 254); + status = check_key_count_line820(keys_count, i, 3) + || action_line820(&i, keys, input, token, &cursor, 254); continue; yy412: YYSKIP (); - status = action_line820(i, keys, input, token, &cursor, 0); + status = check_key_count_line820(keys_count, i, 3) + || action_line820(&i, keys, input, token, &cursor, 0); continue; } @@ -9619,7 +10378,7 @@ yy412: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line820: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line820: unused keys left after %u keys\n", i); } } @@ -9645,7 +10404,7 @@ end: #define YYFILL(n) { break; } static int action_line827 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9653,10 +10412,12 @@ static int action_line827 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9666,17 +10427,17 @@ static int action_line827 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line827: at position %ld (iteration %u):\n" + , "error: lex_line827: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9686,6 +10447,13 @@ static int action_line827 } } +static int check_key_count_line827(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line827: not enough keys\n"); + return 1; +} + int lex_line827() { const size_t padding = 1; /* YYMAXFILL */ @@ -9719,7 +10487,7 @@ int lex_line827() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line827.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9732,7 +10500,7 @@ int lex_line827() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9742,11 +10510,13 @@ int lex_line827() if (yych <= 0x000029FF) goto yy418; yy416: YYSKIP (); - status = action_line827(i, keys, input, token, &cursor, 254); + status = check_key_count_line827(keys_count, i, 3) + || action_line827(&i, keys, input, token, &cursor, 254); continue; yy418: YYSKIP (); - status = action_line827(i, keys, input, token, &cursor, 0); + status = check_key_count_line827(keys_count, i, 3) + || action_line827(&i, keys, input, token, &cursor, 0); continue; } @@ -9758,7 +10528,7 @@ yy418: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line827: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line827: unused keys left after %u keys\n", i); } } @@ -9784,7 +10554,7 @@ end: #define YYFILL(n) { break; } static int action_line834 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9792,10 +10562,12 @@ static int action_line834 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9805,17 +10577,17 @@ static int action_line834 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line834: at position %ld (iteration %u):\n" + , "error: lex_line834: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9825,6 +10597,13 @@ static int action_line834 } } +static int check_key_count_line834(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line834: not enough keys\n"); + return 1; +} + int lex_line834() { const size_t padding = 1; /* YYMAXFILL */ @@ -9858,7 +10637,7 @@ int lex_line834() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line834.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9871,7 +10650,7 @@ int lex_line834() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9881,11 +10660,13 @@ int lex_line834() if (yych <= 0x00002AFF) goto yy424; yy422: YYSKIP (); - status = action_line834(i, keys, input, token, &cursor, 254); + status = check_key_count_line834(keys_count, i, 3) + || action_line834(&i, keys, input, token, &cursor, 254); continue; yy424: YYSKIP (); - status = action_line834(i, keys, input, token, &cursor, 0); + status = check_key_count_line834(keys_count, i, 3) + || action_line834(&i, keys, input, token, &cursor, 0); continue; } @@ -9897,7 +10678,7 @@ yy424: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line834: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line834: unused keys left after %u keys\n", i); } } @@ -9923,7 +10704,7 @@ end: #define YYFILL(n) { break; } static int action_line841 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9931,10 +10712,12 @@ static int action_line841 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9944,17 +10727,17 @@ static int action_line841 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line841: at position %ld (iteration %u):\n" + , "error: lex_line841: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9964,6 +10747,13 @@ static int action_line841 } } +static int check_key_count_line841(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line841: not enough keys\n"); + return 1; +} + int lex_line841() { const size_t padding = 1; /* YYMAXFILL */ @@ -9997,7 +10787,7 @@ int lex_line841() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line841.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10010,7 +10800,7 @@ int lex_line841() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10020,11 +10810,13 @@ int lex_line841() if (yych <= 0x00002BFF) goto yy430; yy428: YYSKIP (); - status = action_line841(i, keys, input, token, &cursor, 254); + status = check_key_count_line841(keys_count, i, 3) + || action_line841(&i, keys, input, token, &cursor, 254); continue; yy430: YYSKIP (); - status = action_line841(i, keys, input, token, &cursor, 0); + status = check_key_count_line841(keys_count, i, 3) + || action_line841(&i, keys, input, token, &cursor, 0); continue; } @@ -10036,7 +10828,7 @@ yy430: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line841: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line841: unused keys left after %u keys\n", i); } } @@ -10062,7 +10854,7 @@ end: #define YYFILL(n) { break; } static int action_line848 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10070,10 +10862,12 @@ static int action_line848 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10083,17 +10877,17 @@ static int action_line848 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line848: at position %ld (iteration %u):\n" + , "error: lex_line848: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10103,6 +10897,13 @@ static int action_line848 } } +static int check_key_count_line848(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line848: not enough keys\n"); + return 1; +} + int lex_line848() { const size_t padding = 1; /* YYMAXFILL */ @@ -10136,7 +10937,7 @@ int lex_line848() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line848.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10149,7 +10950,7 @@ int lex_line848() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10159,11 +10960,13 @@ int lex_line848() if (yych <= 0x00002EFF) goto yy436; yy434: YYSKIP (); - status = action_line848(i, keys, input, token, &cursor, 254); + status = check_key_count_line848(keys_count, i, 3) + || action_line848(&i, keys, input, token, &cursor, 254); continue; yy436: YYSKIP (); - status = action_line848(i, keys, input, token, &cursor, 0); + status = check_key_count_line848(keys_count, i, 3) + || action_line848(&i, keys, input, token, &cursor, 0); continue; } @@ -10175,7 +10978,7 @@ yy436: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line848: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line848: unused keys left after %u keys\n", i); } } @@ -10201,7 +11004,7 @@ end: #define YYFILL(n) { break; } static int action_line855 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10209,10 +11012,12 @@ static int action_line855 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10222,17 +11027,17 @@ static int action_line855 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line855: at position %ld (iteration %u):\n" + , "error: lex_line855: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10242,6 +11047,13 @@ static int action_line855 } } +static int check_key_count_line855(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line855: not enough keys\n"); + return 1; +} + int lex_line855() { const size_t padding = 1; /* YYMAXFILL */ @@ -10275,7 +11087,7 @@ int lex_line855() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line855.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10288,7 +11100,7 @@ int lex_line855() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10298,11 +11110,13 @@ int lex_line855() if (yych <= 0x00002FDF) goto yy442; yy440: YYSKIP (); - status = action_line855(i, keys, input, token, &cursor, 254); + status = check_key_count_line855(keys_count, i, 3) + || action_line855(&i, keys, input, token, &cursor, 254); continue; yy442: YYSKIP (); - status = action_line855(i, keys, input, token, &cursor, 0); + status = check_key_count_line855(keys_count, i, 3) + || action_line855(&i, keys, input, token, &cursor, 0); continue; } @@ -10314,7 +11128,7 @@ yy442: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line855: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line855: unused keys left after %u keys\n", i); } } @@ -10340,7 +11154,7 @@ end: #define YYFILL(n) { break; } static int action_line862 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10348,10 +11162,12 @@ static int action_line862 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10361,17 +11177,17 @@ static int action_line862 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line862: at position %ld (iteration %u):\n" + , "error: lex_line862: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10381,6 +11197,13 @@ static int action_line862 } } +static int check_key_count_line862(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line862: not enough keys\n"); + return 1; +} + int lex_line862() { const size_t padding = 1; /* YYMAXFILL */ @@ -10414,7 +11237,7 @@ int lex_line862() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line862.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10427,7 +11250,7 @@ int lex_line862() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10437,11 +11260,13 @@ int lex_line862() if (yych <= 0x00002FFF) goto yy448; yy446: YYSKIP (); - status = action_line862(i, keys, input, token, &cursor, 254); + status = check_key_count_line862(keys_count, i, 3) + || action_line862(&i, keys, input, token, &cursor, 254); continue; yy448: YYSKIP (); - status = action_line862(i, keys, input, token, &cursor, 0); + status = check_key_count_line862(keys_count, i, 3) + || action_line862(&i, keys, input, token, &cursor, 0); continue; } @@ -10453,7 +11278,7 @@ yy448: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line862: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line862: unused keys left after %u keys\n", i); } } @@ -10479,7 +11304,7 @@ end: #define YYFILL(n) { break; } static int action_line869 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10487,10 +11312,12 @@ static int action_line869 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10500,17 +11327,17 @@ static int action_line869 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line869: at position %ld (iteration %u):\n" + , "error: lex_line869: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10520,6 +11347,13 @@ static int action_line869 } } +static int check_key_count_line869(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line869: not enough keys\n"); + return 1; +} + int lex_line869() { const size_t padding = 1; /* YYMAXFILL */ @@ -10553,7 +11387,7 @@ int lex_line869() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line869.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10566,7 +11400,7 @@ int lex_line869() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10576,11 +11410,13 @@ int lex_line869() if (yych <= 0x0000303F) goto yy454; yy452: YYSKIP (); - status = action_line869(i, keys, input, token, &cursor, 254); + status = check_key_count_line869(keys_count, i, 3) + || action_line869(&i, keys, input, token, &cursor, 254); continue; yy454: YYSKIP (); - status = action_line869(i, keys, input, token, &cursor, 0); + status = check_key_count_line869(keys_count, i, 3) + || action_line869(&i, keys, input, token, &cursor, 0); continue; } @@ -10592,7 +11428,7 @@ yy454: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line869: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line869: unused keys left after %u keys\n", i); } } @@ -10618,7 +11454,7 @@ end: #define YYFILL(n) { break; } static int action_line876 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10626,10 +11462,12 @@ static int action_line876 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10639,17 +11477,17 @@ static int action_line876 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line876: at position %ld (iteration %u):\n" + , "error: lex_line876: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10659,6 +11497,13 @@ static int action_line876 } } +static int check_key_count_line876(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line876: not enough keys\n"); + return 1; +} + int lex_line876() { const size_t padding = 1; /* YYMAXFILL */ @@ -10692,7 +11537,7 @@ int lex_line876() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line876.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10705,7 +11550,7 @@ int lex_line876() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10715,11 +11560,13 @@ int lex_line876() if (yych <= 0x0000309F) goto yy460; yy458: YYSKIP (); - status = action_line876(i, keys, input, token, &cursor, 254); + status = check_key_count_line876(keys_count, i, 3) + || action_line876(&i, keys, input, token, &cursor, 254); continue; yy460: YYSKIP (); - status = action_line876(i, keys, input, token, &cursor, 0); + status = check_key_count_line876(keys_count, i, 3) + || action_line876(&i, keys, input, token, &cursor, 0); continue; } @@ -10731,7 +11578,7 @@ yy460: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line876: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line876: unused keys left after %u keys\n", i); } } @@ -10757,7 +11604,7 @@ end: #define YYFILL(n) { break; } static int action_line883 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10765,10 +11612,12 @@ static int action_line883 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10778,17 +11627,17 @@ static int action_line883 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line883: at position %ld (iteration %u):\n" + , "error: lex_line883: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10798,6 +11647,13 @@ static int action_line883 } } +static int check_key_count_line883(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line883: not enough keys\n"); + return 1; +} + int lex_line883() { const size_t padding = 1; /* YYMAXFILL */ @@ -10831,7 +11687,7 @@ int lex_line883() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line883.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10844,7 +11700,7 @@ int lex_line883() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10854,11 +11710,13 @@ int lex_line883() if (yych <= 0x000030FF) goto yy466; yy464: YYSKIP (); - status = action_line883(i, keys, input, token, &cursor, 254); + status = check_key_count_line883(keys_count, i, 3) + || action_line883(&i, keys, input, token, &cursor, 254); continue; yy466: YYSKIP (); - status = action_line883(i, keys, input, token, &cursor, 0); + status = check_key_count_line883(keys_count, i, 3) + || action_line883(&i, keys, input, token, &cursor, 0); continue; } @@ -10870,7 +11728,7 @@ yy466: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line883: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line883: unused keys left after %u keys\n", i); } } @@ -10896,7 +11754,7 @@ end: #define YYFILL(n) { break; } static int action_line890 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10904,10 +11762,12 @@ static int action_line890 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10917,17 +11777,17 @@ static int action_line890 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line890: at position %ld (iteration %u):\n" + , "error: lex_line890: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10937,6 +11797,13 @@ static int action_line890 } } +static int check_key_count_line890(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line890: not enough keys\n"); + return 1; +} + int lex_line890() { const size_t padding = 1; /* YYMAXFILL */ @@ -10970,7 +11837,7 @@ int lex_line890() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line890.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10983,7 +11850,7 @@ int lex_line890() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10993,11 +11860,13 @@ int lex_line890() if (yych <= 0x0000312F) goto yy472; yy470: YYSKIP (); - status = action_line890(i, keys, input, token, &cursor, 254); + status = check_key_count_line890(keys_count, i, 3) + || action_line890(&i, keys, input, token, &cursor, 254); continue; yy472: YYSKIP (); - status = action_line890(i, keys, input, token, &cursor, 0); + status = check_key_count_line890(keys_count, i, 3) + || action_line890(&i, keys, input, token, &cursor, 0); continue; } @@ -11009,7 +11878,7 @@ yy472: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line890: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line890: unused keys left after %u keys\n", i); } } @@ -11035,7 +11904,7 @@ end: #define YYFILL(n) { break; } static int action_line897 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11043,10 +11912,12 @@ static int action_line897 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11056,17 +11927,17 @@ static int action_line897 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line897: at position %ld (iteration %u):\n" + , "error: lex_line897: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11076,6 +11947,13 @@ static int action_line897 } } +static int check_key_count_line897(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line897: not enough keys\n"); + return 1; +} + int lex_line897() { const size_t padding = 1; /* YYMAXFILL */ @@ -11109,7 +11987,7 @@ int lex_line897() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line897.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11122,7 +12000,7 @@ int lex_line897() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11132,11 +12010,13 @@ int lex_line897() if (yych <= 0x0000318F) goto yy478; yy476: YYSKIP (); - status = action_line897(i, keys, input, token, &cursor, 254); + status = check_key_count_line897(keys_count, i, 3) + || action_line897(&i, keys, input, token, &cursor, 254); continue; yy478: YYSKIP (); - status = action_line897(i, keys, input, token, &cursor, 0); + status = check_key_count_line897(keys_count, i, 3) + || action_line897(&i, keys, input, token, &cursor, 0); continue; } @@ -11148,7 +12028,7 @@ yy478: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line897: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line897: unused keys left after %u keys\n", i); } } @@ -11174,7 +12054,7 @@ end: #define YYFILL(n) { break; } static int action_line904 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11182,10 +12062,12 @@ static int action_line904 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11195,17 +12077,17 @@ static int action_line904 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line904: at position %ld (iteration %u):\n" + , "error: lex_line904: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11215,6 +12097,13 @@ static int action_line904 } } +static int check_key_count_line904(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line904: not enough keys\n"); + return 1; +} + int lex_line904() { const size_t padding = 1; /* YYMAXFILL */ @@ -11248,7 +12137,7 @@ int lex_line904() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line904.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11261,7 +12150,7 @@ int lex_line904() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11271,11 +12160,13 @@ int lex_line904() if (yych <= 0x0000319F) goto yy484; yy482: YYSKIP (); - status = action_line904(i, keys, input, token, &cursor, 254); + status = check_key_count_line904(keys_count, i, 3) + || action_line904(&i, keys, input, token, &cursor, 254); continue; yy484: YYSKIP (); - status = action_line904(i, keys, input, token, &cursor, 0); + status = check_key_count_line904(keys_count, i, 3) + || action_line904(&i, keys, input, token, &cursor, 0); continue; } @@ -11287,7 +12178,7 @@ yy484: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line904: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line904: unused keys left after %u keys\n", i); } } @@ -11313,7 +12204,7 @@ end: #define YYFILL(n) { break; } static int action_line911 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11321,10 +12212,12 @@ static int action_line911 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11334,17 +12227,17 @@ static int action_line911 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line911: at position %ld (iteration %u):\n" + , "error: lex_line911: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11354,6 +12247,13 @@ static int action_line911 } } +static int check_key_count_line911(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line911: not enough keys\n"); + return 1; +} + int lex_line911() { const size_t padding = 1; /* YYMAXFILL */ @@ -11387,7 +12287,7 @@ int lex_line911() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line911.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11400,7 +12300,7 @@ int lex_line911() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11410,11 +12310,13 @@ int lex_line911() if (yych <= 0x000031BF) goto yy490; yy488: YYSKIP (); - status = action_line911(i, keys, input, token, &cursor, 254); + status = check_key_count_line911(keys_count, i, 3) + || action_line911(&i, keys, input, token, &cursor, 254); continue; yy490: YYSKIP (); - status = action_line911(i, keys, input, token, &cursor, 0); + status = check_key_count_line911(keys_count, i, 3) + || action_line911(&i, keys, input, token, &cursor, 0); continue; } @@ -11426,7 +12328,7 @@ yy490: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line911: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line911: unused keys left after %u keys\n", i); } } @@ -11452,7 +12354,7 @@ end: #define YYFILL(n) { break; } static int action_line918 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11460,10 +12362,12 @@ static int action_line918 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11473,17 +12377,17 @@ static int action_line918 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line918: at position %ld (iteration %u):\n" + , "error: lex_line918: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11493,6 +12397,13 @@ static int action_line918 } } +static int check_key_count_line918(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line918: not enough keys\n"); + return 1; +} + int lex_line918() { const size_t padding = 1; /* YYMAXFILL */ @@ -11526,7 +12437,7 @@ int lex_line918() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line918.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11539,7 +12450,7 @@ int lex_line918() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11549,11 +12460,13 @@ int lex_line918() if (yych <= 0x000031FF) goto yy496; yy494: YYSKIP (); - status = action_line918(i, keys, input, token, &cursor, 254); + status = check_key_count_line918(keys_count, i, 3) + || action_line918(&i, keys, input, token, &cursor, 254); continue; yy496: YYSKIP (); - status = action_line918(i, keys, input, token, &cursor, 0); + status = check_key_count_line918(keys_count, i, 3) + || action_line918(&i, keys, input, token, &cursor, 0); continue; } @@ -11565,7 +12478,7 @@ yy496: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line918: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line918: unused keys left after %u keys\n", i); } } @@ -11591,7 +12504,7 @@ end: #define YYFILL(n) { break; } static int action_line925 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11599,10 +12512,12 @@ static int action_line925 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11612,17 +12527,17 @@ static int action_line925 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line925: at position %ld (iteration %u):\n" + , "error: lex_line925: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11632,6 +12547,13 @@ static int action_line925 } } +static int check_key_count_line925(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line925: not enough keys\n"); + return 1; +} + int lex_line925() { const size_t padding = 1; /* YYMAXFILL */ @@ -11665,7 +12587,7 @@ int lex_line925() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line925.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11678,7 +12600,7 @@ int lex_line925() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11688,11 +12610,13 @@ int lex_line925() if (yych <= 0x000032FF) goto yy502; yy500: YYSKIP (); - status = action_line925(i, keys, input, token, &cursor, 254); + status = check_key_count_line925(keys_count, i, 3) + || action_line925(&i, keys, input, token, &cursor, 254); continue; yy502: YYSKIP (); - status = action_line925(i, keys, input, token, &cursor, 0); + status = check_key_count_line925(keys_count, i, 3) + || action_line925(&i, keys, input, token, &cursor, 0); continue; } @@ -11704,7 +12628,7 @@ yy502: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line925: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line925: unused keys left after %u keys\n", i); } } @@ -11730,7 +12654,7 @@ end: #define YYFILL(n) { break; } static int action_line932 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11738,10 +12662,12 @@ static int action_line932 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11751,17 +12677,17 @@ static int action_line932 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line932: at position %ld (iteration %u):\n" + , "error: lex_line932: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11771,6 +12697,13 @@ static int action_line932 } } +static int check_key_count_line932(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line932: not enough keys\n"); + return 1; +} + int lex_line932() { const size_t padding = 1; /* YYMAXFILL */ @@ -11804,7 +12737,7 @@ int lex_line932() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line932.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11817,7 +12750,7 @@ int lex_line932() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11827,11 +12760,13 @@ int lex_line932() if (yych <= 0x000033FF) goto yy508; yy506: YYSKIP (); - status = action_line932(i, keys, input, token, &cursor, 254); + status = check_key_count_line932(keys_count, i, 3) + || action_line932(&i, keys, input, token, &cursor, 254); continue; yy508: YYSKIP (); - status = action_line932(i, keys, input, token, &cursor, 0); + status = check_key_count_line932(keys_count, i, 3) + || action_line932(&i, keys, input, token, &cursor, 0); continue; } @@ -11843,7 +12778,7 @@ yy508: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line932: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line932: unused keys left after %u keys\n", i); } } @@ -11869,7 +12804,7 @@ end: #define YYFILL(n) { break; } static int action_line939 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11877,10 +12812,12 @@ static int action_line939 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11890,17 +12827,17 @@ static int action_line939 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line939: at position %ld (iteration %u):\n" + , "error: lex_line939: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11910,6 +12847,13 @@ static int action_line939 } } +static int check_key_count_line939(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line939: not enough keys\n"); + return 1; +} + int lex_line939() { const size_t padding = 1; /* YYMAXFILL */ @@ -11943,7 +12887,7 @@ int lex_line939() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line939.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11956,7 +12900,7 @@ int lex_line939() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11966,11 +12910,13 @@ int lex_line939() if (yych <= 0x00004DBF) goto yy514; yy512: YYSKIP (); - status = action_line939(i, keys, input, token, &cursor, 254); + status = check_key_count_line939(keys_count, i, 3) + || action_line939(&i, keys, input, token, &cursor, 254); continue; yy514: YYSKIP (); - status = action_line939(i, keys, input, token, &cursor, 0); + status = check_key_count_line939(keys_count, i, 3) + || action_line939(&i, keys, input, token, &cursor, 0); continue; } @@ -11982,7 +12928,7 @@ yy514: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line939: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line939: unused keys left after %u keys\n", i); } } @@ -12008,7 +12954,7 @@ end: #define YYFILL(n) { break; } static int action_line946 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12016,10 +12962,12 @@ static int action_line946 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12029,17 +12977,17 @@ static int action_line946 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line946: at position %ld (iteration %u):\n" + , "error: lex_line946: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12049,6 +12997,13 @@ static int action_line946 } } +static int check_key_count_line946(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line946: not enough keys\n"); + return 1; +} + int lex_line946() { const size_t padding = 1; /* YYMAXFILL */ @@ -12082,7 +13037,7 @@ int lex_line946() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line946.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12095,7 +13050,7 @@ int lex_line946() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12105,11 +13060,13 @@ int lex_line946() if (yych <= 0x00004DFF) goto yy520; yy518: YYSKIP (); - status = action_line946(i, keys, input, token, &cursor, 254); + status = check_key_count_line946(keys_count, i, 3) + || action_line946(&i, keys, input, token, &cursor, 254); continue; yy520: YYSKIP (); - status = action_line946(i, keys, input, token, &cursor, 0); + status = check_key_count_line946(keys_count, i, 3) + || action_line946(&i, keys, input, token, &cursor, 0); continue; } @@ -12121,7 +13078,7 @@ yy520: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line946: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line946: unused keys left after %u keys\n", i); } } @@ -12147,7 +13104,7 @@ end: #define YYFILL(n) { break; } static int action_line953 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12155,10 +13112,12 @@ static int action_line953 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12168,17 +13127,17 @@ static int action_line953 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line953: at position %ld (iteration %u):\n" + , "error: lex_line953: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12188,6 +13147,13 @@ static int action_line953 } } +static int check_key_count_line953(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line953: not enough keys\n"); + return 1; +} + int lex_line953() { const size_t padding = 1; /* YYMAXFILL */ @@ -12221,7 +13187,7 @@ int lex_line953() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line953.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12234,7 +13200,7 @@ int lex_line953() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12244,11 +13210,13 @@ int lex_line953() if (yych <= 0x00009FFF) goto yy526; yy524: YYSKIP (); - status = action_line953(i, keys, input, token, &cursor, 254); + status = check_key_count_line953(keys_count, i, 3) + || action_line953(&i, keys, input, token, &cursor, 254); continue; yy526: YYSKIP (); - status = action_line953(i, keys, input, token, &cursor, 0); + status = check_key_count_line953(keys_count, i, 3) + || action_line953(&i, keys, input, token, &cursor, 0); continue; } @@ -12260,7 +13228,7 @@ yy526: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line953: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line953: unused keys left after %u keys\n", i); } } @@ -12286,7 +13254,7 @@ end: #define YYFILL(n) { break; } static int action_line960 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12294,10 +13262,12 @@ static int action_line960 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12307,17 +13277,17 @@ static int action_line960 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line960: at position %ld (iteration %u):\n" + , "error: lex_line960: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12327,6 +13297,13 @@ static int action_line960 } } +static int check_key_count_line960(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line960: not enough keys\n"); + return 1; +} + int lex_line960() { const size_t padding = 1; /* YYMAXFILL */ @@ -12360,7 +13337,7 @@ int lex_line960() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line960.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12373,7 +13350,7 @@ int lex_line960() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12383,11 +13360,13 @@ int lex_line960() if (yych <= 0x0000A48F) goto yy532; yy530: YYSKIP (); - status = action_line960(i, keys, input, token, &cursor, 254); + status = check_key_count_line960(keys_count, i, 3) + || action_line960(&i, keys, input, token, &cursor, 254); continue; yy532: YYSKIP (); - status = action_line960(i, keys, input, token, &cursor, 0); + status = check_key_count_line960(keys_count, i, 3) + || action_line960(&i, keys, input, token, &cursor, 0); continue; } @@ -12399,7 +13378,7 @@ yy532: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line960: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line960: unused keys left after %u keys\n", i); } } @@ -12425,7 +13404,7 @@ end: #define YYFILL(n) { break; } static int action_line967 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12433,10 +13412,12 @@ static int action_line967 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12446,17 +13427,17 @@ static int action_line967 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line967: at position %ld (iteration %u):\n" + , "error: lex_line967: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12466,6 +13447,13 @@ static int action_line967 } } +static int check_key_count_line967(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line967: not enough keys\n"); + return 1; +} + int lex_line967() { const size_t padding = 1; /* YYMAXFILL */ @@ -12499,7 +13487,7 @@ int lex_line967() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line967.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12512,7 +13500,7 @@ int lex_line967() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12522,11 +13510,13 @@ int lex_line967() if (yych <= 0x0000A4CF) goto yy538; yy536: YYSKIP (); - status = action_line967(i, keys, input, token, &cursor, 254); + status = check_key_count_line967(keys_count, i, 3) + || action_line967(&i, keys, input, token, &cursor, 254); continue; yy538: YYSKIP (); - status = action_line967(i, keys, input, token, &cursor, 0); + status = check_key_count_line967(keys_count, i, 3) + || action_line967(&i, keys, input, token, &cursor, 0); continue; } @@ -12538,7 +13528,7 @@ yy538: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line967: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line967: unused keys left after %u keys\n", i); } } @@ -12564,7 +13554,7 @@ end: #define YYFILL(n) { break; } static int action_line974 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12572,10 +13562,12 @@ static int action_line974 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12585,17 +13577,17 @@ static int action_line974 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line974: at position %ld (iteration %u):\n" + , "error: lex_line974: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12605,6 +13597,13 @@ static int action_line974 } } +static int check_key_count_line974(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line974: not enough keys\n"); + return 1; +} + int lex_line974() { const size_t padding = 1; /* YYMAXFILL */ @@ -12638,7 +13637,7 @@ int lex_line974() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line974.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12651,7 +13650,7 @@ int lex_line974() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12661,11 +13660,13 @@ int lex_line974() if (yych <= 0x0000D7AF) goto yy544; yy542: YYSKIP (); - status = action_line974(i, keys, input, token, &cursor, 254); + status = check_key_count_line974(keys_count, i, 3) + || action_line974(&i, keys, input, token, &cursor, 254); continue; yy544: YYSKIP (); - status = action_line974(i, keys, input, token, &cursor, 0); + status = check_key_count_line974(keys_count, i, 3) + || action_line974(&i, keys, input, token, &cursor, 0); continue; } @@ -12677,7 +13678,7 @@ yy544: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line974: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line974: unused keys left after %u keys\n", i); } } @@ -12703,7 +13704,7 @@ end: #define YYFILL(n) { break; } static int action_line981 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12711,10 +13712,12 @@ static int action_line981 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12724,17 +13727,17 @@ static int action_line981 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line981: at position %ld (iteration %u):\n" + , "error: lex_line981: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12744,6 +13747,13 @@ static int action_line981 } } +static int check_key_count_line981(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line981: not enough keys\n"); + return 1; +} + int lex_line981() { const size_t padding = 1; /* YYMAXFILL */ @@ -12777,7 +13787,7 @@ int lex_line981() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line981.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12790,7 +13800,7 @@ int lex_line981() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12800,11 +13810,13 @@ int lex_line981() if (yych <= 0x0000DB7F) goto yy550; yy548: YYSKIP (); - status = action_line981(i, keys, input, token, &cursor, 254); + status = check_key_count_line981(keys_count, i, 3) + || action_line981(&i, keys, input, token, &cursor, 254); continue; yy550: YYSKIP (); - status = action_line981(i, keys, input, token, &cursor, 0); + status = check_key_count_line981(keys_count, i, 3) + || action_line981(&i, keys, input, token, &cursor, 0); continue; } @@ -12816,7 +13828,7 @@ yy550: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line981: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line981: unused keys left after %u keys\n", i); } } @@ -12842,7 +13854,7 @@ end: #define YYFILL(n) { break; } static int action_line988 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12850,10 +13862,12 @@ static int action_line988 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12863,17 +13877,17 @@ static int action_line988 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line988: at position %ld (iteration %u):\n" + , "error: lex_line988: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12883,6 +13897,13 @@ static int action_line988 } } +static int check_key_count_line988(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line988: not enough keys\n"); + return 1; +} + int lex_line988() { const size_t padding = 1; /* YYMAXFILL */ @@ -12916,7 +13937,7 @@ int lex_line988() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line988.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12929,7 +13950,7 @@ int lex_line988() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12939,11 +13960,13 @@ int lex_line988() if (yych <= 0x0000DBFF) goto yy556; yy554: YYSKIP (); - status = action_line988(i, keys, input, token, &cursor, 254); + status = check_key_count_line988(keys_count, i, 3) + || action_line988(&i, keys, input, token, &cursor, 254); continue; yy556: YYSKIP (); - status = action_line988(i, keys, input, token, &cursor, 0); + status = check_key_count_line988(keys_count, i, 3) + || action_line988(&i, keys, input, token, &cursor, 0); continue; } @@ -12955,7 +13978,7 @@ yy556: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line988: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line988: unused keys left after %u keys\n", i); } } @@ -12981,7 +14004,7 @@ end: #define YYFILL(n) { break; } static int action_line995 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12989,10 +14012,12 @@ static int action_line995 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13002,17 +14027,17 @@ static int action_line995 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line995: at position %ld (iteration %u):\n" + , "error: lex_line995: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13022,6 +14047,13 @@ static int action_line995 } } +static int check_key_count_line995(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line995: not enough keys\n"); + return 1; +} + int lex_line995() { const size_t padding = 1; /* YYMAXFILL */ @@ -13055,7 +14087,7 @@ int lex_line995() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line995.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13068,7 +14100,7 @@ int lex_line995() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13078,11 +14110,13 @@ int lex_line995() if (yych <= 0x0000DFFF) goto yy562; yy560: YYSKIP (); - status = action_line995(i, keys, input, token, &cursor, 254); + status = check_key_count_line995(keys_count, i, 3) + || action_line995(&i, keys, input, token, &cursor, 254); continue; yy562: YYSKIP (); - status = action_line995(i, keys, input, token, &cursor, 0); + status = check_key_count_line995(keys_count, i, 3) + || action_line995(&i, keys, input, token, &cursor, 0); continue; } @@ -13094,7 +14128,7 @@ yy562: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line995: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line995: unused keys left after %u keys\n", i); } } @@ -13120,7 +14154,7 @@ end: #define YYFILL(n) { break; } static int action_line1002 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13128,10 +14162,12 @@ static int action_line1002 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13141,17 +14177,17 @@ static int action_line1002 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1002: at position %ld (iteration %u):\n" + , "error: lex_line1002: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13161,6 +14197,13 @@ static int action_line1002 } } +static int check_key_count_line1002(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1002: not enough keys\n"); + return 1; +} + int lex_line1002() { const size_t padding = 1; /* YYMAXFILL */ @@ -13194,7 +14237,7 @@ int lex_line1002() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1002.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13207,7 +14250,7 @@ int lex_line1002() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13217,11 +14260,13 @@ int lex_line1002() if (yych <= 0x0000F8FF) goto yy568; yy566: YYSKIP (); - status = action_line1002(i, keys, input, token, &cursor, 254); + status = check_key_count_line1002(keys_count, i, 3) + || action_line1002(&i, keys, input, token, &cursor, 254); continue; yy568: YYSKIP (); - status = action_line1002(i, keys, input, token, &cursor, 0); + status = check_key_count_line1002(keys_count, i, 3) + || action_line1002(&i, keys, input, token, &cursor, 0); continue; } @@ -13233,7 +14278,7 @@ yy568: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1002: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1002: unused keys left after %u keys\n", i); } } @@ -13259,7 +14304,7 @@ end: #define YYFILL(n) { break; } static int action_line1009 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13267,10 +14312,12 @@ static int action_line1009 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13280,17 +14327,17 @@ static int action_line1009 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1009: at position %ld (iteration %u):\n" + , "error: lex_line1009: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13300,6 +14347,13 @@ static int action_line1009 } } +static int check_key_count_line1009(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1009: not enough keys\n"); + return 1; +} + int lex_line1009() { const size_t padding = 1; /* YYMAXFILL */ @@ -13333,7 +14387,7 @@ int lex_line1009() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1009.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13346,7 +14400,7 @@ int lex_line1009() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13356,11 +14410,13 @@ int lex_line1009() if (yych <= 0x0000FAFF) goto yy574; yy572: YYSKIP (); - status = action_line1009(i, keys, input, token, &cursor, 254); + status = check_key_count_line1009(keys_count, i, 3) + || action_line1009(&i, keys, input, token, &cursor, 254); continue; yy574: YYSKIP (); - status = action_line1009(i, keys, input, token, &cursor, 0); + status = check_key_count_line1009(keys_count, i, 3) + || action_line1009(&i, keys, input, token, &cursor, 0); continue; } @@ -13372,7 +14428,7 @@ yy574: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1009: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1009: unused keys left after %u keys\n", i); } } @@ -13398,7 +14454,7 @@ end: #define YYFILL(n) { break; } static int action_line1016 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13406,10 +14462,12 @@ static int action_line1016 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13419,17 +14477,17 @@ static int action_line1016 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1016: at position %ld (iteration %u):\n" + , "error: lex_line1016: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13439,6 +14497,13 @@ static int action_line1016 } } +static int check_key_count_line1016(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1016: not enough keys\n"); + return 1; +} + int lex_line1016() { const size_t padding = 1; /* YYMAXFILL */ @@ -13472,7 +14537,7 @@ int lex_line1016() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1016.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13485,7 +14550,7 @@ int lex_line1016() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13495,11 +14560,13 @@ int lex_line1016() if (yych <= 0x0000FB4F) goto yy580; yy578: YYSKIP (); - status = action_line1016(i, keys, input, token, &cursor, 254); + status = check_key_count_line1016(keys_count, i, 3) + || action_line1016(&i, keys, input, token, &cursor, 254); continue; yy580: YYSKIP (); - status = action_line1016(i, keys, input, token, &cursor, 0); + status = check_key_count_line1016(keys_count, i, 3) + || action_line1016(&i, keys, input, token, &cursor, 0); continue; } @@ -13511,7 +14578,7 @@ yy580: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1016: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1016: unused keys left after %u keys\n", i); } } @@ -13537,7 +14604,7 @@ end: #define YYFILL(n) { break; } static int action_line1023 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13545,10 +14612,12 @@ static int action_line1023 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13558,17 +14627,17 @@ static int action_line1023 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1023: at position %ld (iteration %u):\n" + , "error: lex_line1023: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13578,6 +14647,13 @@ static int action_line1023 } } +static int check_key_count_line1023(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1023: not enough keys\n"); + return 1; +} + int lex_line1023() { const size_t padding = 1; /* YYMAXFILL */ @@ -13611,7 +14687,7 @@ int lex_line1023() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1023.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13624,7 +14700,7 @@ int lex_line1023() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13634,11 +14710,13 @@ int lex_line1023() if (yych <= 0x0000FDFF) goto yy586; yy584: YYSKIP (); - status = action_line1023(i, keys, input, token, &cursor, 254); + status = check_key_count_line1023(keys_count, i, 3) + || action_line1023(&i, keys, input, token, &cursor, 254); continue; yy586: YYSKIP (); - status = action_line1023(i, keys, input, token, &cursor, 0); + status = check_key_count_line1023(keys_count, i, 3) + || action_line1023(&i, keys, input, token, &cursor, 0); continue; } @@ -13650,7 +14728,7 @@ yy586: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1023: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1023: unused keys left after %u keys\n", i); } } @@ -13676,7 +14754,7 @@ end: #define YYFILL(n) { break; } static int action_line1030 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13684,10 +14762,12 @@ static int action_line1030 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13697,17 +14777,17 @@ static int action_line1030 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1030: at position %ld (iteration %u):\n" + , "error: lex_line1030: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13717,6 +14797,13 @@ static int action_line1030 } } +static int check_key_count_line1030(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1030: not enough keys\n"); + return 1; +} + int lex_line1030() { const size_t padding = 1; /* YYMAXFILL */ @@ -13750,7 +14837,7 @@ int lex_line1030() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1030.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13763,7 +14850,7 @@ int lex_line1030() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13773,11 +14860,13 @@ int lex_line1030() if (yych <= 0x0000FE0F) goto yy592; yy590: YYSKIP (); - status = action_line1030(i, keys, input, token, &cursor, 254); + status = check_key_count_line1030(keys_count, i, 3) + || action_line1030(&i, keys, input, token, &cursor, 254); continue; yy592: YYSKIP (); - status = action_line1030(i, keys, input, token, &cursor, 0); + status = check_key_count_line1030(keys_count, i, 3) + || action_line1030(&i, keys, input, token, &cursor, 0); continue; } @@ -13789,7 +14878,7 @@ yy592: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1030: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1030: unused keys left after %u keys\n", i); } } @@ -13815,7 +14904,7 @@ end: #define YYFILL(n) { break; } static int action_line1037 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13823,10 +14912,12 @@ static int action_line1037 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13836,17 +14927,17 @@ static int action_line1037 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1037: at position %ld (iteration %u):\n" + , "error: lex_line1037: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13856,6 +14947,13 @@ static int action_line1037 } } +static int check_key_count_line1037(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1037: not enough keys\n"); + return 1; +} + int lex_line1037() { const size_t padding = 1; /* YYMAXFILL */ @@ -13889,7 +14987,7 @@ int lex_line1037() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1037.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13902,7 +15000,7 @@ int lex_line1037() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13912,11 +15010,13 @@ int lex_line1037() if (yych <= 0x0000FE2F) goto yy598; yy596: YYSKIP (); - status = action_line1037(i, keys, input, token, &cursor, 254); + status = check_key_count_line1037(keys_count, i, 3) + || action_line1037(&i, keys, input, token, &cursor, 254); continue; yy598: YYSKIP (); - status = action_line1037(i, keys, input, token, &cursor, 0); + status = check_key_count_line1037(keys_count, i, 3) + || action_line1037(&i, keys, input, token, &cursor, 0); continue; } @@ -13928,7 +15028,7 @@ yy598: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1037: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1037: unused keys left after %u keys\n", i); } } @@ -13954,7 +15054,7 @@ end: #define YYFILL(n) { break; } static int action_line1044 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13962,10 +15062,12 @@ static int action_line1044 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13975,17 +15077,17 @@ static int action_line1044 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1044: at position %ld (iteration %u):\n" + , "error: lex_line1044: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13995,6 +15097,13 @@ static int action_line1044 } } +static int check_key_count_line1044(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1044: not enough keys\n"); + return 1; +} + int lex_line1044() { const size_t padding = 1; /* YYMAXFILL */ @@ -14028,7 +15137,7 @@ int lex_line1044() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1044.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14041,7 +15150,7 @@ int lex_line1044() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14051,11 +15160,13 @@ int lex_line1044() if (yych <= 0x0000FE4F) goto yy604; yy602: YYSKIP (); - status = action_line1044(i, keys, input, token, &cursor, 254); + status = check_key_count_line1044(keys_count, i, 3) + || action_line1044(&i, keys, input, token, &cursor, 254); continue; yy604: YYSKIP (); - status = action_line1044(i, keys, input, token, &cursor, 0); + status = check_key_count_line1044(keys_count, i, 3) + || action_line1044(&i, keys, input, token, &cursor, 0); continue; } @@ -14067,7 +15178,7 @@ yy604: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1044: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1044: unused keys left after %u keys\n", i); } } @@ -14093,7 +15204,7 @@ end: #define YYFILL(n) { break; } static int action_line1051 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14101,10 +15212,12 @@ static int action_line1051 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14114,17 +15227,17 @@ static int action_line1051 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1051: at position %ld (iteration %u):\n" + , "error: lex_line1051: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14134,6 +15247,13 @@ static int action_line1051 } } +static int check_key_count_line1051(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1051: not enough keys\n"); + return 1; +} + int lex_line1051() { const size_t padding = 1; /* YYMAXFILL */ @@ -14167,7 +15287,7 @@ int lex_line1051() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1051.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14180,7 +15300,7 @@ int lex_line1051() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14190,11 +15310,13 @@ int lex_line1051() if (yych <= 0x0000FE6F) goto yy610; yy608: YYSKIP (); - status = action_line1051(i, keys, input, token, &cursor, 254); + status = check_key_count_line1051(keys_count, i, 3) + || action_line1051(&i, keys, input, token, &cursor, 254); continue; yy610: YYSKIP (); - status = action_line1051(i, keys, input, token, &cursor, 0); + status = check_key_count_line1051(keys_count, i, 3) + || action_line1051(&i, keys, input, token, &cursor, 0); continue; } @@ -14206,7 +15328,7 @@ yy610: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1051: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1051: unused keys left after %u keys\n", i); } } @@ -14232,7 +15354,7 @@ end: #define YYFILL(n) { break; } static int action_line1058 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14240,10 +15362,12 @@ static int action_line1058 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14253,17 +15377,17 @@ static int action_line1058 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1058: at position %ld (iteration %u):\n" + , "error: lex_line1058: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14273,6 +15397,13 @@ static int action_line1058 } } +static int check_key_count_line1058(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1058: not enough keys\n"); + return 1; +} + int lex_line1058() { const size_t padding = 1; /* YYMAXFILL */ @@ -14306,7 +15437,7 @@ int lex_line1058() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1058.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14319,7 +15450,7 @@ int lex_line1058() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14329,11 +15460,13 @@ int lex_line1058() if (yych <= 0x0000FEFF) goto yy616; yy614: YYSKIP (); - status = action_line1058(i, keys, input, token, &cursor, 254); + status = check_key_count_line1058(keys_count, i, 3) + || action_line1058(&i, keys, input, token, &cursor, 254); continue; yy616: YYSKIP (); - status = action_line1058(i, keys, input, token, &cursor, 0); + status = check_key_count_line1058(keys_count, i, 3) + || action_line1058(&i, keys, input, token, &cursor, 0); continue; } @@ -14345,7 +15478,7 @@ yy616: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1058: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1058: unused keys left after %u keys\n", i); } } @@ -14371,7 +15504,7 @@ end: #define YYFILL(n) { break; } static int action_line1065 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14379,10 +15512,12 @@ static int action_line1065 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14392,17 +15527,17 @@ static int action_line1065 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1065: at position %ld (iteration %u):\n" + , "error: lex_line1065: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14412,6 +15547,13 @@ static int action_line1065 } } +static int check_key_count_line1065(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1065: not enough keys\n"); + return 1; +} + int lex_line1065() { const size_t padding = 1; /* YYMAXFILL */ @@ -14445,7 +15587,7 @@ int lex_line1065() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1065.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14458,7 +15600,7 @@ int lex_line1065() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14468,11 +15610,13 @@ int lex_line1065() if (yych <= 0x0000FFEF) goto yy622; yy620: YYSKIP (); - status = action_line1065(i, keys, input, token, &cursor, 254); + status = check_key_count_line1065(keys_count, i, 3) + || action_line1065(&i, keys, input, token, &cursor, 254); continue; yy622: YYSKIP (); - status = action_line1065(i, keys, input, token, &cursor, 0); + status = check_key_count_line1065(keys_count, i, 3) + || action_line1065(&i, keys, input, token, &cursor, 0); continue; } @@ -14484,7 +15628,7 @@ yy622: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1065: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1065: unused keys left after %u keys\n", i); } } @@ -14510,7 +15654,7 @@ end: #define YYFILL(n) { break; } static int action_line1072 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14518,10 +15662,12 @@ static int action_line1072 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14531,17 +15677,17 @@ static int action_line1072 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1072: at position %ld (iteration %u):\n" + , "error: lex_line1072: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14551,6 +15697,13 @@ static int action_line1072 } } +static int check_key_count_line1072(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1072: not enough keys\n"); + return 1; +} + int lex_line1072() { const size_t padding = 1; /* YYMAXFILL */ @@ -14584,7 +15737,7 @@ int lex_line1072() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1072.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14597,7 +15750,7 @@ int lex_line1072() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14607,11 +15760,13 @@ int lex_line1072() if (yych <= 0x0000FFFF) goto yy628; yy626: YYSKIP (); - status = action_line1072(i, keys, input, token, &cursor, 254); + status = check_key_count_line1072(keys_count, i, 3) + || action_line1072(&i, keys, input, token, &cursor, 254); continue; yy628: YYSKIP (); - status = action_line1072(i, keys, input, token, &cursor, 0); + status = check_key_count_line1072(keys_count, i, 3) + || action_line1072(&i, keys, input, token, &cursor, 0); continue; } @@ -14623,7 +15778,7 @@ yy628: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1072: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1072: unused keys left after %u keys\n", i); } } @@ -14649,7 +15804,7 @@ end: #define YYFILL(n) { break; } static int action_line1079 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14657,10 +15812,12 @@ static int action_line1079 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14670,17 +15827,17 @@ static int action_line1079 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1079: at position %ld (iteration %u):\n" + , "error: lex_line1079: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14690,6 +15847,13 @@ static int action_line1079 } } +static int check_key_count_line1079(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1079: not enough keys\n"); + return 1; +} + int lex_line1079() { const size_t padding = 1; /* YYMAXFILL */ @@ -14723,7 +15887,7 @@ int lex_line1079() keys = (YYKEYTYPE *) read_file ("unicode_blocks.u--skeleton--encoding-policy(ignore).c.line1079.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14736,7 +15900,7 @@ int lex_line1079() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14785,11 +15949,13 @@ int lex_line1079() } yy632: YYSKIP (); - status = action_line1079(i, keys, input, token, &cursor, 0); + status = check_key_count_line1079(keys_count, i, 3) + || action_line1079(&i, keys, input, token, &cursor, 0); continue; yy634: YYSKIP (); - status = action_line1079(i, keys, input, token, &cursor, 254); + status = check_key_count_line1079(keys_count, i, 3) + || action_line1079(&i, keys, input, token, &cursor, 254); continue; } @@ -14801,7 +15967,7 @@ yy634: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1079: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1079: unused keys left after %u keys\n", i); } } diff --git a/re2c/test/unicode_blocks.x--skeleton--encoding-policy(ignore).c b/re2c/test/unicode_blocks.x--skeleton--encoding-policy(ignore).c index ed0ac52e..6021cfee 100644 --- a/re2c/test/unicode_blocks.x--skeleton--encoding-policy(ignore).c +++ b/re2c/test/unicode_blocks.x--skeleton--encoding-policy(ignore).c @@ -56,7 +56,7 @@ error: #define YYFILL(n) { break; } static int action_line344 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -64,10 +64,12 @@ static int action_line344 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -77,17 +79,17 @@ static int action_line344 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line344: at position %ld (iteration %u):\n" + , "error: lex_line344: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -97,6 +99,13 @@ static int action_line344 } } +static int check_key_count_line344(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line344: not enough keys\n"); + return 1; +} + int lex_line344() { const size_t padding = 1; /* YYMAXFILL */ @@ -130,7 +139,7 @@ int lex_line344() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line344.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -143,7 +152,7 @@ int lex_line344() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -151,11 +160,13 @@ int lex_line344() yych = YYPEEK (); if (yych >= 0x0080) goto yy4; YYSKIP (); - status = action_line344(i, keys, input, token, &cursor, 0); + status = check_key_count_line344(keys_count, i, 3) + || action_line344(&i, keys, input, token, &cursor, 0); continue; yy4: YYSKIP (); - status = action_line344(i, keys, input, token, &cursor, 254); + status = check_key_count_line344(keys_count, i, 3) + || action_line344(&i, keys, input, token, &cursor, 254); continue; } @@ -167,7 +178,7 @@ yy4: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line344: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line344: unused keys left after %u keys\n", i); } } @@ -193,7 +204,7 @@ end: #define YYFILL(n) { break; } static int action_line351 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -201,10 +212,12 @@ static int action_line351 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -214,17 +227,17 @@ static int action_line351 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line351: at position %ld (iteration %u):\n" + , "error: lex_line351: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -234,6 +247,13 @@ static int action_line351 } } +static int check_key_count_line351(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line351: not enough keys\n"); + return 1; +} + int lex_line351() { const size_t padding = 1; /* YYMAXFILL */ @@ -267,7 +287,7 @@ int lex_line351() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line351.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -280,7 +300,7 @@ int lex_line351() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -290,11 +310,13 @@ int lex_line351() if (yych <= 0x00FF) goto yy10; yy8: YYSKIP (); - status = action_line351(i, keys, input, token, &cursor, 254); + status = check_key_count_line351(keys_count, i, 3) + || action_line351(&i, keys, input, token, &cursor, 254); continue; yy10: YYSKIP (); - status = action_line351(i, keys, input, token, &cursor, 0); + status = check_key_count_line351(keys_count, i, 3) + || action_line351(&i, keys, input, token, &cursor, 0); continue; } @@ -306,7 +328,7 @@ yy10: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line351: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line351: unused keys left after %u keys\n", i); } } @@ -332,7 +354,7 @@ end: #define YYFILL(n) { break; } static int action_line358 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -340,10 +362,12 @@ static int action_line358 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -353,17 +377,17 @@ static int action_line358 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line358: at position %ld (iteration %u):\n" + , "error: lex_line358: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -373,6 +397,13 @@ static int action_line358 } } +static int check_key_count_line358(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line358: not enough keys\n"); + return 1; +} + int lex_line358() { const size_t padding = 1; /* YYMAXFILL */ @@ -406,7 +437,7 @@ int lex_line358() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line358.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -419,7 +450,7 @@ int lex_line358() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -429,11 +460,13 @@ int lex_line358() if (yych <= 0x017F) goto yy16; yy14: YYSKIP (); - status = action_line358(i, keys, input, token, &cursor, 254); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 254); continue; yy16: YYSKIP (); - status = action_line358(i, keys, input, token, &cursor, 0); + status = check_key_count_line358(keys_count, i, 3) + || action_line358(&i, keys, input, token, &cursor, 0); continue; } @@ -445,7 +478,7 @@ yy16: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line358: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line358: unused keys left after %u keys\n", i); } } @@ -471,7 +504,7 @@ end: #define YYFILL(n) { break; } static int action_line365 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -479,10 +512,12 @@ static int action_line365 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -492,17 +527,17 @@ static int action_line365 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line365: at position %ld (iteration %u):\n" + , "error: lex_line365: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -512,6 +547,13 @@ static int action_line365 } } +static int check_key_count_line365(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line365: not enough keys\n"); + return 1; +} + int lex_line365() { const size_t padding = 1; /* YYMAXFILL */ @@ -545,7 +587,7 @@ int lex_line365() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line365.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -558,7 +600,7 @@ int lex_line365() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -568,11 +610,13 @@ int lex_line365() if (yych <= 0x024F) goto yy22; yy20: YYSKIP (); - status = action_line365(i, keys, input, token, &cursor, 254); + status = check_key_count_line365(keys_count, i, 3) + || action_line365(&i, keys, input, token, &cursor, 254); continue; yy22: YYSKIP (); - status = action_line365(i, keys, input, token, &cursor, 0); + status = check_key_count_line365(keys_count, i, 3) + || action_line365(&i, keys, input, token, &cursor, 0); continue; } @@ -584,7 +628,7 @@ yy22: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line365: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line365: unused keys left after %u keys\n", i); } } @@ -610,7 +654,7 @@ end: #define YYFILL(n) { break; } static int action_line372 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -618,10 +662,12 @@ static int action_line372 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -631,17 +677,17 @@ static int action_line372 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line372: at position %ld (iteration %u):\n" + , "error: lex_line372: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -651,6 +697,13 @@ static int action_line372 } } +static int check_key_count_line372(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line372: not enough keys\n"); + return 1; +} + int lex_line372() { const size_t padding = 1; /* YYMAXFILL */ @@ -684,7 +737,7 @@ int lex_line372() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line372.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -697,7 +750,7 @@ int lex_line372() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -707,11 +760,13 @@ int lex_line372() if (yych <= 0x02AF) goto yy28; yy26: YYSKIP (); - status = action_line372(i, keys, input, token, &cursor, 254); + status = check_key_count_line372(keys_count, i, 3) + || action_line372(&i, keys, input, token, &cursor, 254); continue; yy28: YYSKIP (); - status = action_line372(i, keys, input, token, &cursor, 0); + status = check_key_count_line372(keys_count, i, 3) + || action_line372(&i, keys, input, token, &cursor, 0); continue; } @@ -723,7 +778,7 @@ yy28: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line372: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line372: unused keys left after %u keys\n", i); } } @@ -749,7 +804,7 @@ end: #define YYFILL(n) { break; } static int action_line379 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -757,10 +812,12 @@ static int action_line379 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -770,17 +827,17 @@ static int action_line379 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line379: at position %ld (iteration %u):\n" + , "error: lex_line379: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -790,6 +847,13 @@ static int action_line379 } } +static int check_key_count_line379(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line379: not enough keys\n"); + return 1; +} + int lex_line379() { const size_t padding = 1; /* YYMAXFILL */ @@ -823,7 +887,7 @@ int lex_line379() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line379.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -836,7 +900,7 @@ int lex_line379() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -846,11 +910,13 @@ int lex_line379() if (yych <= 0x02FF) goto yy34; yy32: YYSKIP (); - status = action_line379(i, keys, input, token, &cursor, 254); + status = check_key_count_line379(keys_count, i, 3) + || action_line379(&i, keys, input, token, &cursor, 254); continue; yy34: YYSKIP (); - status = action_line379(i, keys, input, token, &cursor, 0); + status = check_key_count_line379(keys_count, i, 3) + || action_line379(&i, keys, input, token, &cursor, 0); continue; } @@ -862,7 +928,7 @@ yy34: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line379: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line379: unused keys left after %u keys\n", i); } } @@ -888,7 +954,7 @@ end: #define YYFILL(n) { break; } static int action_line386 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -896,10 +962,12 @@ static int action_line386 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -909,17 +977,17 @@ static int action_line386 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line386: at position %ld (iteration %u):\n" + , "error: lex_line386: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -929,6 +997,13 @@ static int action_line386 } } +static int check_key_count_line386(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line386: not enough keys\n"); + return 1; +} + int lex_line386() { const size_t padding = 1; /* YYMAXFILL */ @@ -962,7 +1037,7 @@ int lex_line386() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line386.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -975,7 +1050,7 @@ int lex_line386() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -985,11 +1060,13 @@ int lex_line386() if (yych <= 0x036F) goto yy40; yy38: YYSKIP (); - status = action_line386(i, keys, input, token, &cursor, 254); + status = check_key_count_line386(keys_count, i, 3) + || action_line386(&i, keys, input, token, &cursor, 254); continue; yy40: YYSKIP (); - status = action_line386(i, keys, input, token, &cursor, 0); + status = check_key_count_line386(keys_count, i, 3) + || action_line386(&i, keys, input, token, &cursor, 0); continue; } @@ -1001,7 +1078,7 @@ yy40: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line386: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line386: unused keys left after %u keys\n", i); } } @@ -1027,7 +1104,7 @@ end: #define YYFILL(n) { break; } static int action_line393 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1035,10 +1112,12 @@ static int action_line393 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1048,17 +1127,17 @@ static int action_line393 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line393: at position %ld (iteration %u):\n" + , "error: lex_line393: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1068,6 +1147,13 @@ static int action_line393 } } +static int check_key_count_line393(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line393: not enough keys\n"); + return 1; +} + int lex_line393() { const size_t padding = 1; /* YYMAXFILL */ @@ -1101,7 +1187,7 @@ int lex_line393() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line393.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1114,7 +1200,7 @@ int lex_line393() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1124,11 +1210,13 @@ int lex_line393() if (yych <= 0x03FF) goto yy46; yy44: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 254); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 254); continue; yy46: YYSKIP (); - status = action_line393(i, keys, input, token, &cursor, 0); + status = check_key_count_line393(keys_count, i, 3) + || action_line393(&i, keys, input, token, &cursor, 0); continue; } @@ -1140,7 +1228,7 @@ yy46: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line393: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line393: unused keys left after %u keys\n", i); } } @@ -1166,7 +1254,7 @@ end: #define YYFILL(n) { break; } static int action_line400 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1174,10 +1262,12 @@ static int action_line400 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1187,17 +1277,17 @@ static int action_line400 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line400: at position %ld (iteration %u):\n" + , "error: lex_line400: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1207,6 +1297,13 @@ static int action_line400 } } +static int check_key_count_line400(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line400: not enough keys\n"); + return 1; +} + int lex_line400() { const size_t padding = 1; /* YYMAXFILL */ @@ -1240,7 +1337,7 @@ int lex_line400() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line400.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1253,7 +1350,7 @@ int lex_line400() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1263,11 +1360,13 @@ int lex_line400() if (yych <= 0x04FF) goto yy52; yy50: YYSKIP (); - status = action_line400(i, keys, input, token, &cursor, 254); + status = check_key_count_line400(keys_count, i, 3) + || action_line400(&i, keys, input, token, &cursor, 254); continue; yy52: YYSKIP (); - status = action_line400(i, keys, input, token, &cursor, 0); + status = check_key_count_line400(keys_count, i, 3) + || action_line400(&i, keys, input, token, &cursor, 0); continue; } @@ -1279,7 +1378,7 @@ yy52: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line400: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line400: unused keys left after %u keys\n", i); } } @@ -1305,7 +1404,7 @@ end: #define YYFILL(n) { break; } static int action_line407 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1313,10 +1412,12 @@ static int action_line407 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1326,17 +1427,17 @@ static int action_line407 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line407: at position %ld (iteration %u):\n" + , "error: lex_line407: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1346,6 +1447,13 @@ static int action_line407 } } +static int check_key_count_line407(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line407: not enough keys\n"); + return 1; +} + int lex_line407() { const size_t padding = 1; /* YYMAXFILL */ @@ -1379,7 +1487,7 @@ int lex_line407() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line407.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1392,7 +1500,7 @@ int lex_line407() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1402,11 +1510,13 @@ int lex_line407() if (yych <= 0x052F) goto yy58; yy56: YYSKIP (); - status = action_line407(i, keys, input, token, &cursor, 254); + status = check_key_count_line407(keys_count, i, 3) + || action_line407(&i, keys, input, token, &cursor, 254); continue; yy58: YYSKIP (); - status = action_line407(i, keys, input, token, &cursor, 0); + status = check_key_count_line407(keys_count, i, 3) + || action_line407(&i, keys, input, token, &cursor, 0); continue; } @@ -1418,7 +1528,7 @@ yy58: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line407: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line407: unused keys left after %u keys\n", i); } } @@ -1444,7 +1554,7 @@ end: #define YYFILL(n) { break; } static int action_line414 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1452,10 +1562,12 @@ static int action_line414 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1465,17 +1577,17 @@ static int action_line414 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line414: at position %ld (iteration %u):\n" + , "error: lex_line414: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1485,6 +1597,13 @@ static int action_line414 } } +static int check_key_count_line414(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line414: not enough keys\n"); + return 1; +} + int lex_line414() { const size_t padding = 1; /* YYMAXFILL */ @@ -1518,7 +1637,7 @@ int lex_line414() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line414.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1531,7 +1650,7 @@ int lex_line414() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1541,11 +1660,13 @@ int lex_line414() if (yych <= 0x058F) goto yy64; yy62: YYSKIP (); - status = action_line414(i, keys, input, token, &cursor, 254); + status = check_key_count_line414(keys_count, i, 3) + || action_line414(&i, keys, input, token, &cursor, 254); continue; yy64: YYSKIP (); - status = action_line414(i, keys, input, token, &cursor, 0); + status = check_key_count_line414(keys_count, i, 3) + || action_line414(&i, keys, input, token, &cursor, 0); continue; } @@ -1557,7 +1678,7 @@ yy64: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line414: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line414: unused keys left after %u keys\n", i); } } @@ -1583,7 +1704,7 @@ end: #define YYFILL(n) { break; } static int action_line421 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1591,10 +1712,12 @@ static int action_line421 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1604,17 +1727,17 @@ static int action_line421 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line421: at position %ld (iteration %u):\n" + , "error: lex_line421: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1624,6 +1747,13 @@ static int action_line421 } } +static int check_key_count_line421(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line421: not enough keys\n"); + return 1; +} + int lex_line421() { const size_t padding = 1; /* YYMAXFILL */ @@ -1657,7 +1787,7 @@ int lex_line421() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line421.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1670,7 +1800,7 @@ int lex_line421() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1680,11 +1810,13 @@ int lex_line421() if (yych <= 0x05FF) goto yy70; yy68: YYSKIP (); - status = action_line421(i, keys, input, token, &cursor, 254); + status = check_key_count_line421(keys_count, i, 3) + || action_line421(&i, keys, input, token, &cursor, 254); continue; yy70: YYSKIP (); - status = action_line421(i, keys, input, token, &cursor, 0); + status = check_key_count_line421(keys_count, i, 3) + || action_line421(&i, keys, input, token, &cursor, 0); continue; } @@ -1696,7 +1828,7 @@ yy70: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line421: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line421: unused keys left after %u keys\n", i); } } @@ -1722,7 +1854,7 @@ end: #define YYFILL(n) { break; } static int action_line428 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1730,10 +1862,12 @@ static int action_line428 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1743,17 +1877,17 @@ static int action_line428 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line428: at position %ld (iteration %u):\n" + , "error: lex_line428: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1763,6 +1897,13 @@ static int action_line428 } } +static int check_key_count_line428(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line428: not enough keys\n"); + return 1; +} + int lex_line428() { const size_t padding = 1; /* YYMAXFILL */ @@ -1796,7 +1937,7 @@ int lex_line428() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line428.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1809,7 +1950,7 @@ int lex_line428() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1819,11 +1960,13 @@ int lex_line428() if (yych <= 0x06FF) goto yy76; yy74: YYSKIP (); - status = action_line428(i, keys, input, token, &cursor, 254); + status = check_key_count_line428(keys_count, i, 3) + || action_line428(&i, keys, input, token, &cursor, 254); continue; yy76: YYSKIP (); - status = action_line428(i, keys, input, token, &cursor, 0); + status = check_key_count_line428(keys_count, i, 3) + || action_line428(&i, keys, input, token, &cursor, 0); continue; } @@ -1835,7 +1978,7 @@ yy76: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line428: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line428: unused keys left after %u keys\n", i); } } @@ -1861,7 +2004,7 @@ end: #define YYFILL(n) { break; } static int action_line435 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -1869,10 +2012,12 @@ static int action_line435 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -1882,17 +2027,17 @@ static int action_line435 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line435: at position %ld (iteration %u):\n" + , "error: lex_line435: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -1902,6 +2047,13 @@ static int action_line435 } } +static int check_key_count_line435(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line435: not enough keys\n"); + return 1; +} + int lex_line435() { const size_t padding = 1; /* YYMAXFILL */ @@ -1935,7 +2087,7 @@ int lex_line435() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line435.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -1948,7 +2100,7 @@ int lex_line435() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -1958,11 +2110,13 @@ int lex_line435() if (yych <= 0x074F) goto yy82; yy80: YYSKIP (); - status = action_line435(i, keys, input, token, &cursor, 254); + status = check_key_count_line435(keys_count, i, 3) + || action_line435(&i, keys, input, token, &cursor, 254); continue; yy82: YYSKIP (); - status = action_line435(i, keys, input, token, &cursor, 0); + status = check_key_count_line435(keys_count, i, 3) + || action_line435(&i, keys, input, token, &cursor, 0); continue; } @@ -1974,7 +2128,7 @@ yy82: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line435: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line435: unused keys left after %u keys\n", i); } } @@ -2000,7 +2154,7 @@ end: #define YYFILL(n) { break; } static int action_line442 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2008,10 +2162,12 @@ static int action_line442 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2021,17 +2177,17 @@ static int action_line442 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line442: at position %ld (iteration %u):\n" + , "error: lex_line442: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2041,6 +2197,13 @@ static int action_line442 } } +static int check_key_count_line442(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line442: not enough keys\n"); + return 1; +} + int lex_line442() { const size_t padding = 1; /* YYMAXFILL */ @@ -2074,7 +2237,7 @@ int lex_line442() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line442.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2087,7 +2250,7 @@ int lex_line442() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2097,11 +2260,13 @@ int lex_line442() if (yych <= 0x07BF) goto yy88; yy86: YYSKIP (); - status = action_line442(i, keys, input, token, &cursor, 254); + status = check_key_count_line442(keys_count, i, 3) + || action_line442(&i, keys, input, token, &cursor, 254); continue; yy88: YYSKIP (); - status = action_line442(i, keys, input, token, &cursor, 0); + status = check_key_count_line442(keys_count, i, 3) + || action_line442(&i, keys, input, token, &cursor, 0); continue; } @@ -2113,7 +2278,7 @@ yy88: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line442: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line442: unused keys left after %u keys\n", i); } } @@ -2139,7 +2304,7 @@ end: #define YYFILL(n) { break; } static int action_line449 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2147,10 +2312,12 @@ static int action_line449 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2160,17 +2327,17 @@ static int action_line449 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line449: at position %ld (iteration %u):\n" + , "error: lex_line449: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2180,6 +2347,13 @@ static int action_line449 } } +static int check_key_count_line449(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line449: not enough keys\n"); + return 1; +} + int lex_line449() { const size_t padding = 1; /* YYMAXFILL */ @@ -2213,7 +2387,7 @@ int lex_line449() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line449.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2226,7 +2400,7 @@ int lex_line449() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2236,11 +2410,13 @@ int lex_line449() if (yych <= 0x097F) goto yy94; yy92: YYSKIP (); - status = action_line449(i, keys, input, token, &cursor, 254); + status = check_key_count_line449(keys_count, i, 3) + || action_line449(&i, keys, input, token, &cursor, 254); continue; yy94: YYSKIP (); - status = action_line449(i, keys, input, token, &cursor, 0); + status = check_key_count_line449(keys_count, i, 3) + || action_line449(&i, keys, input, token, &cursor, 0); continue; } @@ -2252,7 +2428,7 @@ yy94: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line449: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line449: unused keys left after %u keys\n", i); } } @@ -2278,7 +2454,7 @@ end: #define YYFILL(n) { break; } static int action_line456 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2286,10 +2462,12 @@ static int action_line456 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2299,17 +2477,17 @@ static int action_line456 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line456: at position %ld (iteration %u):\n" + , "error: lex_line456: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2319,6 +2497,13 @@ static int action_line456 } } +static int check_key_count_line456(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line456: not enough keys\n"); + return 1; +} + int lex_line456() { const size_t padding = 1; /* YYMAXFILL */ @@ -2352,7 +2537,7 @@ int lex_line456() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line456.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2365,7 +2550,7 @@ int lex_line456() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2375,11 +2560,13 @@ int lex_line456() if (yych <= 0x09FF) goto yy100; yy98: YYSKIP (); - status = action_line456(i, keys, input, token, &cursor, 254); + status = check_key_count_line456(keys_count, i, 3) + || action_line456(&i, keys, input, token, &cursor, 254); continue; yy100: YYSKIP (); - status = action_line456(i, keys, input, token, &cursor, 0); + status = check_key_count_line456(keys_count, i, 3) + || action_line456(&i, keys, input, token, &cursor, 0); continue; } @@ -2391,7 +2578,7 @@ yy100: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line456: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line456: unused keys left after %u keys\n", i); } } @@ -2417,7 +2604,7 @@ end: #define YYFILL(n) { break; } static int action_line463 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2425,10 +2612,12 @@ static int action_line463 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2438,17 +2627,17 @@ static int action_line463 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line463: at position %ld (iteration %u):\n" + , "error: lex_line463: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2458,6 +2647,13 @@ static int action_line463 } } +static int check_key_count_line463(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line463: not enough keys\n"); + return 1; +} + int lex_line463() { const size_t padding = 1; /* YYMAXFILL */ @@ -2491,7 +2687,7 @@ int lex_line463() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line463.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2504,7 +2700,7 @@ int lex_line463() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2514,11 +2710,13 @@ int lex_line463() if (yych <= 0x0A7F) goto yy106; yy104: YYSKIP (); - status = action_line463(i, keys, input, token, &cursor, 254); + status = check_key_count_line463(keys_count, i, 3) + || action_line463(&i, keys, input, token, &cursor, 254); continue; yy106: YYSKIP (); - status = action_line463(i, keys, input, token, &cursor, 0); + status = check_key_count_line463(keys_count, i, 3) + || action_line463(&i, keys, input, token, &cursor, 0); continue; } @@ -2530,7 +2728,7 @@ yy106: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line463: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line463: unused keys left after %u keys\n", i); } } @@ -2556,7 +2754,7 @@ end: #define YYFILL(n) { break; } static int action_line470 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2564,10 +2762,12 @@ static int action_line470 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2577,17 +2777,17 @@ static int action_line470 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line470: at position %ld (iteration %u):\n" + , "error: lex_line470: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2597,6 +2797,13 @@ static int action_line470 } } +static int check_key_count_line470(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line470: not enough keys\n"); + return 1; +} + int lex_line470() { const size_t padding = 1; /* YYMAXFILL */ @@ -2630,7 +2837,7 @@ int lex_line470() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line470.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2643,7 +2850,7 @@ int lex_line470() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2653,11 +2860,13 @@ int lex_line470() if (yych <= 0x0AFF) goto yy112; yy110: YYSKIP (); - status = action_line470(i, keys, input, token, &cursor, 254); + status = check_key_count_line470(keys_count, i, 3) + || action_line470(&i, keys, input, token, &cursor, 254); continue; yy112: YYSKIP (); - status = action_line470(i, keys, input, token, &cursor, 0); + status = check_key_count_line470(keys_count, i, 3) + || action_line470(&i, keys, input, token, &cursor, 0); continue; } @@ -2669,7 +2878,7 @@ yy112: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line470: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line470: unused keys left after %u keys\n", i); } } @@ -2695,7 +2904,7 @@ end: #define YYFILL(n) { break; } static int action_line477 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2703,10 +2912,12 @@ static int action_line477 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2716,17 +2927,17 @@ static int action_line477 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line477: at position %ld (iteration %u):\n" + , "error: lex_line477: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2736,6 +2947,13 @@ static int action_line477 } } +static int check_key_count_line477(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line477: not enough keys\n"); + return 1; +} + int lex_line477() { const size_t padding = 1; /* YYMAXFILL */ @@ -2769,7 +2987,7 @@ int lex_line477() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line477.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2782,7 +3000,7 @@ int lex_line477() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2792,11 +3010,13 @@ int lex_line477() if (yych <= 0x0B7F) goto yy118; yy116: YYSKIP (); - status = action_line477(i, keys, input, token, &cursor, 254); + status = check_key_count_line477(keys_count, i, 3) + || action_line477(&i, keys, input, token, &cursor, 254); continue; yy118: YYSKIP (); - status = action_line477(i, keys, input, token, &cursor, 0); + status = check_key_count_line477(keys_count, i, 3) + || action_line477(&i, keys, input, token, &cursor, 0); continue; } @@ -2808,7 +3028,7 @@ yy118: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line477: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line477: unused keys left after %u keys\n", i); } } @@ -2834,7 +3054,7 @@ end: #define YYFILL(n) { break; } static int action_line484 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2842,10 +3062,12 @@ static int action_line484 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2855,17 +3077,17 @@ static int action_line484 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line484: at position %ld (iteration %u):\n" + , "error: lex_line484: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -2875,6 +3097,13 @@ static int action_line484 } } +static int check_key_count_line484(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line484: not enough keys\n"); + return 1; +} + int lex_line484() { const size_t padding = 1; /* YYMAXFILL */ @@ -2908,7 +3137,7 @@ int lex_line484() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line484.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -2921,7 +3150,7 @@ int lex_line484() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -2931,11 +3160,13 @@ int lex_line484() if (yych <= 0x0BFF) goto yy124; yy122: YYSKIP (); - status = action_line484(i, keys, input, token, &cursor, 254); + status = check_key_count_line484(keys_count, i, 3) + || action_line484(&i, keys, input, token, &cursor, 254); continue; yy124: YYSKIP (); - status = action_line484(i, keys, input, token, &cursor, 0); + status = check_key_count_line484(keys_count, i, 3) + || action_line484(&i, keys, input, token, &cursor, 0); continue; } @@ -2947,7 +3178,7 @@ yy124: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line484: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line484: unused keys left after %u keys\n", i); } } @@ -2973,7 +3204,7 @@ end: #define YYFILL(n) { break; } static int action_line491 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -2981,10 +3212,12 @@ static int action_line491 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -2994,17 +3227,17 @@ static int action_line491 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line491: at position %ld (iteration %u):\n" + , "error: lex_line491: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3014,6 +3247,13 @@ static int action_line491 } } +static int check_key_count_line491(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line491: not enough keys\n"); + return 1; +} + int lex_line491() { const size_t padding = 1; /* YYMAXFILL */ @@ -3047,7 +3287,7 @@ int lex_line491() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line491.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3060,7 +3300,7 @@ int lex_line491() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3070,11 +3310,13 @@ int lex_line491() if (yych <= 0x0C7F) goto yy130; yy128: YYSKIP (); - status = action_line491(i, keys, input, token, &cursor, 254); + status = check_key_count_line491(keys_count, i, 3) + || action_line491(&i, keys, input, token, &cursor, 254); continue; yy130: YYSKIP (); - status = action_line491(i, keys, input, token, &cursor, 0); + status = check_key_count_line491(keys_count, i, 3) + || action_line491(&i, keys, input, token, &cursor, 0); continue; } @@ -3086,7 +3328,7 @@ yy130: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line491: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line491: unused keys left after %u keys\n", i); } } @@ -3112,7 +3354,7 @@ end: #define YYFILL(n) { break; } static int action_line498 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3120,10 +3362,12 @@ static int action_line498 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3133,17 +3377,17 @@ static int action_line498 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line498: at position %ld (iteration %u):\n" + , "error: lex_line498: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3153,6 +3397,13 @@ static int action_line498 } } +static int check_key_count_line498(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line498: not enough keys\n"); + return 1; +} + int lex_line498() { const size_t padding = 1; /* YYMAXFILL */ @@ -3186,7 +3437,7 @@ int lex_line498() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line498.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3199,7 +3450,7 @@ int lex_line498() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3209,11 +3460,13 @@ int lex_line498() if (yych <= 0x0CFF) goto yy136; yy134: YYSKIP (); - status = action_line498(i, keys, input, token, &cursor, 254); + status = check_key_count_line498(keys_count, i, 3) + || action_line498(&i, keys, input, token, &cursor, 254); continue; yy136: YYSKIP (); - status = action_line498(i, keys, input, token, &cursor, 0); + status = check_key_count_line498(keys_count, i, 3) + || action_line498(&i, keys, input, token, &cursor, 0); continue; } @@ -3225,7 +3478,7 @@ yy136: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line498: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line498: unused keys left after %u keys\n", i); } } @@ -3251,7 +3504,7 @@ end: #define YYFILL(n) { break; } static int action_line505 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3259,10 +3512,12 @@ static int action_line505 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3272,17 +3527,17 @@ static int action_line505 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line505: at position %ld (iteration %u):\n" + , "error: lex_line505: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3292,6 +3547,13 @@ static int action_line505 } } +static int check_key_count_line505(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line505: not enough keys\n"); + return 1; +} + int lex_line505() { const size_t padding = 1; /* YYMAXFILL */ @@ -3325,7 +3587,7 @@ int lex_line505() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line505.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3338,7 +3600,7 @@ int lex_line505() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3348,11 +3610,13 @@ int lex_line505() if (yych <= 0x0D7F) goto yy142; yy140: YYSKIP (); - status = action_line505(i, keys, input, token, &cursor, 254); + status = check_key_count_line505(keys_count, i, 3) + || action_line505(&i, keys, input, token, &cursor, 254); continue; yy142: YYSKIP (); - status = action_line505(i, keys, input, token, &cursor, 0); + status = check_key_count_line505(keys_count, i, 3) + || action_line505(&i, keys, input, token, &cursor, 0); continue; } @@ -3364,7 +3628,7 @@ yy142: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line505: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line505: unused keys left after %u keys\n", i); } } @@ -3390,7 +3654,7 @@ end: #define YYFILL(n) { break; } static int action_line512 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3398,10 +3662,12 @@ static int action_line512 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3411,17 +3677,17 @@ static int action_line512 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line512: at position %ld (iteration %u):\n" + , "error: lex_line512: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3431,6 +3697,13 @@ static int action_line512 } } +static int check_key_count_line512(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line512: not enough keys\n"); + return 1; +} + int lex_line512() { const size_t padding = 1; /* YYMAXFILL */ @@ -3464,7 +3737,7 @@ int lex_line512() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line512.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3477,7 +3750,7 @@ int lex_line512() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3487,11 +3760,13 @@ int lex_line512() if (yych <= 0x0DFF) goto yy148; yy146: YYSKIP (); - status = action_line512(i, keys, input, token, &cursor, 254); + status = check_key_count_line512(keys_count, i, 3) + || action_line512(&i, keys, input, token, &cursor, 254); continue; yy148: YYSKIP (); - status = action_line512(i, keys, input, token, &cursor, 0); + status = check_key_count_line512(keys_count, i, 3) + || action_line512(&i, keys, input, token, &cursor, 0); continue; } @@ -3503,7 +3778,7 @@ yy148: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line512: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line512: unused keys left after %u keys\n", i); } } @@ -3529,7 +3804,7 @@ end: #define YYFILL(n) { break; } static int action_line519 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3537,10 +3812,12 @@ static int action_line519 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3550,17 +3827,17 @@ static int action_line519 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line519: at position %ld (iteration %u):\n" + , "error: lex_line519: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3570,6 +3847,13 @@ static int action_line519 } } +static int check_key_count_line519(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line519: not enough keys\n"); + return 1; +} + int lex_line519() { const size_t padding = 1; /* YYMAXFILL */ @@ -3603,7 +3887,7 @@ int lex_line519() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line519.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3616,7 +3900,7 @@ int lex_line519() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3626,11 +3910,13 @@ int lex_line519() if (yych <= 0x0E7F) goto yy154; yy152: YYSKIP (); - status = action_line519(i, keys, input, token, &cursor, 254); + status = check_key_count_line519(keys_count, i, 3) + || action_line519(&i, keys, input, token, &cursor, 254); continue; yy154: YYSKIP (); - status = action_line519(i, keys, input, token, &cursor, 0); + status = check_key_count_line519(keys_count, i, 3) + || action_line519(&i, keys, input, token, &cursor, 0); continue; } @@ -3642,7 +3928,7 @@ yy154: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line519: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line519: unused keys left after %u keys\n", i); } } @@ -3668,7 +3954,7 @@ end: #define YYFILL(n) { break; } static int action_line526 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3676,10 +3962,12 @@ static int action_line526 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3689,17 +3977,17 @@ static int action_line526 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line526: at position %ld (iteration %u):\n" + , "error: lex_line526: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3709,6 +3997,13 @@ static int action_line526 } } +static int check_key_count_line526(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line526: not enough keys\n"); + return 1; +} + int lex_line526() { const size_t padding = 1; /* YYMAXFILL */ @@ -3742,7 +4037,7 @@ int lex_line526() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line526.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3755,7 +4050,7 @@ int lex_line526() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3765,11 +4060,13 @@ int lex_line526() if (yych <= 0x0EFF) goto yy160; yy158: YYSKIP (); - status = action_line526(i, keys, input, token, &cursor, 254); + status = check_key_count_line526(keys_count, i, 3) + || action_line526(&i, keys, input, token, &cursor, 254); continue; yy160: YYSKIP (); - status = action_line526(i, keys, input, token, &cursor, 0); + status = check_key_count_line526(keys_count, i, 3) + || action_line526(&i, keys, input, token, &cursor, 0); continue; } @@ -3781,7 +4078,7 @@ yy160: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line526: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line526: unused keys left after %u keys\n", i); } } @@ -3807,7 +4104,7 @@ end: #define YYFILL(n) { break; } static int action_line533 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3815,10 +4112,12 @@ static int action_line533 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3828,17 +4127,17 @@ static int action_line533 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line533: at position %ld (iteration %u):\n" + , "error: lex_line533: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3848,6 +4147,13 @@ static int action_line533 } } +static int check_key_count_line533(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line533: not enough keys\n"); + return 1; +} + int lex_line533() { const size_t padding = 1; /* YYMAXFILL */ @@ -3881,7 +4187,7 @@ int lex_line533() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line533.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -3894,7 +4200,7 @@ int lex_line533() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -3904,11 +4210,13 @@ int lex_line533() if (yych <= 0x0FFF) goto yy166; yy164: YYSKIP (); - status = action_line533(i, keys, input, token, &cursor, 254); + status = check_key_count_line533(keys_count, i, 3) + || action_line533(&i, keys, input, token, &cursor, 254); continue; yy166: YYSKIP (); - status = action_line533(i, keys, input, token, &cursor, 0); + status = check_key_count_line533(keys_count, i, 3) + || action_line533(&i, keys, input, token, &cursor, 0); continue; } @@ -3920,7 +4228,7 @@ yy166: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line533: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line533: unused keys left after %u keys\n", i); } } @@ -3946,7 +4254,7 @@ end: #define YYFILL(n) { break; } static int action_line540 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -3954,10 +4262,12 @@ static int action_line540 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -3967,17 +4277,17 @@ static int action_line540 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line540: at position %ld (iteration %u):\n" + , "error: lex_line540: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -3987,6 +4297,13 @@ static int action_line540 } } +static int check_key_count_line540(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line540: not enough keys\n"); + return 1; +} + int lex_line540() { const size_t padding = 1; /* YYMAXFILL */ @@ -4020,7 +4337,7 @@ int lex_line540() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line540.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4033,7 +4350,7 @@ int lex_line540() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4043,11 +4360,13 @@ int lex_line540() if (yych <= 0x109F) goto yy172; yy170: YYSKIP (); - status = action_line540(i, keys, input, token, &cursor, 254); + status = check_key_count_line540(keys_count, i, 3) + || action_line540(&i, keys, input, token, &cursor, 254); continue; yy172: YYSKIP (); - status = action_line540(i, keys, input, token, &cursor, 0); + status = check_key_count_line540(keys_count, i, 3) + || action_line540(&i, keys, input, token, &cursor, 0); continue; } @@ -4059,7 +4378,7 @@ yy172: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line540: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line540: unused keys left after %u keys\n", i); } } @@ -4085,7 +4404,7 @@ end: #define YYFILL(n) { break; } static int action_line547 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4093,10 +4412,12 @@ static int action_line547 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4106,17 +4427,17 @@ static int action_line547 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line547: at position %ld (iteration %u):\n" + , "error: lex_line547: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4126,6 +4447,13 @@ static int action_line547 } } +static int check_key_count_line547(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line547: not enough keys\n"); + return 1; +} + int lex_line547() { const size_t padding = 1; /* YYMAXFILL */ @@ -4159,7 +4487,7 @@ int lex_line547() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line547.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4172,7 +4500,7 @@ int lex_line547() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4182,11 +4510,13 @@ int lex_line547() if (yych <= 0x10FF) goto yy178; yy176: YYSKIP (); - status = action_line547(i, keys, input, token, &cursor, 254); + status = check_key_count_line547(keys_count, i, 3) + || action_line547(&i, keys, input, token, &cursor, 254); continue; yy178: YYSKIP (); - status = action_line547(i, keys, input, token, &cursor, 0); + status = check_key_count_line547(keys_count, i, 3) + || action_line547(&i, keys, input, token, &cursor, 0); continue; } @@ -4198,7 +4528,7 @@ yy178: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line547: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line547: unused keys left after %u keys\n", i); } } @@ -4224,7 +4554,7 @@ end: #define YYFILL(n) { break; } static int action_line554 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4232,10 +4562,12 @@ static int action_line554 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4245,17 +4577,17 @@ static int action_line554 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line554: at position %ld (iteration %u):\n" + , "error: lex_line554: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4265,6 +4597,13 @@ static int action_line554 } } +static int check_key_count_line554(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line554: not enough keys\n"); + return 1; +} + int lex_line554() { const size_t padding = 1; /* YYMAXFILL */ @@ -4298,7 +4637,7 @@ int lex_line554() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line554.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4311,7 +4650,7 @@ int lex_line554() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4321,11 +4660,13 @@ int lex_line554() if (yych <= 0x11FF) goto yy184; yy182: YYSKIP (); - status = action_line554(i, keys, input, token, &cursor, 254); + status = check_key_count_line554(keys_count, i, 3) + || action_line554(&i, keys, input, token, &cursor, 254); continue; yy184: YYSKIP (); - status = action_line554(i, keys, input, token, &cursor, 0); + status = check_key_count_line554(keys_count, i, 3) + || action_line554(&i, keys, input, token, &cursor, 0); continue; } @@ -4337,7 +4678,7 @@ yy184: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line554: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line554: unused keys left after %u keys\n", i); } } @@ -4363,7 +4704,7 @@ end: #define YYFILL(n) { break; } static int action_line561 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4371,10 +4712,12 @@ static int action_line561 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4384,17 +4727,17 @@ static int action_line561 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line561: at position %ld (iteration %u):\n" + , "error: lex_line561: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4404,6 +4747,13 @@ static int action_line561 } } +static int check_key_count_line561(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line561: not enough keys\n"); + return 1; +} + int lex_line561() { const size_t padding = 1; /* YYMAXFILL */ @@ -4437,7 +4787,7 @@ int lex_line561() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line561.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4450,7 +4800,7 @@ int lex_line561() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4460,11 +4810,13 @@ int lex_line561() if (yych <= 0x137F) goto yy190; yy188: YYSKIP (); - status = action_line561(i, keys, input, token, &cursor, 254); + status = check_key_count_line561(keys_count, i, 3) + || action_line561(&i, keys, input, token, &cursor, 254); continue; yy190: YYSKIP (); - status = action_line561(i, keys, input, token, &cursor, 0); + status = check_key_count_line561(keys_count, i, 3) + || action_line561(&i, keys, input, token, &cursor, 0); continue; } @@ -4476,7 +4828,7 @@ yy190: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line561: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line561: unused keys left after %u keys\n", i); } } @@ -4502,7 +4854,7 @@ end: #define YYFILL(n) { break; } static int action_line568 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4510,10 +4862,12 @@ static int action_line568 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4523,17 +4877,17 @@ static int action_line568 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line568: at position %ld (iteration %u):\n" + , "error: lex_line568: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4543,6 +4897,13 @@ static int action_line568 } } +static int check_key_count_line568(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line568: not enough keys\n"); + return 1; +} + int lex_line568() { const size_t padding = 1; /* YYMAXFILL */ @@ -4576,7 +4937,7 @@ int lex_line568() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line568.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4589,7 +4950,7 @@ int lex_line568() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4599,11 +4960,13 @@ int lex_line568() if (yych <= 0x13FF) goto yy196; yy194: YYSKIP (); - status = action_line568(i, keys, input, token, &cursor, 254); + status = check_key_count_line568(keys_count, i, 3) + || action_line568(&i, keys, input, token, &cursor, 254); continue; yy196: YYSKIP (); - status = action_line568(i, keys, input, token, &cursor, 0); + status = check_key_count_line568(keys_count, i, 3) + || action_line568(&i, keys, input, token, &cursor, 0); continue; } @@ -4615,7 +4978,7 @@ yy196: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line568: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line568: unused keys left after %u keys\n", i); } } @@ -4641,7 +5004,7 @@ end: #define YYFILL(n) { break; } static int action_line575 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4649,10 +5012,12 @@ static int action_line575 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4662,17 +5027,17 @@ static int action_line575 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line575: at position %ld (iteration %u):\n" + , "error: lex_line575: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4682,6 +5047,13 @@ static int action_line575 } } +static int check_key_count_line575(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line575: not enough keys\n"); + return 1; +} + int lex_line575() { const size_t padding = 1; /* YYMAXFILL */ @@ -4715,7 +5087,7 @@ int lex_line575() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line575.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4728,7 +5100,7 @@ int lex_line575() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4738,11 +5110,13 @@ int lex_line575() if (yych <= 0x167F) goto yy202; yy200: YYSKIP (); - status = action_line575(i, keys, input, token, &cursor, 254); + status = check_key_count_line575(keys_count, i, 3) + || action_line575(&i, keys, input, token, &cursor, 254); continue; yy202: YYSKIP (); - status = action_line575(i, keys, input, token, &cursor, 0); + status = check_key_count_line575(keys_count, i, 3) + || action_line575(&i, keys, input, token, &cursor, 0); continue; } @@ -4754,7 +5128,7 @@ yy202: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line575: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line575: unused keys left after %u keys\n", i); } } @@ -4780,7 +5154,7 @@ end: #define YYFILL(n) { break; } static int action_line582 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4788,10 +5162,12 @@ static int action_line582 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4801,17 +5177,17 @@ static int action_line582 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line582: at position %ld (iteration %u):\n" + , "error: lex_line582: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4821,6 +5197,13 @@ static int action_line582 } } +static int check_key_count_line582(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line582: not enough keys\n"); + return 1; +} + int lex_line582() { const size_t padding = 1; /* YYMAXFILL */ @@ -4854,7 +5237,7 @@ int lex_line582() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line582.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -4867,7 +5250,7 @@ int lex_line582() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -4877,11 +5260,13 @@ int lex_line582() if (yych <= 0x169F) goto yy208; yy206: YYSKIP (); - status = action_line582(i, keys, input, token, &cursor, 254); + status = check_key_count_line582(keys_count, i, 3) + || action_line582(&i, keys, input, token, &cursor, 254); continue; yy208: YYSKIP (); - status = action_line582(i, keys, input, token, &cursor, 0); + status = check_key_count_line582(keys_count, i, 3) + || action_line582(&i, keys, input, token, &cursor, 0); continue; } @@ -4893,7 +5278,7 @@ yy208: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line582: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line582: unused keys left after %u keys\n", i); } } @@ -4919,7 +5304,7 @@ end: #define YYFILL(n) { break; } static int action_line589 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -4927,10 +5312,12 @@ static int action_line589 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -4940,17 +5327,17 @@ static int action_line589 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line589: at position %ld (iteration %u):\n" + , "error: lex_line589: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -4960,6 +5347,13 @@ static int action_line589 } } +static int check_key_count_line589(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line589: not enough keys\n"); + return 1; +} + int lex_line589() { const size_t padding = 1; /* YYMAXFILL */ @@ -4993,7 +5387,7 @@ int lex_line589() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line589.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5006,7 +5400,7 @@ int lex_line589() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5016,11 +5410,13 @@ int lex_line589() if (yych <= 0x16FF) goto yy214; yy212: YYSKIP (); - status = action_line589(i, keys, input, token, &cursor, 254); + status = check_key_count_line589(keys_count, i, 3) + || action_line589(&i, keys, input, token, &cursor, 254); continue; yy214: YYSKIP (); - status = action_line589(i, keys, input, token, &cursor, 0); + status = check_key_count_line589(keys_count, i, 3) + || action_line589(&i, keys, input, token, &cursor, 0); continue; } @@ -5032,7 +5428,7 @@ yy214: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line589: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line589: unused keys left after %u keys\n", i); } } @@ -5058,7 +5454,7 @@ end: #define YYFILL(n) { break; } static int action_line596 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5066,10 +5462,12 @@ static int action_line596 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5079,17 +5477,17 @@ static int action_line596 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line596: at position %ld (iteration %u):\n" + , "error: lex_line596: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5099,6 +5497,13 @@ static int action_line596 } } +static int check_key_count_line596(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line596: not enough keys\n"); + return 1; +} + int lex_line596() { const size_t padding = 1; /* YYMAXFILL */ @@ -5132,7 +5537,7 @@ int lex_line596() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line596.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5145,7 +5550,7 @@ int lex_line596() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5155,11 +5560,13 @@ int lex_line596() if (yych <= 0x171F) goto yy220; yy218: YYSKIP (); - status = action_line596(i, keys, input, token, &cursor, 254); + status = check_key_count_line596(keys_count, i, 3) + || action_line596(&i, keys, input, token, &cursor, 254); continue; yy220: YYSKIP (); - status = action_line596(i, keys, input, token, &cursor, 0); + status = check_key_count_line596(keys_count, i, 3) + || action_line596(&i, keys, input, token, &cursor, 0); continue; } @@ -5171,7 +5578,7 @@ yy220: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line596: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line596: unused keys left after %u keys\n", i); } } @@ -5197,7 +5604,7 @@ end: #define YYFILL(n) { break; } static int action_line603 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5205,10 +5612,12 @@ static int action_line603 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5218,17 +5627,17 @@ static int action_line603 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line603: at position %ld (iteration %u):\n" + , "error: lex_line603: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5238,6 +5647,13 @@ static int action_line603 } } +static int check_key_count_line603(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line603: not enough keys\n"); + return 1; +} + int lex_line603() { const size_t padding = 1; /* YYMAXFILL */ @@ -5271,7 +5687,7 @@ int lex_line603() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line603.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5284,7 +5700,7 @@ int lex_line603() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5294,11 +5710,13 @@ int lex_line603() if (yych <= 0x173F) goto yy226; yy224: YYSKIP (); - status = action_line603(i, keys, input, token, &cursor, 254); + status = check_key_count_line603(keys_count, i, 3) + || action_line603(&i, keys, input, token, &cursor, 254); continue; yy226: YYSKIP (); - status = action_line603(i, keys, input, token, &cursor, 0); + status = check_key_count_line603(keys_count, i, 3) + || action_line603(&i, keys, input, token, &cursor, 0); continue; } @@ -5310,7 +5728,7 @@ yy226: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line603: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line603: unused keys left after %u keys\n", i); } } @@ -5336,7 +5754,7 @@ end: #define YYFILL(n) { break; } static int action_line610 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5344,10 +5762,12 @@ static int action_line610 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5357,17 +5777,17 @@ static int action_line610 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line610: at position %ld (iteration %u):\n" + , "error: lex_line610: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5377,6 +5797,13 @@ static int action_line610 } } +static int check_key_count_line610(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line610: not enough keys\n"); + return 1; +} + int lex_line610() { const size_t padding = 1; /* YYMAXFILL */ @@ -5410,7 +5837,7 @@ int lex_line610() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line610.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5423,7 +5850,7 @@ int lex_line610() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5433,11 +5860,13 @@ int lex_line610() if (yych <= 0x175F) goto yy232; yy230: YYSKIP (); - status = action_line610(i, keys, input, token, &cursor, 254); + status = check_key_count_line610(keys_count, i, 3) + || action_line610(&i, keys, input, token, &cursor, 254); continue; yy232: YYSKIP (); - status = action_line610(i, keys, input, token, &cursor, 0); + status = check_key_count_line610(keys_count, i, 3) + || action_line610(&i, keys, input, token, &cursor, 0); continue; } @@ -5449,7 +5878,7 @@ yy232: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line610: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line610: unused keys left after %u keys\n", i); } } @@ -5475,7 +5904,7 @@ end: #define YYFILL(n) { break; } static int action_line617 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5483,10 +5912,12 @@ static int action_line617 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5496,17 +5927,17 @@ static int action_line617 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line617: at position %ld (iteration %u):\n" + , "error: lex_line617: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5516,6 +5947,13 @@ static int action_line617 } } +static int check_key_count_line617(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line617: not enough keys\n"); + return 1; +} + int lex_line617() { const size_t padding = 1; /* YYMAXFILL */ @@ -5549,7 +5987,7 @@ int lex_line617() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line617.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5562,7 +6000,7 @@ int lex_line617() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5572,11 +6010,13 @@ int lex_line617() if (yych <= 0x177F) goto yy238; yy236: YYSKIP (); - status = action_line617(i, keys, input, token, &cursor, 254); + status = check_key_count_line617(keys_count, i, 3) + || action_line617(&i, keys, input, token, &cursor, 254); continue; yy238: YYSKIP (); - status = action_line617(i, keys, input, token, &cursor, 0); + status = check_key_count_line617(keys_count, i, 3) + || action_line617(&i, keys, input, token, &cursor, 0); continue; } @@ -5588,7 +6028,7 @@ yy238: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line617: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line617: unused keys left after %u keys\n", i); } } @@ -5614,7 +6054,7 @@ end: #define YYFILL(n) { break; } static int action_line624 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5622,10 +6062,12 @@ static int action_line624 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5635,17 +6077,17 @@ static int action_line624 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line624: at position %ld (iteration %u):\n" + , "error: lex_line624: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5655,6 +6097,13 @@ static int action_line624 } } +static int check_key_count_line624(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line624: not enough keys\n"); + return 1; +} + int lex_line624() { const size_t padding = 1; /* YYMAXFILL */ @@ -5688,7 +6137,7 @@ int lex_line624() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line624.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5701,7 +6150,7 @@ int lex_line624() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5711,11 +6160,13 @@ int lex_line624() if (yych <= 0x17FF) goto yy244; yy242: YYSKIP (); - status = action_line624(i, keys, input, token, &cursor, 254); + status = check_key_count_line624(keys_count, i, 3) + || action_line624(&i, keys, input, token, &cursor, 254); continue; yy244: YYSKIP (); - status = action_line624(i, keys, input, token, &cursor, 0); + status = check_key_count_line624(keys_count, i, 3) + || action_line624(&i, keys, input, token, &cursor, 0); continue; } @@ -5727,7 +6178,7 @@ yy244: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line624: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line624: unused keys left after %u keys\n", i); } } @@ -5753,7 +6204,7 @@ end: #define YYFILL(n) { break; } static int action_line631 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5761,10 +6212,12 @@ static int action_line631 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5774,17 +6227,17 @@ static int action_line631 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line631: at position %ld (iteration %u):\n" + , "error: lex_line631: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5794,6 +6247,13 @@ static int action_line631 } } +static int check_key_count_line631(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line631: not enough keys\n"); + return 1; +} + int lex_line631() { const size_t padding = 1; /* YYMAXFILL */ @@ -5827,7 +6287,7 @@ int lex_line631() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line631.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5840,7 +6300,7 @@ int lex_line631() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5850,11 +6310,13 @@ int lex_line631() if (yych <= 0x18AF) goto yy250; yy248: YYSKIP (); - status = action_line631(i, keys, input, token, &cursor, 254); + status = check_key_count_line631(keys_count, i, 3) + || action_line631(&i, keys, input, token, &cursor, 254); continue; yy250: YYSKIP (); - status = action_line631(i, keys, input, token, &cursor, 0); + status = check_key_count_line631(keys_count, i, 3) + || action_line631(&i, keys, input, token, &cursor, 0); continue; } @@ -5866,7 +6328,7 @@ yy250: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line631: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line631: unused keys left after %u keys\n", i); } } @@ -5892,7 +6354,7 @@ end: #define YYFILL(n) { break; } static int action_line638 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -5900,10 +6362,12 @@ static int action_line638 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -5913,17 +6377,17 @@ static int action_line638 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line638: at position %ld (iteration %u):\n" + , "error: lex_line638: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -5933,6 +6397,13 @@ static int action_line638 } } +static int check_key_count_line638(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line638: not enough keys\n"); + return 1; +} + int lex_line638() { const size_t padding = 1; /* YYMAXFILL */ @@ -5966,7 +6437,7 @@ int lex_line638() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line638.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -5979,7 +6450,7 @@ int lex_line638() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -5989,11 +6460,13 @@ int lex_line638() if (yych <= 0x194F) goto yy256; yy254: YYSKIP (); - status = action_line638(i, keys, input, token, &cursor, 254); + status = check_key_count_line638(keys_count, i, 3) + || action_line638(&i, keys, input, token, &cursor, 254); continue; yy256: YYSKIP (); - status = action_line638(i, keys, input, token, &cursor, 0); + status = check_key_count_line638(keys_count, i, 3) + || action_line638(&i, keys, input, token, &cursor, 0); continue; } @@ -6005,7 +6478,7 @@ yy256: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line638: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line638: unused keys left after %u keys\n", i); } } @@ -6031,7 +6504,7 @@ end: #define YYFILL(n) { break; } static int action_line645 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6039,10 +6512,12 @@ static int action_line645 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6052,17 +6527,17 @@ static int action_line645 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line645: at position %ld (iteration %u):\n" + , "error: lex_line645: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6072,6 +6547,13 @@ static int action_line645 } } +static int check_key_count_line645(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line645: not enough keys\n"); + return 1; +} + int lex_line645() { const size_t padding = 1; /* YYMAXFILL */ @@ -6105,7 +6587,7 @@ int lex_line645() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line645.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6118,7 +6600,7 @@ int lex_line645() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6128,11 +6610,13 @@ int lex_line645() if (yych <= 0x197F) goto yy262; yy260: YYSKIP (); - status = action_line645(i, keys, input, token, &cursor, 254); + status = check_key_count_line645(keys_count, i, 3) + || action_line645(&i, keys, input, token, &cursor, 254); continue; yy262: YYSKIP (); - status = action_line645(i, keys, input, token, &cursor, 0); + status = check_key_count_line645(keys_count, i, 3) + || action_line645(&i, keys, input, token, &cursor, 0); continue; } @@ -6144,7 +6628,7 @@ yy262: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line645: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line645: unused keys left after %u keys\n", i); } } @@ -6170,7 +6654,7 @@ end: #define YYFILL(n) { break; } static int action_line652 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6178,10 +6662,12 @@ static int action_line652 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6191,17 +6677,17 @@ static int action_line652 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line652: at position %ld (iteration %u):\n" + , "error: lex_line652: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6211,6 +6697,13 @@ static int action_line652 } } +static int check_key_count_line652(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line652: not enough keys\n"); + return 1; +} + int lex_line652() { const size_t padding = 1; /* YYMAXFILL */ @@ -6244,7 +6737,7 @@ int lex_line652() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line652.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6257,7 +6750,7 @@ int lex_line652() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6267,11 +6760,13 @@ int lex_line652() if (yych <= 0x19FF) goto yy268; yy266: YYSKIP (); - status = action_line652(i, keys, input, token, &cursor, 254); + status = check_key_count_line652(keys_count, i, 3) + || action_line652(&i, keys, input, token, &cursor, 254); continue; yy268: YYSKIP (); - status = action_line652(i, keys, input, token, &cursor, 0); + status = check_key_count_line652(keys_count, i, 3) + || action_line652(&i, keys, input, token, &cursor, 0); continue; } @@ -6283,7 +6778,7 @@ yy268: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line652: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line652: unused keys left after %u keys\n", i); } } @@ -6309,7 +6804,7 @@ end: #define YYFILL(n) { break; } static int action_line659 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6317,10 +6812,12 @@ static int action_line659 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6330,17 +6827,17 @@ static int action_line659 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line659: at position %ld (iteration %u):\n" + , "error: lex_line659: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6350,6 +6847,13 @@ static int action_line659 } } +static int check_key_count_line659(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line659: not enough keys\n"); + return 1; +} + int lex_line659() { const size_t padding = 1; /* YYMAXFILL */ @@ -6383,7 +6887,7 @@ int lex_line659() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line659.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6396,7 +6900,7 @@ int lex_line659() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6406,11 +6910,13 @@ int lex_line659() if (yych <= 0x1D7F) goto yy274; yy272: YYSKIP (); - status = action_line659(i, keys, input, token, &cursor, 254); + status = check_key_count_line659(keys_count, i, 3) + || action_line659(&i, keys, input, token, &cursor, 254); continue; yy274: YYSKIP (); - status = action_line659(i, keys, input, token, &cursor, 0); + status = check_key_count_line659(keys_count, i, 3) + || action_line659(&i, keys, input, token, &cursor, 0); continue; } @@ -6422,7 +6928,7 @@ yy274: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line659: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line659: unused keys left after %u keys\n", i); } } @@ -6448,7 +6954,7 @@ end: #define YYFILL(n) { break; } static int action_line666 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6456,10 +6962,12 @@ static int action_line666 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6469,17 +6977,17 @@ static int action_line666 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line666: at position %ld (iteration %u):\n" + , "error: lex_line666: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6489,6 +6997,13 @@ static int action_line666 } } +static int check_key_count_line666(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line666: not enough keys\n"); + return 1; +} + int lex_line666() { const size_t padding = 1; /* YYMAXFILL */ @@ -6522,7 +7037,7 @@ int lex_line666() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line666.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6535,7 +7050,7 @@ int lex_line666() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6545,11 +7060,13 @@ int lex_line666() if (yych <= 0x1EFF) goto yy280; yy278: YYSKIP (); - status = action_line666(i, keys, input, token, &cursor, 254); + status = check_key_count_line666(keys_count, i, 3) + || action_line666(&i, keys, input, token, &cursor, 254); continue; yy280: YYSKIP (); - status = action_line666(i, keys, input, token, &cursor, 0); + status = check_key_count_line666(keys_count, i, 3) + || action_line666(&i, keys, input, token, &cursor, 0); continue; } @@ -6561,7 +7078,7 @@ yy280: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line666: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line666: unused keys left after %u keys\n", i); } } @@ -6587,7 +7104,7 @@ end: #define YYFILL(n) { break; } static int action_line673 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6595,10 +7112,12 @@ static int action_line673 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6608,17 +7127,17 @@ static int action_line673 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line673: at position %ld (iteration %u):\n" + , "error: lex_line673: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6628,6 +7147,13 @@ static int action_line673 } } +static int check_key_count_line673(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line673: not enough keys\n"); + return 1; +} + int lex_line673() { const size_t padding = 1; /* YYMAXFILL */ @@ -6661,7 +7187,7 @@ int lex_line673() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line673.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6674,7 +7200,7 @@ int lex_line673() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6684,11 +7210,13 @@ int lex_line673() if (yych <= 0x1FFF) goto yy286; yy284: YYSKIP (); - status = action_line673(i, keys, input, token, &cursor, 254); + status = check_key_count_line673(keys_count, i, 3) + || action_line673(&i, keys, input, token, &cursor, 254); continue; yy286: YYSKIP (); - status = action_line673(i, keys, input, token, &cursor, 0); + status = check_key_count_line673(keys_count, i, 3) + || action_line673(&i, keys, input, token, &cursor, 0); continue; } @@ -6700,7 +7228,7 @@ yy286: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line673: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line673: unused keys left after %u keys\n", i); } } @@ -6726,7 +7254,7 @@ end: #define YYFILL(n) { break; } static int action_line680 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6734,10 +7262,12 @@ static int action_line680 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6747,17 +7277,17 @@ static int action_line680 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line680: at position %ld (iteration %u):\n" + , "error: lex_line680: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6767,6 +7297,13 @@ static int action_line680 } } +static int check_key_count_line680(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line680: not enough keys\n"); + return 1; +} + int lex_line680() { const size_t padding = 1; /* YYMAXFILL */ @@ -6800,7 +7337,7 @@ int lex_line680() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line680.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6813,7 +7350,7 @@ int lex_line680() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6823,11 +7360,13 @@ int lex_line680() if (yych <= 0x206F) goto yy292; yy290: YYSKIP (); - status = action_line680(i, keys, input, token, &cursor, 254); + status = check_key_count_line680(keys_count, i, 3) + || action_line680(&i, keys, input, token, &cursor, 254); continue; yy292: YYSKIP (); - status = action_line680(i, keys, input, token, &cursor, 0); + status = check_key_count_line680(keys_count, i, 3) + || action_line680(&i, keys, input, token, &cursor, 0); continue; } @@ -6839,7 +7378,7 @@ yy292: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line680: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line680: unused keys left after %u keys\n", i); } } @@ -6865,7 +7404,7 @@ end: #define YYFILL(n) { break; } static int action_line687 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -6873,10 +7412,12 @@ static int action_line687 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -6886,17 +7427,17 @@ static int action_line687 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line687: at position %ld (iteration %u):\n" + , "error: lex_line687: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -6906,6 +7447,13 @@ static int action_line687 } } +static int check_key_count_line687(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line687: not enough keys\n"); + return 1; +} + int lex_line687() { const size_t padding = 1; /* YYMAXFILL */ @@ -6939,7 +7487,7 @@ int lex_line687() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line687.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -6952,7 +7500,7 @@ int lex_line687() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -6962,11 +7510,13 @@ int lex_line687() if (yych <= 0x209F) goto yy298; yy296: YYSKIP (); - status = action_line687(i, keys, input, token, &cursor, 254); + status = check_key_count_line687(keys_count, i, 3) + || action_line687(&i, keys, input, token, &cursor, 254); continue; yy298: YYSKIP (); - status = action_line687(i, keys, input, token, &cursor, 0); + status = check_key_count_line687(keys_count, i, 3) + || action_line687(&i, keys, input, token, &cursor, 0); continue; } @@ -6978,7 +7528,7 @@ yy298: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line687: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line687: unused keys left after %u keys\n", i); } } @@ -7004,7 +7554,7 @@ end: #define YYFILL(n) { break; } static int action_line694 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7012,10 +7562,12 @@ static int action_line694 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7025,17 +7577,17 @@ static int action_line694 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line694: at position %ld (iteration %u):\n" + , "error: lex_line694: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7045,6 +7597,13 @@ static int action_line694 } } +static int check_key_count_line694(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line694: not enough keys\n"); + return 1; +} + int lex_line694() { const size_t padding = 1; /* YYMAXFILL */ @@ -7078,7 +7637,7 @@ int lex_line694() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line694.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7091,7 +7650,7 @@ int lex_line694() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7101,11 +7660,13 @@ int lex_line694() if (yych <= 0x20CF) goto yy304; yy302: YYSKIP (); - status = action_line694(i, keys, input, token, &cursor, 254); + status = check_key_count_line694(keys_count, i, 3) + || action_line694(&i, keys, input, token, &cursor, 254); continue; yy304: YYSKIP (); - status = action_line694(i, keys, input, token, &cursor, 0); + status = check_key_count_line694(keys_count, i, 3) + || action_line694(&i, keys, input, token, &cursor, 0); continue; } @@ -7117,7 +7678,7 @@ yy304: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line694: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line694: unused keys left after %u keys\n", i); } } @@ -7143,7 +7704,7 @@ end: #define YYFILL(n) { break; } static int action_line701 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7151,10 +7712,12 @@ static int action_line701 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7164,17 +7727,17 @@ static int action_line701 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line701: at position %ld (iteration %u):\n" + , "error: lex_line701: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7184,6 +7747,13 @@ static int action_line701 } } +static int check_key_count_line701(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line701: not enough keys\n"); + return 1; +} + int lex_line701() { const size_t padding = 1; /* YYMAXFILL */ @@ -7217,7 +7787,7 @@ int lex_line701() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line701.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7230,7 +7800,7 @@ int lex_line701() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7240,11 +7810,13 @@ int lex_line701() if (yych <= 0x20FF) goto yy310; yy308: YYSKIP (); - status = action_line701(i, keys, input, token, &cursor, 254); + status = check_key_count_line701(keys_count, i, 3) + || action_line701(&i, keys, input, token, &cursor, 254); continue; yy310: YYSKIP (); - status = action_line701(i, keys, input, token, &cursor, 0); + status = check_key_count_line701(keys_count, i, 3) + || action_line701(&i, keys, input, token, &cursor, 0); continue; } @@ -7256,7 +7828,7 @@ yy310: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line701: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line701: unused keys left after %u keys\n", i); } } @@ -7282,7 +7854,7 @@ end: #define YYFILL(n) { break; } static int action_line708 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7290,10 +7862,12 @@ static int action_line708 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7303,17 +7877,17 @@ static int action_line708 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line708: at position %ld (iteration %u):\n" + , "error: lex_line708: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7323,6 +7897,13 @@ static int action_line708 } } +static int check_key_count_line708(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line708: not enough keys\n"); + return 1; +} + int lex_line708() { const size_t padding = 1; /* YYMAXFILL */ @@ -7356,7 +7937,7 @@ int lex_line708() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line708.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7369,7 +7950,7 @@ int lex_line708() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7379,11 +7960,13 @@ int lex_line708() if (yych <= 0x214F) goto yy316; yy314: YYSKIP (); - status = action_line708(i, keys, input, token, &cursor, 254); + status = check_key_count_line708(keys_count, i, 3) + || action_line708(&i, keys, input, token, &cursor, 254); continue; yy316: YYSKIP (); - status = action_line708(i, keys, input, token, &cursor, 0); + status = check_key_count_line708(keys_count, i, 3) + || action_line708(&i, keys, input, token, &cursor, 0); continue; } @@ -7395,7 +7978,7 @@ yy316: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line708: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line708: unused keys left after %u keys\n", i); } } @@ -7421,7 +8004,7 @@ end: #define YYFILL(n) { break; } static int action_line715 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7429,10 +8012,12 @@ static int action_line715 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7442,17 +8027,17 @@ static int action_line715 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line715: at position %ld (iteration %u):\n" + , "error: lex_line715: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7462,6 +8047,13 @@ static int action_line715 } } +static int check_key_count_line715(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line715: not enough keys\n"); + return 1; +} + int lex_line715() { const size_t padding = 1; /* YYMAXFILL */ @@ -7495,7 +8087,7 @@ int lex_line715() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line715.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7508,7 +8100,7 @@ int lex_line715() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7518,11 +8110,13 @@ int lex_line715() if (yych <= 0x218F) goto yy322; yy320: YYSKIP (); - status = action_line715(i, keys, input, token, &cursor, 254); + status = check_key_count_line715(keys_count, i, 3) + || action_line715(&i, keys, input, token, &cursor, 254); continue; yy322: YYSKIP (); - status = action_line715(i, keys, input, token, &cursor, 0); + status = check_key_count_line715(keys_count, i, 3) + || action_line715(&i, keys, input, token, &cursor, 0); continue; } @@ -7534,7 +8128,7 @@ yy322: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line715: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line715: unused keys left after %u keys\n", i); } } @@ -7560,7 +8154,7 @@ end: #define YYFILL(n) { break; } static int action_line722 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7568,10 +8162,12 @@ static int action_line722 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7581,17 +8177,17 @@ static int action_line722 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line722: at position %ld (iteration %u):\n" + , "error: lex_line722: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7601,6 +8197,13 @@ static int action_line722 } } +static int check_key_count_line722(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line722: not enough keys\n"); + return 1; +} + int lex_line722() { const size_t padding = 1; /* YYMAXFILL */ @@ -7634,7 +8237,7 @@ int lex_line722() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line722.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7647,7 +8250,7 @@ int lex_line722() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7657,11 +8260,13 @@ int lex_line722() if (yych <= 0x21FF) goto yy328; yy326: YYSKIP (); - status = action_line722(i, keys, input, token, &cursor, 254); + status = check_key_count_line722(keys_count, i, 3) + || action_line722(&i, keys, input, token, &cursor, 254); continue; yy328: YYSKIP (); - status = action_line722(i, keys, input, token, &cursor, 0); + status = check_key_count_line722(keys_count, i, 3) + || action_line722(&i, keys, input, token, &cursor, 0); continue; } @@ -7673,7 +8278,7 @@ yy328: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line722: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line722: unused keys left after %u keys\n", i); } } @@ -7699,7 +8304,7 @@ end: #define YYFILL(n) { break; } static int action_line729 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7707,10 +8312,12 @@ static int action_line729 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7720,17 +8327,17 @@ static int action_line729 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line729: at position %ld (iteration %u):\n" + , "error: lex_line729: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7740,6 +8347,13 @@ static int action_line729 } } +static int check_key_count_line729(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line729: not enough keys\n"); + return 1; +} + int lex_line729() { const size_t padding = 1; /* YYMAXFILL */ @@ -7773,7 +8387,7 @@ int lex_line729() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line729.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7786,7 +8400,7 @@ int lex_line729() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7796,11 +8410,13 @@ int lex_line729() if (yych <= 0x22FF) goto yy334; yy332: YYSKIP (); - status = action_line729(i, keys, input, token, &cursor, 254); + status = check_key_count_line729(keys_count, i, 3) + || action_line729(&i, keys, input, token, &cursor, 254); continue; yy334: YYSKIP (); - status = action_line729(i, keys, input, token, &cursor, 0); + status = check_key_count_line729(keys_count, i, 3) + || action_line729(&i, keys, input, token, &cursor, 0); continue; } @@ -7812,7 +8428,7 @@ yy334: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line729: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line729: unused keys left after %u keys\n", i); } } @@ -7838,7 +8454,7 @@ end: #define YYFILL(n) { break; } static int action_line736 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7846,10 +8462,12 @@ static int action_line736 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7859,17 +8477,17 @@ static int action_line736 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line736: at position %ld (iteration %u):\n" + , "error: lex_line736: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -7879,6 +8497,13 @@ static int action_line736 } } +static int check_key_count_line736(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line736: not enough keys\n"); + return 1; +} + int lex_line736() { const size_t padding = 1; /* YYMAXFILL */ @@ -7912,7 +8537,7 @@ int lex_line736() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line736.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -7925,7 +8550,7 @@ int lex_line736() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -7935,11 +8560,13 @@ int lex_line736() if (yych <= 0x23FF) goto yy340; yy338: YYSKIP (); - status = action_line736(i, keys, input, token, &cursor, 254); + status = check_key_count_line736(keys_count, i, 3) + || action_line736(&i, keys, input, token, &cursor, 254); continue; yy340: YYSKIP (); - status = action_line736(i, keys, input, token, &cursor, 0); + status = check_key_count_line736(keys_count, i, 3) + || action_line736(&i, keys, input, token, &cursor, 0); continue; } @@ -7951,7 +8578,7 @@ yy340: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line736: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line736: unused keys left after %u keys\n", i); } } @@ -7977,7 +8604,7 @@ end: #define YYFILL(n) { break; } static int action_line743 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -7985,10 +8612,12 @@ static int action_line743 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -7998,17 +8627,17 @@ static int action_line743 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line743: at position %ld (iteration %u):\n" + , "error: lex_line743: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8018,6 +8647,13 @@ static int action_line743 } } +static int check_key_count_line743(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line743: not enough keys\n"); + return 1; +} + int lex_line743() { const size_t padding = 1; /* YYMAXFILL */ @@ -8051,7 +8687,7 @@ int lex_line743() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line743.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8064,7 +8700,7 @@ int lex_line743() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8074,11 +8710,13 @@ int lex_line743() if (yych <= 0x243F) goto yy346; yy344: YYSKIP (); - status = action_line743(i, keys, input, token, &cursor, 254); + status = check_key_count_line743(keys_count, i, 3) + || action_line743(&i, keys, input, token, &cursor, 254); continue; yy346: YYSKIP (); - status = action_line743(i, keys, input, token, &cursor, 0); + status = check_key_count_line743(keys_count, i, 3) + || action_line743(&i, keys, input, token, &cursor, 0); continue; } @@ -8090,7 +8728,7 @@ yy346: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line743: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line743: unused keys left after %u keys\n", i); } } @@ -8116,7 +8754,7 @@ end: #define YYFILL(n) { break; } static int action_line750 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8124,10 +8762,12 @@ static int action_line750 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8137,17 +8777,17 @@ static int action_line750 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line750: at position %ld (iteration %u):\n" + , "error: lex_line750: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8157,6 +8797,13 @@ static int action_line750 } } +static int check_key_count_line750(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line750: not enough keys\n"); + return 1; +} + int lex_line750() { const size_t padding = 1; /* YYMAXFILL */ @@ -8190,7 +8837,7 @@ int lex_line750() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line750.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8203,7 +8850,7 @@ int lex_line750() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8213,11 +8860,13 @@ int lex_line750() if (yych <= 0x245F) goto yy352; yy350: YYSKIP (); - status = action_line750(i, keys, input, token, &cursor, 254); + status = check_key_count_line750(keys_count, i, 3) + || action_line750(&i, keys, input, token, &cursor, 254); continue; yy352: YYSKIP (); - status = action_line750(i, keys, input, token, &cursor, 0); + status = check_key_count_line750(keys_count, i, 3) + || action_line750(&i, keys, input, token, &cursor, 0); continue; } @@ -8229,7 +8878,7 @@ yy352: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line750: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line750: unused keys left after %u keys\n", i); } } @@ -8255,7 +8904,7 @@ end: #define YYFILL(n) { break; } static int action_line757 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8263,10 +8912,12 @@ static int action_line757 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8276,17 +8927,17 @@ static int action_line757 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line757: at position %ld (iteration %u):\n" + , "error: lex_line757: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8296,6 +8947,13 @@ static int action_line757 } } +static int check_key_count_line757(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line757: not enough keys\n"); + return 1; +} + int lex_line757() { const size_t padding = 1; /* YYMAXFILL */ @@ -8329,7 +8987,7 @@ int lex_line757() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line757.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8342,7 +9000,7 @@ int lex_line757() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8352,11 +9010,13 @@ int lex_line757() if (yych <= 0x24FF) goto yy358; yy356: YYSKIP (); - status = action_line757(i, keys, input, token, &cursor, 254); + status = check_key_count_line757(keys_count, i, 3) + || action_line757(&i, keys, input, token, &cursor, 254); continue; yy358: YYSKIP (); - status = action_line757(i, keys, input, token, &cursor, 0); + status = check_key_count_line757(keys_count, i, 3) + || action_line757(&i, keys, input, token, &cursor, 0); continue; } @@ -8368,7 +9028,7 @@ yy358: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line757: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line757: unused keys left after %u keys\n", i); } } @@ -8394,7 +9054,7 @@ end: #define YYFILL(n) { break; } static int action_line764 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8402,10 +9062,12 @@ static int action_line764 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8415,17 +9077,17 @@ static int action_line764 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line764: at position %ld (iteration %u):\n" + , "error: lex_line764: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8435,6 +9097,13 @@ static int action_line764 } } +static int check_key_count_line764(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line764: not enough keys\n"); + return 1; +} + int lex_line764() { const size_t padding = 1; /* YYMAXFILL */ @@ -8468,7 +9137,7 @@ int lex_line764() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line764.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8481,7 +9150,7 @@ int lex_line764() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8491,11 +9160,13 @@ int lex_line764() if (yych <= 0x257F) goto yy364; yy362: YYSKIP (); - status = action_line764(i, keys, input, token, &cursor, 254); + status = check_key_count_line764(keys_count, i, 3) + || action_line764(&i, keys, input, token, &cursor, 254); continue; yy364: YYSKIP (); - status = action_line764(i, keys, input, token, &cursor, 0); + status = check_key_count_line764(keys_count, i, 3) + || action_line764(&i, keys, input, token, &cursor, 0); continue; } @@ -8507,7 +9178,7 @@ yy364: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line764: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line764: unused keys left after %u keys\n", i); } } @@ -8533,7 +9204,7 @@ end: #define YYFILL(n) { break; } static int action_line771 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8541,10 +9212,12 @@ static int action_line771 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8554,17 +9227,17 @@ static int action_line771 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line771: at position %ld (iteration %u):\n" + , "error: lex_line771: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8574,6 +9247,13 @@ static int action_line771 } } +static int check_key_count_line771(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line771: not enough keys\n"); + return 1; +} + int lex_line771() { const size_t padding = 1; /* YYMAXFILL */ @@ -8607,7 +9287,7 @@ int lex_line771() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line771.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8620,7 +9300,7 @@ int lex_line771() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8630,11 +9310,13 @@ int lex_line771() if (yych <= 0x259F) goto yy370; yy368: YYSKIP (); - status = action_line771(i, keys, input, token, &cursor, 254); + status = check_key_count_line771(keys_count, i, 3) + || action_line771(&i, keys, input, token, &cursor, 254); continue; yy370: YYSKIP (); - status = action_line771(i, keys, input, token, &cursor, 0); + status = check_key_count_line771(keys_count, i, 3) + || action_line771(&i, keys, input, token, &cursor, 0); continue; } @@ -8646,7 +9328,7 @@ yy370: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line771: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line771: unused keys left after %u keys\n", i); } } @@ -8672,7 +9354,7 @@ end: #define YYFILL(n) { break; } static int action_line778 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8680,10 +9362,12 @@ static int action_line778 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8693,17 +9377,17 @@ static int action_line778 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line778: at position %ld (iteration %u):\n" + , "error: lex_line778: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8713,6 +9397,13 @@ static int action_line778 } } +static int check_key_count_line778(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line778: not enough keys\n"); + return 1; +} + int lex_line778() { const size_t padding = 1; /* YYMAXFILL */ @@ -8746,7 +9437,7 @@ int lex_line778() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line778.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8759,7 +9450,7 @@ int lex_line778() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8769,11 +9460,13 @@ int lex_line778() if (yych <= 0x25FF) goto yy376; yy374: YYSKIP (); - status = action_line778(i, keys, input, token, &cursor, 254); + status = check_key_count_line778(keys_count, i, 3) + || action_line778(&i, keys, input, token, &cursor, 254); continue; yy376: YYSKIP (); - status = action_line778(i, keys, input, token, &cursor, 0); + status = check_key_count_line778(keys_count, i, 3) + || action_line778(&i, keys, input, token, &cursor, 0); continue; } @@ -8785,7 +9478,7 @@ yy376: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line778: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line778: unused keys left after %u keys\n", i); } } @@ -8811,7 +9504,7 @@ end: #define YYFILL(n) { break; } static int action_line785 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8819,10 +9512,12 @@ static int action_line785 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8832,17 +9527,17 @@ static int action_line785 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line785: at position %ld (iteration %u):\n" + , "error: lex_line785: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8852,6 +9547,13 @@ static int action_line785 } } +static int check_key_count_line785(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line785: not enough keys\n"); + return 1; +} + int lex_line785() { const size_t padding = 1; /* YYMAXFILL */ @@ -8885,7 +9587,7 @@ int lex_line785() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line785.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -8898,7 +9600,7 @@ int lex_line785() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -8908,11 +9610,13 @@ int lex_line785() if (yych <= 0x26FF) goto yy382; yy380: YYSKIP (); - status = action_line785(i, keys, input, token, &cursor, 254); + status = check_key_count_line785(keys_count, i, 3) + || action_line785(&i, keys, input, token, &cursor, 254); continue; yy382: YYSKIP (); - status = action_line785(i, keys, input, token, &cursor, 0); + status = check_key_count_line785(keys_count, i, 3) + || action_line785(&i, keys, input, token, &cursor, 0); continue; } @@ -8924,7 +9628,7 @@ yy382: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line785: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line785: unused keys left after %u keys\n", i); } } @@ -8950,7 +9654,7 @@ end: #define YYFILL(n) { break; } static int action_line792 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -8958,10 +9662,12 @@ static int action_line792 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -8971,17 +9677,17 @@ static int action_line792 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line792: at position %ld (iteration %u):\n" + , "error: lex_line792: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -8991,6 +9697,13 @@ static int action_line792 } } +static int check_key_count_line792(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line792: not enough keys\n"); + return 1; +} + int lex_line792() { const size_t padding = 1; /* YYMAXFILL */ @@ -9024,7 +9737,7 @@ int lex_line792() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line792.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9037,7 +9750,7 @@ int lex_line792() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9047,11 +9760,13 @@ int lex_line792() if (yych <= 0x27BF) goto yy388; yy386: YYSKIP (); - status = action_line792(i, keys, input, token, &cursor, 254); + status = check_key_count_line792(keys_count, i, 3) + || action_line792(&i, keys, input, token, &cursor, 254); continue; yy388: YYSKIP (); - status = action_line792(i, keys, input, token, &cursor, 0); + status = check_key_count_line792(keys_count, i, 3) + || action_line792(&i, keys, input, token, &cursor, 0); continue; } @@ -9063,7 +9778,7 @@ yy388: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line792: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line792: unused keys left after %u keys\n", i); } } @@ -9089,7 +9804,7 @@ end: #define YYFILL(n) { break; } static int action_line799 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9097,10 +9812,12 @@ static int action_line799 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9110,17 +9827,17 @@ static int action_line799 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line799: at position %ld (iteration %u):\n" + , "error: lex_line799: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9130,6 +9847,13 @@ static int action_line799 } } +static int check_key_count_line799(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line799: not enough keys\n"); + return 1; +} + int lex_line799() { const size_t padding = 1; /* YYMAXFILL */ @@ -9163,7 +9887,7 @@ int lex_line799() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line799.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9176,7 +9900,7 @@ int lex_line799() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9186,11 +9910,13 @@ int lex_line799() if (yych <= 0x27EF) goto yy394; yy392: YYSKIP (); - status = action_line799(i, keys, input, token, &cursor, 254); + status = check_key_count_line799(keys_count, i, 3) + || action_line799(&i, keys, input, token, &cursor, 254); continue; yy394: YYSKIP (); - status = action_line799(i, keys, input, token, &cursor, 0); + status = check_key_count_line799(keys_count, i, 3) + || action_line799(&i, keys, input, token, &cursor, 0); continue; } @@ -9202,7 +9928,7 @@ yy394: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line799: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line799: unused keys left after %u keys\n", i); } } @@ -9228,7 +9954,7 @@ end: #define YYFILL(n) { break; } static int action_line806 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9236,10 +9962,12 @@ static int action_line806 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9249,17 +9977,17 @@ static int action_line806 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line806: at position %ld (iteration %u):\n" + , "error: lex_line806: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9269,6 +9997,13 @@ static int action_line806 } } +static int check_key_count_line806(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line806: not enough keys\n"); + return 1; +} + int lex_line806() { const size_t padding = 1; /* YYMAXFILL */ @@ -9302,7 +10037,7 @@ int lex_line806() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line806.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9315,7 +10050,7 @@ int lex_line806() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9325,11 +10060,13 @@ int lex_line806() if (yych <= 0x27FF) goto yy400; yy398: YYSKIP (); - status = action_line806(i, keys, input, token, &cursor, 254); + status = check_key_count_line806(keys_count, i, 3) + || action_line806(&i, keys, input, token, &cursor, 254); continue; yy400: YYSKIP (); - status = action_line806(i, keys, input, token, &cursor, 0); + status = check_key_count_line806(keys_count, i, 3) + || action_line806(&i, keys, input, token, &cursor, 0); continue; } @@ -9341,7 +10078,7 @@ yy400: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line806: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line806: unused keys left after %u keys\n", i); } } @@ -9367,7 +10104,7 @@ end: #define YYFILL(n) { break; } static int action_line813 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9375,10 +10112,12 @@ static int action_line813 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9388,17 +10127,17 @@ static int action_line813 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line813: at position %ld (iteration %u):\n" + , "error: lex_line813: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9408,6 +10147,13 @@ static int action_line813 } } +static int check_key_count_line813(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line813: not enough keys\n"); + return 1; +} + int lex_line813() { const size_t padding = 1; /* YYMAXFILL */ @@ -9441,7 +10187,7 @@ int lex_line813() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line813.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9454,7 +10200,7 @@ int lex_line813() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9464,11 +10210,13 @@ int lex_line813() if (yych <= 0x28FF) goto yy406; yy404: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 254); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 254); continue; yy406: YYSKIP (); - status = action_line813(i, keys, input, token, &cursor, 0); + status = check_key_count_line813(keys_count, i, 3) + || action_line813(&i, keys, input, token, &cursor, 0); continue; } @@ -9480,7 +10228,7 @@ yy406: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line813: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line813: unused keys left after %u keys\n", i); } } @@ -9506,7 +10254,7 @@ end: #define YYFILL(n) { break; } static int action_line820 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9514,10 +10262,12 @@ static int action_line820 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9527,17 +10277,17 @@ static int action_line820 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line820: at position %ld (iteration %u):\n" + , "error: lex_line820: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9547,6 +10297,13 @@ static int action_line820 } } +static int check_key_count_line820(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line820: not enough keys\n"); + return 1; +} + int lex_line820() { const size_t padding = 1; /* YYMAXFILL */ @@ -9580,7 +10337,7 @@ int lex_line820() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line820.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9593,7 +10350,7 @@ int lex_line820() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9603,11 +10360,13 @@ int lex_line820() if (yych <= 0x297F) goto yy412; yy410: YYSKIP (); - status = action_line820(i, keys, input, token, &cursor, 254); + status = check_key_count_line820(keys_count, i, 3) + || action_line820(&i, keys, input, token, &cursor, 254); continue; yy412: YYSKIP (); - status = action_line820(i, keys, input, token, &cursor, 0); + status = check_key_count_line820(keys_count, i, 3) + || action_line820(&i, keys, input, token, &cursor, 0); continue; } @@ -9619,7 +10378,7 @@ yy412: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line820: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line820: unused keys left after %u keys\n", i); } } @@ -9645,7 +10404,7 @@ end: #define YYFILL(n) { break; } static int action_line827 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9653,10 +10412,12 @@ static int action_line827 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9666,17 +10427,17 @@ static int action_line827 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line827: at position %ld (iteration %u):\n" + , "error: lex_line827: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9686,6 +10447,13 @@ static int action_line827 } } +static int check_key_count_line827(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line827: not enough keys\n"); + return 1; +} + int lex_line827() { const size_t padding = 1; /* YYMAXFILL */ @@ -9719,7 +10487,7 @@ int lex_line827() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line827.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9732,7 +10500,7 @@ int lex_line827() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9742,11 +10510,13 @@ int lex_line827() if (yych <= 0x29FF) goto yy418; yy416: YYSKIP (); - status = action_line827(i, keys, input, token, &cursor, 254); + status = check_key_count_line827(keys_count, i, 3) + || action_line827(&i, keys, input, token, &cursor, 254); continue; yy418: YYSKIP (); - status = action_line827(i, keys, input, token, &cursor, 0); + status = check_key_count_line827(keys_count, i, 3) + || action_line827(&i, keys, input, token, &cursor, 0); continue; } @@ -9758,7 +10528,7 @@ yy418: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line827: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line827: unused keys left after %u keys\n", i); } } @@ -9784,7 +10554,7 @@ end: #define YYFILL(n) { break; } static int action_line834 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9792,10 +10562,12 @@ static int action_line834 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9805,17 +10577,17 @@ static int action_line834 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line834: at position %ld (iteration %u):\n" + , "error: lex_line834: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9825,6 +10597,13 @@ static int action_line834 } } +static int check_key_count_line834(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line834: not enough keys\n"); + return 1; +} + int lex_line834() { const size_t padding = 1; /* YYMAXFILL */ @@ -9858,7 +10637,7 @@ int lex_line834() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line834.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -9871,7 +10650,7 @@ int lex_line834() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -9881,11 +10660,13 @@ int lex_line834() if (yych <= 0x2AFF) goto yy424; yy422: YYSKIP (); - status = action_line834(i, keys, input, token, &cursor, 254); + status = check_key_count_line834(keys_count, i, 3) + || action_line834(&i, keys, input, token, &cursor, 254); continue; yy424: YYSKIP (); - status = action_line834(i, keys, input, token, &cursor, 0); + status = check_key_count_line834(keys_count, i, 3) + || action_line834(&i, keys, input, token, &cursor, 0); continue; } @@ -9897,7 +10678,7 @@ yy424: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line834: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line834: unused keys left after %u keys\n", i); } } @@ -9923,7 +10704,7 @@ end: #define YYFILL(n) { break; } static int action_line841 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -9931,10 +10712,12 @@ static int action_line841 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -9944,17 +10727,17 @@ static int action_line841 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line841: at position %ld (iteration %u):\n" + , "error: lex_line841: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -9964,6 +10747,13 @@ static int action_line841 } } +static int check_key_count_line841(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line841: not enough keys\n"); + return 1; +} + int lex_line841() { const size_t padding = 1; /* YYMAXFILL */ @@ -9997,7 +10787,7 @@ int lex_line841() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line841.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10010,7 +10800,7 @@ int lex_line841() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10020,11 +10810,13 @@ int lex_line841() if (yych <= 0x2BFF) goto yy430; yy428: YYSKIP (); - status = action_line841(i, keys, input, token, &cursor, 254); + status = check_key_count_line841(keys_count, i, 3) + || action_line841(&i, keys, input, token, &cursor, 254); continue; yy430: YYSKIP (); - status = action_line841(i, keys, input, token, &cursor, 0); + status = check_key_count_line841(keys_count, i, 3) + || action_line841(&i, keys, input, token, &cursor, 0); continue; } @@ -10036,7 +10828,7 @@ yy430: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line841: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line841: unused keys left after %u keys\n", i); } } @@ -10062,7 +10854,7 @@ end: #define YYFILL(n) { break; } static int action_line848 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10070,10 +10862,12 @@ static int action_line848 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10083,17 +10877,17 @@ static int action_line848 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line848: at position %ld (iteration %u):\n" + , "error: lex_line848: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10103,6 +10897,13 @@ static int action_line848 } } +static int check_key_count_line848(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line848: not enough keys\n"); + return 1; +} + int lex_line848() { const size_t padding = 1; /* YYMAXFILL */ @@ -10136,7 +10937,7 @@ int lex_line848() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line848.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10149,7 +10950,7 @@ int lex_line848() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10159,11 +10960,13 @@ int lex_line848() if (yych <= 0x2EFF) goto yy436; yy434: YYSKIP (); - status = action_line848(i, keys, input, token, &cursor, 254); + status = check_key_count_line848(keys_count, i, 3) + || action_line848(&i, keys, input, token, &cursor, 254); continue; yy436: YYSKIP (); - status = action_line848(i, keys, input, token, &cursor, 0); + status = check_key_count_line848(keys_count, i, 3) + || action_line848(&i, keys, input, token, &cursor, 0); continue; } @@ -10175,7 +10978,7 @@ yy436: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line848: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line848: unused keys left after %u keys\n", i); } } @@ -10201,7 +11004,7 @@ end: #define YYFILL(n) { break; } static int action_line855 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10209,10 +11012,12 @@ static int action_line855 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10222,17 +11027,17 @@ static int action_line855 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line855: at position %ld (iteration %u):\n" + , "error: lex_line855: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10242,6 +11047,13 @@ static int action_line855 } } +static int check_key_count_line855(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line855: not enough keys\n"); + return 1; +} + int lex_line855() { const size_t padding = 1; /* YYMAXFILL */ @@ -10275,7 +11087,7 @@ int lex_line855() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line855.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10288,7 +11100,7 @@ int lex_line855() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10298,11 +11110,13 @@ int lex_line855() if (yych <= 0x2FDF) goto yy442; yy440: YYSKIP (); - status = action_line855(i, keys, input, token, &cursor, 254); + status = check_key_count_line855(keys_count, i, 3) + || action_line855(&i, keys, input, token, &cursor, 254); continue; yy442: YYSKIP (); - status = action_line855(i, keys, input, token, &cursor, 0); + status = check_key_count_line855(keys_count, i, 3) + || action_line855(&i, keys, input, token, &cursor, 0); continue; } @@ -10314,7 +11128,7 @@ yy442: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line855: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line855: unused keys left after %u keys\n", i); } } @@ -10340,7 +11154,7 @@ end: #define YYFILL(n) { break; } static int action_line862 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10348,10 +11162,12 @@ static int action_line862 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10361,17 +11177,17 @@ static int action_line862 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line862: at position %ld (iteration %u):\n" + , "error: lex_line862: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10381,6 +11197,13 @@ static int action_line862 } } +static int check_key_count_line862(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line862: not enough keys\n"); + return 1; +} + int lex_line862() { const size_t padding = 1; /* YYMAXFILL */ @@ -10414,7 +11237,7 @@ int lex_line862() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line862.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10427,7 +11250,7 @@ int lex_line862() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10437,11 +11260,13 @@ int lex_line862() if (yych <= 0x2FFF) goto yy448; yy446: YYSKIP (); - status = action_line862(i, keys, input, token, &cursor, 254); + status = check_key_count_line862(keys_count, i, 3) + || action_line862(&i, keys, input, token, &cursor, 254); continue; yy448: YYSKIP (); - status = action_line862(i, keys, input, token, &cursor, 0); + status = check_key_count_line862(keys_count, i, 3) + || action_line862(&i, keys, input, token, &cursor, 0); continue; } @@ -10453,7 +11278,7 @@ yy448: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line862: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line862: unused keys left after %u keys\n", i); } } @@ -10479,7 +11304,7 @@ end: #define YYFILL(n) { break; } static int action_line869 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10487,10 +11312,12 @@ static int action_line869 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10500,17 +11327,17 @@ static int action_line869 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line869: at position %ld (iteration %u):\n" + , "error: lex_line869: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10520,6 +11347,13 @@ static int action_line869 } } +static int check_key_count_line869(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line869: not enough keys\n"); + return 1; +} + int lex_line869() { const size_t padding = 1; /* YYMAXFILL */ @@ -10553,7 +11387,7 @@ int lex_line869() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line869.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10566,7 +11400,7 @@ int lex_line869() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10576,11 +11410,13 @@ int lex_line869() if (yych <= 0x303F) goto yy454; yy452: YYSKIP (); - status = action_line869(i, keys, input, token, &cursor, 254); + status = check_key_count_line869(keys_count, i, 3) + || action_line869(&i, keys, input, token, &cursor, 254); continue; yy454: YYSKIP (); - status = action_line869(i, keys, input, token, &cursor, 0); + status = check_key_count_line869(keys_count, i, 3) + || action_line869(&i, keys, input, token, &cursor, 0); continue; } @@ -10592,7 +11428,7 @@ yy454: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line869: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line869: unused keys left after %u keys\n", i); } } @@ -10618,7 +11454,7 @@ end: #define YYFILL(n) { break; } static int action_line876 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10626,10 +11462,12 @@ static int action_line876 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10639,17 +11477,17 @@ static int action_line876 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line876: at position %ld (iteration %u):\n" + , "error: lex_line876: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10659,6 +11497,13 @@ static int action_line876 } } +static int check_key_count_line876(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line876: not enough keys\n"); + return 1; +} + int lex_line876() { const size_t padding = 1; /* YYMAXFILL */ @@ -10692,7 +11537,7 @@ int lex_line876() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line876.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10705,7 +11550,7 @@ int lex_line876() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10715,11 +11560,13 @@ int lex_line876() if (yych <= 0x309F) goto yy460; yy458: YYSKIP (); - status = action_line876(i, keys, input, token, &cursor, 254); + status = check_key_count_line876(keys_count, i, 3) + || action_line876(&i, keys, input, token, &cursor, 254); continue; yy460: YYSKIP (); - status = action_line876(i, keys, input, token, &cursor, 0); + status = check_key_count_line876(keys_count, i, 3) + || action_line876(&i, keys, input, token, &cursor, 0); continue; } @@ -10731,7 +11578,7 @@ yy460: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line876: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line876: unused keys left after %u keys\n", i); } } @@ -10757,7 +11604,7 @@ end: #define YYFILL(n) { break; } static int action_line883 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10765,10 +11612,12 @@ static int action_line883 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10778,17 +11627,17 @@ static int action_line883 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line883: at position %ld (iteration %u):\n" + , "error: lex_line883: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10798,6 +11647,13 @@ static int action_line883 } } +static int check_key_count_line883(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line883: not enough keys\n"); + return 1; +} + int lex_line883() { const size_t padding = 1; /* YYMAXFILL */ @@ -10831,7 +11687,7 @@ int lex_line883() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line883.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10844,7 +11700,7 @@ int lex_line883() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10854,11 +11710,13 @@ int lex_line883() if (yych <= 0x30FF) goto yy466; yy464: YYSKIP (); - status = action_line883(i, keys, input, token, &cursor, 254); + status = check_key_count_line883(keys_count, i, 3) + || action_line883(&i, keys, input, token, &cursor, 254); continue; yy466: YYSKIP (); - status = action_line883(i, keys, input, token, &cursor, 0); + status = check_key_count_line883(keys_count, i, 3) + || action_line883(&i, keys, input, token, &cursor, 0); continue; } @@ -10870,7 +11728,7 @@ yy466: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line883: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line883: unused keys left after %u keys\n", i); } } @@ -10896,7 +11754,7 @@ end: #define YYFILL(n) { break; } static int action_line890 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -10904,10 +11762,12 @@ static int action_line890 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -10917,17 +11777,17 @@ static int action_line890 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line890: at position %ld (iteration %u):\n" + , "error: lex_line890: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -10937,6 +11797,13 @@ static int action_line890 } } +static int check_key_count_line890(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line890: not enough keys\n"); + return 1; +} + int lex_line890() { const size_t padding = 1; /* YYMAXFILL */ @@ -10970,7 +11837,7 @@ int lex_line890() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line890.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -10983,7 +11850,7 @@ int lex_line890() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -10993,11 +11860,13 @@ int lex_line890() if (yych <= 0x312F) goto yy472; yy470: YYSKIP (); - status = action_line890(i, keys, input, token, &cursor, 254); + status = check_key_count_line890(keys_count, i, 3) + || action_line890(&i, keys, input, token, &cursor, 254); continue; yy472: YYSKIP (); - status = action_line890(i, keys, input, token, &cursor, 0); + status = check_key_count_line890(keys_count, i, 3) + || action_line890(&i, keys, input, token, &cursor, 0); continue; } @@ -11009,7 +11878,7 @@ yy472: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line890: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line890: unused keys left after %u keys\n", i); } } @@ -11035,7 +11904,7 @@ end: #define YYFILL(n) { break; } static int action_line897 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11043,10 +11912,12 @@ static int action_line897 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11056,17 +11927,17 @@ static int action_line897 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line897: at position %ld (iteration %u):\n" + , "error: lex_line897: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11076,6 +11947,13 @@ static int action_line897 } } +static int check_key_count_line897(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line897: not enough keys\n"); + return 1; +} + int lex_line897() { const size_t padding = 1; /* YYMAXFILL */ @@ -11109,7 +11987,7 @@ int lex_line897() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line897.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11122,7 +12000,7 @@ int lex_line897() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11132,11 +12010,13 @@ int lex_line897() if (yych <= 0x318F) goto yy478; yy476: YYSKIP (); - status = action_line897(i, keys, input, token, &cursor, 254); + status = check_key_count_line897(keys_count, i, 3) + || action_line897(&i, keys, input, token, &cursor, 254); continue; yy478: YYSKIP (); - status = action_line897(i, keys, input, token, &cursor, 0); + status = check_key_count_line897(keys_count, i, 3) + || action_line897(&i, keys, input, token, &cursor, 0); continue; } @@ -11148,7 +12028,7 @@ yy478: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line897: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line897: unused keys left after %u keys\n", i); } } @@ -11174,7 +12054,7 @@ end: #define YYFILL(n) { break; } static int action_line904 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11182,10 +12062,12 @@ static int action_line904 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11195,17 +12077,17 @@ static int action_line904 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line904: at position %ld (iteration %u):\n" + , "error: lex_line904: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11215,6 +12097,13 @@ static int action_line904 } } +static int check_key_count_line904(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line904: not enough keys\n"); + return 1; +} + int lex_line904() { const size_t padding = 1; /* YYMAXFILL */ @@ -11248,7 +12137,7 @@ int lex_line904() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line904.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11261,7 +12150,7 @@ int lex_line904() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11271,11 +12160,13 @@ int lex_line904() if (yych <= 0x319F) goto yy484; yy482: YYSKIP (); - status = action_line904(i, keys, input, token, &cursor, 254); + status = check_key_count_line904(keys_count, i, 3) + || action_line904(&i, keys, input, token, &cursor, 254); continue; yy484: YYSKIP (); - status = action_line904(i, keys, input, token, &cursor, 0); + status = check_key_count_line904(keys_count, i, 3) + || action_line904(&i, keys, input, token, &cursor, 0); continue; } @@ -11287,7 +12178,7 @@ yy484: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line904: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line904: unused keys left after %u keys\n", i); } } @@ -11313,7 +12204,7 @@ end: #define YYFILL(n) { break; } static int action_line911 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11321,10 +12212,12 @@ static int action_line911 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11334,17 +12227,17 @@ static int action_line911 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line911: at position %ld (iteration %u):\n" + , "error: lex_line911: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11354,6 +12247,13 @@ static int action_line911 } } +static int check_key_count_line911(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line911: not enough keys\n"); + return 1; +} + int lex_line911() { const size_t padding = 1; /* YYMAXFILL */ @@ -11387,7 +12287,7 @@ int lex_line911() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line911.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11400,7 +12300,7 @@ int lex_line911() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11410,11 +12310,13 @@ int lex_line911() if (yych <= 0x31BF) goto yy490; yy488: YYSKIP (); - status = action_line911(i, keys, input, token, &cursor, 254); + status = check_key_count_line911(keys_count, i, 3) + || action_line911(&i, keys, input, token, &cursor, 254); continue; yy490: YYSKIP (); - status = action_line911(i, keys, input, token, &cursor, 0); + status = check_key_count_line911(keys_count, i, 3) + || action_line911(&i, keys, input, token, &cursor, 0); continue; } @@ -11426,7 +12328,7 @@ yy490: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line911: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line911: unused keys left after %u keys\n", i); } } @@ -11452,7 +12354,7 @@ end: #define YYFILL(n) { break; } static int action_line918 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11460,10 +12362,12 @@ static int action_line918 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11473,17 +12377,17 @@ static int action_line918 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line918: at position %ld (iteration %u):\n" + , "error: lex_line918: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11493,6 +12397,13 @@ static int action_line918 } } +static int check_key_count_line918(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line918: not enough keys\n"); + return 1; +} + int lex_line918() { const size_t padding = 1; /* YYMAXFILL */ @@ -11526,7 +12437,7 @@ int lex_line918() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line918.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11539,7 +12450,7 @@ int lex_line918() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11549,11 +12460,13 @@ int lex_line918() if (yych <= 0x31FF) goto yy496; yy494: YYSKIP (); - status = action_line918(i, keys, input, token, &cursor, 254); + status = check_key_count_line918(keys_count, i, 3) + || action_line918(&i, keys, input, token, &cursor, 254); continue; yy496: YYSKIP (); - status = action_line918(i, keys, input, token, &cursor, 0); + status = check_key_count_line918(keys_count, i, 3) + || action_line918(&i, keys, input, token, &cursor, 0); continue; } @@ -11565,7 +12478,7 @@ yy496: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line918: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line918: unused keys left after %u keys\n", i); } } @@ -11591,7 +12504,7 @@ end: #define YYFILL(n) { break; } static int action_line925 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11599,10 +12512,12 @@ static int action_line925 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11612,17 +12527,17 @@ static int action_line925 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line925: at position %ld (iteration %u):\n" + , "error: lex_line925: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11632,6 +12547,13 @@ static int action_line925 } } +static int check_key_count_line925(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line925: not enough keys\n"); + return 1; +} + int lex_line925() { const size_t padding = 1; /* YYMAXFILL */ @@ -11665,7 +12587,7 @@ int lex_line925() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line925.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11678,7 +12600,7 @@ int lex_line925() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11688,11 +12610,13 @@ int lex_line925() if (yych <= 0x32FF) goto yy502; yy500: YYSKIP (); - status = action_line925(i, keys, input, token, &cursor, 254); + status = check_key_count_line925(keys_count, i, 3) + || action_line925(&i, keys, input, token, &cursor, 254); continue; yy502: YYSKIP (); - status = action_line925(i, keys, input, token, &cursor, 0); + status = check_key_count_line925(keys_count, i, 3) + || action_line925(&i, keys, input, token, &cursor, 0); continue; } @@ -11704,7 +12628,7 @@ yy502: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line925: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line925: unused keys left after %u keys\n", i); } } @@ -11730,7 +12654,7 @@ end: #define YYFILL(n) { break; } static int action_line932 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11738,10 +12662,12 @@ static int action_line932 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11751,17 +12677,17 @@ static int action_line932 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line932: at position %ld (iteration %u):\n" + , "error: lex_line932: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11771,6 +12697,13 @@ static int action_line932 } } +static int check_key_count_line932(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line932: not enough keys\n"); + return 1; +} + int lex_line932() { const size_t padding = 1; /* YYMAXFILL */ @@ -11804,7 +12737,7 @@ int lex_line932() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line932.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11817,7 +12750,7 @@ int lex_line932() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11827,11 +12760,13 @@ int lex_line932() if (yych <= 0x33FF) goto yy508; yy506: YYSKIP (); - status = action_line932(i, keys, input, token, &cursor, 254); + status = check_key_count_line932(keys_count, i, 3) + || action_line932(&i, keys, input, token, &cursor, 254); continue; yy508: YYSKIP (); - status = action_line932(i, keys, input, token, &cursor, 0); + status = check_key_count_line932(keys_count, i, 3) + || action_line932(&i, keys, input, token, &cursor, 0); continue; } @@ -11843,7 +12778,7 @@ yy508: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line932: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line932: unused keys left after %u keys\n", i); } } @@ -11869,7 +12804,7 @@ end: #define YYFILL(n) { break; } static int action_line939 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -11877,10 +12812,12 @@ static int action_line939 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -11890,17 +12827,17 @@ static int action_line939 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line939: at position %ld (iteration %u):\n" + , "error: lex_line939: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -11910,6 +12847,13 @@ static int action_line939 } } +static int check_key_count_line939(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line939: not enough keys\n"); + return 1; +} + int lex_line939() { const size_t padding = 1; /* YYMAXFILL */ @@ -11943,7 +12887,7 @@ int lex_line939() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line939.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -11956,7 +12900,7 @@ int lex_line939() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -11966,11 +12910,13 @@ int lex_line939() if (yych <= 0x4DBF) goto yy514; yy512: YYSKIP (); - status = action_line939(i, keys, input, token, &cursor, 254); + status = check_key_count_line939(keys_count, i, 3) + || action_line939(&i, keys, input, token, &cursor, 254); continue; yy514: YYSKIP (); - status = action_line939(i, keys, input, token, &cursor, 0); + status = check_key_count_line939(keys_count, i, 3) + || action_line939(&i, keys, input, token, &cursor, 0); continue; } @@ -11982,7 +12928,7 @@ yy514: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line939: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line939: unused keys left after %u keys\n", i); } } @@ -12008,7 +12954,7 @@ end: #define YYFILL(n) { break; } static int action_line946 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12016,10 +12962,12 @@ static int action_line946 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12029,17 +12977,17 @@ static int action_line946 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line946: at position %ld (iteration %u):\n" + , "error: lex_line946: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12049,6 +12997,13 @@ static int action_line946 } } +static int check_key_count_line946(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line946: not enough keys\n"); + return 1; +} + int lex_line946() { const size_t padding = 1; /* YYMAXFILL */ @@ -12082,7 +13037,7 @@ int lex_line946() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line946.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12095,7 +13050,7 @@ int lex_line946() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12105,11 +13060,13 @@ int lex_line946() if (yych <= 0x4DFF) goto yy520; yy518: YYSKIP (); - status = action_line946(i, keys, input, token, &cursor, 254); + status = check_key_count_line946(keys_count, i, 3) + || action_line946(&i, keys, input, token, &cursor, 254); continue; yy520: YYSKIP (); - status = action_line946(i, keys, input, token, &cursor, 0); + status = check_key_count_line946(keys_count, i, 3) + || action_line946(&i, keys, input, token, &cursor, 0); continue; } @@ -12121,7 +13078,7 @@ yy520: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line946: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line946: unused keys left after %u keys\n", i); } } @@ -12147,7 +13104,7 @@ end: #define YYFILL(n) { break; } static int action_line953 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12155,10 +13112,12 @@ static int action_line953 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12168,17 +13127,17 @@ static int action_line953 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line953: at position %ld (iteration %u):\n" + , "error: lex_line953: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12188,6 +13147,13 @@ static int action_line953 } } +static int check_key_count_line953(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line953: not enough keys\n"); + return 1; +} + int lex_line953() { const size_t padding = 1; /* YYMAXFILL */ @@ -12221,7 +13187,7 @@ int lex_line953() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line953.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12234,7 +13200,7 @@ int lex_line953() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12244,11 +13210,13 @@ int lex_line953() if (yych <= 0x9FFF) goto yy526; yy524: YYSKIP (); - status = action_line953(i, keys, input, token, &cursor, 254); + status = check_key_count_line953(keys_count, i, 3) + || action_line953(&i, keys, input, token, &cursor, 254); continue; yy526: YYSKIP (); - status = action_line953(i, keys, input, token, &cursor, 0); + status = check_key_count_line953(keys_count, i, 3) + || action_line953(&i, keys, input, token, &cursor, 0); continue; } @@ -12260,7 +13228,7 @@ yy526: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line953: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line953: unused keys left after %u keys\n", i); } } @@ -12286,7 +13254,7 @@ end: #define YYFILL(n) { break; } static int action_line960 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12294,10 +13262,12 @@ static int action_line960 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12307,17 +13277,17 @@ static int action_line960 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line960: at position %ld (iteration %u):\n" + , "error: lex_line960: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12327,6 +13297,13 @@ static int action_line960 } } +static int check_key_count_line960(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line960: not enough keys\n"); + return 1; +} + int lex_line960() { const size_t padding = 1; /* YYMAXFILL */ @@ -12360,7 +13337,7 @@ int lex_line960() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line960.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12373,7 +13350,7 @@ int lex_line960() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12383,11 +13360,13 @@ int lex_line960() if (yych <= 0xA48F) goto yy532; yy530: YYSKIP (); - status = action_line960(i, keys, input, token, &cursor, 254); + status = check_key_count_line960(keys_count, i, 3) + || action_line960(&i, keys, input, token, &cursor, 254); continue; yy532: YYSKIP (); - status = action_line960(i, keys, input, token, &cursor, 0); + status = check_key_count_line960(keys_count, i, 3) + || action_line960(&i, keys, input, token, &cursor, 0); continue; } @@ -12399,7 +13378,7 @@ yy532: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line960: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line960: unused keys left after %u keys\n", i); } } @@ -12425,7 +13404,7 @@ end: #define YYFILL(n) { break; } static int action_line967 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12433,10 +13412,12 @@ static int action_line967 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12446,17 +13427,17 @@ static int action_line967 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line967: at position %ld (iteration %u):\n" + , "error: lex_line967: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12466,6 +13447,13 @@ static int action_line967 } } +static int check_key_count_line967(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line967: not enough keys\n"); + return 1; +} + int lex_line967() { const size_t padding = 1; /* YYMAXFILL */ @@ -12499,7 +13487,7 @@ int lex_line967() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line967.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12512,7 +13500,7 @@ int lex_line967() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12522,11 +13510,13 @@ int lex_line967() if (yych <= 0xA4CF) goto yy538; yy536: YYSKIP (); - status = action_line967(i, keys, input, token, &cursor, 254); + status = check_key_count_line967(keys_count, i, 3) + || action_line967(&i, keys, input, token, &cursor, 254); continue; yy538: YYSKIP (); - status = action_line967(i, keys, input, token, &cursor, 0); + status = check_key_count_line967(keys_count, i, 3) + || action_line967(&i, keys, input, token, &cursor, 0); continue; } @@ -12538,7 +13528,7 @@ yy538: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line967: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line967: unused keys left after %u keys\n", i); } } @@ -12564,7 +13554,7 @@ end: #define YYFILL(n) { break; } static int action_line974 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12572,10 +13562,12 @@ static int action_line974 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12585,17 +13577,17 @@ static int action_line974 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line974: at position %ld (iteration %u):\n" + , "error: lex_line974: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12605,6 +13597,13 @@ static int action_line974 } } +static int check_key_count_line974(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line974: not enough keys\n"); + return 1; +} + int lex_line974() { const size_t padding = 1; /* YYMAXFILL */ @@ -12638,7 +13637,7 @@ int lex_line974() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line974.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12651,7 +13650,7 @@ int lex_line974() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12661,11 +13660,13 @@ int lex_line974() if (yych <= 0xD7AF) goto yy544; yy542: YYSKIP (); - status = action_line974(i, keys, input, token, &cursor, 254); + status = check_key_count_line974(keys_count, i, 3) + || action_line974(&i, keys, input, token, &cursor, 254); continue; yy544: YYSKIP (); - status = action_line974(i, keys, input, token, &cursor, 0); + status = check_key_count_line974(keys_count, i, 3) + || action_line974(&i, keys, input, token, &cursor, 0); continue; } @@ -12677,7 +13678,7 @@ yy544: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line974: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line974: unused keys left after %u keys\n", i); } } @@ -12703,7 +13704,7 @@ end: #define YYFILL(n) { break; } static int action_line981 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12711,10 +13712,12 @@ static int action_line981 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12724,17 +13727,17 @@ static int action_line981 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line981: at position %ld (iteration %u):\n" + , "error: lex_line981: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12744,6 +13747,13 @@ static int action_line981 } } +static int check_key_count_line981(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line981: not enough keys\n"); + return 1; +} + int lex_line981() { const size_t padding = 1; /* YYMAXFILL */ @@ -12777,7 +13787,7 @@ int lex_line981() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line981.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12790,7 +13800,7 @@ int lex_line981() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12800,11 +13810,13 @@ int lex_line981() if (yych <= 0xDB7F) goto yy550; yy548: YYSKIP (); - status = action_line981(i, keys, input, token, &cursor, 254); + status = check_key_count_line981(keys_count, i, 3) + || action_line981(&i, keys, input, token, &cursor, 254); continue; yy550: YYSKIP (); - status = action_line981(i, keys, input, token, &cursor, 0); + status = check_key_count_line981(keys_count, i, 3) + || action_line981(&i, keys, input, token, &cursor, 0); continue; } @@ -12816,7 +13828,7 @@ yy550: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line981: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line981: unused keys left after %u keys\n", i); } } @@ -12842,7 +13854,7 @@ end: #define YYFILL(n) { break; } static int action_line988 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12850,10 +13862,12 @@ static int action_line988 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -12863,17 +13877,17 @@ static int action_line988 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line988: at position %ld (iteration %u):\n" + , "error: lex_line988: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -12883,6 +13897,13 @@ static int action_line988 } } +static int check_key_count_line988(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line988: not enough keys\n"); + return 1; +} + int lex_line988() { const size_t padding = 1; /* YYMAXFILL */ @@ -12916,7 +13937,7 @@ int lex_line988() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line988.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -12929,7 +13950,7 @@ int lex_line988() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -12939,11 +13960,13 @@ int lex_line988() if (yych <= 0xDBFF) goto yy556; yy554: YYSKIP (); - status = action_line988(i, keys, input, token, &cursor, 254); + status = check_key_count_line988(keys_count, i, 3) + || action_line988(&i, keys, input, token, &cursor, 254); continue; yy556: YYSKIP (); - status = action_line988(i, keys, input, token, &cursor, 0); + status = check_key_count_line988(keys_count, i, 3) + || action_line988(&i, keys, input, token, &cursor, 0); continue; } @@ -12955,7 +13978,7 @@ yy556: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line988: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line988: unused keys left after %u keys\n", i); } } @@ -12981,7 +14004,7 @@ end: #define YYFILL(n) { break; } static int action_line995 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -12989,10 +14012,12 @@ static int action_line995 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13002,17 +14027,17 @@ static int action_line995 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line995: at position %ld (iteration %u):\n" + , "error: lex_line995: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13022,6 +14047,13 @@ static int action_line995 } } +static int check_key_count_line995(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line995: not enough keys\n"); + return 1; +} + int lex_line995() { const size_t padding = 1; /* YYMAXFILL */ @@ -13055,7 +14087,7 @@ int lex_line995() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line995.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13068,7 +14100,7 @@ int lex_line995() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13078,11 +14110,13 @@ int lex_line995() if (yych <= 0xDFFF) goto yy562; yy560: YYSKIP (); - status = action_line995(i, keys, input, token, &cursor, 254); + status = check_key_count_line995(keys_count, i, 3) + || action_line995(&i, keys, input, token, &cursor, 254); continue; yy562: YYSKIP (); - status = action_line995(i, keys, input, token, &cursor, 0); + status = check_key_count_line995(keys_count, i, 3) + || action_line995(&i, keys, input, token, &cursor, 0); continue; } @@ -13094,7 +14128,7 @@ yy562: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line995: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line995: unused keys left after %u keys\n", i); } } @@ -13120,7 +14154,7 @@ end: #define YYFILL(n) { break; } static int action_line1002 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13128,10 +14162,12 @@ static int action_line1002 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13141,17 +14177,17 @@ static int action_line1002 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1002: at position %ld (iteration %u):\n" + , "error: lex_line1002: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13161,6 +14197,13 @@ static int action_line1002 } } +static int check_key_count_line1002(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1002: not enough keys\n"); + return 1; +} + int lex_line1002() { const size_t padding = 1; /* YYMAXFILL */ @@ -13194,7 +14237,7 @@ int lex_line1002() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1002.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13207,7 +14250,7 @@ int lex_line1002() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13217,11 +14260,13 @@ int lex_line1002() if (yych <= 0xF8FF) goto yy568; yy566: YYSKIP (); - status = action_line1002(i, keys, input, token, &cursor, 254); + status = check_key_count_line1002(keys_count, i, 3) + || action_line1002(&i, keys, input, token, &cursor, 254); continue; yy568: YYSKIP (); - status = action_line1002(i, keys, input, token, &cursor, 0); + status = check_key_count_line1002(keys_count, i, 3) + || action_line1002(&i, keys, input, token, &cursor, 0); continue; } @@ -13233,7 +14278,7 @@ yy568: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1002: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1002: unused keys left after %u keys\n", i); } } @@ -13259,7 +14304,7 @@ end: #define YYFILL(n) { break; } static int action_line1009 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13267,10 +14312,12 @@ static int action_line1009 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13280,17 +14327,17 @@ static int action_line1009 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1009: at position %ld (iteration %u):\n" + , "error: lex_line1009: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13300,6 +14347,13 @@ static int action_line1009 } } +static int check_key_count_line1009(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1009: not enough keys\n"); + return 1; +} + int lex_line1009() { const size_t padding = 1; /* YYMAXFILL */ @@ -13333,7 +14387,7 @@ int lex_line1009() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1009.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13346,7 +14400,7 @@ int lex_line1009() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13356,11 +14410,13 @@ int lex_line1009() if (yych <= 0xFAFF) goto yy574; yy572: YYSKIP (); - status = action_line1009(i, keys, input, token, &cursor, 254); + status = check_key_count_line1009(keys_count, i, 3) + || action_line1009(&i, keys, input, token, &cursor, 254); continue; yy574: YYSKIP (); - status = action_line1009(i, keys, input, token, &cursor, 0); + status = check_key_count_line1009(keys_count, i, 3) + || action_line1009(&i, keys, input, token, &cursor, 0); continue; } @@ -13372,7 +14428,7 @@ yy574: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1009: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1009: unused keys left after %u keys\n", i); } } @@ -13398,7 +14454,7 @@ end: #define YYFILL(n) { break; } static int action_line1016 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13406,10 +14462,12 @@ static int action_line1016 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13419,17 +14477,17 @@ static int action_line1016 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1016: at position %ld (iteration %u):\n" + , "error: lex_line1016: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13439,6 +14497,13 @@ static int action_line1016 } } +static int check_key_count_line1016(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1016: not enough keys\n"); + return 1; +} + int lex_line1016() { const size_t padding = 1; /* YYMAXFILL */ @@ -13472,7 +14537,7 @@ int lex_line1016() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1016.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13485,7 +14550,7 @@ int lex_line1016() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13495,11 +14560,13 @@ int lex_line1016() if (yych <= 0xFB4F) goto yy580; yy578: YYSKIP (); - status = action_line1016(i, keys, input, token, &cursor, 254); + status = check_key_count_line1016(keys_count, i, 3) + || action_line1016(&i, keys, input, token, &cursor, 254); continue; yy580: YYSKIP (); - status = action_line1016(i, keys, input, token, &cursor, 0); + status = check_key_count_line1016(keys_count, i, 3) + || action_line1016(&i, keys, input, token, &cursor, 0); continue; } @@ -13511,7 +14578,7 @@ yy580: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1016: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1016: unused keys left after %u keys\n", i); } } @@ -13537,7 +14604,7 @@ end: #define YYFILL(n) { break; } static int action_line1023 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13545,10 +14612,12 @@ static int action_line1023 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13558,17 +14627,17 @@ static int action_line1023 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1023: at position %ld (iteration %u):\n" + , "error: lex_line1023: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13578,6 +14647,13 @@ static int action_line1023 } } +static int check_key_count_line1023(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1023: not enough keys\n"); + return 1; +} + int lex_line1023() { const size_t padding = 1; /* YYMAXFILL */ @@ -13611,7 +14687,7 @@ int lex_line1023() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1023.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13624,7 +14700,7 @@ int lex_line1023() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13634,11 +14710,13 @@ int lex_line1023() if (yych <= 0xFDFF) goto yy586; yy584: YYSKIP (); - status = action_line1023(i, keys, input, token, &cursor, 254); + status = check_key_count_line1023(keys_count, i, 3) + || action_line1023(&i, keys, input, token, &cursor, 254); continue; yy586: YYSKIP (); - status = action_line1023(i, keys, input, token, &cursor, 0); + status = check_key_count_line1023(keys_count, i, 3) + || action_line1023(&i, keys, input, token, &cursor, 0); continue; } @@ -13650,7 +14728,7 @@ yy586: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1023: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1023: unused keys left after %u keys\n", i); } } @@ -13676,7 +14754,7 @@ end: #define YYFILL(n) { break; } static int action_line1030 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13684,10 +14762,12 @@ static int action_line1030 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13697,17 +14777,17 @@ static int action_line1030 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1030: at position %ld (iteration %u):\n" + , "error: lex_line1030: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13717,6 +14797,13 @@ static int action_line1030 } } +static int check_key_count_line1030(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1030: not enough keys\n"); + return 1; +} + int lex_line1030() { const size_t padding = 1; /* YYMAXFILL */ @@ -13750,7 +14837,7 @@ int lex_line1030() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1030.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13763,7 +14850,7 @@ int lex_line1030() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13773,11 +14860,13 @@ int lex_line1030() if (yych <= 0xFE0F) goto yy592; yy590: YYSKIP (); - status = action_line1030(i, keys, input, token, &cursor, 254); + status = check_key_count_line1030(keys_count, i, 3) + || action_line1030(&i, keys, input, token, &cursor, 254); continue; yy592: YYSKIP (); - status = action_line1030(i, keys, input, token, &cursor, 0); + status = check_key_count_line1030(keys_count, i, 3) + || action_line1030(&i, keys, input, token, &cursor, 0); continue; } @@ -13789,7 +14878,7 @@ yy592: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1030: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1030: unused keys left after %u keys\n", i); } } @@ -13815,7 +14904,7 @@ end: #define YYFILL(n) { break; } static int action_line1037 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13823,10 +14912,12 @@ static int action_line1037 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13836,17 +14927,17 @@ static int action_line1037 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1037: at position %ld (iteration %u):\n" + , "error: lex_line1037: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13856,6 +14947,13 @@ static int action_line1037 } } +static int check_key_count_line1037(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1037: not enough keys\n"); + return 1; +} + int lex_line1037() { const size_t padding = 1; /* YYMAXFILL */ @@ -13889,7 +14987,7 @@ int lex_line1037() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1037.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -13902,7 +15000,7 @@ int lex_line1037() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -13912,11 +15010,13 @@ int lex_line1037() if (yych <= 0xFE2F) goto yy598; yy596: YYSKIP (); - status = action_line1037(i, keys, input, token, &cursor, 254); + status = check_key_count_line1037(keys_count, i, 3) + || action_line1037(&i, keys, input, token, &cursor, 254); continue; yy598: YYSKIP (); - status = action_line1037(i, keys, input, token, &cursor, 0); + status = check_key_count_line1037(keys_count, i, 3) + || action_line1037(&i, keys, input, token, &cursor, 0); continue; } @@ -13928,7 +15028,7 @@ yy598: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1037: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1037: unused keys left after %u keys\n", i); } } @@ -13954,7 +15054,7 @@ end: #define YYFILL(n) { break; } static int action_line1044 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -13962,10 +15062,12 @@ static int action_line1044 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -13975,17 +15077,17 @@ static int action_line1044 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1044: at position %ld (iteration %u):\n" + , "error: lex_line1044: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -13995,6 +15097,13 @@ static int action_line1044 } } +static int check_key_count_line1044(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1044: not enough keys\n"); + return 1; +} + int lex_line1044() { const size_t padding = 1; /* YYMAXFILL */ @@ -14028,7 +15137,7 @@ int lex_line1044() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1044.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14041,7 +15150,7 @@ int lex_line1044() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14051,11 +15160,13 @@ int lex_line1044() if (yych <= 0xFE4F) goto yy604; yy602: YYSKIP (); - status = action_line1044(i, keys, input, token, &cursor, 254); + status = check_key_count_line1044(keys_count, i, 3) + || action_line1044(&i, keys, input, token, &cursor, 254); continue; yy604: YYSKIP (); - status = action_line1044(i, keys, input, token, &cursor, 0); + status = check_key_count_line1044(keys_count, i, 3) + || action_line1044(&i, keys, input, token, &cursor, 0); continue; } @@ -14067,7 +15178,7 @@ yy604: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1044: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1044: unused keys left after %u keys\n", i); } } @@ -14093,7 +15204,7 @@ end: #define YYFILL(n) { break; } static int action_line1051 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14101,10 +15212,12 @@ static int action_line1051 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14114,17 +15227,17 @@ static int action_line1051 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1051: at position %ld (iteration %u):\n" + , "error: lex_line1051: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14134,6 +15247,13 @@ static int action_line1051 } } +static int check_key_count_line1051(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1051: not enough keys\n"); + return 1; +} + int lex_line1051() { const size_t padding = 1; /* YYMAXFILL */ @@ -14167,7 +15287,7 @@ int lex_line1051() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1051.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14180,7 +15300,7 @@ int lex_line1051() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14190,11 +15310,13 @@ int lex_line1051() if (yych <= 0xFE6F) goto yy610; yy608: YYSKIP (); - status = action_line1051(i, keys, input, token, &cursor, 254); + status = check_key_count_line1051(keys_count, i, 3) + || action_line1051(&i, keys, input, token, &cursor, 254); continue; yy610: YYSKIP (); - status = action_line1051(i, keys, input, token, &cursor, 0); + status = check_key_count_line1051(keys_count, i, 3) + || action_line1051(&i, keys, input, token, &cursor, 0); continue; } @@ -14206,7 +15328,7 @@ yy610: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1051: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1051: unused keys left after %u keys\n", i); } } @@ -14232,7 +15354,7 @@ end: #define YYFILL(n) { break; } static int action_line1058 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14240,10 +15362,12 @@ static int action_line1058 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14253,17 +15377,17 @@ static int action_line1058 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1058: at position %ld (iteration %u):\n" + , "error: lex_line1058: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14273,6 +15397,13 @@ static int action_line1058 } } +static int check_key_count_line1058(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1058: not enough keys\n"); + return 1; +} + int lex_line1058() { const size_t padding = 1; /* YYMAXFILL */ @@ -14306,7 +15437,7 @@ int lex_line1058() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1058.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14319,7 +15450,7 @@ int lex_line1058() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14329,11 +15460,13 @@ int lex_line1058() if (yych <= 0xFEFF) goto yy616; yy614: YYSKIP (); - status = action_line1058(i, keys, input, token, &cursor, 254); + status = check_key_count_line1058(keys_count, i, 3) + || action_line1058(&i, keys, input, token, &cursor, 254); continue; yy616: YYSKIP (); - status = action_line1058(i, keys, input, token, &cursor, 0); + status = check_key_count_line1058(keys_count, i, 3) + || action_line1058(&i, keys, input, token, &cursor, 0); continue; } @@ -14345,7 +15478,7 @@ yy616: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1058: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1058: unused keys left after %u keys\n", i); } } @@ -14371,7 +15504,7 @@ end: #define YYFILL(n) { break; } static int action_line1065 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14379,10 +15512,12 @@ static int action_line1065 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14392,17 +15527,17 @@ static int action_line1065 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1065: at position %ld (iteration %u):\n" + , "error: lex_line1065: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14412,6 +15547,13 @@ static int action_line1065 } } +static int check_key_count_line1065(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1065: not enough keys\n"); + return 1; +} + int lex_line1065() { const size_t padding = 1; /* YYMAXFILL */ @@ -14445,7 +15587,7 @@ int lex_line1065() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1065.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14458,7 +15600,7 @@ int lex_line1065() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14468,11 +15610,13 @@ int lex_line1065() if (yych <= 0xFFEF) goto yy622; yy620: YYSKIP (); - status = action_line1065(i, keys, input, token, &cursor, 254); + status = check_key_count_line1065(keys_count, i, 3) + || action_line1065(&i, keys, input, token, &cursor, 254); continue; yy622: YYSKIP (); - status = action_line1065(i, keys, input, token, &cursor, 0); + status = check_key_count_line1065(keys_count, i, 3) + || action_line1065(&i, keys, input, token, &cursor, 0); continue; } @@ -14484,7 +15628,7 @@ yy622: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1065: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1065: unused keys left after %u keys\n", i); } } @@ -14510,7 +15654,7 @@ end: #define YYFILL(n) { break; } static int action_line1072 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14518,10 +15662,12 @@ static int action_line1072 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14531,17 +15677,17 @@ static int action_line1072 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1072: at position %ld (iteration %u):\n" + , "error: lex_line1072: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14551,6 +15697,13 @@ static int action_line1072 } } +static int check_key_count_line1072(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1072: not enough keys\n"); + return 1; +} + int lex_line1072() { const size_t padding = 1; /* YYMAXFILL */ @@ -14584,7 +15737,7 @@ int lex_line1072() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1072.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14597,7 +15750,7 @@ int lex_line1072() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14605,11 +15758,13 @@ int lex_line1072() yych = YYPEEK (); if (yych >= 0xFFF0) goto yy628; YYSKIP (); - status = action_line1072(i, keys, input, token, &cursor, 254); + status = check_key_count_line1072(keys_count, i, 3) + || action_line1072(&i, keys, input, token, &cursor, 254); continue; yy628: YYSKIP (); - status = action_line1072(i, keys, input, token, &cursor, 0); + status = check_key_count_line1072(keys_count, i, 3) + || action_line1072(&i, keys, input, token, &cursor, 0); continue; } @@ -14621,7 +15776,7 @@ yy628: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1072: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1072: unused keys left after %u keys\n", i); } } @@ -14647,7 +15802,7 @@ end: #define YYFILL(n) { break; } static int action_line1079 - ( unsigned int i + ( unsigned *pkix , const YYKEYTYPE *keys , const YYCTYPE *start , const YYCTYPE *token @@ -14655,10 +15810,12 @@ static int action_line1079 , YYKEYTYPE rule_act ) { + const unsigned kix = *pkix; const long pos = token - start; const long len_act = *cursor - token; - const long len_exp = (long) keys [3 * i + 1]; - const YYKEYTYPE rule_exp = keys [3 * i + 2]; + const long len_exp = (long) keys[kix + 1]; + const YYKEYTYPE rule_exp = keys[kix + 2]; + *pkix = kix + 3; if (rule_exp == 255) { fprintf ( stderr @@ -14668,17 +15825,17 @@ static int action_line1079 ); } if (len_act == len_exp && rule_act == rule_exp) { - const YYKEYTYPE offset = keys[3 * i]; + const YYKEYTYPE offset = keys[kix]; *cursor = token + offset; return 0; } else { fprintf ( stderr - , "error: lex_line1079: at position %ld (iteration %u):\n" + , "error: lex_line1079: at position %ld (key %u):\n" "\texpected: match length %ld, rule %u\n" "\tactual: match length %ld, rule %u\n" , pos - , i + , kix , len_exp , rule_exp , len_act @@ -14688,6 +15845,13 @@ static int action_line1079 } } +static int check_key_count_line1079(unsigned have, unsigned used, unsigned need) +{ + if (used + need <= have) return 0; + fprintf(stderr, "error: lex_line1079: not enough keys\n"); + return 1; +} + int lex_line1079() { const size_t padding = 1; /* YYMAXFILL */ @@ -14721,7 +15885,7 @@ int lex_line1079() keys = (YYKEYTYPE *) read_file ("unicode_blocks.x--skeleton--encoding-policy(ignore).c.line1079.keys" - , 3 * sizeof (YYKEYTYPE) + , sizeof (YYKEYTYPE) , 0 , &keys_count ); @@ -14734,7 +15898,7 @@ int lex_line1079() limit = input + input_len + padding; eof = input + input_len; - for (i = 0; status == 0 && i < keys_count; ++i) { + for (i = 0; status == 0 && cursor < eof && i < keys_count;) { token = cursor; YYCTYPE yych; @@ -14782,11 +15946,13 @@ int lex_line1079() } yy632: YYSKIP (); - status = action_line1079(i, keys, input, token, &cursor, 0); + status = check_key_count_line1079(keys_count, i, 3) + || action_line1079(&i, keys, input, token, &cursor, 0); continue; yy634: YYSKIP (); - status = action_line1079(i, keys, input, token, &cursor, 254); + status = check_key_count_line1079(keys_count, i, 3) + || action_line1079(&i, keys, input, token, &cursor, 254); continue; } @@ -14798,7 +15964,7 @@ yy634: } if (i != keys_count) { status = 1; - fprintf(stderr, "error: lex_line1079: unused keys left after %u iterations\n", i); + fprintf(stderr, "error: lex_line1079: unused keys left after %u keys\n", i); } } -- 2.40.0