[Groonga-commit] groonga/groonga at 6c68c44 [master] Add quorum match

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 8 00:01:50 JST 2018


Kouhei Sutou	2018-01-08 00:01:50 +0900 (Mon, 08 Jan 2018)

  New Revision: 6c68c44c30afbd5c687ca7918cb8bbb509077e84
  https://github.com/groonga/groonga/commit/6c68c44c30afbd5c687ca7918cb8bbb509077e84

  Message:
    Add quorum match
    
    Query syntax:
    
        *Q${THRESHOLD}"..."
    
    Script syntax:
    
        column *Q${THRESHOLD} "..."
    
    [groonga-talk:385]
    
    Suggested by 付超群. Thanks!!!

  Modified files:
    include/groonga/groonga.h
    lib/db.c
    lib/expr.c
    lib/grn_ecmascript.c
    lib/grn_ecmascript.h
    lib/grn_ecmascript.lemon
    lib/grn_expr.h
    lib/grn_ii.h
    lib/ii.c
    lib/mrb/mrb_expr.c
    lib/mrb/mrb_operator.c
    lib/mrb/scripts/expression_tree_builder.rb
    lib/mrb/scripts/scan_info.rb
    lib/mrb/scripts/scan_info_builder.rb
    lib/mrb/scripts/scan_info_data.rb

  Modified: include/groonga/groonga.h (+4 -2)
===================================================================
--- include/groonga/groonga.h    2018-01-07 15:04:32 +0900 (e289bf97f)
+++ include/groonga/groonga.h    2018-01-08 00:01:50 +0900 (01c9c1ff6)
@@ -1,5 +1,5 @@
 /*
-  Copyright(C) 2009-2017 Brazil
+  Copyright(C) 2009-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -609,7 +609,8 @@ typedef enum {
   GRN_OP_JSON_PUT,
   GRN_OP_GET_MEMBER,
   GRN_OP_REGEXP,
-  GRN_OP_FUZZY
+  GRN_OP_FUZZY,
+  GRN_OP_QUORUM
 } grn_operator;
 
 GRN_API grn_obj *grn_obj_column(grn_ctx *ctx, grn_obj *table,
@@ -809,6 +810,7 @@ struct _grn_search_optarg {
   unsigned int scorer_args_expr_offset;
   grn_fuzzy_search_optarg fuzzy;
   grn_match_info match_info;
+  int quorum_threshold;
 };
 
 GRN_API grn_rc grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query,

  Modified: lib/db.c (+8 -1)
===================================================================
--- lib/db.c    2018-01-07 15:04:32 +0900 (94b21e8e9)
+++ lib/db.c    2018-01-08 00:01:50 +0900 (4d8578d8a)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2009-2017 Brazil
+  Copyright(C) 2009-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -3625,6 +3625,9 @@ grn_obj_search_column_index_by_key(grn_ctx *ctx, grn_obj *obj,
         case GRN_OP_FUZZY :
           tag = "[key][fuzzy]";
           break;
+        case GRN_OP_QUORUM :
+          tag = "[key][quorum]";
+          break;
         default :
           tag = "[key][unknown]";
           break;
@@ -12815,6 +12818,7 @@ is_valid_index(grn_ctx *ctx, grn_obj *index_column, grn_operator op)
   case GRN_OP_NEAR :
   case GRN_OP_NEAR2 :
   case GRN_OP_SIMILAR :
+  case GRN_OP_QUORUM :
     return is_valid_match_index(ctx, index_column);
     break;
   case GRN_OP_LESS :
@@ -13141,6 +13145,7 @@ grn_column_find_index_data_accessor(grn_ctx *ctx, grn_obj *obj,
   case GRN_OP_CALL :
   case GRN_OP_REGEXP :
   case GRN_OP_FUZZY :
+  case GRN_OP_QUORUM :
     n = grn_column_find_index_data_accessor_match(ctx, obj, op,
                                                   index_data, n_index_data,
                                                   index_buf, buf_size,
@@ -13176,6 +13181,7 @@ grn_column_index(grn_ctx *ctx, grn_obj *obj, grn_operator op,
     case GRN_OP_SIMILAR :
     case GRN_OP_REGEXP :
     case GRN_OP_FUZZY :
+    case GRN_OP_QUORUM :
       n = grn_column_find_index_data_column_match(ctx, obj, op,
                                                   NULL, 0,
                                                   index_buf, buf_size,
@@ -13226,6 +13232,7 @@ grn_column_find_index_data(grn_ctx *ctx, grn_obj *obj, grn_operator op,
     case GRN_OP_SIMILAR :
     case GRN_OP_REGEXP :
     case GRN_OP_FUZZY :
+    case GRN_OP_QUORUM :
       n = grn_column_find_index_data_column_match(ctx, obj, op,
                                                   index_data, n_index_data,
                                                   NULL, 0, NULL);

  Modified: lib/expr.c (+84 -2)
===================================================================
--- lib/expr.c    2018-01-07 15:04:32 +0900 (a5c68d22d)
+++ lib/expr.c    2018-01-08 00:01:50 +0900 (590125635)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2010-2017 Brazil
+  Copyright(C) 2010-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -1100,6 +1100,7 @@ grn_expr_append_obj(grn_ctx *ctx, grn_obj *expr, grn_obj *obj, grn_operator op,
     case GRN_OP_ADJUST :
     case GRN_OP_TERM_EXTRACT :
     case GRN_OP_REGEXP :
+    case GRN_OP_QUORUM :
       PUSH_CODE(e, op, obj, nargs, code);
       if (nargs) {
         int i = nargs - 1;
@@ -3924,6 +3925,7 @@ grn_expr_get_value(grn_ctx *ctx, grn_obj *expr, int offset)
 #define DEFAULT_DECAYSTEP 2
 #define DEFAULT_MAX_INTERVAL 10
 #define DEFAULT_SIMILARITY_THRESHOLD 0
+#define DEFAULT_QUORUM_THRESHOLD 1
 #define DEFAULT_TERM_EXTRACT_POLICY 0
 #define DEFAULT_WEIGHT_VECTOR_SIZE 4096
 
@@ -3943,6 +3945,7 @@ struct _grn_scan_info {
   grn_obj *initial_args[GRN_SCAN_INFO_INITIAL_MAX_N_ARGS];
   int max_interval;
   int similarity_threshold;
+  int quorum_threshold;
   grn_obj scorers;
   grn_obj scorer_args_exprs;
   grn_obj scorer_args_expr_offsets;
@@ -3976,6 +3979,7 @@ struct _grn_scan_info {
     (si)->args = (si)->initial_args;\
     (si)->max_interval = DEFAULT_MAX_INTERVAL;\
     (si)->similarity_threshold = DEFAULT_SIMILARITY_THRESHOLD;\
+    (si)->quorum_threshold = DEFAULT_QUORUM_THRESHOLD;\
     (si)->start = (st);\
     (si)->query = NULL;\
     GRN_PTR_INIT(&(si)->scorers, GRN_OBJ_VECTOR, GRN_ID_NIL);\
@@ -4138,7 +4142,11 @@ static const char *opstrs[] = {
   "TABLE_SELECT",
   "TABLE_SORT",
   "TABLE_GROUP",
-  "JSON_PUT"
+  "JSON_PUT",
+  "GET_MEMBER",
+  "REGEXP",
+  "FUZZY",
+  "QUORUM"
 };
 
 static void
@@ -4297,6 +4305,7 @@ grn_scan_info_open(grn_ctx *ctx, int start)
   si->args = si->initial_args;
   si->max_interval = DEFAULT_MAX_INTERVAL;
   si->similarity_threshold = DEFAULT_SIMILARITY_THRESHOLD;
+  si->quorum_threshold = DEFAULT_QUORUM_THRESHOLD;
   si->start = start;
   GRN_PTR_INIT(&si->scorers, GRN_OBJ_VECTOR, GRN_ID_NIL);
   GRN_PTR_INIT(&si->scorer_args_exprs, GRN_OBJ_VECTOR, GRN_ID_NIL);
@@ -4411,6 +4420,18 @@ grn_scan_info_set_similarity_threshold(scan_info *si, int similarity_threshold)
   si->similarity_threshold = similarity_threshold;
 }
 
+int
+grn_scan_info_get_quorum_threshold(scan_info *si)
+{
+  return si->quorum_threshold;
+}
+
+void
+grn_scan_info_set_quorum_threshold(scan_info *si, int quorum_threshold)
+{
+  si->quorum_threshold = quorum_threshold;
+}
+
 grn_bool
 grn_scan_info_push_arg(grn_ctx *ctx, scan_info *si, grn_obj *arg)
 {
@@ -4810,6 +4831,15 @@ scan_info_build_match(grn_ctx *ctx, scan_info *si, int32_t weight)
           si->query = *p;
         }
         break;
+      case GRN_OP_QUORUM :
+        if (si->nargs == 3 &&
+            *p == si->args[2] &&
+            (*p)->header.domain == GRN_DB_INT32) {
+          si->quorum_threshold = GRN_INT32_VALUE(*p);
+        } else {
+          si->query = *p;
+        }
+        break;
       default :
         si->query = *p;
         break;
@@ -4952,6 +4982,7 @@ grn_scan_info_build_full(grn_ctx *ctx, grn_obj *expr, int *n,
     case GRN_OP_GEO_WITHINP8 :
     case GRN_OP_TERM_EXTRACT :
     case GRN_OP_REGEXP :
+    case GRN_OP_QUORUM :
       if (stat < SCAN_COL1 || SCAN_CONST < stat) { return NULL; }
       stat = SCAN_START;
       m++;
@@ -5105,6 +5136,7 @@ grn_scan_info_build_full(grn_ctx *ctx, grn_obj *expr, int *n,
     case GRN_OP_GEO_WITHINP8 :
     case GRN_OP_TERM_EXTRACT :
     case GRN_OP_REGEXP :
+    case GRN_OP_QUORUM :
       stat = SCAN_START;
       si->op = code_op;
       si->end = c - e->codes;
@@ -5438,6 +5470,7 @@ grn_scan_info_build_simple_operation(grn_ctx *ctx,
   case GRN_OP_GREATER_EQUAL :
   case GRN_OP_TERM_EXTRACT :
   case GRN_OP_REGEXP :
+  case GRN_OP_QUORUM :
     break;
   default :
     return NULL;
@@ -5519,6 +5552,7 @@ grn_scan_info_build_simple_and_operations(grn_ctx *ctx,
     case GRN_OP_GREATER_EQUAL :
     case GRN_OP_TERM_EXTRACT :
     case GRN_OP_REGEXP :
+    case GRN_OP_QUORUM :
       break;
     default :
       return NULL;
@@ -6292,6 +6326,9 @@ grn_table_select_index_match(grn_ctx *ctx,
   case GRN_OP_SIMILAR :
     optarg.similarity_threshold = si->similarity_threshold;
     break;
+  case GRN_OP_QUORUM :
+    optarg.quorum_threshold = si->quorum_threshold;
+    break;
   default :
     break;
   }
@@ -6815,6 +6852,7 @@ grn_table_select_index(grn_ctx *ctx, grn_obj *table, scan_info *si,
     case GRN_OP_NEAR2 :
     case GRN_OP_SIMILAR :
     case GRN_OP_REGEXP :
+    case GRN_OP_QUORUM :
       processed = grn_table_select_index_match(ctx,
                                                table,
                                                index,
@@ -7055,6 +7093,7 @@ typedef struct {
   grn_obj mode_stack;
   grn_obj max_interval_stack;
   grn_obj similarity_threshold_stack;
+  grn_obj quorum_threshold_stack;
   grn_obj weight_stack;
   grn_operator default_op;
   grn_select_optarg opt;
@@ -7136,6 +7175,13 @@ parse_query_op(efs_info *q, efs_op *op, grn_operator *mode, int *option)
     start = ++end;
     q->cur = end;
     break;
+  case 'Q' :
+    *mode = GRN_OP_QUORUM;
+    start = ++end;
+    *option = grn_atoi(start, q->str_end, (const char **)&end);
+    if (start == end) { *option = DEFAULT_QUORUM_THRESHOLD; }
+    q->cur = end;
+    break;
   default :
     found = GRN_FALSE;
     break;
@@ -7325,6 +7371,20 @@ parse_query_accept_string(grn_ctx *ctx, efs_info *efsi,
       }
     }
     break;
+  case GRN_OP_QUORUM :
+    {
+      int quorum_threshold;
+      quorum_threshold =
+        grn_int32_value_at(&efsi->quorum_threshold_stack, -1);
+      grn_expr_append_const_int(efsi->ctx, efsi->e, quorum_threshold,
+                                GRN_OP_PUSH, 1);
+      if (weight == 0) {
+        grn_expr_append_op(efsi->ctx, efsi->e, mode, 3);
+      } else {
+        grn_expr_append_const_int(efsi->ctx, efsi->e, weight, mode, 3);
+      }
+    }
+    break;
   default :
     if (weight == 0) {
       grn_expr_append_op(efsi->ctx, efsi->e, mode, 2);
@@ -7635,6 +7695,9 @@ parse_query(grn_ctx *ctx, efs_info *q)
         case GRN_OP_SIMILAR :
           GRN_INT32_PUT(ctx, &q->similarity_threshold_stack, option);
           break;
+        case GRN_OP_QUORUM :
+          GRN_INT32_PUT(ctx, &q->quorum_threshold_stack, option);
+          break;
         default :
           break;
         }
@@ -8133,6 +8196,22 @@ parse_script(grn_ctx *ctx, efs_info *q)
         PARSE(GRN_EXPR_TOKEN_TERM_EXTRACT);
         q->cur += 2;
         break;
+      case 'Q' :
+        {
+          const char *next_start = q->cur + 2;
+          const char *end;
+          int quorum_threshold;
+          quorum_threshold = grn_atoi(next_start, q->str_end, &end);
+          if (end == next_start) {
+            quorum_threshold = DEFAULT_QUORUM_THRESHOLD;
+          } else {
+            next_start = end;
+          }
+          GRN_INT32_PUT(ctx, &q->quorum_threshold_stack, quorum_threshold);
+          PARSE(GRN_EXPR_TOKEN_QUORUM);
+          q->cur = next_start;
+        }
+        break;
       case '>' :
         PARSE(GRN_EXPR_TOKEN_ADJUST);
         q->cur += 2;
@@ -8489,6 +8568,7 @@ grn_expr_parse(grn_ctx *ctx, grn_obj *expr,
     GRN_INT32_INIT(&efsi.mode_stack, GRN_OBJ_VECTOR);
     GRN_INT32_INIT(&efsi.max_interval_stack, GRN_OBJ_VECTOR);
     GRN_INT32_INIT(&efsi.similarity_threshold_stack, GRN_OBJ_VECTOR);
+    GRN_INT32_INIT(&efsi.quorum_threshold_stack, GRN_OBJ_VECTOR);
     GRN_INT32_INIT(&efsi.weight_stack, GRN_OBJ_VECTOR);
     GRN_PTR_INIT(&efsi.column_stack, GRN_OBJ_VECTOR, GRN_ID_NIL);
     GRN_PTR_INIT(&efsi.token_stack, GRN_OBJ_VECTOR, GRN_ID_NIL);
@@ -8547,6 +8627,7 @@ grn_expr_parse(grn_ctx *ctx, grn_obj *expr,
     GRN_OBJ_FIN(ctx, &efsi.mode_stack);
     GRN_OBJ_FIN(ctx, &efsi.max_interval_stack);
     GRN_OBJ_FIN(ctx, &efsi.similarity_threshold_stack);
+    GRN_OBJ_FIN(ctx, &efsi.quorum_threshold_stack);
     GRN_OBJ_FIN(ctx, &efsi.weight_stack);
     GRN_OBJ_FIN(ctx, &efsi.column_stack);
     GRN_OBJ_FIN(ctx, &efsi.token_stack);
@@ -9212,6 +9293,7 @@ grn_expr_get_keywords(grn_ctx *ctx, grn_obj *expr, grn_obj *keywords)
             }
             break;
           case GRN_OP_SIMILAR :
+          case GRN_OP_QUORUM :
             if (keywords->header.type == GRN_VECTOR &&
                 GRN_BULK_VSIZE(&(si->index)) > 0) {
               grn_token_cursor *token_cursor;

  Modified: lib/grn_ecmascript.c (+922 -896)
===================================================================
--- lib/grn_ecmascript.c    2018-01-07 15:04:32 +0900 (cfabcc919)
+++ lib/grn_ecmascript.c    2018-01-08 00:01:50 +0900 (9df72a96f)
@@ -80,7 +80,8 @@
 **    YY_MAX_SHIFT       Maximum value for shift actions
 **    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
 **    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
-**    YY_MIN_REDUCE      Maximum value for reduce actions
+**    YY_MIN_REDUCE      Minimum value for reduce actions
+**    YY_MAX_REDUCE      Maximum value for reduce actions
 **    YY_ERROR_ACTION    The yy_action[] code for syntax error
 **    YY_ACCEPT_ACTION   The yy_action[] code for accept
 **    YY_NO_ACTION       The yy_action[] code for no-op
@@ -90,13 +91,13 @@
 #endif
 /************* Begin control #defines *****************************************/
 #define YYCODETYPE unsigned char
-#define YYNOCODE 115
+#define YYNOCODE 116
 #define YYACTIONTYPE unsigned short int
 #define grn_expr_parserTOKENTYPE  int 
 typedef union {
   int yyinit;
   grn_expr_parserTOKENTYPE yy0;
-  void * yy217;
+  void * yy165;
 } YYMINORTYPE;
 #ifndef YYSTACKDEPTH
 #define YYSTACKDEPTH 100
@@ -105,16 +106,16 @@ typedef union {
 #define grn_expr_parserARG_PDECL , efs_info *efsi 
 #define grn_expr_parserARG_FETCH  efs_info *efsi  = yypParser->efsi 
 #define grn_expr_parserARG_STORE yypParser->efsi  = efsi 
-#define YYNSTATE             145
-#define YYNRULE              136
-#define YY_MAX_SHIFT         144
-#define YY_MIN_SHIFTREDUCE   232
-#define YY_MAX_SHIFTREDUCE   367
-#define YY_MIN_REDUCE        368
-#define YY_MAX_REDUCE        503
-#define YY_ERROR_ACTION      504
-#define YY_ACCEPT_ACTION     505
-#define YY_NO_ACTION         506
+#define YYNSTATE             147
+#define YYNRULE              137
+#define YY_MAX_SHIFT         146
+#define YY_MIN_SHIFTREDUCE   234
+#define YY_MAX_SHIFTREDUCE   370
+#define YY_MIN_REDUCE        371
+#define YY_MAX_REDUCE        507
+#define YY_ERROR_ACTION      508
+#define YY_ACCEPT_ACTION     509
+#define YY_NO_ACTION         510
 /************* End control #defines *******************************************/
 
 /* Define the yytestcase() macro to be a no-op if is not already defined
@@ -186,423 +187,425 @@ typedef union {
 **  yy_default[]       Default action for each state.
 **
 *********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (1794)
+#define YY_ACTTAB_COUNT (1807)
 static const YYACTIONTYPE yy_action[] = {
- /*     0 */     3,   72,  115,  115,  136,  131,  323,    2,  363,   54,
- /*    10 */    83,  129,    1,  232,   71,  505,   79,  112,   10,  241,
- /*    20 */    79,   75,  112,  112,   91,  126,  125,  139,  138,  137,
- /*    30 */   120,   88,  103,  116,  104,  104,  104,   91,   75,  241,
- /*    40 */   241,   75,   75,  323,   74,  457,   84,   83,  144,    9,
- /*    50 */   236,   71,   66,   65,   53,   52,   51,   69,   68,   67,
- /*    60 */    64,   63,   61,   60,   59,  348,  349,  350,  351,  352,
- /*    70 */     4,  127,   70,   58,   57,   75,  127,  127,   91,  126,
- /*    80 */   125,  139,  138,  137,  120,   88,  103,  116,  104,  104,
- /*    90 */   104,   91,   75,   78,  456,   75,   75,   78,   76,  115,
- /*   100 */   115,  136,  235,  323,    2,  499,   54,   83,  129,    1,
- /*   110 */     5,   71,   78,  118,  110,   82,   78,   75,  118,  118,
- /*   120 */    91,  126,  125,  139,  138,  137,  120,   88,  103,  116,
- /*   130 */   104,  104,  104,   91,   75,  315,  133,   75,   75,    7,
- /*   140 */   300,   62,   77,  346,   73,  110,  133,  362,  136,   66,
- /*   150 */    65,  299,  343,  239,   69,   68,   67,   64,   63,   61,
- /*   160 */    60,   59,  348,  349,  350,  351,  352,    4,   50,   49,
- /*   170 */    48,   47,   46,   45,   44,   43,   42,   41,   40,   39,
- /*   180 */    38,   37,   31,   30,   66,   65,  312,   56,   55,   69,
- /*   190 */    68,   67,   64,   63,   61,   60,   59,  348,  349,  350,
- /*   200 */   351,  352,    4,  111,  238,  313,   75,  314,  314,   91,
- /*   210 */   126,  125,  139,  138,  137,  120,   88,  103,  116,  104,
- /*   220 */   104,  104,   91,   75,   36,   35,   75,   75,    7,  237,
- /*   230 */    62,    6,  346,   73,  309,  240,  357,   28,   75,   87,
- /*   240 */    87,   91,  126,  125,  139,  138,  137,  120,   88,  103,
- /*   250 */   116,  104,  104,  104,   91,   75,  304,  234,   75,   75,
- /*   260 */    11,   87,    7,   23,   62,  233,  346,   73,  297,  298,
- /*   270 */   357,    7,  356,   66,   65,  346,   73,  130,   69,   68,
- /*   280 */    67,   64,   63,   61,   60,   59,  348,  349,  350,  351,
- /*   290 */   352,    4,  354,    7,    8,   62,  135,  346,   73,  345,
- /*   300 */   317,  356,   32,   29,  316,  132,   28,   66,   65,  364,
- /*   310 */    24,   34,   69,   68,   67,   64,   63,   61,   60,   59,
- /*   320 */   348,  349,  350,  351,  352,    4,  353,   26,  355,  348,
- /*   330 */   349,  350,  351,  352,    4,   33,   25,  370,   66,   65,
- /*   340 */   370,  370,  370,   69,   68,   67,   64,   63,   61,   60,
- /*   350 */    59,  348,  349,  350,  351,  352,    4,   75,  314,  314,
- /*   360 */    91,  126,  125,  139,  138,  137,  120,   88,  103,  116,
- /*   370 */   104,  104,  104,   91,   75,  370,  370,   75,   75,  370,
- /*   380 */   370,  370,  370,  370,  370,  311,   28,  370,  370,  370,
- /*   390 */   370,   75,  306,  306,   91,  126,  125,  139,  138,  137,
- /*   400 */   120,   88,  103,  116,  104,  104,  104,   91,   75,  370,
- /*   410 */   370,   75,   75,  370,  370,  370,  370,  370,  114,  118,
- /*   420 */   370,  370,  370,   75,  118,  118,   91,  126,  125,  139,
- /*   430 */   138,  137,  120,   88,  103,  116,  104,  104,  104,   91,
- /*   440 */    75,  121,  303,   75,   75,   75,  121,  121,   91,  126,
- /*   450 */   125,  139,  138,  137,  120,   88,  103,  116,  104,  104,
- /*   460 */   104,   91,   75,  370,  370,   75,   75,  370,    7,  370,
- /*   470 */    62,  127,  346,   73,  370,   75,  127,  127,   91,  126,
- /*   480 */   125,  139,  138,  137,  120,   88,  103,  116,  104,  104,
- /*   490 */   104,   91,   75,  455,  370,   75,   75,    7,  370,   62,
- /*   500 */   370,  346,   73,  370,  370,  370,  370,  370,  370,   28,
- /*   510 */   370,  370,  370,   66,   65,  370,  370,  370,   69,   68,
- /*   520 */    67,   64,   63,   61,   60,   59,  348,  349,  128,  351,
- /*   530 */   352,    4,  370,  370,  370,  370,  370,  370,  370,  370,
- /*   540 */   370,  370,   66,   65,  370,  370,  370,   69,   68,   67,
- /*   550 */    64,   63,   61,   60,   59,  348,  349,  350,  351,  352,
- /*   560 */     4,   75,  360,  360,   91,  126,  125,  139,  138,  137,
- /*   570 */   120,   88,  103,  116,  104,  104,  104,   91,   75,  370,
- /*   580 */   370,   75,   75,   75,  359,  359,   91,  126,  125,  139,
- /*   590 */   138,  137,  120,   88,  103,  116,  104,  104,  104,   91,
- /*   600 */    75,  370,  370,   75,   75,   75,  254,  254,   91,  126,
- /*   610 */   125,  139,  138,  137,  120,   88,  103,  116,  104,  104,
- /*   620 */   104,   91,   75,  370,  370,   75,   75,   75,  253,  253,
- /*   630 */    91,  126,  125,  139,  138,  137,  120,   88,  103,  116,
- /*   640 */   104,  104,  104,   91,   75,  370,  370,   75,   75,   75,
- /*   650 */   252,  252,   91,  126,  125,  139,  138,  137,  120,   88,
- /*   660 */   103,  116,  104,  104,  104,   91,   75,  370,  370,   75,
- /*   670 */    75,   75,  251,  251,   91,  126,  125,  139,  138,  137,
- /*   680 */   120,   88,  103,  116,  104,  104,  104,   91,   75,  370,
- /*   690 */   370,   75,   75,   75,  250,  250,   91,  126,  125,  139,
- /*   700 */   138,  137,  120,   88,  103,  116,  104,  104,  104,   91,
- /*   710 */    75,  370,  370,   75,   75,   75,  249,  249,   91,  126,
- /*   720 */   125,  139,  138,  137,  120,   88,  103,  116,  104,  104,
- /*   730 */   104,   91,   75,  370,  370,   75,   75,   75,  248,  248,
- /*   740 */    91,  126,  125,  139,  138,  137,  120,   88,  103,  116,
- /*   750 */   104,  104,  104,   91,   75,  370,  370,   75,   75,   75,
- /*   760 */   247,  247,   91,  126,  125,  139,  138,  137,  120,   88,
- /*   770 */   103,  116,  104,  104,  104,   91,   75,  370,  370,   75,
- /*   780 */    75,   75,  246,  246,   91,  126,  125,  139,  138,  137,
- /*   790 */   120,   88,  103,  116,  104,  104,  104,   91,   75,  370,
- /*   800 */   370,   75,   75,   75,  245,  245,   91,  126,  125,  139,
- /*   810 */   138,  137,  120,   88,  103,  116,  104,  104,  104,   91,
- /*   820 */    75,  370,  370,   75,   75,   75,  244,  244,   91,  126,
- /*   830 */   125,  139,  138,  137,  120,   88,  103,  116,  104,  104,
- /*   840 */   104,   91,   75,  370,  370,   75,   75,   75,  307,  307,
- /*   850 */    91,  126,  125,  139,  138,  137,  120,   88,  103,  116,
- /*   860 */   104,  104,  104,   91,   75,  370,  370,   75,   75,   75,
- /*   870 */   302,  302,   91,  126,  125,  139,  138,  137,  120,   88,
- /*   880 */   103,  116,  104,  104,  104,   91,   75,  370,  370,   75,
- /*   890 */    75,   75,  255,  255,   91,  126,  125,  139,  138,  137,
- /*   900 */   120,   88,  103,  116,  104,  104,  104,   91,   75,  370,
- /*   910 */   370,   75,   75,   75,  143,  143,   91,  126,  125,  139,
- /*   920 */   138,  137,  120,   88,  103,  116,  104,  104,  104,   91,
- /*   930 */    75,  370,  370,   75,   75,   75,  243,  243,   91,  126,
- /*   940 */   125,  139,  138,  137,  120,   88,  103,  116,  104,  104,
- /*   950 */   104,   91,   75,  370,  370,   75,   75,   75,  242,  242,
- /*   960 */    91,  126,  125,  139,  138,  137,  120,   88,  103,  116,
- /*   970 */   104,  104,  104,   91,   75,  370,   75,   75,   75,  122,
- /*   980 */   370,  113,  139,  138,  137,  120,   88,  103,  116,  104,
- /*   990 */   104,  104,  122,   75,  370,   75,   75,   75,  122,  370,
- /*  1000 */   370,  134,  138,  137,  120,   88,  103,  116,  104,  104,
- /*  1010 */   104,  122,   75,  370,   75,   75,   75,  122,  370,  370,
- /*  1020 */   142,  138,  137,  120,   88,  103,  116,  104,  104,  104,
- /*  1030 */   122,   75,  370,   75,   75,   75,  122,  370,  370,  370,
- /*  1040 */   141,  137,  120,   88,  103,  116,  104,  104,  104,  122,
- /*  1050 */    75,  370,   75,   75,   75,  122,  370,  370,  370,  370,
- /*  1060 */   140,  120,   88,  103,  116,  104,  104,  104,  122,   75,
- /*  1070 */   370,  370,   75,   75,  370,  370,  370,  370,   27,   22,
- /*  1080 */    21,   20,   19,   18,   17,   16,   15,   14,   13,   12,
- /*  1090 */    75,  370,  370,  122,  370,  370,  370,  370,  370,  124,
- /*  1100 */    88,  103,  116,  104,  104,  104,  122,   75,  370,  370,
- /*  1110 */    75,   75,   75,  370,  370,  122,  370,  370,  370,  370,
- /*  1120 */   297,  298,   89,  103,  116,  104,  104,  104,  122,   75,
- /*  1130 */   370,   75,   75,   75,  122,  370,  370,  370,  370,  370,
- /*  1140 */   370,   90,  103,  116,  104,  104,  104,  122,   75,  370,
- /*  1150 */   370,   75,   75,  370,  370,   86,   85,   81,   80,  323,
- /*  1160 */    74,  324,   84,   83,  144,    9,  454,   71,  370,   86,
- /*  1170 */    85,   81,   80,  323,   74,  370,   84,   83,  144,    9,
- /*  1180 */   370,   71,  370,   75,  370,  370,  122,  370,  370,  370,
- /*  1190 */   370,  370,  370,  370,   92,  116,  104,  104,  104,  122,
- /*  1200 */    75,  370,  370,   75,   75,   75,  370,  370,  122,  370,
- /*  1210 */   370,  370,  370,  370,  370,  370,   93,  116,  104,  104,
- /*  1220 */   104,  122,   75,  370,  370,   75,   75,   75,  370,  370,
- /*  1230 */   122,  370,  370,  370,  370,  370,  370,  370,   94,  116,
- /*  1240 */   104,  104,  104,  122,   75,  370,   75,   75,   75,  122,
- /*  1250 */   370,  370,  370,  370,  370,  370,  370,   95,  116,  104,
- /*  1260 */   104,  104,  122,   75,  370,   75,   75,   75,  122,  370,
- /*  1270 */   370,  370,  370,  370,  370,  370,   96,  116,  104,  104,
- /*  1280 */   104,  122,   75,  370,   75,   75,   75,  122,  370,  370,
- /*  1290 */   370,  370,  370,  370,  370,   97,  116,  104,  104,  104,
- /*  1300 */   122,   75,  370,   75,   75,   75,  122,  370,  370,  370,
- /*  1310 */   370,  370,  370,  370,   98,  116,  104,  104,  104,  122,
- /*  1320 */    75,  370,   75,   75,   75,  122,  370,  370,  370,  370,
- /*  1330 */   370,  370,  370,   99,  116,  104,  104,  104,  122,   75,
- /*  1340 */   370,   75,   75,   75,  122,  370,  370,  370,  370,  370,
- /*  1350 */   370,  370,  100,  116,  104,  104,  104,  122,   75,  370,
- /*  1360 */    75,   75,   75,  122,  370,  370,  370,  370,  370,  370,
- /*  1370 */   370,  101,  116,  104,  104,  104,  122,   75,  370,   75,
- /*  1380 */    75,   75,  122,  370,  370,  370,  370,  370,  370,  370,
- /*  1390 */   102,  116,  104,  104,  104,  122,   75,  370,   75,   75,
- /*  1400 */    75,  122,  370,  370,  370,  370,  370,  370,  370,  105,
- /*  1410 */   116,  104,  104,  104,  122,   75,  370,   75,   75,   75,
- /*  1420 */   122,  370,  370,  370,  370,  370,  370,  370,  107,  116,
- /*  1430 */   104,  104,  104,  122,   75,  370,   75,   75,   75,  122,
- /*  1440 */   370,  370,  370,  370,  370,  370,  370,  109,  116,  104,
- /*  1450 */   104,  104,  122,   75,  370,   75,   75,   75,  122,  370,
- /*  1460 */   370,  370,  370,  370,  370,  370,  370,  117,  104,  104,
- /*  1470 */   104,  122,   75,  370,   75,   75,   75,  122,  370,  370,
- /*  1480 */   370,  370,  370,  370,  370,  370,  119,  104,  104,  104,
- /*  1490 */   122,   75,  370,   75,   75,   75,  122,  370,  370,  370,
- /*  1500 */   237,   75,  370,  370,  122,  123,  104,  104,  104,  122,
- /*  1510 */    75,  370,  370,   75,   75,  293,  293,  122,   75,  370,
- /*  1520 */    75,   75,   75,  122,  370,  370,  370,  370,  370,  370,
- /*  1530 */   370,  370,  370,  106,  106,  106,  122,   75,  370,   75,
- /*  1540 */    75,   75,  122,  370,  370,  370,  370,  370,  370,  370,
- /*  1550 */   370,  370,  108,  108,  108,  122,   75,  370,   75,   75,
- /*  1560 */    75,  122,  370,  370,  370,  370,  370,  370,  370,  370,
- /*  1570 */   370,  370,  285,  285,  122,   75,  370,   75,   75,   75,
- /*  1580 */   122,  370,  370,  370,  370,   75,  370,  370,  122,  370,
- /*  1590 */   370,  284,  284,  122,   75,  370,  370,   75,   75,  296,
- /*  1600 */   296,  122,   75,  370,   75,   75,   75,  122,  370,  370,
- /*  1610 */   370,  370,  370,  370,  370,  370,  370,  370,  295,  295,
- /*  1620 */   122,   75,  370,   75,   75,   75,  122,  370,  370,  370,
- /*  1630 */   370,  370,  370,  370,  370,  370,  370,  294,  294,  122,
- /*  1640 */    75,  370,   75,   75,   75,  122,  370,  370,  370,  370,
- /*  1650 */   370,  370,  370,  370,  370,  370,  293,  293,  122,   75,
- /*  1660 */   370,   75,   75,   75,  122,  370,  370,  370,  370,   75,
- /*  1670 */   370,  370,  122,  370,  370,  292,  292,  122,   75,  370,
- /*  1680 */   370,   75,   75,  291,  291,  122,   75,  370,   75,   75,
- /*  1690 */    75,  122,  370,  370,  370,  370,  370,  370,  370,  370,
- /*  1700 */   370,  370,  290,  290,  122,   75,  370,   75,   75,   75,
- /*  1710 */   122,  370,  370,  370,  370,  370,  370,  370,  370,  370,
- /*  1720 */   370,  289,  289,  122,   75,  370,   75,   75,   75,  122,
- /*  1730 */   370,  370,  370,  370,  370,  370,  370,  370,  370,  370,
- /*  1740 */   288,  288,  122,   75,  370,   75,   75,   75,  122,  370,
- /*  1750 */   370,  370,  370,   75,  370,  370,  122,  370,  370,  287,
- /*  1760 */   287,  122,   75,  370,  370,   75,   75,  286,  286,  122,
- /*  1770 */    75,  370,   75,   75,   75,  122,  370,  370,  370,  370,
- /*  1780 */   370,  370,  370,  370,  370,  370,  283,  283,  122,   75,
- /*  1790 */   370,  370,   75,   75,
+ /*     0 */     3,   73,  117,  117,  138,  133,  326,    2,  366,   55,
+ /*    10 */    84,  131,    1,  371,   72,  509,   80,  114,   10,  380,
+ /*    20 */    80,   76,  114,  114,   92,  128,  127,  141,  140,  139,
+ /*    30 */   122,   89,  105,  118,  106,  106,  106,   92,   76,  380,
+ /*    40 */   380,   76,   76,  326,   75,  461,   85,   84,  146,    9,
+ /*    50 */   375,   72,  374,   67,   66,   54,   53,   52,   70,   69,
+ /*    60 */    68,   65,   64,   62,   61,   60,  351,  352,  353,  354,
+ /*    70 */   355,    4,  129,   71,   59,   58,   76,  129,  129,   92,
+ /*    80 */   128,  127,  141,  140,  139,  122,   89,  105,  118,  106,
+ /*    90 */   106,  106,   92,   76,   79,  460,   76,   76,   79,   77,
+ /*   100 */   117,  117,  138,  378,  326,    2,  503,   55,   84,  131,
+ /*   110 */     1,    5,   72,   79,  120,  112,   83,   79,   76,  120,
+ /*   120 */   120,   92,  128,  127,  141,  140,  139,  122,   89,  105,
+ /*   130 */   118,  106,  106,  106,   92,   76,  455,  135,   76,   76,
+ /*   140 */     7,  303,   63,   78,  349,   74,  112,  135,  307,  439,
+ /*   150 */   483,   67,   66,  502,  138,   23,   70,   69,   68,   65,
+ /*   160 */    64,   62,   61,   60,  351,  352,  353,  354,  355,    4,
+ /*   170 */    51,   50,   49,   48,   47,   46,   45,   44,   43,   42,
+ /*   180 */    41,   40,   39,   38,   37,  377,   67,   66,  315,   57,
+ /*   190 */    56,   70,   69,   68,   65,   64,   62,   61,   60,  351,
+ /*   200 */   352,  353,  354,  355,    4,  113,  376,  316,   76,  454,
+ /*   210 */   454,   92,  128,  127,  141,  140,  139,  122,   89,  105,
+ /*   220 */   118,  106,  106,  106,   92,   76,   31,   30,   76,   76,
+ /*   230 */     6,  373,  359,   36,   35,  372,  449,   76,   88,   88,
+ /*   240 */    92,  128,  127,  141,  140,  139,  122,   89,  105,  118,
+ /*   250 */   106,  106,  106,   92,   76,  348,  132,   76,   76,   11,
+ /*   260 */    88,    7,   28,   63,  320,  349,   74,  319,  242,  360,
+ /*   270 */    28,   76,  454,  454,   92,  128,  127,  141,  140,  139,
+ /*   280 */   122,   89,  105,  118,  106,  106,  106,   92,   76,  358,
+ /*   290 */   459,   76,   76,  134,    8,   32,  137,   28,  367,  451,
+ /*   300 */   300,  301,   24,   34,   25,   33,   28,   67,   66,  373,
+ /*   310 */   373,  373,   70,   69,   68,   65,   64,   62,   61,   60,
+ /*   320 */   351,  352,  353,  354,  355,    4,  357,    7,  373,   63,
+ /*   330 */   373,  349,   74,  373,  373,  360,   76,  446,  446,   92,
+ /*   340 */   128,  127,  141,  140,  139,  122,   89,  105,  118,  106,
+ /*   350 */   106,  106,   92,   76,  306,  373,   76,   76,  373,  373,
+ /*   360 */   373,  373,  373,  116,  373,  373,  373,  373,  373,  373,
+ /*   370 */   373,  373,    7,   67,   66,  373,  349,   74,   70,   69,
+ /*   380 */    68,   65,   64,   62,   61,   60,  351,  352,  353,  354,
+ /*   390 */   355,    4,  356,    7,  373,   63,  373,  349,   74,   29,
+ /*   400 */   120,  359,  373,  373,   76,  120,  120,   92,  128,  127,
+ /*   410 */   141,  140,  139,  122,   89,  105,  118,  106,  106,  106,
+ /*   420 */    92,   76,  373,   26,   76,   76,  373,  373,  373,  373,
+ /*   430 */   373,  351,  352,  353,  354,  355,    4,  373,  373,   67,
+ /*   440 */    66,  373,  373,  373,   70,   69,   68,   65,   64,   62,
+ /*   450 */    61,   60,  351,  352,  353,  354,  355,    4,  373,  123,
+ /*   460 */   373,  373,  373,   76,  123,  123,   92,  128,  127,  141,
+ /*   470 */   140,  139,  122,   89,  105,  118,  106,  106,  106,   92,
+ /*   480 */    76,  129,  373,   76,   76,   76,  129,  129,   92,  128,
+ /*   490 */   127,  141,  140,  139,  122,   89,  105,  118,  106,  106,
+ /*   500 */   106,   92,   76,  373,  373,   76,   76,    7,  373,   63,
+ /*   510 */   373,  349,   74,  373,  373,  373,  373,  373,  373,  373,
+ /*   520 */   373,  373,  373,  373,   76,  500,  500,   92,  128,  127,
+ /*   530 */   141,  140,  139,  122,   89,  105,  118,  106,  106,  106,
+ /*   540 */    92,   76,  373,  373,   76,   76,  373,  373,  373,  373,
+ /*   550 */   373,  373,  373,   67,   66,  373,  373,  373,   70,   69,
+ /*   560 */    68,   65,   64,   62,   61,   60,  351,  352,  130,  354,
+ /*   570 */   355,    4,    7,  373,   63,  373,  349,   74,   76,  499,
+ /*   580 */   499,   92,  128,  127,  141,  140,  139,  122,   89,  105,
+ /*   590 */   118,  106,  106,  106,   92,   76,  373,  373,   76,   76,
+ /*   600 */   373,  373,  373,   87,   86,   82,   81,  326,   75,  327,
+ /*   610 */    85,   84,  146,    9,  373,   72,  373,  373,   67,   66,
+ /*   620 */   373,  373,  373,   70,   69,   68,   65,   64,   62,   61,
+ /*   630 */    60,  351,  352,  353,  354,  355,    4,  373,   76,  393,
+ /*   640 */   393,   92,  128,  127,  141,  140,  139,  122,   89,  105,
+ /*   650 */   118,  106,  106,  106,   92,   76,  373,  373,   76,   76,
+ /*   660 */   373,   76,  392,  392,   92,  128,  127,  141,  140,  139,
+ /*   670 */   122,   89,  105,  118,  106,  106,  106,   92,   76,  373,
+ /*   680 */   373,   76,   76,   76,  391,  391,   92,  128,  127,  141,
+ /*   690 */   140,  139,  122,   89,  105,  118,  106,  106,  106,   92,
+ /*   700 */    76,  373,  373,   76,   76,  373,  373,  373,   76,  390,
+ /*   710 */   390,   92,  128,  127,  141,  140,  139,  122,   89,  105,
+ /*   720 */   118,  106,  106,  106,   92,   76,  373,  373,   76,   76,
+ /*   730 */    76,  389,  389,   92,  128,  127,  141,  140,  139,  122,
+ /*   740 */    89,  105,  118,  106,  106,  106,   92,   76,  373,  373,
+ /*   750 */    76,   76,   76,  388,  388,   92,  128,  127,  141,  140,
+ /*   760 */   139,  122,   89,  105,  118,  106,  106,  106,   92,   76,
+ /*   770 */   373,  373,   76,   76,   76,  387,  387,   92,  128,  127,
+ /*   780 */   141,  140,  139,  122,   89,  105,  118,  106,  106,  106,
+ /*   790 */    92,   76,  373,  373,   76,   76,   76,  386,  386,   92,
+ /*   800 */   128,  127,  141,  140,  139,  122,   89,  105,  118,  106,
+ /*   810 */   106,  106,   92,   76,  373,  373,   76,   76,   76,  385,
+ /*   820 */   385,   92,  128,  127,  141,  140,  139,  122,   89,  105,
+ /*   830 */   118,  106,  106,  106,   92,   76,  373,  373,   76,   76,
+ /*   840 */    76,  384,  384,   92,  128,  127,  141,  140,  139,  122,
+ /*   850 */    89,  105,  118,  106,  106,  106,   92,   76,  373,  373,
+ /*   860 */    76,   76,   76,  383,  383,   92,  128,  127,  141,  140,
+ /*   870 */   139,  122,   89,  105,  118,  106,  106,  106,   92,   76,
+ /*   880 */   373,  373,   76,   76,   76,  447,  447,   92,  128,  127,
+ /*   890 */   141,  140,  139,  122,   89,  105,  118,  106,  106,  106,
+ /*   900 */    92,   76,  373,  373,   76,   76,   76,  442,  442,   92,
+ /*   910 */   128,  127,  141,  140,  139,  122,   89,  105,  118,  106,
+ /*   920 */   106,  106,   92,   76,  373,  373,   76,   76,   76,  394,
+ /*   930 */   394,   92,  128,  127,  141,  140,  139,  122,   89,  105,
+ /*   940 */   118,  106,  106,  106,   92,   76,  373,  373,   76,   76,
+ /*   950 */    76,  145,  145,   92,  128,  127,  141,  140,  139,  122,
+ /*   960 */    89,  105,  118,  106,  106,  106,   92,   76,  373,  373,
+ /*   970 */    76,   76,   76,  382,  382,   92,  128,  127,  141,  140,
+ /*   980 */   139,  122,   89,  105,  118,  106,  106,  106,   92,   76,
+ /*   990 */   373,  373,   76,   76,   76,  381,  381,   92,  128,  127,
+ /*  1000 */   141,  140,  139,  122,   89,  105,  118,  106,  106,  106,
+ /*  1010 */    92,   76,  373,   76,   76,   76,  124,  373,  115,  141,
+ /*  1020 */   140,  139,  122,   89,  105,  118,  106,  106,  106,  124,
+ /*  1030 */    76,  373,  373,   76,   76,   76,  373,  373,  124,  373,
+ /*  1040 */   373,  136,  140,  139,  122,   89,  105,  118,  106,  106,
+ /*  1050 */   106,  124,   76,  373,  373,   76,   76,   76,  373,  373,
+ /*  1060 */   124,  373,  373,  144,  140,  139,  122,   89,  105,  118,
+ /*  1070 */   106,  106,  106,  124,   76,  373,  373,   76,   76,   76,
+ /*  1080 */   373,  373,  124,  373,  373,  373,  143,  139,  122,   89,
+ /*  1090 */   105,  118,  106,  106,  106,  124,   76,  373,   76,   76,
+ /*  1100 */    76,  124,  373,  373,  373,  373,  142,  122,   89,  105,
+ /*  1110 */   118,  106,  106,  106,  124,   76,  373,  373,   76,   76,
+ /*  1120 */   373,  373,  373,  373,   27,   22,   21,   20,   19,   18,
+ /*  1130 */    17,   16,   15,   14,   13,   12,   76,  373,  373,  124,
+ /*  1140 */   373,  373,  373,  373,  373,  126,   89,  105,  118,  106,
+ /*  1150 */   106,  106,  124,   76,  373,  373,   76,   76,  373,   76,
+ /*  1160 */   373,  373,  124,  373,  373,  373,  373,  300,  301,   90,
+ /*  1170 */   105,  118,  106,  106,  106,  124,   76,  373,   76,   76,
+ /*  1180 */    76,  124,  373,  373,  373,  373,  373,  373,   91,  105,
+ /*  1190 */   118,  106,  106,  106,  124,   76,  373,  373,   76,   76,
+ /*  1200 */   458,  373,  373,   87,   86,   82,   81,  326,   75,  373,
+ /*  1210 */    85,   84,  146,    9,   76,   72,  373,  124,  373,  373,
+ /*  1220 */   373,  373,  373,  373,  373,   93,  118,  106,  106,  106,
+ /*  1230 */   124,   76,  373,   76,   76,   76,  124,  373,  373,  373,
+ /*  1240 */   373,  373,  373,  373,   94,  118,  106,  106,  106,  124,
+ /*  1250 */    76,  373,   76,   76,   76,  124,  373,  373,  373,  373,
+ /*  1260 */   373,  373,  373,   95,  118,  106,  106,  106,  124,   76,
+ /*  1270 */   373,  373,   76,   76,   76,  373,  373,  124,  373,  373,
+ /*  1280 */   373,  373,  373,  373,  373,   96,  118,  106,  106,  106,
+ /*  1290 */   124,   76,  373,   76,   76,   76,  124,  373,  373,  373,
+ /*  1300 */   373,  373,  373,  373,   97,  118,  106,  106,  106,  124,
+ /*  1310 */    76,  373,   76,   76,   76,  124,  373,  373,  373,  373,
+ /*  1320 */   373,  373,  373,   98,  118,  106,  106,  106,  124,   76,
+ /*  1330 */   373,   76,   76,   76,  124,  373,  373,  373,  373,  373,
+ /*  1340 */   373,  373,   99,  118,  106,  106,  106,  124,   76,  373,
+ /*  1350 */    76,   76,   76,  124,  373,  373,  373,  373,  373,  373,
+ /*  1360 */   373,  100,  118,  106,  106,  106,  124,   76,  373,  373,
+ /*  1370 */    76,   76,   76,  373,  373,  124,  373,  373,  373,  373,
+ /*  1380 */   373,  373,  373,  101,  118,  106,  106,  106,  124,   76,
+ /*  1390 */   373,   76,   76,   76,  124,  373,  373,  373,  373,  373,
+ /*  1400 */   373,  373,  102,  118,  106,  106,  106,  124,   76,  373,
+ /*  1410 */    76,   76,   76,  124,  373,  373,  373,  373,  373,  373,
+ /*  1420 */   373,  103,  118,  106,  106,  106,  124,   76,  373,   76,
+ /*  1430 */    76,   76,  124,  373,  373,  373,  373,  373,  373,  373,
+ /*  1440 */   104,  118,  106,  106,  106,  124,   76,  373,   76,   76,
+ /*  1450 */    76,  124,  373,  373,  373,  373,  373,  373,  373,  107,
+ /*  1460 */   118,  106,  106,  106,  124,   76,  373,  373,   76,   76,
+ /*  1470 */    76,  373,  373,  124,  373,  373,  373,  373,  373,  373,
+ /*  1480 */   373,  109,  118,  106,  106,  106,  124,   76,  373,   76,
+ /*  1490 */    76,   76,  124,  373,  373,  373,  373,  373,  373,  373,
+ /*  1500 */   111,  118,  106,  106,  106,  124,   76,  373,   76,   76,
+ /*  1510 */    76,  124,  373,  373,  373,  373,  373,  373,  373,  373,
+ /*  1520 */   119,  106,  106,  106,  124,   76,  373,   76,   76,   76,
+ /*  1530 */   124,  373,  373,  373,  373,  373,  373,  373,  373,  121,
+ /*  1540 */   106,  106,  106,  124,   76,  373,   76,   76,   76,  124,
+ /*  1550 */   373,  373,  373,  376,   76,  373,  373,  124,  125,  106,
+ /*  1560 */   106,  106,  124,   76,  373,  373,   76,   76,  433,  433,
+ /*  1570 */   124,   76,  373,  373,   76,   76,   76,  373,  373,  124,
+ /*  1580 */   373,  373,  373,  373,  373,   76,  373,  373,  124,  108,
+ /*  1590 */   108,  108,  124,   76,  373,  373,   76,   76,  110,  110,
+ /*  1600 */   110,  124,   76,  373,  373,   76,   76,   76,  373,  373,
+ /*  1610 */   124,  373,  373,  373,  373,   76,  373,  373,  124,  373,
+ /*  1620 */   373,  425,  425,  124,   76,  373,  373,   76,   76,  424,
+ /*  1630 */   424,  124,   76,  373,   76,   76,   76,  124,  373,  373,
+ /*  1640 */   373,  373,   76,  373,  373,  124,  373,  373,  436,  436,
+ /*  1650 */   124,   76,  373,  373,   76,   76,  435,  435,  124,   76,
+ /*  1660 */   373,   76,   76,   76,  124,  373,  373,  373,  373,  373,
+ /*  1670 */    76,  373,  373,  124,  373,  434,  434,  124,   76,  373,
+ /*  1680 */   373,   76,   76,  373,  433,  433,  124,   76,  373,  373,
+ /*  1690 */    76,   76,   76,  373,  373,  124,  373,  373,  373,  373,
+ /*  1700 */    76,  373,  373,  124,  373,  373,  432,  432,  124,   76,
+ /*  1710 */   373,  373,   76,   76,  431,  431,  124,   76,  373,   76,
+ /*  1720 */    76,   76,  124,  373,  373,  373,  373,   76,  373,  373,
+ /*  1730 */   124,  373,  373,  430,  430,  124,   76,  373,  373,   76,
+ /*  1740 */    76,  429,  429,  124,   76,  373,   76,   76,   76,  124,
+ /*  1750 */   373,  373,  373,  373,  373,   76,  373,  373,  124,  373,
+ /*  1760 */   428,  428,  124,   76,  373,  373,   76,   76,  373,  427,
+ /*  1770 */   427,  124,   76,  373,  373,   76,   76,   76,  373,  373,
+ /*  1780 */   124,  373,  373,  373,  373,   76,  373,  373,  124,  373,
+ /*  1790 */   373,  426,  426,  124,   76,  373,  373,   76,   76,  423,
+ /*  1800 */   423,  124,   76,  373,  373,   76,   76,
 };
 static const YYCODETYPE yy_lookahead[] = {
- /*     0 */     1,    2,  107,  108,  109,   12,    7,    8,   68,   10,
- /*    10 */    11,   12,   13,   82,   15,   77,   78,   79,  105,   83,
- /*    20 */    82,   83,   84,   85,   86,   87,   88,   89,   90,   91,
- /*    30 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  103,
- /*    40 */   104,  103,  104,    7,    8,    0,   10,   11,   12,   13,
- /*    50 */    82,   15,   53,   54,   50,   51,   52,   58,   59,   60,
+ /*     0 */     1,    2,  108,  109,  110,   12,    7,    8,   69,   10,
+ /*    10 */    11,   12,   13,   83,   15,   78,   79,   80,  106,   84,
+ /*    20 */    83,   84,   85,   86,   87,   88,   89,   90,   91,   92,
+ /*    30 */    93,   94,   95,   96,   97,   98,   99,  100,  101,  104,
+ /*    40 */   105,  104,  105,    7,    8,    0,   10,   11,   12,   13,
+ /*    50 */    83,   15,   83,   54,   55,   51,   52,   53,   59,   60,
  /*    60 */    61,   62,   63,   64,   65,   66,   67,   68,   69,   70,
- /*    70 */    71,   79,   55,   56,   57,   83,   84,   85,   86,   87,
+ /*    70 */    71,   72,   80,   56,   57,   58,   84,   85,   86,   87,
  /*    80 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*    90 */    98,   99,  100,   78,    0,  103,  104,   82,   53,  107,
- /*   100 */   108,  109,   82,    7,    8,   30,   10,   11,   12,   13,
- /*   110 */    16,   15,   78,   79,   81,   11,   82,   83,   84,   85,
+ /*    90 */    98,   99,  100,  101,   79,    0,  104,  105,   83,   54,
+ /*   100 */   108,  109,  110,   83,    7,    8,   30,   10,   11,   12,
+ /*   110 */    13,   16,   15,   79,   80,   82,   11,   83,   84,   85,
  /*   120 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
- /*   130 */    96,   97,   98,   99,  100,  112,  113,  103,  104,    8,
- /*   140 */    14,   10,   16,   12,   13,  112,  113,  108,  109,   53,
- /*   150 */    54,  101,  102,   82,   58,   59,   60,   61,   62,   63,
- /*   160 */    64,   65,   66,   67,   68,   69,   70,   71,   36,   37,
- /*   170 */    38,   39,   40,   41,   42,   43,   44,   45,   46,   47,
- /*   180 */    48,   49,    3,    4,   53,   54,   55,   53,   54,   58,
- /*   190 */    59,   60,   61,   62,   63,   64,   65,   66,   67,   68,
- /*   200 */    69,   70,   71,   80,   82,   74,   83,   84,   85,   86,
- /*   210 */    87,   88,   89,   90,   91,   92,   93,   94,   95,   96,
- /*   220 */    97,   98,   99,  100,   34,   35,  103,  104,    8,   82,
- /*   230 */    10,    8,   12,   13,  111,   14,   16,   16,   83,   84,
- /*   240 */    85,   86,   87,   88,   89,   90,   91,   92,   93,   94,
- /*   250 */    95,   96,   97,   98,   99,  100,    9,   82,  103,  104,
- /*   260 */   105,  106,    8,   16,   10,   82,   12,   13,   59,   60,
- /*   270 */    16,    8,   16,   53,   54,   12,   13,   41,   58,   59,
- /*   280 */    60,   61,   62,   63,   64,   65,   66,   67,   68,   69,
- /*   290 */    70,   71,   72,    8,   71,   10,   73,   12,   13,    9,
- /*   300 */    68,   16,   31,    5,   66,   55,   16,   53,   54,   12,
- /*   310 */    30,   33,   58,   59,   60,   61,   62,   63,   64,   65,
- /*   320 */    66,   67,   68,   69,   70,   71,   72,   29,   72,   66,
- /*   330 */    67,   68,   69,   70,   71,   32,   30,  114,   53,   54,
- /*   340 */   114,  114,  114,   58,   59,   60,   61,   62,   63,   64,
- /*   350 */    65,   66,   67,   68,   69,   70,   71,   83,   84,   85,
- /*   360 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
- /*   370 */    96,   97,   98,   99,  100,  114,  114,  103,  104,  114,
- /*   380 */   114,  114,  114,  114,  114,  111,   16,  114,  114,  114,
- /*   390 */   114,   83,   84,   85,   86,   87,   88,   89,   90,   91,
- /*   400 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  114,
- /*   410 */   114,  103,  104,  114,  114,  114,  114,  114,  110,   79,
- /*   420 */   114,  114,  114,   83,   84,   85,   86,   87,   88,   89,
- /*   430 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
- /*   440 */   100,   79,   72,  103,  104,   83,   84,   85,   86,   87,
- /*   450 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*   460 */    98,   99,  100,  114,  114,  103,  104,  114,    8,  114,
- /*   470 */    10,   79,   12,   13,  114,   83,   84,   85,   86,   87,
- /*   480 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*   490 */    98,   99,  100,    0,  114,  103,  104,    8,  114,   10,
- /*   500 */   114,   12,   13,  114,  114,  114,  114,  114,  114,   16,
- /*   510 */   114,  114,  114,   53,   54,  114,  114,  114,   58,   59,
- /*   520 */    60,   61,   62,   63,   64,   65,   66,   67,   68,   69,
- /*   530 */    70,   71,  114,  114,  114,  114,  114,  114,  114,  114,
- /*   540 */   114,  114,   53,   54,  114,  114,  114,   58,   59,   60,
- /*   550 */    61,   62,   63,   64,   65,   66,   67,   68,   69,   70,
- /*   560 */    71,   83,   84,   85,   86,   87,   88,   89,   90,   91,
- /*   570 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  114,
- /*   580 */   114,  103,  104,   83,   84,   85,   86,   87,   88,   89,
- /*   590 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
- /*   600 */   100,  114,  114,  103,  104,   83,   84,   85,   86,   87,
- /*   610 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*   620 */    98,   99,  100,  114,  114,  103,  104,   83,   84,   85,
- /*   630 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
- /*   640 */    96,   97,   98,   99,  100,  114,  114,  103,  104,   83,
- /*   650 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
- /*   660 */    94,   95,   96,   97,   98,   99,  100,  114,  114,  103,
- /*   670 */   104,   83,   84,   85,   86,   87,   88,   89,   90,   91,
- /*   680 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  114,
- /*   690 */   114,  103,  104,   83,   84,   85,   86,   87,   88,   89,
- /*   700 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
- /*   710 */   100,  114,  114,  103,  104,   83,   84,   85,   86,   87,
- /*   720 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*   730 */    98,   99,  100,  114,  114,  103,  104,   83,   84,   85,
- /*   740 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
- /*   750 */    96,   97,   98,   99,  100,  114,  114,  103,  104,   83,
- /*   760 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
- /*   770 */    94,   95,   96,   97,   98,   99,  100,  114,  114,  103,
- /*   780 */   104,   83,   84,   85,   86,   87,   88,   89,   90,   91,
- /*   790 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  114,
- /*   800 */   114,  103,  104,   83,   84,   85,   86,   87,   88,   89,
- /*   810 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
- /*   820 */   100,  114,  114,  103,  104,   83,   84,   85,   86,   87,
- /*   830 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*   840 */    98,   99,  100,  114,  114,  103,  104,   83,   84,   85,
- /*   850 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
- /*   860 */    96,   97,   98,   99,  100,  114,  114,  103,  104,   83,
- /*   870 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
- /*   880 */    94,   95,   96,   97,   98,   99,  100,  114,  114,  103,
- /*   890 */   104,   83,   84,   85,   86,   87,   88,   89,   90,   91,
- /*   900 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  114,
- /*   910 */   114,  103,  104,   83,   84,   85,   86,   87,   88,   89,
- /*   920 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
- /*   930 */   100,  114,  114,  103,  104,   83,   84,   85,   86,   87,
- /*   940 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*   950 */    98,   99,  100,  114,  114,  103,  104,   83,   84,   85,
- /*   960 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
- /*   970 */    96,   97,   98,   99,  100,  114,   83,  103,  104,   86,
- /*   980 */   114,   88,   89,   90,   91,   92,   93,   94,   95,   96,
- /*   990 */    97,   98,   99,  100,  114,   83,  103,  104,   86,  114,
- /*  1000 */   114,   89,   90,   91,   92,   93,   94,   95,   96,   97,
- /*  1010 */    98,   99,  100,  114,   83,  103,  104,   86,  114,  114,
- /*  1020 */    89,   90,   91,   92,   93,   94,   95,   96,   97,   98,
- /*  1030 */    99,  100,  114,   83,  103,  104,   86,  114,  114,  114,
- /*  1040 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
- /*  1050 */   100,  114,   83,  103,  104,   86,  114,  114,  114,  114,
- /*  1060 */    91,   92,   93,   94,   95,   96,   97,   98,   99,  100,
- /*  1070 */   114,  114,  103,  104,  114,  114,  114,  114,   17,   18,
- /*  1080 */    19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
- /*  1090 */    83,  114,  114,   86,  114,  114,  114,  114,  114,   92,
- /*  1100 */    93,   94,   95,   96,   97,   98,   99,  100,  114,  114,
- /*  1110 */   103,  104,   83,  114,  114,   86,  114,  114,  114,  114,
- /*  1120 */    59,   60,   93,   94,   95,   96,   97,   98,   99,  100,
- /*  1130 */   114,   83,  103,  104,   86,  114,  114,  114,  114,  114,
- /*  1140 */   114,   93,   94,   95,   96,   97,   98,   99,  100,  114,
- /*  1150 */   114,  103,  104,  114,  114,    3,    4,    5,    6,    7,
- /*  1160 */     8,    9,   10,   11,   12,   13,    0,   15,  114,    3,
- /*  1170 */     4,    5,    6,    7,    8,  114,   10,   11,   12,   13,
- /*  1180 */   114,   15,  114,   83,  114,  114,   86,  114,  114,  114,
- /*  1190 */   114,  114,  114,  114,   94,   95,   96,   97,   98,   99,
- /*  1200 */   100,  114,  114,  103,  104,   83,  114,  114,   86,  114,
- /*  1210 */   114,  114,  114,  114,  114,  114,   94,   95,   96,   97,
- /*  1220 */    98,   99,  100,  114,  114,  103,  104,   83,  114,  114,
- /*  1230 */    86,  114,  114,  114,  114,  114,  114,  114,   94,   95,
- /*  1240 */    96,   97,   98,   99,  100,  114,   83,  103,  104,   86,
- /*  1250 */   114,  114,  114,  114,  114,  114,  114,   94,   95,   96,
- /*  1260 */    97,   98,   99,  100,  114,   83,  103,  104,   86,  114,
- /*  1270 */   114,  114,  114,  114,  114,  114,   94,   95,   96,   97,
- /*  1280 */    98,   99,  100,  114,   83,  103,  104,   86,  114,  114,
- /*  1290 */   114,  114,  114,  114,  114,   94,   95,   96,   97,   98,
- /*  1300 */    99,  100,  114,   83,  103,  104,   86,  114,  114,  114,
- /*  1310 */   114,  114,  114,  114,   94,   95,   96,   97,   98,   99,
- /*  1320 */   100,  114,   83,  103,  104,   86,  114,  114,  114,  114,
- /*  1330 */   114,  114,  114,   94,   95,   96,   97,   98,   99,  100,
- /*  1340 */   114,   83,  103,  104,   86,  114,  114,  114,  114,  114,
- /*  1350 */   114,  114,   94,   95,   96,   97,   98,   99,  100,  114,
- /*  1360 */    83,  103,  104,   86,  114,  114,  114,  114,  114,  114,
- /*  1370 */   114,   94,   95,   96,   97,   98,   99,  100,  114,   83,
- /*  1380 */   103,  104,   86,  114,  114,  114,  114,  114,  114,  114,
- /*  1390 */    94,   95,   96,   97,   98,   99,  100,  114,   83,  103,
- /*  1400 */   104,   86,  114,  114,  114,  114,  114,  114,  114,   94,
- /*  1410 */    95,   96,   97,   98,   99,  100,  114,   83,  103,  104,
- /*  1420 */    86,  114,  114,  114,  114,  114,  114,  114,   94,   95,
- /*  1430 */    96,   97,   98,   99,  100,  114,   83,  103,  104,   86,
- /*  1440 */   114,  114,  114,  114,  114,  114,  114,   94,   95,   96,
- /*  1450 */    97,   98,   99,  100,  114,   83,  103,  104,   86,  114,
- /*  1460 */   114,  114,  114,  114,  114,  114,  114,   95,   96,   97,
- /*  1470 */    98,   99,  100,  114,   83,  103,  104,   86,  114,  114,
- /*  1480 */   114,  114,  114,  114,  114,  114,   95,   96,   97,   98,
- /*  1490 */    99,  100,  114,   83,  103,  104,   86,  114,  114,  114,
- /*  1500 */    82,   83,  114,  114,   86,   95,   96,   97,   98,   99,
- /*  1510 */   100,  114,  114,  103,  104,   97,   98,   99,  100,  114,
- /*  1520 */    83,  103,  104,   86,  114,  114,  114,  114,  114,  114,
- /*  1530 */   114,  114,  114,   96,   97,   98,   99,  100,  114,   83,
- /*  1540 */   103,  104,   86,  114,  114,  114,  114,  114,  114,  114,
- /*  1550 */   114,  114,   96,   97,   98,   99,  100,  114,   83,  103,
- /*  1560 */   104,   86,  114,  114,  114,  114,  114,  114,  114,  114,
- /*  1570 */   114,  114,   97,   98,   99,  100,  114,   83,  103,  104,
- /*  1580 */    86,  114,  114,  114,  114,   83,  114,  114,   86,  114,
- /*  1590 */   114,   97,   98,   99,  100,  114,  114,  103,  104,   97,
- /*  1600 */    98,   99,  100,  114,   83,  103,  104,   86,  114,  114,
- /*  1610 */   114,  114,  114,  114,  114,  114,  114,  114,   97,   98,
- /*  1620 */    99,  100,  114,   83,  103,  104,   86,  114,  114,  114,
- /*  1630 */   114,  114,  114,  114,  114,  114,  114,   97,   98,   99,
- /*  1640 */   100,  114,   83,  103,  104,   86,  114,  114,  114,  114,
- /*  1650 */   114,  114,  114,  114,  114,  114,   97,   98,   99,  100,
- /*  1660 */   114,   83,  103,  104,   86,  114,  114,  114,  114,   83,
- /*  1670 */   114,  114,   86,  114,  114,   97,   98,   99,  100,  114,
- /*  1680 */   114,  103,  104,   97,   98,   99,  100,  114,   83,  103,
- /*  1690 */   104,   86,  114,  114,  114,  114,  114,  114,  114,  114,
- /*  1700 */   114,  114,   97,   98,   99,  100,  114,   83,  103,  104,
- /*  1710 */    86,  114,  114,  114,  114,  114,  114,  114,  114,  114,
- /*  1720 */   114,   97,   98,   99,  100,  114,   83,  103,  104,   86,
- /*  1730 */   114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
- /*  1740 */    97,   98,   99,  100,  114,   83,  103,  104,   86,  114,
- /*  1750 */   114,  114,  114,   83,  114,  114,   86,  114,  114,   97,
- /*  1760 */    98,   99,  100,  114,  114,  103,  104,   97,   98,   99,
- /*  1770 */   100,  114,   83,  103,  104,   86,  114,  114,  114,  114,
- /*  1780 */   114,  114,  114,  114,  114,  114,   97,   98,   99,  100,
- /*  1790 */   114,  114,  103,  104,
+ /*   130 */    96,   97,   98,   99,  100,  101,  113,  114,  104,  105,
+ /*   140 */     8,   14,   10,   16,   12,   13,  113,  114,    9,  102,
+ /*   150 */   103,   54,   55,  109,  110,   16,   59,   60,   61,   62,
+ /*   160 */    63,   64,   65,   66,   67,   68,   69,   70,   71,   72,
+ /*   170 */    36,   37,   38,   39,   40,   41,   42,   43,   44,   45,
+ /*   180 */    46,   47,   48,   49,   50,   83,   54,   55,   56,   54,
+ /*   190 */    55,   59,   60,   61,   62,   63,   64,   65,   66,   67,
+ /*   200 */    68,   69,   70,   71,   72,   81,   83,   75,   84,   85,
+ /*   210 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
+ /*   220 */    96,   97,   98,   99,  100,  101,    3,    4,  104,  105,
+ /*   230 */     8,   83,   16,   34,   35,   83,  112,   84,   85,   86,
+ /*   240 */    87,   88,   89,   90,   91,   92,   93,   94,   95,   96,
+ /*   250 */    97,   98,   99,  100,  101,    9,   41,  104,  105,  106,
+ /*   260 */   107,    8,   16,   10,   69,   12,   13,   67,   14,   16,
+ /*   270 */    16,   84,   85,   86,   87,   88,   89,   90,   91,   92,
+ /*   280 */    93,   94,   95,   96,   97,   98,   99,  100,  101,   73,
+ /*   290 */     0,  104,  105,   56,   72,   31,   74,   16,   12,  112,
+ /*   300 */    60,   61,   30,   33,   30,   32,   16,   54,   55,  115,
+ /*   310 */   115,  115,   59,   60,   61,   62,   63,   64,   65,   66,
+ /*   320 */    67,   68,   69,   70,   71,   72,   73,    8,  115,   10,
+ /*   330 */   115,   12,   13,  115,  115,   16,   84,   85,   86,   87,
+ /*   340 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
+ /*   350 */    98,   99,  100,  101,   73,  115,  104,  105,  115,  115,
+ /*   360 */   115,  115,  115,  111,  115,  115,  115,  115,  115,  115,
+ /*   370 */   115,  115,    8,   54,   55,  115,   12,   13,   59,   60,
+ /*   380 */    61,   62,   63,   64,   65,   66,   67,   68,   69,   70,
+ /*   390 */    71,   72,   73,    8,  115,   10,  115,   12,   13,    5,
+ /*   400 */    80,   16,  115,  115,   84,   85,   86,   87,   88,   89,
+ /*   410 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
+ /*   420 */   100,  101,  115,   29,  104,  105,  115,  115,  115,  115,
+ /*   430 */   115,   67,   68,   69,   70,   71,   72,  115,  115,   54,
+ /*   440 */    55,  115,  115,  115,   59,   60,   61,   62,   63,   64,
+ /*   450 */    65,   66,   67,   68,   69,   70,   71,   72,  115,   80,
+ /*   460 */   115,  115,  115,   84,   85,   86,   87,   88,   89,   90,
+ /*   470 */    91,   92,   93,   94,   95,   96,   97,   98,   99,  100,
+ /*   480 */   101,   80,  115,  104,  105,   84,   85,   86,   87,   88,
+ /*   490 */    89,   90,   91,   92,   93,   94,   95,   96,   97,   98,
+ /*   500 */    99,  100,  101,  115,  115,  104,  105,    8,  115,   10,
+ /*   510 */   115,   12,   13,  115,  115,  115,  115,  115,  115,  115,
+ /*   520 */   115,  115,  115,  115,   84,   85,   86,   87,   88,   89,
+ /*   530 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
+ /*   540 */   100,  101,  115,  115,  104,  105,  115,  115,  115,  115,
+ /*   550 */   115,  115,  115,   54,   55,  115,  115,  115,   59,   60,
+ /*   560 */    61,   62,   63,   64,   65,   66,   67,   68,   69,   70,
+ /*   570 */    71,   72,    8,  115,   10,  115,   12,   13,   84,   85,
+ /*   580 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
+ /*   590 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*   600 */   115,  115,  115,    3,    4,    5,    6,    7,    8,    9,
+ /*   610 */    10,   11,   12,   13,  115,   15,  115,  115,   54,   55,
+ /*   620 */   115,  115,  115,   59,   60,   61,   62,   63,   64,   65,
+ /*   630 */    66,   67,   68,   69,   70,   71,   72,  115,   84,   85,
+ /*   640 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
+ /*   650 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*   660 */   115,   84,   85,   86,   87,   88,   89,   90,   91,   92,
+ /*   670 */    93,   94,   95,   96,   97,   98,   99,  100,  101,  115,
+ /*   680 */   115,  104,  105,   84,   85,   86,   87,   88,   89,   90,
+ /*   690 */    91,   92,   93,   94,   95,   96,   97,   98,   99,  100,
+ /*   700 */   101,  115,  115,  104,  105,  115,  115,  115,   84,   85,
+ /*   710 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
+ /*   720 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*   730 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
+ /*   740 */    94,   95,   96,   97,   98,   99,  100,  101,  115,  115,
+ /*   750 */   104,  105,   84,   85,   86,   87,   88,   89,   90,   91,
+ /*   760 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  101,
+ /*   770 */   115,  115,  104,  105,   84,   85,   86,   87,   88,   89,
+ /*   780 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
+ /*   790 */   100,  101,  115,  115,  104,  105,   84,   85,   86,   87,
+ /*   800 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
+ /*   810 */    98,   99,  100,  101,  115,  115,  104,  105,   84,   85,
+ /*   820 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
+ /*   830 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*   840 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
+ /*   850 */    94,   95,   96,   97,   98,   99,  100,  101,  115,  115,
+ /*   860 */   104,  105,   84,   85,   86,   87,   88,   89,   90,   91,
+ /*   870 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  101,
+ /*   880 */   115,  115,  104,  105,   84,   85,   86,   87,   88,   89,
+ /*   890 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
+ /*   900 */   100,  101,  115,  115,  104,  105,   84,   85,   86,   87,
+ /*   910 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
+ /*   920 */    98,   99,  100,  101,  115,  115,  104,  105,   84,   85,
+ /*   930 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
+ /*   940 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*   950 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
+ /*   960 */    94,   95,   96,   97,   98,   99,  100,  101,  115,  115,
+ /*   970 */   104,  105,   84,   85,   86,   87,   88,   89,   90,   91,
+ /*   980 */    92,   93,   94,   95,   96,   97,   98,   99,  100,  101,
+ /*   990 */   115,  115,  104,  105,   84,   85,   86,   87,   88,   89,
+ /*  1000 */    90,   91,   92,   93,   94,   95,   96,   97,   98,   99,
+ /*  1010 */   100,  101,  115,   84,  104,  105,   87,  115,   89,   90,
+ /*  1020 */    91,   92,   93,   94,   95,   96,   97,   98,   99,  100,
+ /*  1030 */   101,  115,  115,  104,  105,   84,  115,  115,   87,  115,
+ /*  1040 */   115,   90,   91,   92,   93,   94,   95,   96,   97,   98,
+ /*  1050 */    99,  100,  101,  115,  115,  104,  105,   84,  115,  115,
+ /*  1060 */    87,  115,  115,   90,   91,   92,   93,   94,   95,   96,
+ /*  1070 */    97,   98,   99,  100,  101,  115,  115,  104,  105,   84,
+ /*  1080 */   115,  115,   87,  115,  115,  115,   91,   92,   93,   94,
+ /*  1090 */    95,   96,   97,   98,   99,  100,  101,  115,   84,  104,
+ /*  1100 */   105,   87,  115,  115,  115,  115,   92,   93,   94,   95,
+ /*  1110 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*  1120 */   115,  115,  115,  115,   17,   18,   19,   20,   21,   22,
+ /*  1130 */    23,   24,   25,   26,   27,   28,   84,  115,  115,   87,
+ /*  1140 */   115,  115,  115,  115,  115,   93,   94,   95,   96,   97,
+ /*  1150 */    98,   99,  100,  101,  115,  115,  104,  105,  115,   84,
+ /*  1160 */   115,  115,   87,  115,  115,  115,  115,   60,   61,   94,
+ /*  1170 */    95,   96,   97,   98,   99,  100,  101,  115,   84,  104,
+ /*  1180 */   105,   87,  115,  115,  115,  115,  115,  115,   94,   95,
+ /*  1190 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*  1200 */     0,  115,  115,    3,    4,    5,    6,    7,    8,  115,
+ /*  1210 */    10,   11,   12,   13,   84,   15,  115,   87,  115,  115,
+ /*  1220 */   115,  115,  115,  115,  115,   95,   96,   97,   98,   99,
+ /*  1230 */   100,  101,  115,   84,  104,  105,   87,  115,  115,  115,
+ /*  1240 */   115,  115,  115,  115,   95,   96,   97,   98,   99,  100,
+ /*  1250 */   101,  115,   84,  104,  105,   87,  115,  115,  115,  115,
+ /*  1260 */   115,  115,  115,   95,   96,   97,   98,   99,  100,  101,
+ /*  1270 */   115,  115,  104,  105,   84,  115,  115,   87,  115,  115,
+ /*  1280 */   115,  115,  115,  115,  115,   95,   96,   97,   98,   99,
+ /*  1290 */   100,  101,  115,   84,  104,  105,   87,  115,  115,  115,
+ /*  1300 */   115,  115,  115,  115,   95,   96,   97,   98,   99,  100,
+ /*  1310 */   101,  115,   84,  104,  105,   87,  115,  115,  115,  115,
+ /*  1320 */   115,  115,  115,   95,   96,   97,   98,   99,  100,  101,
+ /*  1330 */   115,   84,  104,  105,   87,  115,  115,  115,  115,  115,
+ /*  1340 */   115,  115,   95,   96,   97,   98,   99,  100,  101,  115,
+ /*  1350 */    84,  104,  105,   87,  115,  115,  115,  115,  115,  115,
+ /*  1360 */   115,   95,   96,   97,   98,   99,  100,  101,  115,  115,
+ /*  1370 */   104,  105,   84,  115,  115,   87,  115,  115,  115,  115,
+ /*  1380 */   115,  115,  115,   95,   96,   97,   98,   99,  100,  101,
+ /*  1390 */   115,   84,  104,  105,   87,  115,  115,  115,  115,  115,
+ /*  1400 */   115,  115,   95,   96,   97,   98,   99,  100,  101,  115,
+ /*  1410 */    84,  104,  105,   87,  115,  115,  115,  115,  115,  115,
+ /*  1420 */   115,   95,   96,   97,   98,   99,  100,  101,  115,   84,
+ /*  1430 */   104,  105,   87,  115,  115,  115,  115,  115,  115,  115,
+ /*  1440 */    95,   96,   97,   98,   99,  100,  101,  115,   84,  104,
+ /*  1450 */   105,   87,  115,  115,  115,  115,  115,  115,  115,   95,
+ /*  1460 */    96,   97,   98,   99,  100,  101,  115,  115,  104,  105,
+ /*  1470 */    84,  115,  115,   87,  115,  115,  115,  115,  115,  115,
+ /*  1480 */   115,   95,   96,   97,   98,   99,  100,  101,  115,   84,
+ /*  1490 */   104,  105,   87,  115,  115,  115,  115,  115,  115,  115,
+ /*  1500 */    95,   96,   97,   98,   99,  100,  101,  115,   84,  104,
+ /*  1510 */   105,   87,  115,  115,  115,  115,  115,  115,  115,  115,
+ /*  1520 */    96,   97,   98,   99,  100,  101,  115,   84,  104,  105,
+ /*  1530 */    87,  115,  115,  115,  115,  115,  115,  115,  115,   96,
+ /*  1540 */    97,   98,   99,  100,  101,  115,   84,  104,  105,   87,
+ /*  1550 */   115,  115,  115,   83,   84,  115,  115,   87,   96,   97,
+ /*  1560 */    98,   99,  100,  101,  115,  115,  104,  105,   98,   99,
+ /*  1570 */   100,  101,  115,  115,  104,  105,   84,  115,  115,   87,
+ /*  1580 */   115,  115,  115,  115,  115,   84,  115,  115,   87,   97,
+ /*  1590 */    98,   99,  100,  101,  115,  115,  104,  105,   97,   98,
+ /*  1600 */    99,  100,  101,  115,  115,  104,  105,   84,  115,  115,
+ /*  1610 */    87,  115,  115,  115,  115,   84,  115,  115,   87,  115,
+ /*  1620 */   115,   98,   99,  100,  101,  115,  115,  104,  105,   98,
+ /*  1630 */    99,  100,  101,  115,   84,  104,  105,   87,  115,  115,
+ /*  1640 */   115,  115,   84,  115,  115,   87,  115,  115,   98,   99,
+ /*  1650 */   100,  101,  115,  115,  104,  105,   98,   99,  100,  101,
+ /*  1660 */   115,   84,  104,  105,   87,  115,  115,  115,  115,  115,
+ /*  1670 */    84,  115,  115,   87,  115,   98,   99,  100,  101,  115,
+ /*  1680 */   115,  104,  105,  115,   98,   99,  100,  101,  115,  115,
+ /*  1690 */   104,  105,   84,  115,  115,   87,  115,  115,  115,  115,
+ /*  1700 */    84,  115,  115,   87,  115,  115,   98,   99,  100,  101,
+ /*  1710 */   115,  115,  104,  105,   98,   99,  100,  101,  115,   84,
+ /*  1720 */   104,  105,   87,  115,  115,  115,  115,   84,  115,  115,
+ /*  1730 */    87,  115,  115,   98,   99,  100,  101,  115,  115,  104,
+ /*  1740 */   105,   98,   99,  100,  101,  115,   84,  104,  105,   87,
+ /*  1750 */   115,  115,  115,  115,  115,   84,  115,  115,   87,  115,
+ /*  1760 */    98,   99,  100,  101,  115,  115,  104,  105,  115,   98,
+ /*  1770 */    99,  100,  101,  115,  115,  104,  105,   84,  115,  115,
+ /*  1780 */    87,  115,  115,  115,  115,   84,  115,  115,   87,  115,
+ /*  1790 */   115,   98,   99,  100,  101,  115,  115,  104,  105,   98,
+ /*  1800 */    99,  100,  101,  115,  115,  104,  105,
 };
-#define YY_SHIFT_USE_DFLT (1794)
-#define YY_SHIFT_COUNT    (144)
-#define YY_SHIFT_MIN      (-60)
-#define YY_SHIFT_MAX      (1166)
+#define YY_SHIFT_USE_DFLT (1807)
+#define YY_SHIFT_COUNT    (146)
+#define YY_SHIFT_MIN      (-61)
+#define YY_SHIFT_MAX      (1200)
 static const short yy_shift_ofst[] = {
- /*     0 */    -1,  460,   96,  131,  285,  131,  489,  489,  489,  489,
- /*    10 */   220,  254,  489,  489,  489,  489,  489,  489,  489,  489,
- /*    20 */   489,  489,  489,  489,  489,  489,  489,  489,  489,  489,
- /*    30 */   489,  489,  489,  489,  489,  489,  489,  489,  489,  489,
- /*    40 */   489,  489,  489,  489,  489,  489,  489,  489,  489,  489,
- /*    50 */   489,  489,  489,  489,   96,  489,  489,  489,  489,  489,
- /*    60 */   489,  489,  489,  489,  489,  489,  489,  489,  489,  489,
- /*    70 */   489,  263,   -7,  -60,   36,  223,   -7,  -60, 1152, 1166,
- /*    80 */    36,   36,   36,   36,   36,   36,   36,  256,  132,  132,
- /*    90 */   132, 1061,    4,    4,    4,    4,    4,    4,    4,    4,
- /*   100 */     4,    4,    4,    4,   17,    4,   17,    4,   17,    4,
- /*   110 */    45,   94,  493,  179,  247,  126,  134,  134,  290,  134,
- /*   120 */   190,  370,  209,  134,  190,  179,  298,  221,   75,  104,
- /*   130 */   232,  236,  238,  250,  271,  297,  280,  278,  303,  271,
- /*   140 */   278,  303,  271,  306,  104,
+ /*     0 */    -1,  499,   97,  132,  385,  132,  564,  564,  564,  564,
+ /*    10 */   253,  319,  564,  564,  564,  564,  564,  564,  564,  564,
+ /*    20 */   564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
+ /*    30 */   564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
+ /*    40 */   564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
+ /*    50 */   564,  564,  564,  564,  564,   97,  564,  564,  564,  564,
+ /*    60 */   564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
+ /*    70 */   564,  564,  364,   -7,  -61,   36,  222,   -7,  -61,  600,
+ /*    80 */  1200,   36,   36,   36,   36,   36,   36,   36,  216,  134,
+ /*    90 */   134,  134, 1107,    4,    4,    4,    4,    4,    4,    4,
+ /*   100 */     4,    4,    4,    4,    4,    4,   17,    4,   17,    4,
+ /*   110 */    17,    4,   45,   95,  290,  223,  139,  127,  135,  135,
+ /*   120 */   246,  135,  199,  281,  240,  135,  199,  223,  394,  254,
+ /*   130 */    76,  105,  195,  215,  200,  237,  264,  286,  272,  270,
+ /*   140 */   273,  264,  270,  273,  264,  274,  105,
 };
-#define YY_REDUCE_USE_DFLT (-106)
-#define YY_REDUCE_COUNT (87)
-#define YY_REDUCE_MIN   (-105)
-#define YY_REDUCE_MAX   (1689)
+#define YY_REDUCE_USE_DFLT (-107)
+#define YY_REDUCE_COUNT (88)
+#define YY_REDUCE_MIN   (-106)
+#define YY_REDUCE_MAX   (1701)
 static const short yy_reduce_ofst[] = {
- /*     0 */   -62,   -8,   34,  123,  155,  274,  308,  340,  362,  392,
- /*    10 */   478,  500,  522,  544,  566,  588,  610,  632,  654,  676,
- /*    20 */   698,  720,  742,  764,  786,  808,  830,  852,  874,  893,
- /*    30 */   912,  931,  950,  969, 1007, 1029, 1048, 1100, 1122, 1144,
- /*    40 */  1163, 1182, 1201, 1220, 1239, 1258, 1277, 1296, 1315, 1334,
- /*    50 */  1353, 1372, 1391, 1410, 1418, 1437, 1456, 1475, 1494, 1502,
- /*    60 */  1521, 1540, 1559, 1578, 1586, 1605, 1624, 1643, 1662, 1670,
- /*    70 */  1689,  -64,   33, -105,   15,   50,   23,   39,  -69,  -69,
- /*    80 */   -32,   20,   71,  122,  147,  175,  183,  -87,
+ /*     0 */   -63,   -8,   34,  124,  153,  187,  252,  320,  379,  401,
+ /*    10 */   440,  494,  554,  577,  599,  624,  646,  668,  690,  712,
+ /*    20 */   734,  756,  778,  800,  822,  844,  866,  888,  910,  929,
+ /*    30 */   951,  973,  995, 1014, 1052, 1075, 1094, 1130, 1149, 1168,
+ /*    40 */  1190, 1209, 1228, 1247, 1266, 1288, 1307, 1326, 1345, 1364,
+ /*    50 */  1386, 1405, 1424, 1443, 1462, 1470, 1492, 1501, 1523, 1531,
+ /*    60 */  1550, 1558, 1577, 1586, 1608, 1616, 1635, 1643, 1662, 1671,
+ /*    70 */  1693, 1701,  -65,   33, -106,   15,   47,   23,   44,  -70,
+ /*    80 */   -70,  -33,  -31,   20,  102,  123,  148,  152,  -88,
 };
 static const YYACTIONTYPE yy_default[] = {
- /*     0 */   504,  437,  504,  444,  504,  446,  441,  504,  504,  504,
- /*    10 */   504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
- /*    20 */   504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
- /*    30 */   504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
- /*    40 */   504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
- /*    50 */   504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
- /*    60 */   504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
- /*    70 */   504,  504,  501,  437,  504,  477,  504,  504,  504,  504,
- /*    80 */   504,  504,  504,  504,  504,  504,  504,  504,  469,  399,
- /*    90 */   398,  475,  413,  412,  411,  410,  409,  408,  407,  406,
- /*   100 */   405,  404,  403,  470,  472,  402,  418,  401,  417,  400,
- /*   110 */   504,  504,  504,  392,  504,  504,  471,  416,  504,  415,
- /*   120 */   468,  504,  475,  414,  397,  464,  463,  504,  486,  482,
- /*   130 */   504,  504,  504,  503,  394,  504,  504,  467,  466,  465,
- /*   140 */   396,  395,  393,  504,  504,
+ /*     0 */   508,  441,  508,  448,  508,  450,  445,  508,  508,  508,
+ /*    10 */   508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
+ /*    20 */   508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
+ /*    30 */   508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
+ /*    40 */   508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
+ /*    50 */   508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
+ /*    60 */   508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
+ /*    70 */   508,  508,  508,  505,  441,  508,  481,  508,  508,  508,
+ /*    80 */   508,  508,  508,  508,  508,  508,  508,  508,  508,  473,
+ /*    90 */   402,  401,  479,  417,  416,  415,  414,  413,  412,  411,
+ /*   100 */   410,  409,  408,  407,  406,  474,  476,  405,  422,  404,
+ /*   110 */   421,  403,  508,  508,  508,  395,  508,  508,  475,  420,
+ /*   120 */   508,  419,  472,  508,  479,  418,  400,  468,  467,  508,
+ /*   130 */   490,  486,  508,  508,  508,  507,  397,  508,  508,  471,
+ /*   140 */   470,  469,  399,  398,  396,  508,  508,
 };
 /********** End of lemon-generated parsing tables *****************************/
 
@@ -667,6 +670,7 @@ struct yyParser {
   yyStackEntry yystk0;          /* First stack entry */
 #else
   yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
+  yyStackEntry *yystackEnd;            /* Last entry in the stack */
 #endif
 };
 typedef struct yyParser yyParser;
@@ -718,24 +722,24 @@ static const char *const yyTokenName[] = {
   "BITWISE_XOR",   "BITWISE_AND",   "EQUAL",         "NOT_EQUAL",   
   "LESS",          "GREATER",       "LESS_EQUAL",    "GREATER_EQUAL",
   "IN",            "MATCH",         "NEAR",          "NEAR2",       
-  "SIMILAR",       "TERM_EXTRACT",  "LCP",           "PREFIX",      
-  "SUFFIX",        "REGEXP",        "SHIFTL",        "SHIFTR",      
-  "SHIFTRR",       "PLUS",          "MINUS",         "STAR",        
-  "SLASH",         "MOD",           "DELETE",        "INCR",        
-  "DECR",          "NOT",           "BITWISE_NOT",   "EXACT",       
-  "PARTIAL",       "UNSPLIT",       "DECIMAL",       "HEX_INTEGER", 
-  "STRING",        "BOOLEAN",       "NULL",          "BRACKETL",    
-  "BRACKETR",      "DOT",           "NONEXISTENT_COLUMN",  "error",       
-  "suppress_unused_variable_warning",  "input",         "query",         "expression",  
-  "output_columns",  "adjuster",      "query_element",  "primary_expression",
-  "assignment_expression",  "conditional_expression",  "lefthand_side_expression",  "logical_or_expression",
-  "logical_and_expression",  "bitwise_or_expression",  "bitwise_xor_expression",  "bitwise_and_expression",
-  "equality_expression",  "relational_expression",  "shift_expression",  "additive_expression",
-  "multiplicative_expression",  "unary_expression",  "postfix_expression",  "call_expression",
-  "member_expression",  "arguments",     "member_expression_part",  "object_literal",
-  "array_literal",  "elision",       "element_list",  "property_name_and_value_list",
-  "property_name_and_value",  "property_name",  "argument_list",  "output_column",
-  "adjust_expression",  "adjust_match_expression",
+  "SIMILAR",       "TERM_EXTRACT",  "QUORUM",        "LCP",         
+  "PREFIX",        "SUFFIX",        "REGEXP",        "SHIFTL",      
+  "SHIFTR",        "SHIFTRR",       "PLUS",          "MINUS",       
+  "STAR",          "SLASH",         "MOD",           "DELETE",      
+  "INCR",          "DECR",          "NOT",           "BITWISE_NOT", 
+  "EXACT",         "PARTIAL",       "UNSPLIT",       "DECIMAL",     
+  "HEX_INTEGER",   "STRING",        "BOOLEAN",       "NULL",        
+  "BRACKETL",      "BRACKETR",      "DOT",           "NONEXISTENT_COLUMN",
+  "error",         "suppress_unused_variable_warning",  "input",         "query",       
+  "expression",    "output_columns",  "adjuster",      "query_element",
+  "primary_expression",  "assignment_expression",  "conditional_expression",  "lefthand_side_expression",
+  "logical_or_expression",  "logical_and_expression",  "bitwise_or_expression",  "bitwise_xor_expression",
+  "bitwise_and_expression",  "equality_expression",  "relational_expression",  "shift_expression",
+  "additive_expression",  "multiplicative_expression",  "unary_expression",  "postfix_expression",
+  "call_expression",  "member_expression",  "arguments",     "member_expression_part",
+  "object_literal",  "array_literal",  "elision",       "element_list",
+  "property_name_and_value_list",  "property_name_and_value",  "property_name",  "argument_list",
+  "output_column",  "adjust_expression",  "adjust_match_expression",
 };
 #endif /* NDEBUG */
 
@@ -785,100 +789,101 @@ static const char *const yyRuleName[] = {
  /*  39 */ "relational_expression ::= relational_expression NEAR2 shift_expression",
  /*  40 */ "relational_expression ::= relational_expression SIMILAR shift_expression",
  /*  41 */ "relational_expression ::= relational_expression TERM_EXTRACT shift_expression",
- /*  42 */ "relational_expression ::= relational_expression LCP shift_expression",
- /*  43 */ "relational_expression ::= relational_expression PREFIX shift_expression",
- /*  44 */ "relational_expression ::= relational_expression SUFFIX shift_expression",
- /*  45 */ "relational_expression ::= relational_expression REGEXP shift_expression",
- /*  46 */ "shift_expression ::= shift_expression SHIFTL additive_expression",
- /*  47 */ "shift_expression ::= shift_expression SHIFTR additive_expression",
- /*  48 */ "shift_expression ::= shift_expression SHIFTRR additive_expression",
- /*  49 */ "additive_expression ::= additive_expression PLUS multiplicative_expression",
- /*  50 */ "additive_expression ::= additive_expression MINUS multiplicative_expression",
- /*  51 */ "multiplicative_expression ::= multiplicative_expression STAR unary_expression",
- /*  52 */ "multiplicative_expression ::= multiplicative_expression SLASH unary_expression",
- /*  53 */ "multiplicative_expression ::= multiplicative_expression MOD unary_expression",
- /*  54 */ "unary_expression ::= DELETE unary_expression",
- /*  55 */ "unary_expression ::= INCR unary_expression",
- /*  56 */ "unary_expression ::= DECR unary_expression",
- /*  57 */ "unary_expression ::= PLUS unary_expression",
- /*  58 */ "unary_expression ::= MINUS unary_expression",
- /*  59 */ "unary_expression ::= NOT unary_expression",
- /*  60 */ "unary_expression ::= BITWISE_NOT unary_expression",
- /*  61 */ "unary_expression ::= ADJUST unary_expression",
- /*  62 */ "unary_expression ::= EXACT unary_expression",
- /*  63 */ "unary_expression ::= PARTIAL unary_expression",
- /*  64 */ "unary_expression ::= UNSPLIT unary_expression",
- /*  65 */ "postfix_expression ::= lefthand_side_expression INCR",
- /*  66 */ "postfix_expression ::= lefthand_side_expression DECR",
- /*  67 */ "call_expression ::= member_expression arguments",
- /*  68 */ "object_literal ::= BRACEL property_name_and_value_list BRACER",
- /*  69 */ "property_name_and_value_list ::=",
- /*  70 */ "property_name_and_value ::= property_name COLON assignment_expression",
- /*  71 */ "member_expression_part ::= BRACKETL expression BRACKETR",
- /*  72 */ "arguments ::= PARENL argument_list PARENR",
- /*  73 */ "argument_list ::=",
- /*  74 */ "argument_list ::= assignment_expression",
- /*  75 */ "argument_list ::= argument_list COMMA assignment_expression",
- /*  76 */ "output_columns ::=",
- /*  77 */ "output_columns ::= output_column",
- /*  78 */ "output_columns ::= output_columns COMMA",
- /*  79 */ "output_columns ::= output_columns COMMA output_column",
- /*  80 */ "output_column ::= STAR",
- /*  81 */ "output_column ::= NONEXISTENT_COLUMN",
- /*  82 */ "output_column ::= assignment_expression",
- /*  83 */ "adjuster ::= adjuster PLUS adjust_expression",
- /*  84 */ "adjust_expression ::= adjust_match_expression STAR DECIMAL",
- /*  85 */ "adjust_match_expression ::= IDENTIFIER MATCH STRING",
- /*  86 */ "input ::= query",
- /*  87 */ "input ::= expression",
- /*  88 */ "input ::= START_OUTPUT_COLUMNS output_columns",
- /*  89 */ "input ::= START_ADJUSTER adjuster",
- /*  90 */ "query ::= query_element",
- /*  91 */ "query_element ::= QSTRING",
- /*  92 */ "query_element ::= PARENL query PARENR",
- /*  93 */ "expression ::= assignment_expression",
- /*  94 */ "assignment_expression ::= conditional_expression",
- /*  95 */ "conditional_expression ::= logical_or_expression",
- /*  96 */ "logical_or_expression ::= logical_and_expression",
- /*  97 */ "logical_and_expression ::= bitwise_or_expression",
- /*  98 */ "bitwise_or_expression ::= bitwise_xor_expression",
- /*  99 */ "bitwise_xor_expression ::= bitwise_and_expression",
- /* 100 */ "bitwise_and_expression ::= equality_expression",
- /* 101 */ "equality_expression ::= relational_expression",
- /* 102 */ "relational_expression ::= shift_expression",
- /* 103 */ "shift_expression ::= additive_expression",
- /* 104 */ "additive_expression ::= multiplicative_expression",
- /* 105 */ "multiplicative_expression ::= unary_expression",
- /* 106 */ "unary_expression ::= postfix_expression",
- /* 107 */ "postfix_expression ::= lefthand_side_expression",
- /* 108 */ "lefthand_side_expression ::= call_expression",
- /* 109 */ "lefthand_side_expression ::= member_expression",
- /* 110 */ "member_expression ::= primary_expression",
- /* 111 */ "member_expression ::= member_expression member_expression_part",
- /* 112 */ "primary_expression ::= object_literal",
- /* 113 */ "primary_expression ::= PARENL expression PARENR",
- /* 114 */ "primary_expression ::= IDENTIFIER",
- /* 115 */ "primary_expression ::= array_literal",
- /* 116 */ "primary_expression ::= DECIMAL",
- /* 117 */ "primary_expression ::= HEX_INTEGER",
- /* 118 */ "primary_expression ::= STRING",
- /* 119 */ "primary_expression ::= BOOLEAN",
- /* 120 */ "primary_expression ::= NULL",
- /* 121 */ "array_literal ::= BRACKETL elision BRACKETR",
- /* 122 */ "array_literal ::= BRACKETL element_list elision BRACKETR",
- /* 123 */ "array_literal ::= BRACKETL element_list BRACKETR",
- /* 124 */ "elision ::= COMMA",
- /* 125 */ "elision ::= elision COMMA",
- /* 126 */ "element_list ::= assignment_expression",
- /* 127 */ "element_list ::= elision assignment_expression",
- /* 128 */ "element_list ::= element_list elision assignment_expression",
- /* 129 */ "property_name_and_value_list ::= property_name_and_value",
- /* 130 */ "property_name_and_value_list ::= property_name_and_value_list COMMA property_name_and_value",
- /* 131 */ "property_name ::= STRING",
- /* 132 */ "member_expression_part ::= DOT IDENTIFIER",
- /* 133 */ "adjuster ::=",
- /* 134 */ "adjuster ::= adjust_expression",
- /* 135 */ "adjust_expression ::= adjust_match_expression",
+ /*  42 */ "relational_expression ::= relational_expression QUORUM shift_expression",
+ /*  43 */ "relational_expression ::= relational_expression LCP shift_expression",
+ /*  44 */ "relational_expression ::= relational_expression PREFIX shift_expression",
+ /*  45 */ "relational_expression ::= relational_expression SUFFIX shift_expression",
+ /*  46 */ "relational_expression ::= relational_expression REGEXP shift_expression",
+ /*  47 */ "shift_expression ::= shift_expression SHIFTL additive_expression",
+ /*  48 */ "shift_expression ::= shift_expression SHIFTR additive_expression",
+ /*  49 */ "shift_expression ::= shift_expression SHIFTRR additive_expression",
+ /*  50 */ "additive_expression ::= additive_expression PLUS multiplicative_expression",
+ /*  51 */ "additive_expression ::= additive_expression MINUS multiplicative_expression",
+ /*  52 */ "multiplicative_expression ::= multiplicative_expression STAR unary_expression",
+ /*  53 */ "multiplicative_expression ::= multiplicative_expression SLASH unary_expression",
+ /*  54 */ "multiplicative_expression ::= multiplicative_expression MOD unary_expression",
+ /*  55 */ "unary_expression ::= DELETE unary_expression",
+ /*  56 */ "unary_expression ::= INCR unary_expression",
+ /*  57 */ "unary_expression ::= DECR unary_expression",
+ /*  58 */ "unary_expression ::= PLUS unary_expression",
+ /*  59 */ "unary_expression ::= MINUS unary_expression",
+ /*  60 */ "unary_expression ::= NOT unary_expression",
+ /*  61 */ "unary_expression ::= BITWISE_NOT unary_expression",
+ /*  62 */ "unary_expression ::= ADJUST unary_expression",
+ /*  63 */ "unary_expression ::= EXACT unary_expression",
+ /*  64 */ "unary_expression ::= PARTIAL unary_expression",
+ /*  65 */ "unary_expression ::= UNSPLIT unary_expression",
+ /*  66 */ "postfix_expression ::= lefthand_side_expression INCR",
+ /*  67 */ "postfix_expression ::= lefthand_side_expression DECR",
+ /*  68 */ "call_expression ::= member_expression arguments",
+ /*  69 */ "object_literal ::= BRACEL property_name_and_value_list BRACER",
+ /*  70 */ "property_name_and_value_list ::=",
+ /*  71 */ "property_name_and_value ::= property_name COLON assignment_expression",
+ /*  72 */ "member_expression_part ::= BRACKETL expression BRACKETR",
+ /*  73 */ "arguments ::= PARENL argument_list PARENR",
+ /*  74 */ "argument_list ::=",
+ /*  75 */ "argument_list ::= assignment_expression",
+ /*  76 */ "argument_list ::= argument_list COMMA assignment_expression",
+ /*  77 */ "output_columns ::=",
+ /*  78 */ "output_columns ::= output_column",
+ /*  79 */ "output_columns ::= output_columns COMMA",
+ /*  80 */ "output_columns ::= output_columns COMMA output_column",
+ /*  81 */ "output_column ::= STAR",
+ /*  82 */ "output_column ::= NONEXISTENT_COLUMN",
+ /*  83 */ "output_column ::= assignment_expression",
+ /*  84 */ "adjuster ::= adjuster PLUS adjust_expression",
+ /*  85 */ "adjust_expression ::= adjust_match_expression STAR DECIMAL",
+ /*  86 */ "adjust_match_expression ::= IDENTIFIER MATCH STRING",
+ /*  87 */ "input ::= query",
+ /*  88 */ "input ::= expression",
+ /*  89 */ "input ::= START_OUTPUT_COLUMNS output_columns",
+ /*  90 */ "input ::= START_ADJUSTER adjuster",
+ /*  91 */ "query ::= query_element",
+ /*  92 */ "query_element ::= QSTRING",
+ /*  93 */ "query_element ::= PARENL query PARENR",
+ /*  94 */ "expression ::= assignment_expression",
+ /*  95 */ "assignment_expression ::= conditional_expression",
+ /*  96 */ "conditional_expression ::= logical_or_expression",
+ /*  97 */ "logical_or_expression ::= logical_and_expression",
+ /*  98 */ "logical_and_expression ::= bitwise_or_expression",
+ /*  99 */ "bitwise_or_expression ::= bitwise_xor_expression",
+ /* 100 */ "bitwise_xor_expression ::= bitwise_and_expression",
+ /* 101 */ "bitwise_and_expression ::= equality_expression",
+ /* 102 */ "equality_expression ::= relational_expression",
+ /* 103 */ "relational_expression ::= shift_expression",
+ /* 104 */ "shift_expression ::= additive_expression",
+ /* 105 */ "additive_expression ::= multiplicative_expression",
+ /* 106 */ "multiplicative_expression ::= unary_expression",
+ /* 107 */ "unary_expression ::= postfix_expression",
+ /* 108 */ "postfix_expression ::= lefthand_side_expression",
+ /* 109 */ "lefthand_side_expression ::= call_expression",
+ /* 110 */ "lefthand_side_expression ::= member_expression",
+ /* 111 */ "member_expression ::= primary_expression",
+ /* 112 */ "member_expression ::= member_expression member_expression_part",
+ /* 113 */ "primary_expression ::= object_literal",
+ /* 114 */ "primary_expression ::= PARENL expression PARENR",
+ /* 115 */ "primary_expression ::= IDENTIFIER",
+ /* 116 */ "primary_expression ::= array_literal",
+ /* 117 */ "primary_expression ::= DECIMAL",
+ /* 118 */ "primary_expression ::= HEX_INTEGER",
+ /* 119 */ "primary_expression ::= STRING",
+ /* 120 */ "primary_expression ::= BOOLEAN",
+ /* 121 */ "primary_expression ::= NULL",
+ /* 122 */ "array_literal ::= BRACKETL elision BRACKETR",
+ /* 123 */ "array_literal ::= BRACKETL element_list elision BRACKETR",
+ /* 124 */ "array_literal ::= BRACKETL element_list BRACKETR",
+ /* 125 */ "elision ::= COMMA",
+ /* 126 */ "elision ::= elision COMMA",
+ /* 127 */ "element_list ::= assignment_expression",
+ /* 128 */ "element_list ::= elision assignment_expression",
+ /* 129 */ "element_list ::= element_list elision assignment_expression",
+ /* 130 */ "property_name_and_value_list ::= property_name_and_value",
+ /* 131 */ "property_name_and_value_list ::= property_name_and_value_list COMMA property_name_and_value",
+ /* 132 */ "property_name ::= STRING",
+ /* 133 */ "member_expression_part ::= DOT IDENTIFIER",
+ /* 134 */ "adjuster ::=",
+ /* 135 */ "adjuster ::= adjust_expression",
+ /* 136 */ "adjust_expression ::= adjust_match_expression",
 };
 #endif /* NDEBUG */
 
@@ -947,6 +952,9 @@ void grn_expr_parserInit(void *yypParser){
   pParser->yytos = pParser->yystack;
   pParser->yystack[0].stateno = 0;
   pParser->yystack[0].major = 0;
+#if YYSTACKDEPTH>0
+  pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1];
+#endif
 }
 
 #ifndef grn_expr_parser_ENGINEALWAYSONSTACK
@@ -996,13 +1004,13 @@ static void yy_destructor(
     ** inside the C code.
     */
 /********* Begin destructor definitions ***************************************/
-    case 76: /* suppress_unused_variable_warning */
+    case 77: /* suppress_unused_variable_warning */
 {
 #line 14 "grn_ecmascript.lemon"
 
   (void)efsi;
 
-#line 1006 "grn_ecmascript.c"
+#line 1014 "grn_ecmascript.c"
 }
       break;
 /********* End destructor definitions *****************************************/
@@ -1223,7 +1231,7 @@ static void yy_shift(
   }
 #endif
 #if YYSTACKDEPTH>0 
-  if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH] ){
+  if( yypParser->yytos>yypParser->yystackEnd ){
     yypParser->yytos--;
     yyStackOverflow(yypParser);
     return;
@@ -1251,145 +1259,146 @@ static void yy_shift(
 ** is used during the reduce.
 */
 static const struct {
-  YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
-  unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
+  YYCODETYPE lhs;       /* Symbol on the left-hand side of the rule */
+  signed char nrhs;     /* Negative of the number of RHS symbols in the rule */
 } yyRuleInfo[] = {
-  { 78, 2 },
-  { 78, 3 },
-  { 78, 3 },
-  { 78, 3 },
-  { 78, 3 },
-  { 82, 2 },
-  { 82, 2 },
-  { 82, 3 },
-  { 82, 3 },
-  { 82, 2 },
-  { 79, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 84, 3 },
-  { 85, 5 },
-  { 87, 3 },
-  { 88, 3 },
-  { 88, 3 },
-  { 89, 3 },
-  { 90, 3 },
-  { 91, 3 },
-  { 92, 3 },
-  { 92, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 93, 3 },
-  { 94, 3 },
-  { 94, 3 },
-  { 94, 3 },
-  { 95, 3 },
-  { 95, 3 },
-  { 96, 3 },
-  { 96, 3 },
-  { 96, 3 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 97, 2 },
-  { 98, 2 },
-  { 98, 2 },
-  { 99, 2 },
-  { 103, 3 },
-  { 107, 0 },
-  { 108, 3 },
-  { 102, 3 },
-  { 101, 3 },
-  { 110, 0 },
-  { 110, 1 },
-  { 110, 3 },
-  { 80, 0 },
-  { 80, 1 },
-  { 80, 2 },
-  { 80, 3 },
-  { 111, 1 },
-  { 111, 1 },
-  { 111, 1 },
-  { 81, 3 },
-  { 112, 3 },
-  { 113, 3 },
-  { 77, 1 },
-  { 77, 1 },
-  { 77, 2 },
-  { 77, 2 },
-  { 78, 1 },
-  { 82, 1 },
-  { 82, 3 },
-  { 79, 1 },
-  { 84, 1 },
-  { 85, 1 },
-  { 87, 1 },
-  { 88, 1 },
-  { 89, 1 },
-  { 90, 1 },
-  { 91, 1 },
-  { 92, 1 },
-  { 93, 1 },
-  { 94, 1 },
-  { 95, 1 },
-  { 96, 1 },
-  { 97, 1 },
-  { 98, 1 },
-  { 86, 1 },
-  { 86, 1 },
-  { 100, 1 },
-  { 100, 2 },
-  { 83, 1 },
-  { 83, 3 },
-  { 83, 1 },
-  { 83, 1 },
-  { 83, 1 },
-  { 83, 1 },
-  { 83, 1 },
-  { 83, 1 },
-  { 83, 1 },
-  { 104, 3 },
-  { 104, 4 },
-  { 104, 3 },
-  { 105, 1 },
-  { 105, 2 },
-  { 106, 1 },
-  { 106, 2 },
-  { 106, 3 },
-  { 107, 1 },
-  { 107, 3 },
-  { 109, 1 },
-  { 102, 2 },
+  { 79, -2 },
+  { 79, -3 },
+  { 79, -3 },
+  { 79, -3 },
+  { 79, -3 },
+  { 83, -2 },
+  { 83, -2 },
+  { 83, -3 },
+  { 83, -3 },
+  { 83, -2 },
+  { 80, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 85, -3 },
+  { 86, -5 },
+  { 88, -3 },
+  { 89, -3 },
+  { 89, -3 },
+  { 90, -3 },
+  { 91, -3 },
+  { 92, -3 },
+  { 93, -3 },
+  { 93, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 94, -3 },
+  { 95, -3 },
+  { 95, -3 },
+  { 95, -3 },
+  { 96, -3 },
+  { 96, -3 },
+  { 97, -3 },
+  { 97, -3 },
+  { 97, -3 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 98, -2 },
+  { 99, -2 },
+  { 99, -2 },
+  { 100, -2 },
+  { 104, -3 },
+  { 108, 0 },
+  { 109, -3 },
+  { 103, -3 },
+  { 102, -3 },
+  { 111, 0 },
+  { 111, -1 },
+  { 111, -3 },
   { 81, 0 },
-  { 81, 1 },
-  { 112, 1 },
+  { 81, -1 },
+  { 81, -2 },
+  { 81, -3 },
+  { 112, -1 },
+  { 112, -1 },
+  { 112, -1 },
+  { 82, -3 },
+  { 113, -3 },
+  { 114, -3 },
+  { 78, -1 },
+  { 78, -1 },
+  { 78, -2 },
+  { 78, -2 },
+  { 79, -1 },
+  { 83, -1 },
+  { 83, -3 },
+  { 80, -1 },
+  { 85, -1 },
+  { 86, -1 },
+  { 88, -1 },
+  { 89, -1 },
+  { 90, -1 },
+  { 91, -1 },
+  { 92, -1 },
+  { 93, -1 },
+  { 94, -1 },
+  { 95, -1 },
+  { 96, -1 },
+  { 97, -1 },
+  { 98, -1 },
+  { 99, -1 },
+  { 87, -1 },
+  { 87, -1 },
+  { 101, -1 },
+  { 101, -2 },
+  { 84, -1 },
+  { 84, -3 },
+  { 84, -1 },
+  { 84, -1 },
+  { 84, -1 },
+  { 84, -1 },
+  { 84, -1 },
+  { 84, -1 },
+  { 84, -1 },
+  { 105, -3 },
+  { 105, -4 },
+  { 105, -3 },
+  { 106, -1 },
+  { 106, -2 },
+  { 107, -1 },
+  { 107, -2 },
+  { 107, -3 },
+  { 108, -1 },
+  { 108, -3 },
+  { 110, -1 },
+  { 103, -2 },
+  { 82, 0 },
+  { 82, -1 },
+  { 113, -1 },
 };
 
 static void yy_accept(yyParser*);  /* Forward Declaration */
@@ -1412,7 +1421,7 @@ static void yy_reduce(
   if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
     yysize = yyRuleInfo[yyruleno].nrhs;
     fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt,
-      yyRuleName[yyruleno], yymsp[-yysize].stateno);
+      yyRuleName[yyruleno], yymsp[yysize].stateno);
   }
 #endif /* NDEBUG */
 
@@ -1427,7 +1436,7 @@ static void yy_reduce(
     }
 #endif
 #if YYSTACKDEPTH>0 
-    if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH-1] ){
+    if( yypParser->yytos>=yypParser->yystackEnd ){
       yyStackOverflow(yypParser);
       return;
     }
@@ -1458,7 +1467,7 @@ static void yy_reduce(
 {
   grn_expr_append_op(efsi->ctx, efsi->e, grn_int32_value_at(&efsi->op_stack, -1), 2);
 }
-#line 1462 "grn_ecmascript.c"
+#line 1471 "grn_ecmascript.c"
         break;
       case 1: /* query ::= query LOGICAL_AND query_element */
       case 25: /* logical_and_expression ::= logical_and_expression LOGICAL_AND bitwise_or_expression */ yytestcase(yyruleno==25);
@@ -1466,7 +1475,7 @@ static void yy_reduce(
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_AND, 2);
 }
-#line 1470 "grn_ecmascript.c"
+#line 1479 "grn_ecmascript.c"
         break;
       case 2: /* query ::= query LOGICAL_AND_NOT query_element */
       case 26: /* logical_and_expression ::= logical_and_expression LOGICAL_AND_NOT bitwise_or_expression */ yytestcase(yyruleno==26);
@@ -1474,7 +1483,7 @@ static void yy_reduce(
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_AND_NOT, 2);
 }
-#line 1478 "grn_ecmascript.c"
+#line 1487 "grn_ecmascript.c"
         break;
       case 3: /* query ::= query LOGICAL_OR query_element */
       case 24: /* logical_or_expression ::= logical_or_expression LOGICAL_OR logical_and_expression */ yytestcase(yyruleno==24);
@@ -1482,7 +1491,7 @@ static void yy_reduce(
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_OR, 2);
 }
-#line 1486 "grn_ecmascript.c"
+#line 1495 "grn_ecmascript.c"
         break;
       case 4: /* query ::= query NEGATIVE query_element */
 #line 65 "grn_ecmascript.lemon"
@@ -1491,7 +1500,7 @@ static void yy_reduce(
   GRN_INT32_POP(&efsi->weight_stack, weight);
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_ADJUST, 2);
 }
-#line 1495 "grn_ecmascript.c"
+#line 1504 "grn_ecmascript.c"
         break;
       case 5: /* query_element ::= ADJUST query_element */
 #line 74 "grn_ecmascript.lemon"
@@ -1499,7 +1508,7 @@ static void yy_reduce(
   int weight;
   GRN_INT32_POP(&efsi->weight_stack, weight);
 }
-#line 1503 "grn_ecmascript.c"
+#line 1512 "grn_ecmascript.c"
         break;
       case 6: /* query_element ::= RELATIVE_OP query_element */
 #line 78 "grn_ecmascript.lemon"
@@ -1507,7 +1516,7 @@ static void yy_reduce(
   int mode;
   GRN_INT32_POP(&efsi->mode_stack, mode);
 }
-#line 1511 "grn_ecmascript.c"
+#line 1520 "grn_ecmascript.c"
         break;
       case 7: /* query_element ::= IDENTIFIER RELATIVE_OP query_element */
 #line 82 "grn_ecmascript.lemon"
@@ -1534,7 +1543,7 @@ static void yy_reduce(
     break;
   }
 }
-#line 1538 "grn_ecmascript.c"
+#line 1547 "grn_ecmascript.c"
         break;
       case 8: /* query_element ::= BRACEL expression BRACER */
       case 9: /* query_element ::= EVAL primary_expression */ yytestcase(yyruleno==9);
@@ -1542,98 +1551,98 @@ static void yy_reduce(
 {
   efsi->flags = efsi->default_flags;
 }
-#line 1546 "grn_ecmascript.c"
+#line 1555 "grn_ecmascript.c"
         break;
       case 10: /* expression ::= expression COMMA assignment_expression */
 #line 113 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_COMMA, 2);
 }
-#line 1553 "grn_ecmascript.c"
+#line 1562 "grn_ecmascript.c"
         break;
       case 11: /* assignment_expression ::= lefthand_side_expression ASSIGN assignment_expression */
 #line 118 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_ASSIGN, 2);
 }
-#line 1560 "grn_ecmascript.c"
+#line 1569 "grn_ecmascript.c"
         break;
       case 12: /* assignment_expression ::= lefthand_side_expression STAR_ASSIGN assignment_expression */
 #line 121 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_STAR_ASSIGN, 2);
 }
-#line 1567 "grn_ecmascript.c"
+#line 1576 "grn_ecmascript.c"
         break;
       case 13: /* assignment_expression ::= lefthand_side_expression SLASH_ASSIGN assignment_expression */
 #line 124 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SLASH_ASSIGN, 2);
 }
-#line 1574 "grn_ecmascript.c"
+#line 1583 "grn_ecmascript.c"
         break;
       case 14: /* assignment_expression ::= lefthand_side_expression MOD_ASSIGN assignment_expression */
 #line 127 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MOD_ASSIGN, 2);
 }
-#line 1581 "grn_ecmascript.c"
+#line 1590 "grn_ecmascript.c"
         break;
       case 15: /* assignment_expression ::= lefthand_side_expression PLUS_ASSIGN assignment_expression */
 #line 130 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PLUS_ASSIGN, 2);
 }
-#line 1588 "grn_ecmascript.c"
+#line 1597 "grn_ecmascript.c"
         break;
       case 16: /* assignment_expression ::= lefthand_side_expression MINUS_ASSIGN assignment_expression */
 #line 133 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MINUS_ASSIGN, 2);
 }
-#line 1595 "grn_ecmascript.c"
+#line 1604 "grn_ecmascript.c"
         break;
       case 17: /* assignment_expression ::= lefthand_side_expression SHIFTL_ASSIGN assignment_expression */
 #line 136 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTL_ASSIGN, 2);
 }
-#line 1602 "grn_ecmascript.c"
+#line 1611 "grn_ecmascript.c"
         break;
       case 18: /* assignment_expression ::= lefthand_side_expression SHIFTR_ASSIGN assignment_expression */
 #line 139 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTR_ASSIGN, 2);
 }
-#line 1609 "grn_ecmascript.c"
+#line 1618 "grn_ecmascript.c"
         break;
       case 19: /* assignment_expression ::= lefthand_side_expression SHIFTRR_ASSIGN assignment_expression */
 #line 142 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTRR_ASSIGN, 2);
 }
-#line 1616 "grn_ecmascript.c"
+#line 1625 "grn_ecmascript.c"
         break;
       case 20: /* assignment_expression ::= lefthand_side_expression AND_ASSIGN assignment_expression */
 #line 145 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_AND_ASSIGN, 2);
 }
-#line 1623 "grn_ecmascript.c"
+#line 1632 "grn_ecmascript.c"
         break;
       case 21: /* assignment_expression ::= lefthand_side_expression XOR_ASSIGN assignment_expression */
 #line 148 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_XOR_ASSIGN, 2);
 }
-#line 1630 "grn_ecmascript.c"
+#line 1639 "grn_ecmascript.c"
         break;
       case 22: /* assignment_expression ::= lefthand_side_expression OR_ASSIGN assignment_expression */
 #line 151 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_OR_ASSIGN, 2);
 }
-#line 1637 "grn_ecmascript.c"
+#line 1646 "grn_ecmascript.c"
         break;
       case 23: /* conditional_expression ::= logical_or_expression QUESTION assignment_expression COLON assignment_expression */
 #line 156 "grn_ecmascript.lemon"
@@ -1642,85 +1651,85 @@ static void yy_reduce(
   e->codes[yymsp[-3].minor.yy0].nargs = yymsp[-1].minor.yy0 - yymsp[-3].minor.yy0;
   e->codes[yymsp[-1].minor.yy0].nargs = e->codes_curr - yymsp[-1].minor.yy0 - 1;
 }
-#line 1646 "grn_ecmascript.c"
+#line 1655 "grn_ecmascript.c"
         break;
       case 27: /* bitwise_or_expression ::= bitwise_or_expression BITWISE_OR bitwise_xor_expression */
 #line 176 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_OR, 2);
 }
-#line 1653 "grn_ecmascript.c"
+#line 1662 "grn_ecmascript.c"
         break;
       case 28: /* bitwise_xor_expression ::= bitwise_xor_expression BITWISE_XOR bitwise_and_expression */
 #line 181 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_XOR, 2);
 }
-#line 1660 "grn_ecmascript.c"
+#line 1669 "grn_ecmascript.c"
         break;
       case 29: /* bitwise_and_expression ::= bitwise_and_expression BITWISE_AND equality_expression */
 #line 186 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_AND, 2);
 }
-#line 1667 "grn_ecmascript.c"
+#line 1676 "grn_ecmascript.c"
         break;
       case 30: /* equality_expression ::= equality_expression EQUAL relational_expression */
 #line 191 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_EQUAL, 2);
 }
-#line 1674 "grn_ecmascript.c"
+#line 1683 "grn_ecmascript.c"
         break;
       case 31: /* equality_expression ::= equality_expression NOT_EQUAL relational_expression */
 #line 194 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NOT_EQUAL, 2);
 }
-#line 1681 "grn_ecmascript.c"
+#line 1690 "grn_ecmascript.c"
         break;
       case 32: /* relational_expression ::= relational_expression LESS shift_expression */
 #line 199 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_LESS, 2);
 }
-#line 1688 "grn_ecmascript.c"
+#line 1697 "grn_ecmascript.c"
         break;
       case 33: /* relational_expression ::= relational_expression GREATER shift_expression */
 #line 202 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_GREATER, 2);
 }
-#line 1695 "grn_ecmascript.c"
+#line 1704 "grn_ecmascript.c"
         break;
       case 34: /* relational_expression ::= relational_expression LESS_EQUAL shift_expression */
 #line 205 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_LESS_EQUAL, 2);
 }
-#line 1702 "grn_ecmascript.c"
+#line 1711 "grn_ecmascript.c"
         break;
       case 35: /* relational_expression ::= relational_expression GREATER_EQUAL shift_expression */
 #line 208 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_GREATER_EQUAL, 2);
 }
-#line 1709 "grn_ecmascript.c"
+#line 1718 "grn_ecmascript.c"
         break;
       case 36: /* relational_expression ::= relational_expression IN shift_expression */
 #line 211 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_IN, 2);
 }
-#line 1716 "grn_ecmascript.c"
+#line 1725 "grn_ecmascript.c"
         break;
       case 37: /* relational_expression ::= relational_expression MATCH shift_expression */
-      case 85: /* adjust_match_expression ::= IDENTIFIER MATCH STRING */ yytestcase(yyruleno==85);
+      case 86: /* adjust_match_expression ::= IDENTIFIER MATCH STRING */ yytestcase(yyruleno==86);
 #line 214 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MATCH, 2);
 }
-#line 1724 "grn_ecmascript.c"
+#line 1733 "grn_ecmascript.c"
         break;
       case 38: /* relational_expression ::= relational_expression NEAR shift_expression */
 #line 217 "grn_ecmascript.lemon"
@@ -1733,124 +1742,137 @@ static void yy_reduce(
   }
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NEAR, 3);
 }
-#line 1737 "grn_ecmascript.c"
+#line 1746 "grn_ecmascript.c"
         break;
       case 39: /* relational_expression ::= relational_expression NEAR2 shift_expression */
 #line 226 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NEAR2, 2);
 }
-#line 1744 "grn_ecmascript.c"
+#line 1753 "grn_ecmascript.c"
         break;
       case 40: /* relational_expression ::= relational_expression SIMILAR shift_expression */
 #line 229 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SIMILAR, 2);
 }
-#line 1751 "grn_ecmascript.c"
+#line 1760 "grn_ecmascript.c"
         break;
       case 41: /* relational_expression ::= relational_expression TERM_EXTRACT shift_expression */
 #line 232 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_TERM_EXTRACT, 2);
 }
-#line 1758 "grn_ecmascript.c"
+#line 1767 "grn_ecmascript.c"
         break;
-      case 42: /* relational_expression ::= relational_expression LCP shift_expression */
+      case 42: /* relational_expression ::= relational_expression QUORUM shift_expression */
 #line 235 "grn_ecmascript.lemon"
 {
+  {
+    int quorum_threshold;
+    GRN_INT32_POP(&efsi->quorum_threshold_stack, quorum_threshold);
+    grn_expr_append_const_int(efsi->ctx, efsi->e, quorum_threshold,
+                              GRN_OP_PUSH, 1);
+  }
+  grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_QUORUM, 3);
+}
+#line 1780 "grn_ecmascript.c"
+        break;
+      case 43: /* relational_expression ::= relational_expression LCP shift_expression */
+#line 244 "grn_ecmascript.lemon"
+{
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_LCP, 2);
 }
-#line 1765 "grn_ecmascript.c"
+#line 1787 "grn_ecmascript.c"
         break;
-      case 43: /* relational_expression ::= relational_expression PREFIX shift_expression */
-#line 238 "grn_ecmascript.lemon"
+      case 44: /* relational_expression ::= relational_expression PREFIX shift_expression */
+#line 247 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PREFIX, 2);
 }
-#line 1772 "grn_ecmascript.c"
+#line 1794 "grn_ecmascript.c"
         break;
-      case 44: /* relational_expression ::= relational_expression SUFFIX shift_expression */
-#line 241 "grn_ecmascript.lemon"
+      case 45: /* relational_expression ::= relational_expression SUFFIX shift_expression */
+#line 250 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SUFFIX, 2);
 }
-#line 1779 "grn_ecmascript.c"
+#line 1801 "grn_ecmascript.c"
         break;
-      case 45: /* relational_expression ::= relational_expression REGEXP shift_expression */
-#line 244 "grn_ecmascript.lemon"
+      case 46: /* relational_expression ::= relational_expression REGEXP shift_expression */
+#line 253 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_REGEXP, 2);
 }
-#line 1786 "grn_ecmascript.c"
+#line 1808 "grn_ecmascript.c"
         break;
-      case 46: /* shift_expression ::= shift_expression SHIFTL additive_expression */
-#line 249 "grn_ecmascript.lemon"
+      case 47: /* shift_expression ::= shift_expression SHIFTL additive_expression */
+#line 258 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTL, 2);
 }
-#line 1793 "grn_ecmascript.c"
+#line 1815 "grn_ecmascript.c"
         break;
-      case 47: /* shift_expression ::= shift_expression SHIFTR additive_expression */
-#line 252 "grn_ecmascript.lemon"
+      case 48: /* shift_expression ::= shift_expression SHIFTR additive_expression */
+#line 261 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTR, 2);
 }
-#line 1800 "grn_ecmascript.c"
+#line 1822 "grn_ecmascript.c"
         break;
-      case 48: /* shift_expression ::= shift_expression SHIFTRR additive_expression */
-#line 255 "grn_ecmascript.lemon"
+      case 49: /* shift_expression ::= shift_expression SHIFTRR additive_expression */
+#line 264 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SHIFTRR, 2);
 }
-#line 1807 "grn_ecmascript.c"
+#line 1829 "grn_ecmascript.c"
         break;
-      case 49: /* additive_expression ::= additive_expression PLUS multiplicative_expression */
-      case 83: /* adjuster ::= adjuster PLUS adjust_expression */ yytestcase(yyruleno==83);
-#line 260 "grn_ecmascript.lemon"
+      case 50: /* additive_expression ::= additive_expression PLUS multiplicative_expression */
+      case 84: /* adjuster ::= adjuster PLUS adjust_expression */ yytestcase(yyruleno==84);
+#line 269 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PLUS, 2);
 }
-#line 1815 "grn_ecmascript.c"
+#line 1837 "grn_ecmascript.c"
         break;
-      case 50: /* additive_expression ::= additive_expression MINUS multiplicative_expression */
-#line 263 "grn_ecmascript.lemon"
+      case 51: /* additive_expression ::= additive_expression MINUS multiplicative_expression */
+#line 272 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MINUS, 2);
 }
-#line 1822 "grn_ecmascript.c"
+#line 1844 "grn_ecmascript.c"
         break;
-      case 51: /* multiplicative_expression ::= multiplicative_expression STAR unary_expression */
-      case 84: /* adjust_expression ::= adjust_match_expression STAR DECIMAL */ yytestcase(yyruleno==84);
-#line 268 "grn_ecmascript.lemon"
+      case 52: /* multiplicative_expression ::= multiplicative_expression STAR unary_expression */
+      case 85: /* adjust_expression ::= adjust_match_expression STAR DECIMAL */ yytestcase(yyruleno==85);
+#line 277 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_STAR, 2);
 }
-#line 1830 "grn_ecmascript.c"
+#line 1852 "grn_ecmascript.c"
         break;
-      case 52: /* multiplicative_expression ::= multiplicative_expression SLASH unary_expression */
-#line 271 "grn_ecmascript.lemon"
+      case 53: /* multiplicative_expression ::= multiplicative_expression SLASH unary_expression */
+#line 280 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_SLASH, 2);
 }
-#line 1837 "grn_ecmascript.c"
+#line 1859 "grn_ecmascript.c"
         break;
-      case 53: /* multiplicative_expression ::= multiplicative_expression MOD unary_expression */
-#line 274 "grn_ecmascript.lemon"
+      case 54: /* multiplicative_expression ::= multiplicative_expression MOD unary_expression */
+#line 283 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MOD, 2);
 }
-#line 1844 "grn_ecmascript.c"
+#line 1866 "grn_ecmascript.c"
         break;
-      case 54: /* unary_expression ::= DELETE unary_expression */
-#line 279 "grn_ecmascript.lemon"
+      case 55: /* unary_expression ::= DELETE unary_expression */
+#line 288 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_DELETE, 1);
 }
-#line 1851 "grn_ecmascript.c"
+#line 1873 "grn_ecmascript.c"
         break;
-      case 55: /* unary_expression ::= INCR unary_expression */
-#line 282 "grn_ecmascript.lemon"
+      case 56: /* unary_expression ::= INCR unary_expression */
+#line 291 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
   grn_expr *e = (grn_expr *)(efsi->e);
@@ -1868,10 +1890,10 @@ static void yy_reduce(
     grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_INCR, 1);
   }
 }
-#line 1872 "grn_ecmascript.c"
+#line 1894 "grn_ecmascript.c"
         break;
-      case 56: /* unary_expression ::= DECR unary_expression */
-#line 299 "grn_ecmascript.lemon"
+      case 57: /* unary_expression ::= DECR unary_expression */
+#line 308 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
   grn_expr *e = (grn_expr *)(efsi->e);
@@ -1889,66 +1911,66 @@ static void yy_reduce(
     grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_DECR, 1);
   }
 }
-#line 1893 "grn_ecmascript.c"
+#line 1915 "grn_ecmascript.c"
         break;
-      case 57: /* unary_expression ::= PLUS unary_expression */
-#line 316 "grn_ecmascript.lemon"
+      case 58: /* unary_expression ::= PLUS unary_expression */
+#line 325 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PLUS, 1);
 }
-#line 1900 "grn_ecmascript.c"
+#line 1922 "grn_ecmascript.c"
         break;
-      case 58: /* unary_expression ::= MINUS unary_expression */
-#line 319 "grn_ecmascript.lemon"
+      case 59: /* unary_expression ::= MINUS unary_expression */
+#line 328 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_MINUS, 1);
 }
-#line 1907 "grn_ecmascript.c"
+#line 1929 "grn_ecmascript.c"
         break;
-      case 59: /* unary_expression ::= NOT unary_expression */
-#line 322 "grn_ecmascript.lemon"
+      case 60: /* unary_expression ::= NOT unary_expression */
+#line 331 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_NOT, 1);
 }
-#line 1914 "grn_ecmascript.c"
+#line 1936 "grn_ecmascript.c"
         break;
-      case 60: /* unary_expression ::= BITWISE_NOT unary_expression */
-#line 325 "grn_ecmascript.lemon"
+      case 61: /* unary_expression ::= BITWISE_NOT unary_expression */
+#line 334 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_BITWISE_NOT, 1);
 }
-#line 1921 "grn_ecmascript.c"
+#line 1943 "grn_ecmascript.c"
         break;
-      case 61: /* unary_expression ::= ADJUST unary_expression */
-#line 328 "grn_ecmascript.lemon"
+      case 62: /* unary_expression ::= ADJUST unary_expression */
+#line 337 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_ADJUST, 1);
 }
-#line 1928 "grn_ecmascript.c"
+#line 1950 "grn_ecmascript.c"
         break;
-      case 62: /* unary_expression ::= EXACT unary_expression */
-#line 331 "grn_ecmascript.lemon"
+      case 63: /* unary_expression ::= EXACT unary_expression */
+#line 340 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_EXACT, 1);
 }
-#line 1935 "grn_ecmascript.c"
+#line 1957 "grn_ecmascript.c"
         break;
-      case 63: /* unary_expression ::= PARTIAL unary_expression */
-#line 334 "grn_ecmascript.lemon"
+      case 64: /* unary_expression ::= PARTIAL unary_expression */
+#line 343 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_PARTIAL, 1);
 }
-#line 1942 "grn_ecmascript.c"
+#line 1964 "grn_ecmascript.c"
         break;
-      case 64: /* unary_expression ::= UNSPLIT unary_expression */
-#line 337 "grn_ecmascript.lemon"
+      case 65: /* unary_expression ::= UNSPLIT unary_expression */
+#line 346 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_UNSPLIT, 1);
 }
-#line 1949 "grn_ecmascript.c"
+#line 1971 "grn_ecmascript.c"
         break;
-      case 65: /* postfix_expression ::= lefthand_side_expression INCR */
-#line 342 "grn_ecmascript.lemon"
+      case 66: /* postfix_expression ::= lefthand_side_expression INCR */
+#line 351 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
   grn_expr *e = (grn_expr *)(efsi->e);
@@ -1966,10 +1988,10 @@ static void yy_reduce(
     grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_INCR_POST, 1);
   }
 }
-#line 1970 "grn_ecmascript.c"
+#line 1992 "grn_ecmascript.c"
         break;
-      case 66: /* postfix_expression ::= lefthand_side_expression DECR */
-#line 359 "grn_ecmascript.lemon"
+      case 67: /* postfix_expression ::= lefthand_side_expression DECR */
+#line 368 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
   grn_expr *e = (grn_expr *)(efsi->e);
@@ -1987,17 +2009,17 @@ static void yy_reduce(
     grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_DECR_POST, 1);
   }
 }
-#line 1991 "grn_ecmascript.c"
+#line 2013 "grn_ecmascript.c"
         break;
-      case 67: /* call_expression ::= member_expression arguments */
-#line 380 "grn_ecmascript.lemon"
+      case 68: /* call_expression ::= member_expression arguments */
+#line 389 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_CALL, yymsp[0].minor.yy0);
 }
-#line 1998 "grn_ecmascript.c"
+#line 2020 "grn_ecmascript.c"
         break;
-      case 68: /* object_literal ::= BRACEL property_name_and_value_list BRACER */
-#line 408 "grn_ecmascript.lemon"
+      case 69: /* object_literal ::= BRACEL property_name_and_value_list BRACER */
+#line 417 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
   grn_expr_take_obj(ctx, efsi->e, (grn_obj *)(efsi->object_literal));
@@ -2005,10 +2027,10 @@ static void yy_reduce(
                       GRN_OP_PUSH, 1);
   efsi->object_literal = NULL;
 }
-#line 2009 "grn_ecmascript.c"
+#line 2031 "grn_ecmascript.c"
         break;
-      case 69: /* property_name_and_value_list ::= */
-#line 416 "grn_ecmascript.lemon"
+      case 70: /* property_name_and_value_list ::= */
+#line 425 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
 
@@ -2021,10 +2043,10 @@ static void yy_reduce(
         (int)(efsi->str_end - efsi->str), efsi->str);
   }
 }
-#line 2025 "grn_ecmascript.c"
+#line 2047 "grn_ecmascript.c"
         break;
-      case 70: /* property_name_and_value ::= property_name COLON assignment_expression */
-#line 431 "grn_ecmascript.lemon"
+      case 71: /* property_name_and_value ::= property_name COLON assignment_expression */
+#line 440 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
   grn_expr *e = (grn_expr *)(efsi->e);
@@ -2066,61 +2088,61 @@ static void yy_reduce(
     }
   }
 }
-#line 2070 "grn_ecmascript.c"
+#line 2092 "grn_ecmascript.c"
         break;
-      case 71: /* member_expression_part ::= BRACKETL expression BRACKETR */
-#line 475 "grn_ecmascript.lemon"
+      case 72: /* member_expression_part ::= BRACKETL expression BRACKETR */
+#line 484 "grn_ecmascript.lemon"
 {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_GET_MEMBER, 2);
 }
-#line 2077 "grn_ecmascript.c"
+#line 2099 "grn_ecmascript.c"
         break;
-      case 72: /* arguments ::= PARENL argument_list PARENR */
-#line 480 "grn_ecmascript.lemon"
+      case 73: /* arguments ::= PARENL argument_list PARENR */
+#line 489 "grn_ecmascript.lemon"
 { yymsp[-2].minor.yy0 = yymsp[-1].minor.yy0; }
-#line 2082 "grn_ecmascript.c"
+#line 2104 "grn_ecmascript.c"
         break;
-      case 73: /* argument_list ::= */
-#line 481 "grn_ecmascript.lemon"
+      case 74: /* argument_list ::= */
+#line 490 "grn_ecmascript.lemon"
 { yymsp[1].minor.yy0 = 0; }
-#line 2087 "grn_ecmascript.c"
+#line 2109 "grn_ecmascript.c"
         break;
-      case 74: /* argument_list ::= assignment_expression */
-#line 482 "grn_ecmascript.lemon"
+      case 75: /* argument_list ::= assignment_expression */
+#line 491 "grn_ecmascript.lemon"
 { yymsp[0].minor.yy0 = 1; }
-#line 2092 "grn_ecmascript.c"
+#line 2114 "grn_ecmascript.c"
         break;
-      case 75: /* argument_list ::= argument_list COMMA assignment_expression */
-#line 483 "grn_ecmascript.lemon"
+      case 76: /* argument_list ::= argument_list COMMA assignment_expression */
+#line 492 "grn_ecmascript.lemon"
 { yylhsminor.yy0 = yymsp[-2].minor.yy0 + 1; }
-#line 2097 "grn_ecmascript.c"
+#line 2119 "grn_ecmascript.c"
   yymsp[-2].minor.yy0 = yylhsminor.yy0;
         break;
-      case 76: /* output_columns ::= */
-#line 485 "grn_ecmascript.lemon"
+      case 77: /* output_columns ::= */
+#line 494 "grn_ecmascript.lemon"
 {
   yymsp[1].minor.yy0 = 0;
 }
-#line 2105 "grn_ecmascript.c"
+#line 2127 "grn_ecmascript.c"
         break;
-      case 77: /* output_columns ::= output_column */
-#line 488 "grn_ecmascript.lemon"
+      case 78: /* output_columns ::= output_column */
+#line 497 "grn_ecmascript.lemon"
 {
   yylhsminor.yy0 = yymsp[0].minor.yy0;
 }
-#line 2112 "grn_ecmascript.c"
+#line 2134 "grn_ecmascript.c"
   yymsp[0].minor.yy0 = yylhsminor.yy0;
         break;
-      case 78: /* output_columns ::= output_columns COMMA */
-#line 493 "grn_ecmascript.lemon"
+      case 79: /* output_columns ::= output_columns COMMA */
+#line 502 "grn_ecmascript.lemon"
 {
   yylhsminor.yy0 = yymsp[-1].minor.yy0;
 }
-#line 2120 "grn_ecmascript.c"
+#line 2142 "grn_ecmascript.c"
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 79: /* output_columns ::= output_columns COMMA output_column */
-#line 498 "grn_ecmascript.lemon"
+      case 80: /* output_columns ::= output_columns COMMA output_column */
+#line 507 "grn_ecmascript.lemon"
 {
   if (yymsp[-2].minor.yy0 == 0) {
     yylhsminor.yy0 = yymsp[0].minor.yy0;
@@ -2133,11 +2155,11 @@ static void yy_reduce(
     yylhsminor.yy0 = 1;
   }
 }
-#line 2137 "grn_ecmascript.c"
+#line 2159 "grn_ecmascript.c"
   yymsp[-2].minor.yy0 = yylhsminor.yy0;
         break;
-      case 80: /* output_column ::= STAR */
-#line 511 "grn_ecmascript.lemon"
+      case 81: /* output_column ::= STAR */
+#line 520 "grn_ecmascript.lemon"
 {
   grn_ctx *ctx = efsi->ctx;
   grn_obj *expr = efsi->e;
@@ -2188,93 +2210,97 @@ static void yy_reduce(
     yymsp[0].minor.yy0 = 0;
   }
 }
-#line 2192 "grn_ecmascript.c"
+#line 2214 "grn_ecmascript.c"
         break;
-      case 81: /* output_column ::= NONEXISTENT_COLUMN */
-#line 561 "grn_ecmascript.lemon"
+      case 82: /* output_column ::= NONEXISTENT_COLUMN */
+#line 570 "grn_ecmascript.lemon"
 {
   yymsp[0].minor.yy0 = 0;
 }
-#line 2199 "grn_ecmascript.c"
+#line 2221 "grn_ecmascript.c"
         break;
-      case 82: /* output_column ::= assignment_expression */
-#line 564 "grn_ecmascript.lemon"
+      case 83: /* output_column ::= assignment_expression */
+#line 573 "grn_ecmascript.lemon"
 {
   yymsp[0].minor.yy0 = 1;
 }
-#line 2206 "grn_ecmascript.c"
+#line 2228 "grn_ecmascript.c"
         break;
       default:
-      /* (86) input ::= query */ yytestcase(yyruleno==86);
-      /* (87) input ::= expression */ yytestcase(yyruleno==87);
-      /* (88) input ::= START_OUTPUT_COLUMNS output_columns */ yytestcase(yyruleno==88);
-      /* (89) input ::= START_ADJUSTER adjuster */ yytestcase(yyruleno==89);
-      /* (90) query ::= query_element (OPTIMIZED OUT) */ assert(yyruleno!=90);
-      /* (91) query_element ::= QSTRING */ yytestcase(yyruleno==91);
-      /* (92) query_element ::= PARENL query PARENR */ yytestcase(yyruleno==92);
-      /* (93) expression ::= assignment_expression (OPTIMIZED OUT) */ assert(yyruleno!=93);
-      /* (94) assignment_expression ::= conditional_expression (OPTIMIZED OUT) */ assert(yyruleno!=94);
-      /* (95) conditional_expression ::= logical_or_expression */ yytestcase(yyruleno==95);
-      /* (96) logical_or_expression ::= logical_and_expression */ yytestcase(yyruleno==96);
-      /* (97) logical_and_expression ::= bitwise_or_expression */ yytestcase(yyruleno==97);
-      /* (98) bitwise_or_expression ::= bitwise_xor_expression */ yytestcase(yyruleno==98);
-      /* (99) bitwise_xor_expression ::= bitwise_and_expression */ yytestcase(yyruleno==99);
-      /* (100) bitwise_and_expression ::= equality_expression */ yytestcase(yyruleno==100);
-      /* (101) equality_expression ::= relational_expression */ yytestcase(yyruleno==101);
-      /* (102) relational_expression ::= shift_expression */ yytestcase(yyruleno==102);
-      /* (103) shift_expression ::= additive_expression */ yytestcase(yyruleno==103);
-      /* (104) additive_expression ::= multiplicative_expression */ yytestcase(yyruleno==104);
-      /* (105) multiplicative_expression ::= unary_expression (OPTIMIZED OUT) */ assert(yyruleno!=105);
-      /* (106) unary_expression ::= postfix_expression (OPTIMIZED OUT) */ assert(yyruleno!=106);
-      /* (107) postfix_expression ::= lefthand_side_expression */ yytestcase(yyruleno==107);
-      /* (108) lefthand_side_expression ::= call_expression (OPTIMIZED OUT) */ assert(yyruleno!=108);
-      /* (109) lefthand_side_expression ::= member_expression */ yytestcase(yyruleno==109);
-      /* (110) member_expression ::= primary_expression (OPTIMIZED OUT) */ assert(yyruleno!=110);
-      /* (111) member_expression ::= member_expression member_expression_part */ yytestcase(yyruleno==111);
-      /* (112) primary_expression ::= object_literal (OPTIMIZED OUT) */ assert(yyruleno!=112);
-      /* (113) primary_expression ::= PARENL expression PARENR */ yytestcase(yyruleno==113);
-      /* (114) primary_expression ::= IDENTIFIER */ yytestcase(yyruleno==114);
-      /* (115) primary_expression ::= array_literal (OPTIMIZED OUT) */ assert(yyruleno!=115);
-      /* (116) primary_expression ::= DECIMAL */ yytestcase(yyruleno==116);
-      /* (117) primary_expression ::= HEX_INTEGER */ yytestcase(yyruleno==117);
-      /* (118) primary_expression ::= STRING */ yytestcase(yyruleno==118);
-      /* (119) primary_expression ::= BOOLEAN */ yytestcase(yyruleno==119);
-      /* (120) primary_expression ::= NULL */ yytestcase(yyruleno==120);
-      /* (121) array_literal ::= BRACKETL elision BRACKETR */ yytestcase(yyruleno==121);
-      /* (122) array_literal ::= BRACKETL element_list elision BRACKETR */ yytestcase(yyruleno==122);
-      /* (123) array_literal ::= BRACKETL element_list BRACKETR */ yytestcase(yyruleno==123);
-      /* (124) elision ::= COMMA */ yytestcase(yyruleno==124);
-      /* (125) elision ::= elision COMMA */ yytestcase(yyruleno==125);
-      /* (126) element_list ::= assignment_expression (OPTIMIZED OUT) */ assert(yyruleno!=126);
-      /* (127) element_list ::= elision assignment_expression */ yytestcase(yyruleno==127);
-      /* (128) element_list ::= element_list elision assignment_expression */ yytestcase(yyruleno==128);
-      /* (129) property_name_and_value_list ::= property_name_and_value (OPTIMIZED OUT) */ assert(yyruleno!=129);
-      /* (130) property_name_and_value_list ::= property_name_and_value_list COMMA property_name_and_value */ yytestcase(yyruleno==130);
-      /* (131) property_name ::= STRING */ yytestcase(yyruleno==131);
-      /* (132) member_expression_part ::= DOT IDENTIFIER */ yytestcase(yyruleno==132);
-      /* (133) adjuster ::= */ yytestcase(yyruleno==133);
-      /* (134) adjuster ::= adjust_expression (OPTIMIZED OUT) */ assert(yyruleno!=134);
-      /* (135) adjust_expression ::= adjust_match_expression */ yytestcase(yyruleno==135);
+      /* (87) input ::= query */ yytestcase(yyruleno==87);
+      /* (88) input ::= expression */ yytestcase(yyruleno==88);
+      /* (89) input ::= START_OUTPUT_COLUMNS output_columns */ yytestcase(yyruleno==89);
+      /* (90) input ::= START_ADJUSTER adjuster */ yytestcase(yyruleno==90);
+      /* (91) query ::= query_element (OPTIMIZED OUT) */ assert(yyruleno!=91);
+      /* (92) query_element ::= QSTRING */ yytestcase(yyruleno==92);
+      /* (93) query_element ::= PARENL query PARENR */ yytestcase(yyruleno==93);
+      /* (94) expression ::= assignment_expression (OPTIMIZED OUT) */ assert(yyruleno!=94);
+      /* (95) assignment_expression ::= conditional_expression (OPTIMIZED OUT) */ assert(yyruleno!=95);
+      /* (96) conditional_expression ::= logical_or_expression */ yytestcase(yyruleno==96);
+      /* (97) logical_or_expression ::= logical_and_expression */ yytestcase(yyruleno==97);
+      /* (98) logical_and_expression ::= bitwise_or_expression */ yytestcase(yyruleno==98);
+      /* (99) bitwise_or_expression ::= bitwise_xor_expression */ yytestcase(yyruleno==99);
+      /* (100) bitwise_xor_expression ::= bitwise_and_expression */ yytestcase(yyruleno==100);
+      /* (101) bitwise_and_expression ::= equality_expression */ yytestcase(yyruleno==101);
+      /* (102) equality_expression ::= relational_expression */ yytestcase(yyruleno==102);
+      /* (103) relational_expression ::= shift_expression */ yytestcase(yyruleno==103);
+      /* (104) shift_expression ::= additive_expression */ yytestcase(yyruleno==104);
+      /* (105) additive_expression ::= multiplicative_expression */ yytestcase(yyruleno==105);
+      /* (106) multiplicative_expression ::= unary_expression (OPTIMIZED OUT) */ assert(yyruleno!=106);
+      /* (107) unary_expression ::= postfix_expression (OPTIMIZED OUT) */ assert(yyruleno!=107);
+      /* (108) postfix_expression ::= lefthand_side_expression */ yytestcase(yyruleno==108);
+      /* (109) lefthand_side_expression ::= call_expression (OPTIMIZED OUT) */ assert(yyruleno!=109);
+      /* (110) lefthand_side_expression ::= member_expression */ yytestcase(yyruleno==110);
+      /* (111) member_expression ::= primary_expression (OPTIMIZED OUT) */ assert(yyruleno!=111);
+      /* (112) member_expression ::= member_expression member_expression_part */ yytestcase(yyruleno==112);
+      /* (113) primary_expression ::= object_literal (OPTIMIZED OUT) */ assert(yyruleno!=113);
+      /* (114) primary_expression ::= PARENL expression PARENR */ yytestcase(yyruleno==114);
+      /* (115) primary_expression ::= IDENTIFIER */ yytestcase(yyruleno==115);
+      /* (116) primary_expression ::= array_literal (OPTIMIZED OUT) */ assert(yyruleno!=116);
+      /* (117) primary_expression ::= DECIMAL */ yytestcase(yyruleno==117);
+      /* (118) primary_expression ::= HEX_INTEGER */ yytestcase(yyruleno==118);
+      /* (119) primary_expression ::= STRING */ yytestcase(yyruleno==119);
+      /* (120) primary_expression ::= BOOLEAN */ yytestcase(yyruleno==120);
+      /* (121) primary_expression ::= NULL */ yytestcase(yyruleno==121);
+      /* (122) array_literal ::= BRACKETL elision BRACKETR */ yytestcase(yyruleno==122);
+      /* (123) array_literal ::= BRACKETL element_list elision BRACKETR */ yytestcase(yyruleno==123);
+      /* (124) array_literal ::= BRACKETL element_list BRACKETR */ yytestcase(yyruleno==124);
+      /* (125) elision ::= COMMA */ yytestcase(yyruleno==125);
+      /* (126) elision ::= elision COMMA */ yytestcase(yyruleno==126);
+      /* (127) element_list ::= assignment_expression (OPTIMIZED OUT) */ assert(yyruleno!=127);
+      /* (128) element_list ::= elision assignment_expression */ yytestcase(yyruleno==128);
+      /* (129) element_list ::= element_list elision assignment_expression */ yytestcase(yyruleno==129);
+      /* (130) property_name_and_value_list ::= property_name_and_value (OPTIMIZED OUT) */ assert(yyruleno!=130);
+      /* (131) property_name_and_value_list ::= property_name_and_value_list COMMA property_name_and_value */ yytestcase(yyruleno==131);
+      /* (132) property_name ::= STRING */ yytestcase(yyruleno==132);
+      /* (133) member_expression_part ::= DOT IDENTIFIER */ yytestcase(yyruleno==133);
+      /* (134) adjuster ::= */ yytestcase(yyruleno==134);
+      /* (135) adjuster ::= adjust_expression (OPTIMIZED OUT) */ assert(yyruleno!=135);
+      /* (136) adjust_expression ::= adjust_match_expression */ yytestcase(yyruleno==136);
         break;
 /********** End reduce actions ************************************************/
   };
   assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
   yygoto = yyRuleInfo[yyruleno].lhs;
   yysize = yyRuleInfo[yyruleno].nrhs;
-  yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
-  if( yyact <= YY_MAX_SHIFTREDUCE ){
-    if( yyact>YY_MAX_SHIFT ){
-      yyact += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
-    }
-    yymsp -= yysize-1;
+  yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
+
+  /* There are no SHIFTREDUCE actions on nonterminals because the table
+  ** generator has simplified them to pure REDUCE actions. */
+  assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );
+
+  /* It is not possible for a REDUCE to be followed by an error */
+  assert( yyact!=YY_ERROR_ACTION );
+
+  if( yyact==YY_ACCEPT_ACTION ){
+    yypParser->yytos += yysize;
+    yy_accept(yypParser);
+  }else{
+    yymsp += yysize+1;
     yypParser->yytos = yymsp;
     yymsp->stateno = (YYACTIONTYPE)yyact;
     yymsp->major = (YYCODETYPE)yygoto;
     yyTraceShift(yypParser, yyact);
-  }else{
-    assert( yyact == YY_ACCEPT_ACTION );
-    yypParser->yytos -= yysize;
-    yy_accept(yypParser);
   }
 }
 
@@ -2337,7 +2363,7 @@ static void yy_syntax_error(
     }
     GRN_OBJ_FIN(ctx, &message);
   }
-#line 2341 "grn_ecmascript.c"
+#line 2367 "grn_ecmascript.c"
 /************ End %syntax_error code ******************************************/
   grn_expr_parserARG_STORE; /* Suppress warning about unused %extra_argument variable */
 }

  Modified: lib/grn_ecmascript.h (+30 -29)
===================================================================
--- lib/grn_ecmascript.h    2018-01-07 15:04:32 +0900 (15272b0aa)
+++ lib/grn_ecmascript.h    2018-01-08 00:01:50 +0900 (66dfb9542)
@@ -43,32 +43,33 @@
 #define GRN_EXPR_TOKEN_NEAR2                           43
 #define GRN_EXPR_TOKEN_SIMILAR                         44
 #define GRN_EXPR_TOKEN_TERM_EXTRACT                    45
-#define GRN_EXPR_TOKEN_LCP                             46
-#define GRN_EXPR_TOKEN_PREFIX                          47
-#define GRN_EXPR_TOKEN_SUFFIX                          48
-#define GRN_EXPR_TOKEN_REGEXP                          49
-#define GRN_EXPR_TOKEN_SHIFTL                          50
-#define GRN_EXPR_TOKEN_SHIFTR                          51
-#define GRN_EXPR_TOKEN_SHIFTRR                         52
-#define GRN_EXPR_TOKEN_PLUS                            53
-#define GRN_EXPR_TOKEN_MINUS                           54
-#define GRN_EXPR_TOKEN_STAR                            55
-#define GRN_EXPR_TOKEN_SLASH                           56
-#define GRN_EXPR_TOKEN_MOD                             57
-#define GRN_EXPR_TOKEN_DELETE                          58
-#define GRN_EXPR_TOKEN_INCR                            59
-#define GRN_EXPR_TOKEN_DECR                            60
-#define GRN_EXPR_TOKEN_NOT                             61
-#define GRN_EXPR_TOKEN_BITWISE_NOT                     62
-#define GRN_EXPR_TOKEN_EXACT                           63
-#define GRN_EXPR_TOKEN_PARTIAL                         64
-#define GRN_EXPR_TOKEN_UNSPLIT                         65
-#define GRN_EXPR_TOKEN_DECIMAL                         66
-#define GRN_EXPR_TOKEN_HEX_INTEGER                     67
-#define GRN_EXPR_TOKEN_STRING                          68
-#define GRN_EXPR_TOKEN_BOOLEAN                         69
-#define GRN_EXPR_TOKEN_NULL                            70
-#define GRN_EXPR_TOKEN_BRACKETL                        71
-#define GRN_EXPR_TOKEN_BRACKETR                        72
-#define GRN_EXPR_TOKEN_DOT                             73
-#define GRN_EXPR_TOKEN_NONEXISTENT_COLUMN              74
+#define GRN_EXPR_TOKEN_QUORUM                          46
+#define GRN_EXPR_TOKEN_LCP                             47
+#define GRN_EXPR_TOKEN_PREFIX                          48
+#define GRN_EXPR_TOKEN_SUFFIX                          49
+#define GRN_EXPR_TOKEN_REGEXP                          50
+#define GRN_EXPR_TOKEN_SHIFTL                          51
+#define GRN_EXPR_TOKEN_SHIFTR                          52
+#define GRN_EXPR_TOKEN_SHIFTRR                         53
+#define GRN_EXPR_TOKEN_PLUS                            54
+#define GRN_EXPR_TOKEN_MINUS                           55
+#define GRN_EXPR_TOKEN_STAR                            56
+#define GRN_EXPR_TOKEN_SLASH                           57
+#define GRN_EXPR_TOKEN_MOD                             58
+#define GRN_EXPR_TOKEN_DELETE                          59
+#define GRN_EXPR_TOKEN_INCR                            60
+#define GRN_EXPR_TOKEN_DECR                            61
+#define GRN_EXPR_TOKEN_NOT                             62
+#define GRN_EXPR_TOKEN_BITWISE_NOT                     63
+#define GRN_EXPR_TOKEN_EXACT                           64
+#define GRN_EXPR_TOKEN_PARTIAL                         65
+#define GRN_EXPR_TOKEN_UNSPLIT                         66
+#define GRN_EXPR_TOKEN_DECIMAL                         67
+#define GRN_EXPR_TOKEN_HEX_INTEGER                     68
+#define GRN_EXPR_TOKEN_STRING                          69
+#define GRN_EXPR_TOKEN_BOOLEAN                         70
+#define GRN_EXPR_TOKEN_NULL                            71
+#define GRN_EXPR_TOKEN_BRACKETL                        72
+#define GRN_EXPR_TOKEN_BRACKETR                        73
+#define GRN_EXPR_TOKEN_DOT                             74
+#define GRN_EXPR_TOKEN_NONEXISTENT_COLUMN              75

  Modified: lib/grn_ecmascript.lemon (+9 -0)
===================================================================
--- lib/grn_ecmascript.lemon    2018-01-07 15:04:32 +0900 (234ea41c0)
+++ lib/grn_ecmascript.lemon    2018-01-08 00:01:50 +0900 (c116b1199)
@@ -232,6 +232,15 @@ relational_expression ::= relational_expression SIMILAR shift_expression. {
 relational_expression ::= relational_expression TERM_EXTRACT shift_expression. {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_TERM_EXTRACT, 2);
 }
+relational_expression ::= relational_expression QUORUM shift_expression. {
+  {
+    int quorum_threshold;
+    GRN_INT32_POP(&efsi->quorum_threshold_stack, quorum_threshold);
+    grn_expr_append_const_int(efsi->ctx, efsi->e, quorum_threshold,
+                              GRN_OP_PUSH, 1);
+  }
+  grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_QUORUM, 3);
+}
 relational_expression ::= relational_expression LCP shift_expression. {
   grn_expr_append_op(efsi->ctx, efsi->e, GRN_OP_LCP, 2);
 }

  Modified: lib/grn_expr.h (+3 -1)
===================================================================
--- lib/grn_expr.h    2018-01-07 15:04:32 +0900 (6e0edbac2)
+++ lib/grn_expr.h    2018-01-08 00:01:50 +0900 (97c384d8a)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2013-2016 Brazil
+  Copyright(C) 2013-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -66,6 +66,8 @@ int grn_scan_info_get_max_interval(scan_info *si);
 void grn_scan_info_set_max_interval(scan_info *si, int max_interval);
 int grn_scan_info_get_similarity_threshold(scan_info *si);
 void grn_scan_info_set_similarity_threshold(scan_info *si, int similarity_threshold);
+int grn_scan_info_get_quorum_threshold(scan_info *si);
+void grn_scan_info_set_quorum_threshold(scan_info *si, int quorum_threshold);
 grn_bool grn_scan_info_push_arg(grn_ctx *ctx, scan_info *si, grn_obj *arg);
 grn_obj *grn_scan_info_get_arg(grn_ctx *ctx, scan_info *si, int i);
 int grn_scan_info_get_start_position(scan_info *si);

  Modified: lib/grn_ii.h (+2 -1)
===================================================================
--- lib/grn_ii.h    2018-01-07 15:04:32 +0900 (21f57e2f1)
+++ lib/grn_ii.h    2018-01-08 00:01:50 +0900 (51994005f)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2009-2016 Brazil
+  Copyright(C) 2009-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -157,6 +157,7 @@ struct _grn_select_optarg {
   unsigned int scorer_args_expr_offset;
   grn_fuzzy_search_optarg fuzzy;
   grn_match_info *match_info;
+  int quorum_threshold;
 };
 
 GRN_API grn_rc grn_ii_column_update(grn_ctx *ctx, grn_ii *ii, grn_id id,

  Modified: lib/ii.c (+304 -93)
===================================================================
--- lib/ii.c    2018-01-07 15:04:32 +0900 (aad77a766)
+++ lib/ii.c    2018-01-08 00:01:50 +0900 (dca70ff0d)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2009-2017 Brazil
+  Copyright(C) 2009-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <float.h>
 
 #ifdef WIN32
 # include <io.h>
@@ -7777,6 +7778,94 @@ grn_ii_term_extract(grn_ctx *ctx, grn_ii *ii, const char *string,
 }
 
 typedef struct {
+  grn_obj *lexicon;
+  const char *query;
+  unsigned int query_len;
+  grn_hash *result_set;
+  grn_operator op;
+  grn_select_optarg *optarg;
+  grn_operator mode;
+  grn_wv_mode wv_mode;
+  grn_scorer_score_func *score_func;
+  grn_scorer_matched_record record;
+  grn_id previous_min;
+  grn_id current_min;
+  grn_bool set_min_enable_for_and_query;
+} grn_ii_select_data;
+
+static void
+grn_ii_select_data_init(grn_ctx *ctx,
+                        grn_ii_select_data *data,
+                        grn_select_optarg *optarg)
+{
+  data->optarg = optarg;
+  data->mode = GRN_OP_EXACT;
+  data->wv_mode = grn_wv_none;
+  data->score_func = NULL;
+  data->previous_min = GRN_ID_NIL;
+  data->current_min = GRN_ID_NIL;
+  data->set_min_enable_for_and_query = GRN_FALSE;
+
+  if (!optarg) {
+    return;
+  }
+
+  data->mode = optarg->mode;
+
+  if (optarg->func) {
+    data->wv_mode = grn_wv_dynamic;
+  } else if (optarg->vector_size != 0) {
+    if (optarg->weight_vector) {
+      data->wv_mode = grn_wv_static;
+    } else {
+      data->wv_mode = grn_wv_constant;
+    }
+  }
+
+  if (optarg->match_info) {
+    if (optarg->match_info->flags & GRN_MATCH_INFO_GET_MIN_RECORD_ID) {
+      data->previous_min = optarg->match_info->min;
+      data->set_min_enable_for_and_query = GRN_TRUE;
+    }
+  }
+
+  if (optarg->scorer) {
+    grn_proc *scorer = (grn_proc *)(optarg->scorer);
+    data->score_func = scorer->callbacks.scorer.score;
+    data->record.table = grn_ctx_at(ctx, data->result_set->obj.header.domain);
+    data->record.lexicon = data->lexicon;
+    data->record.id = GRN_ID_NIL;
+    GRN_RECORD_INIT(&(data->record.terms), GRN_OBJ_VECTOR,
+                    data->lexicon->header.domain);
+    GRN_UINT32_INIT(&(data->record.term_weights), GRN_OBJ_VECTOR);
+    data->record.total_term_weights = 0;
+    data->record.n_documents = grn_table_size(ctx, data->record.table);
+    data->record.n_occurrences = 0;
+    data->record.n_candidates = 0;
+    data->record.n_tokens = 0;
+    data->record.weight = 0;
+    data->record.args_expr = optarg->scorer_args_expr;
+    data->record.args_expr_offset = optarg->scorer_args_expr_offset;
+  }
+}
+
+static void
+grn_ii_select_data_fin(grn_ctx *ctx,
+                       grn_ii_select_data *data)
+{
+  if (data->score_func) {
+    GRN_OBJ_FIN(ctx, &(data->record.terms));
+    GRN_OBJ_FIN(ctx, &(data->record.term_weights));
+  }
+
+  if (data->set_min_enable_for_and_query) {
+    if (data->current_min > data->previous_min) {
+      data->optarg->match_info->min = data->current_min;
+    }
+  }
+}
+
+typedef struct {
   grn_id rid;
   uint32_t sid;
   uint32_t start_pos;
@@ -8328,6 +8417,153 @@ grn_ii_select_regexp(grn_ctx *ctx, grn_ii *ii,
   return rc;
 }
 
+typedef struct {
+  uint32_t n_occurs;
+  double score;
+} grn_ii_quorum_match_record_data;
+
+grn_rc
+grn_ii_quorum_match(grn_ctx *ctx, grn_ii *ii, grn_ii_select_data *data)
+{
+  size_t record_key_size;
+  grn_hash *n_occurs;
+  grn_token_cursor *token_cursor;
+  unsigned int token_flags = 0;
+  int ii_cursor_flags = 0;
+
+  record_key_size = sizeof(grn_id);
+  if (ii->header->flags & GRN_OBJ_WITH_SECTION) {
+    record_key_size += sizeof(uint32_t);
+    ii_cursor_flags |= GRN_OBJ_WITH_SECTION;
+  }
+
+  n_occurs = grn_hash_create(ctx,
+                             NULL,
+                             record_key_size,
+                             sizeof(grn_ii_quorum_match_record_data),
+                             0);
+  if (!n_occurs) {
+    return GRN_NO_MEMORY_AVAILABLE;
+  }
+
+  token_cursor = grn_token_cursor_open(ctx,
+                                       data->lexicon,
+                                       data->query, data->query_len,
+                                       GRN_TOKEN_GET,
+                                       token_flags);
+  if (!token_cursor) {
+    grn_rc rc = ctx->rc;
+    char ii_name[GRN_TABLE_MAX_KEY_SIZE];
+    int ii_name_len;
+
+    if (rc == GRN_SUCCESS) {
+      rc = GRN_UNKNOWN_ERROR;
+    }
+    ii_name_len = grn_obj_name(ctx,
+                               (grn_obj *)ii,
+                               ii_name, GRN_TABLE_MAX_KEY_SIZE);
+    ERR(rc,
+        "[ii][quorum-match] failed to create token cursor: <%.*s>: <%.*s>%s%s",
+        ii_name_len, ii_name,
+        data->query_len, data->query,
+        ctx->errbuf[0] ? ": " : "",
+        ctx->errbuf[0] ? ctx->errbuf : "");
+    grn_hash_close(ctx, n_occurs);
+    return rc;
+  }
+  while (token_cursor->status != GRN_TOKEN_CURSOR_DONE &&
+         token_cursor->status != GRN_TOKEN_CURSOR_DONE_SKIP) {
+    grn_id tid;
+    if ((tid = grn_token_cursor_next(ctx, token_cursor)) != GRN_ID_NIL) {
+      grn_ii_cursor *cursor;
+      cursor = grn_ii_cursor_open(ctx, ii, tid,
+                                  GRN_ID_NIL, GRN_ID_MAX, ii->n_elements,
+                                  ii_cursor_flags);
+      while (grn_ii_cursor_next(ctx, cursor)) {
+        grn_ii_quorum_match_record_data *record_data;
+        double weight;
+
+        weight = get_weight(ctx,
+                            data->result_set,
+                            cursor->post->rid,
+                            cursor->post->sid,
+                            data->wv_mode,
+                            data->optarg);
+        if (weight <= DBL_EPSILON) {
+          continue;
+        }
+        if (grn_hash_add(ctx, n_occurs,
+                         cursor->post,
+                         record_key_size,
+                         (void **)&record_data,
+                         NULL)) {
+          record_data->n_occurs++;
+          record_data->score += weight;
+        }
+      }
+      grn_ii_cursor_close(ctx, cursor);
+    }
+  }
+  grn_token_cursor_close(ctx, token_cursor);
+
+  {
+    grn_rset_posinfo posinfo;
+    grn_hash_cursor *cursor;
+
+    memset(&posinfo, 0, sizeof(grn_rset_posinfo));
+    cursor = grn_hash_cursor_open(ctx, n_occurs, NULL, 0, NULL, 0, 0, -1, 0);
+    if (!cursor) {
+      grn_rc rc = ctx->rc;
+      char ii_name[GRN_TABLE_MAX_KEY_SIZE];
+      int ii_name_len;
+
+      if (rc == GRN_SUCCESS) {
+        rc = GRN_UNKNOWN_ERROR;
+      }
+      ii_name_len = grn_obj_name(ctx,
+                                 (grn_obj *)ii,
+                                 ii_name, GRN_TABLE_MAX_KEY_SIZE);
+      ERR(rc,
+          "[ii][quorum-match] failed to create count cursor: <%.*s>: <%.*s>%s%s",
+          ii_name_len, ii_name,
+          data->query_len, data->query,
+          ctx->errbuf[0] ? ": " : "",
+          ctx->errbuf[0] ? ctx->errbuf : "");
+      grn_hash_close(ctx, n_occurs);
+      return rc;
+    }
+    {
+      const int quorum_threshold = data->optarg->quorum_threshold;
+      while (grn_hash_cursor_next(ctx, cursor) != GRN_ID_NIL) {
+        grn_posting *posting;
+        grn_ii_quorum_match_record_data *record_data;
+
+        grn_hash_cursor_get_key_value(ctx, cursor,
+                                      (void **)&posting,
+                                      NULL,
+                                      (void **)&record_data);
+        if (record_data->n_occurs >= quorum_threshold) {
+          double score = record_data->score;
+          memcpy(&posinfo, posting, record_key_size);
+          if (data->score_func) {
+            data->record.id = posting->rid;
+            data->record.weight = score / record_data->n_occurs;
+            data->record.n_occurrences = record_data->n_occurs;
+            data->record.total_term_weights = data->record.weight;
+            score = data->score_func(ctx, &(data->record)) * data->record.weight;
+          }
+          res_add(ctx, data->result_set, &posinfo, score, data->op);
+        }
+      }
+    }
+    grn_hash_cursor_close(ctx, cursor);
+  }
+  grn_hash_close(ctx, n_occurs);
+  grn_ii_resolve_sel_and(ctx, data->result_set, data->op);
+
+  return GRN_SUCCESS;
+}
+
 #ifdef GRN_II_SELECT_ENABLE_SEQUENTIAL_SEARCH
 static grn_bool
 grn_ii_select_sequential_search_should_use(grn_ctx *ctx,
@@ -8557,39 +8793,34 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
   token_info *ti, **tis = NULL, **tip, **tie;
   uint32_t n = 0, rid, sid, nrid, nsid;
   grn_bool only_skip_token = GRN_FALSE;
-  grn_operator mode = GRN_OP_EXACT;
-  grn_wv_mode wvm = grn_wv_none;
-  grn_obj *lexicon = ii->lexicon;
-  grn_scorer_score_func *score_func = NULL;
-  grn_scorer_matched_record record;
-  grn_id previous_min = GRN_ID_NIL;
-  grn_id current_min = GRN_ID_NIL;
-  grn_bool set_min_enable_for_and_query = GRN_FALSE;
+  grn_obj *lexicon;
+  grn_ii_select_data data;
 
-  if (!lexicon || !ii || !s) { return GRN_INVALID_ARGUMENT; }
-  if (optarg) {
-    mode = optarg->mode;
-    if (optarg->func) {
-      wvm = grn_wv_dynamic;
-    } else if (optarg->vector_size) {
-      wvm = optarg->weight_vector ? grn_wv_static : grn_wv_constant;
-    }
-    if (optarg->match_info) {
-      if (optarg->match_info->flags & GRN_MATCH_INFO_GET_MIN_RECORD_ID) {
-        previous_min = optarg->match_info->min;
-        set_min_enable_for_and_query = GRN_TRUE;
-      }
-    }
+  if (!ii) {
+    return GRN_INVALID_ARGUMENT;
   }
-  if (mode == GRN_OP_SIMILAR) {
+
+  lexicon = ii->lexicon;
+  if (!lexicon || !s) { return GRN_INVALID_ARGUMENT; }
+
+  data.lexicon = lexicon;
+  data.query = string;
+  data.query_len = string_len;
+  data.result_set = s;
+  data.op = op;
+  grn_ii_select_data_init(ctx, &data, optarg);
+  if (data.mode == GRN_OP_SIMILAR) {
     return grn_ii_similar_search(ctx, ii, string, string_len, s, op, optarg);
   }
-  if (mode == GRN_OP_TERM_EXTRACT) {
+  if (data.mode == GRN_OP_TERM_EXTRACT) {
     return grn_ii_term_extract(ctx, ii, string, string_len, s, op, optarg);
   }
-  if (mode == GRN_OP_REGEXP) {
+  if (data.mode == GRN_OP_REGEXP) {
     return grn_ii_select_regexp(ctx, ii, string, string_len, s, op, optarg);
   }
+  if (data.mode == GRN_OP_QUORUM) {
+    return grn_ii_quorum_match(ctx, ii, &data);
+  }
   /* todo : support subrec
   rep = (s->record_unit == grn_rec_position || s->subrec_unit == grn_rec_position);
   orp = (s->record_unit == grn_rec_position || op == GRN_OP_OR);
@@ -8600,24 +8831,25 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
   if (!(tis = GRN_MALLOC(sizeof(token_info *) * string_len * 2))) {
     return GRN_NO_MEMORY_AVAILABLE;
   }
-  if (mode == GRN_OP_FUZZY) {
+  if (data.mode == GRN_OP_FUZZY) {
     if (token_info_build_fuzzy(ctx, lexicon, ii, string, string_len,
-                               tis, &n, &only_skip_token, previous_min,
-                               mode, &(optarg->fuzzy)) ||
+                               tis, &n, &only_skip_token, data.previous_min,
+                               data.mode, &(optarg->fuzzy)) ||
         !n) {
       goto exit;
     }
   } else {
     if (token_info_build(ctx, lexicon, ii, string, string_len,
-                         tis, &n, &only_skip_token, previous_min, mode) ||
+                         tis, &n, &only_skip_token, data.previous_min,
+                         data.mode) ||
         !n) {
       goto exit;
     }
   }
-  switch (mode) {
+  switch (data.mode) {
   case GRN_OP_NEAR2 :
     token_info_clear_offset(tis, n);
-    mode = GRN_OP_NEAR;
+    data.mode = GRN_OP_NEAR;
     /* fallthru */
   case GRN_OP_NEAR :
     if (!(bt = bt_open(ctx, n))) { rc = GRN_NO_MEMORY_AVAILABLE; goto exit; }
@@ -8656,29 +8888,11 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
   */
 #ifdef GRN_II_SELECT_ENABLE_SEQUENTIAL_SEARCH
   if (grn_ii_select_sequential_search(ctx, ii, string, string_len,
-                                      s, op, wvm, optarg, tis, n)) {
+                                      s, op, data.wv_mode, optarg, tis, n)) {
     goto exit;
   }
 #endif
 
-  if (optarg && optarg->scorer) {
-    grn_proc *scorer = (grn_proc *)(optarg->scorer);
-    score_func = scorer->callbacks.scorer.score;
-    record.table = grn_ctx_at(ctx, s->obj.header.domain);
-    record.lexicon = lexicon;
-    record.id = GRN_ID_NIL;
-    GRN_RECORD_INIT(&(record.terms), GRN_OBJ_VECTOR, lexicon->header.domain);
-    GRN_UINT32_INIT(&(record.term_weights), GRN_OBJ_VECTOR);
-    record.total_term_weights = 0;
-    record.n_documents = grn_table_size(ctx, record.table);
-    record.n_occurrences = 0;
-    record.n_candidates = 0;
-    record.n_tokens = 0;
-    record.weight = 0;
-    record.args_expr = optarg->scorer_args_expr;
-    record.args_expr_offset = optarg->scorer_args_expr_offset;
-  }
-
   for (;;) {
     rid = (*tis)->p->rid;
     sid = (*tis)->p->sid;
@@ -8691,17 +8905,17 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
         break;
       }
     }
-    weight = get_weight(ctx, s, rid, sid, wvm, optarg);
+    weight = get_weight(ctx, s, rid, sid, data.wv_mode, optarg);
     if (tip == tie && weight != 0) {
       grn_rset_posinfo pi = {rid, sid, 0};
       if (orp || grn_hash_get(ctx, s, &pi, s->key_size, NULL)) {
         int count = 0, noccur = 0, pos = 0, score = 0, tscore = 0, min, max;
 
-        if (score_func) {
-          GRN_BULK_REWIND(&(record.terms));
-          GRN_BULK_REWIND(&(record.term_weights));
-          record.n_candidates = 0;
-          record.n_tokens = 0;
+        if (data.score_func) {
+          GRN_BULK_REWIND(&(data.record.terms));
+          GRN_BULK_REWIND(&(data.record.term_weights));
+          data.record.n_candidates = 0;
+          data.record.n_tokens = 0;
         }
 
 #define SKIP_OR_BREAK(pos) {\
@@ -8715,14 +8929,15 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
         if (n == 1 && !rep) {
           noccur = (*tis)->p->tf;
           tscore = (*tis)->p->weight + (*tis)->cursors->bins[0]->weight;
-          if (score_func) {
-            GRN_RECORD_PUT(ctx, &(record.terms), (*tis)->cursors->bins[0]->id);
-            GRN_UINT32_PUT(ctx, &(record.term_weights), tscore);
-            record.n_occurrences = noccur;
-            record.n_candidates = (*tis)->size;
-            record.n_tokens = (*tis)->ntoken;
+          if (data.score_func) {
+            GRN_RECORD_PUT(ctx, &(data.record.terms),
+                           (*tis)->cursors->bins[0]->id);
+            GRN_UINT32_PUT(ctx, &(data.record.term_weights), tscore);
+            data.record.n_occurrences = noccur;
+            data.record.n_candidates = (*tis)->size;
+            data.record.n_tokens = (*tis)->ntoken;
           }
-        } else if (mode == GRN_OP_NEAR) {
+        } else if (data.mode == GRN_OP_NEAR) {
           bt_zap(bt);
           for (tip = tis; tip < tie; tip++) {
             ti = *tip;
@@ -8773,19 +8988,20 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
             } else {
               score = ti->p->weight + ti->cursors->bins[0]->weight; count = 1;
               pos = ti->pos;
-              if (noccur == 0 && score_func) {
-                GRN_BULK_REWIND(&(record.terms));
-                GRN_BULK_REWIND(&(record.term_weights));
-                record.n_candidates = 0;
-                record.n_tokens = 0;
+              if (noccur == 0 && data.score_func) {
+                GRN_BULK_REWIND(&(data.record.terms));
+                GRN_BULK_REWIND(&(data.record.term_weights));
+                data.record.n_candidates = 0;
+                data.record.n_tokens = 0;
               }
             }
-            if (noccur == 0 && score_func) {
-              GRN_RECORD_PUT(ctx, &(record.terms), ti->cursors->bins[0]->id);
-              GRN_UINT32_PUT(ctx, &(record.term_weights),
+            if (noccur == 0 && data.score_func) {
+              GRN_RECORD_PUT(ctx, &(data.record.terms),
+                             ti->cursors->bins[0]->id);
+              GRN_UINT32_PUT(ctx, &(data.record.term_weights),
                              ti->p->weight + ti->cursors->bins[0]->weight);
-              record.n_candidates += ti->size;
-              record.n_tokens += ti->ntoken;
+              data.record.n_candidates += ti->size;
+              data.record.n_tokens += ti->ntoken;
             }
             if (count == n) {
               if (rep) {
@@ -8799,18 +9015,18 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
         }
         if (noccur && !rep) {
           double record_score;
-          if (score_func) {
-            record.id = rid;
-            record.weight = weight;
-            record.n_occurrences = noccur;
-            record.total_term_weights = tscore;
-            record_score = score_func(ctx, &record) * weight;
+          if (data.score_func) {
+            data.record.id = rid;
+            data.record.weight = weight;
+            data.record.n_occurrences = noccur;
+            data.record.total_term_weights = tscore;
+            record_score = data.score_func(ctx, &(data.record)) * weight;
           } else {
             record_score = (noccur + tscore) * weight;
           }
-          if (set_min_enable_for_and_query) {
-            if (current_min == GRN_ID_NIL) {
-              current_min = rid;
+          if (data.set_min_enable_for_and_query) {
+            if (data.current_min == GRN_ID_NIL) {
+              data.current_min = rid;
             }
           }
           res_add(ctx, s, &pi, record_score, op);
@@ -8821,16 +9037,7 @@ grn_ii_select(grn_ctx *ctx, grn_ii *ii,
     if (token_info_skip(ctx, *tis, nrid, nsid)) { goto exit; }
   }
 exit :
-  if (score_func) {
-    GRN_OBJ_FIN(ctx, &(record.terms));
-    GRN_OBJ_FIN(ctx, &(record.term_weights));
-  }
-
-  if (set_min_enable_for_and_query) {
-    if (current_min > previous_min) {
-      optarg->match_info->min = current_min;
-    }
-  }
+  grn_ii_select_data_fin(ctx, &data);
 
   for (tip = tis; tip < tis + n; tip++) {
     if (*tip) { token_info_close(ctx, *tip); }
@@ -9032,6 +9239,10 @@ grn_ii_sel(grn_ctx *ctx, grn_ii *ii, const char *string, unsigned int string_len
         arg.mode = optarg->mode;
         arg.fuzzy = optarg->fuzzy;
         break;
+      case GRN_OP_QUORUM :
+        arg.mode = optarg->mode;
+        arg.quorum_threshold = optarg->quorum_threshold;
+        break;
       default :
         break;
       }

  Modified: lib/mrb/mrb_expr.c (+28 -1)
===================================================================
--- lib/mrb/mrb_expr.c    2018-01-07 15:04:32 +0900 (91d69fd1d)
+++ lib/mrb/mrb_expr.c    2018-01-08 00:01:50 +0900 (77522bb86)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2013-2017 Brazil
+  Copyright(C) 2013-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -282,6 +282,29 @@ mrb_grn_scan_info_get_similarity_threshold(mrb_state *mrb, mrb_value self)
 }
 
 static mrb_value
+mrb_grn_scan_info_set_quorum_threshold(mrb_state *mrb, mrb_value self)
+{
+  scan_info *si;
+  mrb_int quorum_threshold;
+
+  mrb_get_args(mrb, "i", &quorum_threshold);
+  si = DATA_PTR(self);
+  grn_scan_info_set_quorum_threshold(si, quorum_threshold);
+  return self;
+}
+
+static mrb_value
+mrb_grn_scan_info_get_quorum_threshold(mrb_state *mrb, mrb_value self)
+{
+  scan_info *si;
+  int quorum_threshold;
+
+  si = DATA_PTR(self);
+  quorum_threshold = grn_scan_info_get_quorum_threshold(si);
+  return mrb_fixnum_value(quorum_threshold);
+}
+
+static mrb_value
 mrb_grn_scan_info_get_arg(mrb_state *mrb, mrb_value self)
 {
   grn_ctx *ctx = (grn_ctx *)mrb->ud;
@@ -878,6 +901,10 @@ grn_mrb_expr_init(grn_ctx *ctx)
                     mrb_grn_scan_info_get_similarity_threshold, MRB_ARGS_NONE());
   mrb_define_method(mrb, klass, "similarity_threshold=",
                     mrb_grn_scan_info_set_similarity_threshold, MRB_ARGS_REQ(1));
+  mrb_define_method(mrb, klass, "quorum_threshold",
+                    mrb_grn_scan_info_get_quorum_threshold, MRB_ARGS_NONE());
+  mrb_define_method(mrb, klass, "quorum_threshold=",
+                    mrb_grn_scan_info_set_quorum_threshold, MRB_ARGS_REQ(1));
   mrb_define_method(mrb, klass, "get_arg",
                     mrb_grn_scan_info_get_arg, MRB_ARGS_REQ(1));
   mrb_define_method(mrb, klass, "push_arg",

  Modified: lib/mrb/mrb_operator.c (+2 -1)
===================================================================
--- lib/mrb/mrb_operator.c    2018-01-07 15:04:32 +0900 (ed16a0230)
+++ lib/mrb/mrb_operator.c    2018-01-08 00:01:50 +0900 (582faefae)
@@ -1,6 +1,6 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2014-2015 Brazil
+  Copyright(C) 2014-2018 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -149,6 +149,7 @@ grn_mrb_operator_init(grn_ctx *ctx)
   DEFINE_OPERATOR(GET_MEMBER);
   DEFINE_OPERATOR(REGEXP);
   DEFINE_OPERATOR(FUZZY);
+  DEFINE_OPERATOR(QUORUM);
 
 #undef DEFINE_OPERATOR
 }

  Modified: lib/mrb/scripts/expression_tree_builder.rb (+1 -0)
===================================================================
--- lib/mrb/scripts/expression_tree_builder.rb    2018-01-07 15:04:32 +0900 (f2cc297c2)
+++ lib/mrb/scripts/expression_tree_builder.rb    2018-01-08 00:01:50 +0900 (477c38c0d)
@@ -21,6 +21,7 @@ module Groonga
       Operator::TERM_EXTRACT,
       Operator::REGEXP,
       Operator::FUZZY,
+      Operator::QUORUM,
     ]
 
     ARITHMETIC_OPERATORS = [

  Modified: lib/mrb/scripts/scan_info.rb (+3 -0)
===================================================================
--- lib/mrb/scripts/scan_info.rb    2018-01-07 15:04:32 +0900 (acdb2eeb2)
+++ lib/mrb/scripts/scan_info.rb    2018-01-08 00:01:50 +0900 (bb14d557e)
@@ -19,6 +19,9 @@ module Groonga
       if data.similarity_threshold
         self.similarity_threshold = data.similarity_threshold
       end
+      if data.quorum_threshold
+        self.quorum_threshold = data.quorum_threshold
+      end
       data.args.each do |arg|
         push_arg(arg)
       end

  Modified: lib/mrb/scripts/scan_info_builder.rb (+1 -0)
===================================================================
--- lib/mrb/scripts/scan_info_builder.rb    2018-01-07 15:04:32 +0900 (66dad9ea4)
+++ lib/mrb/scripts/scan_info_builder.rb    2018-01-08 00:01:50 +0900 (8f938e315)
@@ -30,6 +30,7 @@ module Groonga
       Operator::TERM_EXTRACT,
       Operator::REGEXP,
       Operator::FUZZY,
+      Operator::QUORUM,
     ]
 
     ARITHMETIC_OPERATORS = [

  Modified: lib/mrb/scripts/scan_info_data.rb (+27 -0)
===================================================================
--- lib/mrb/scripts/scan_info_data.rb    2018-01-07 15:04:32 +0900 (342f7a7a6)
+++ lib/mrb/scripts/scan_info_data.rb    2018-01-08 00:01:50 +0900 (771a19621)
@@ -12,6 +12,7 @@ module Groonga
     attr_accessor :flags
     attr_accessor :max_interval
     attr_accessor :similarity_threshold
+    attr_accessor :quorum_threshold
     attr_accessor :start_position
     attr_accessor :weight
     def initialize(start)
@@ -25,6 +26,7 @@ module Groonga
       @flags = ScanInfo::Flags::PUSH
       @max_interval = nil
       @similarity_threshold = nil
+      @quorum_threshold = nil
       @start_position = nil
       @weight = 0
     end
@@ -34,6 +36,8 @@ module Groonga
         match_near_resolve_index
       elsif similar_search?
         match_similar_resolve_index
+      elsif quorum_match?
+        match_quorum_resolve_index
       else
         match_generic_resolve_index
       end
@@ -96,6 +100,29 @@ module Groonga
       self.similarity_threshold = @args[2].value
     end
 
+    def quorum_match?
+      @op == Operator::QUORUM and****@args***** == 3
+    end
+
+    def match_quorum_resolve_index
+      arg = @args[0]
+      case arg
+      when Expression
+        match_resolve_index_expression(arg)
+      when Accessor
+        match_resolve_index_accessor(arg)
+      when Indexable
+        match_resolve_index_indexable(arg)
+      else
+        message =
+          "The first argument of QUORUM must be Expression, Accessor or Indexable: #{arg.class}"
+        raise ErrorMesesage, message
+      end
+
+      self.query = @args[1]
+      self.quorum_threshold = @args[2].value
+    end
+
     def match_generic_resolve_index
       @args.each do |arg|
         case arg




More information about the Groonga-commit mailing list
Back to archive index