# LR(1) parser, autogenerated on 2012-08-03 16:55:24
# generator: wisent 0.6.2, http://seehuhn.de/pages/wisent
# source: ftl.wi

# All parts of this file which are not taken verbatim from the input grammar
# are covered by the following notice:
#
# Copyright (C) 2008, 2009  Jochen Voss <voss@seehuhn.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#   1. Redistributions of source code must retain the above copyright
#      notice, this list of conditions and the following disclaimer.
#
#   2. Redistributions in binary form must reproduce the above
#      copyright notice, this list of conditions and the following
#      disclaimer in the documentation and/or other materials provided
#      with the distribution.
#
#   3. The name of the author may not be used to endorse or promote
#      products derived from this software without specific prior
#      written permission.
#
# This software is provided by the author "as is" and any express or
# implied warranties, including, but not limited to, the implied
# warranties of merchantability and fitness for a particular purpose
# are disclaimed.  In no event shall the author be liable for any
# direct, indirect, incidental, special, exemplary, or consequential
# damages (including, but not limited to, procurement of substitute
# goods or services; loss of use, data, or profits; or business
# interruption) however caused and on any theory of liability, whether
# in contract, strict liability, or tort (including negligence or
# otherwise) arising in any way out of the use of this software, even
# if advised of the possibility of such damage.

from itertools import chain

class Unique(object):

    """Unique objects for use as markers.

    These objects are internally used to represent the start symbol
    and the end-of-input marker of the grammar.
    """

    def __init__(self, label):
        """Create a new unique object.

        `label` is a string which is used as a textual representation
        of the object.
        """
        self.label = label

    def __repr__(self):
        """Return the `label` given at object construction."""
        return self.label

class Parser(object):

    """LR(1) parser class.

    terminal symbols:
      '(', ')', '*', '**', '+', ',', '-', '.', '/', '/=', ':', ':=', ';', '<',
      '<=', '=', '=<', '=>', '>', '>=', 'ID', 'NUMBER', '[', ']', 'and',
      'array', 'def', 'enum', 'is', 'let', 'not', 'or', 'record', 'union',
      'when', '{', '|', '}'

    nonterminal symbols:
      'addition', 'any_cluster_type', 'ap_fun', 'arg_list', 'as_array',
      'brackets', 'cluster', 'cluster_pipe_type', 'cluster_type', 'complement',
      'component', 'conjuction', 'def_prototype', 'def_stmt', 'difference',
      'disjuction', 'enum_v_type', 'enum_v_type_item', 'equality', 'expr',
      'expr_list', 'field_by_name', 'greater_eq_than', 'greater_than',
      'inequality', 'less_eq_than', 'less_than', 'let_stmt', 'param',
      'param_list', 'pipeline', 'piperef', 'power', 'product', 'qual_id',
      'quotient', 'rec_v_type', 'rec_v_type_item', 'start', 'typeref',
      'typesig', 'typespec', 'typespec_list', 'value_expr', 'value_type',
      'when_cond'

    production rules:
      'start' -> '_0+'
      '_0+' -> 'def_stmt'
      '_0+' -> '_0+' 'def_stmt'
      'def_stmt' -> 'def_prototype' 'is' '_def_body' ';'
      'def_prototype' -> 'def' 'ID' '_1?' '_38?' '_3?'
      '_1?' ->
      '_1?' -> 'param_list'
      '_3?' ->
      '_3?' -> 'when_cond'
      'param_list' -> '(' 'param' '_5*' ')'
      '_5*' ->
      '_5*' -> '_5*' ',' 'param'
      'param' -> 'ID' '_38?' '_48?'
      '_def_body' -> 'cluster'
      '_def_body' -> 'typespec'
      '_def_body' -> 'value_expr'
      'pipeline' -> '_11+'
      '_(10)' -> 'component'
      '_(10)' -> 'cluster'
      '_(10)' -> 'piperef'
      '_(10)' -> 'let_stmt'
      '_(10)' -> 'def_stmt'
      '_11+' -> '_(10)'
      '_11+' -> '_11+' '_(10)'
      'cluster' -> '{' '_17?' 'pipeline' '_15*' '}'
      '_17?' ->
      '_17?' -> 'when_cond' ':'
      '_15*' ->
      '_15*' -> '_15*' '|' '_17?' 'pipeline'
      'when_cond' -> 'when' 'value_expr'
      'component' -> 'qual_id' '_19?' '_20?' '_38?' '_41?'
      '_19?' ->
      '_19?' -> ':' 'qual_id'
      '_20?' ->
      '_20?' -> 'arg_list'
      'let_stmt' -> 'let' 'value_expr' '_38?' '_41?'
      'piperef' -> '_piperef_left' 'ID' '_piperef_right' '_38?'
      'piperef' -> '=>' '_38?'
      '_piperef_left' -> '=<'
      '_piperef_left' -> '<'
      '_piperef_right' -> '>'
      '_piperef_right' -> '>='
      'value_expr' -> '(' 'expr' ')'
      'typespec' -> '[' 'typespec_list' '_28?' ']'
      '_28?' ->
      '_28?' -> '=>' 'typespec_list'
      'typespec_list' -> 'typesig' '_30*'
      '_30*' ->
      '_30*' -> '_30*' ',' 'typesig'
      'typesig' -> 'typeref'
      'typesig' -> 'cluster_type'
      'typesig' -> 'value_type'
      'typeref' -> 'qual_id' '_20?' '_41?'
      'as_array' -> 'array' 'arg_list'
      'cluster_type' -> '_34?' '{' '_cluster_type_item' '_37*' '}' '_41?'
      '_34?' ->
      '_34?' -> 'ID' ':'
      '_37*' ->
      '_37*' -> '_37*' '|' '_cluster_type_item'
      '_cluster_type_item' -> 'cluster_type'
      '_cluster_type_item' -> 'any_cluster_type'
      '_cluster_type_item' -> 'typeref'
      '_cluster_type_item' -> 'cluster_pipe_type'
      '_cluster_type_item' ->
      'any_cluster_type' -> '*'
      'cluster_pipe_type' -> '<' 'ID' '>' '_38?'
      '_38?' ->
      '_38?' -> 'typespec'
      'value_type' -> 'rec_v_type'
      'value_type' -> 'enum_v_type'
      'rec_v_type' -> '_40?' '(' 'rec_v_type_item' '_43*' ')' '_41?'
      '_40?' ->
      '_40?' -> 'record'
      '_40?' -> 'union'
      '_41?' ->
      '_41?' -> 'as_array'
      '_43*' ->
      '_43*' -> '_43*' ',' 'rec_v_type_item'
      'rec_v_type_item' -> 'ID' 'typespec'
      'enum_v_type' -> 'enum' '(' 'enum_v_type_item' '_46*' ')' '_41?'
      '_46*' ->
      '_46*' -> '_46*' ',' 'enum_v_type_item'
      'enum_v_type_item' -> 'ID' '_48?'
      '_48?' ->
      '_48?' -> ':=' 'expr'
      'expr_list' ->
      'expr_list' -> 'expr' '_51*'
      '_51*' ->
      '_51*' -> '_51*' ',' 'expr'
      'expr' -> '_logicfun'
      '_logicfun' -> 'conjuction'
      '_logicfun' -> 'disjuction'
      '_logicfun' -> '_testative'
      'conjuction' -> '_logicfun' 'and' '_testative'
      'disjuction' -> '_logicfun' 'or' '_testative'
      '_testative' -> 'equality'
      '_testative' -> 'inequality'
      '_testative' -> 'less_than'
      '_testative' -> 'less_eq_than'
      '_testative' -> 'greater_than'
      '_testative' -> 'greater_eq_than'
      '_testative' -> '_additive'
      'equality' -> '_testative' '=' '_additive'
      'inequality' -> '_testative' '/=' '_additive'
      'less_than' -> '_testative' '<' '_additive'
      'less_eq_than' -> '_testative' '<=' '_additive'
      'greater_than' -> '_testative' '>' '_additive'
      'greater_eq_than' -> '_testative' '>=' '_additive'
      '_additive' -> 'addition'
      '_additive' -> 'difference'
      '_additive' -> '_multiplicative'
      'addition' -> '_additive' '+' '_multiplicative'
      'difference' -> '_additive' '-' '_multiplicative'
      '_multiplicative' -> 'product'
      '_multiplicative' -> 'quotient'
      '_multiplicative' -> '_exponentiative'
      'product' -> '_multiplicative' '*' '_exponentiative'
      'quotient' -> '_multiplicative' '/' '_exponentiative'
      '_exponentiative' -> 'complement'
      '_exponentiative' -> 'power'
      '_exponentiative' -> '_structured'
      'complement' -> 'not' '_structured'
      'power' -> '_exponentiative' '**' '_structured'
      '_structured' -> 'field_by_name'
      '_structured' -> 'ap_fun'
      '_structured' -> 'NUMBER'
      '_structured' -> 'ID'
      '_structured' -> '.'
      '_structured' -> 'brackets'
      'field_by_name' -> '_structured' '.' 'ID'
      'ap_fun' -> '_structured' 'arg_list'
      'qual_id' -> 'ID' '_53*'
      '_53*' ->
      '_53*' -> '_53*' '.' 'ID'
      'brackets' -> '(' '_logicfun' ')'
      'arg_list' -> '(' 'expr_list' ')'
    """

    class ParseErrors(Exception):

        """Exception class to represent a collection of parse errors.

        Instances of this class have two attributes, `errors` and `tree`.
        `errors` is a list of tuples, each describing one error.
        Each tuple consists of the first input token which could not
        be processed and the list of grammar symbols which were allowed
        at this point.
        `tree` is a "repaired" parse tree which might be used for further
        error checking, or `None` if no repair was possible.
        """

        def __init__(self, errors, tree):
            msg = "%d parse errors"%len(errors)
            Exception.__init__(self, msg)
            self.errors = errors
            self.tree = tree

    terminals = [ '(', ')', '*', '**', '+', ',', '-', '.', '/', '/=', ':',
                  ':=', ';', '<', '<=', '=', '=<', '=>', '>', '>=', 'ID',
                  'NUMBER', '[', ']', 'and', 'array', 'def', 'enum', 'is',
                  'let', 'not', 'or', 'record', 'union', 'when', '{', '|',
                  '}' ]
    _transparent = [ '_(10)', '_0+', '_11+', '_15*', '_17?', '_19?', '_1?',
                     '_20?', '_28?', '_30*', '_34?', '_37*', '_38?', '_3?',
                     '_40?', '_41?', '_43*', '_46*', '_48?', '_5*', '_51*',
                     '_53*', '_additive', '_cluster_type_item', '_def_body',
                     '_exponentiative', '_logicfun', '_multiplicative',
                     '_piperef_left', '_piperef_right', '_structured',
                     '_testative' ]
    EOF = Unique('EOF')
    S = Unique('S')

    _halting_state = 209
    _reduce = {
        (2, EOF): ('start', 1), (3, EOF): ('_0+', 1), (3, 'def'): ('_0+', 1),
        (4, EOF): ('_0+', 2), (4, 'def'): ('_0+', 2),
        (8, EOF): ('def_stmt', 4), (8, '<'): ('def_stmt', 4),
        (8, '=<'): ('def_stmt', 4), (8, '=>'): ('def_stmt', 4),
        (8, 'ID'): ('def_stmt', 4), (8, 'def'): ('def_stmt', 4),
        (8, 'let'): ('def_stmt', 4), (8, '{'): ('def_stmt', 4),
        (8, '|'): ('def_stmt', 4), (8, '}'): ('def_stmt', 4),
        (10, '['): ('_1?', 0), (10, 'is'): ('_1?', 0),
        (10, 'when'): ('_1?', 0), (11, 'is'): ('_38?', 0),
        (11, 'when'): ('_38?', 0), (12, 'is'): ('_3?', 0),
        (13, 'is'): ('def_prototype', 5), (14, '['): ('_1?', 1),
        (14, 'is'): ('_1?', 1), (14, 'when'): ('_1?', 1),
        (15, 'is'): ('_3?', 1), (17, ')'): ('_5*', 0), (17, ','): ('_5*', 0),
        (19, '['): ('param_list', 4), (19, 'is'): ('param_list', 4),
        (19, 'when'): ('param_list', 4), (21, ')'): ('_5*', 3),
        (21, ','): ('_5*', 3), (22, ')'): ('_38?', 0), (22, ','): ('_38?', 0),
        (22, ':='): ('_38?', 0), (23, ')'): ('_48?', 0),
        (23, ','): ('_48?', 0), (24, ')'): ('param', 3),
        (24, ','): ('param', 3), (25, ';'): ('_def_body', 1),
        (26, ';'): ('_def_body', 1), (27, ';'): ('_def_body', 1),
        (28, '|'): ('pipeline', 1), (28, '}'): ('pipeline', 1),
        (29, '<'): ('_(10)', 1), (29, '=<'): ('_(10)', 1),
        (29, '=>'): ('_(10)', 1), (29, 'ID'): ('_(10)', 1),
        (29, 'def'): ('_(10)', 1), (29, 'let'): ('_(10)', 1),
        (29, '{'): ('_(10)', 1), (29, '|'): ('_(10)', 1),
        (29, '}'): ('_(10)', 1), (30, '<'): ('_(10)', 1),
        (30, '=<'): ('_(10)', 1), (30, '=>'): ('_(10)', 1),
        (30, 'ID'): ('_(10)', 1), (30, 'def'): ('_(10)', 1),
        (30, 'let'): ('_(10)', 1), (30, '{'): ('_(10)', 1),
        (30, '|'): ('_(10)', 1), (30, '}'): ('_(10)', 1),
        (31, '<'): ('_(10)', 1), (31, '=<'): ('_(10)', 1),
        (31, '=>'): ('_(10)', 1), (31, 'ID'): ('_(10)', 1),
        (31, 'def'): ('_(10)', 1), (31, 'let'): ('_(10)', 1),
        (31, '{'): ('_(10)', 1), (31, '|'): ('_(10)', 1),
        (31, '}'): ('_(10)', 1), (32, '<'): ('_(10)', 1),
        (32, '=<'): ('_(10)', 1), (32, '=>'): ('_(10)', 1),
        (32, 'ID'): ('_(10)', 1), (32, 'def'): ('_(10)', 1),
        (32, 'let'): ('_(10)', 1), (32, '{'): ('_(10)', 1),
        (32, '|'): ('_(10)', 1), (32, '}'): ('_(10)', 1),
        (33, '<'): ('_(10)', 1), (33, '=<'): ('_(10)', 1),
        (33, '=>'): ('_(10)', 1), (33, 'ID'): ('_(10)', 1),
        (33, 'def'): ('_(10)', 1), (33, 'let'): ('_(10)', 1),
        (33, '{'): ('_(10)', 1), (33, '|'): ('_(10)', 1),
        (33, '}'): ('_(10)', 1), (34, '<'): ('_11+', 1),
        (34, '=<'): ('_11+', 1), (34, '=>'): ('_11+', 1),
        (34, 'ID'): ('_11+', 1), (34, 'def'): ('_11+', 1),
        (34, 'let'): ('_11+', 1), (34, '{'): ('_11+', 1),
        (34, '|'): ('_11+', 1), (34, '}'): ('_11+', 1), (35, '<'): ('_11+', 2),
        (35, '=<'): ('_11+', 2), (35, '=>'): ('_11+', 2),
        (35, 'ID'): ('_11+', 2), (35, 'def'): ('_11+', 2),
        (35, 'let'): ('_11+', 2), (35, '{'): ('_11+', 2),
        (35, '|'): ('_11+', 2), (35, '}'): ('_11+', 2), (36, '<'): ('_17?', 0),
        (36, '=<'): ('_17?', 0), (36, '=>'): ('_17?', 0),
        (36, 'ID'): ('_17?', 0), (36, 'def'): ('_17?', 0),
        (36, 'let'): ('_17?', 0), (36, '{'): ('_17?', 0),
        (38, '|'): ('_15*', 0), (38, '}'): ('_15*', 0),
        (40, ';'): ('cluster', 5), (40, '<'): ('cluster', 5),
        (40, '=<'): ('cluster', 5), (40, '=>'): ('cluster', 5),
        (40, 'ID'): ('cluster', 5), (40, 'def'): ('cluster', 5),
        (40, 'let'): ('cluster', 5), (40, '{'): ('cluster', 5),
        (40, '|'): ('cluster', 5), (40, '}'): ('cluster', 5),
        (42, '<'): ('_17?', 2), (42, '=<'): ('_17?', 2),
        (42, '=>'): ('_17?', 2), (42, 'ID'): ('_17?', 2),
        (42, 'def'): ('_17?', 2), (42, 'let'): ('_17?', 2),
        (42, '{'): ('_17?', 2), (43, '<'): ('_17?', 0),
        (43, '=<'): ('_17?', 0), (43, '=>'): ('_17?', 0),
        (43, 'ID'): ('_17?', 0), (43, 'def'): ('_17?', 0),
        (43, 'let'): ('_17?', 0), (43, '{'): ('_17?', 0),
        (45, '|'): ('_15*', 4), (45, '}'): ('_15*', 4),
        (47, ':'): ('when_cond', 2), (47, 'is'): ('when_cond', 2),
        (48, '('): ('_19?', 0), (48, '<'): ('_19?', 0),
        (48, '=<'): ('_19?', 0), (48, '=>'): ('_19?', 0),
        (48, 'ID'): ('_19?', 0), (48, '['): ('_19?', 0),
        (48, 'array'): ('_19?', 0), (48, 'def'): ('_19?', 0),
        (48, 'let'): ('_19?', 0), (48, '{'): ('_19?', 0),
        (48, '|'): ('_19?', 0), (48, '}'): ('_19?', 0), (49, '<'): ('_20?', 0),
        (49, '=<'): ('_20?', 0), (49, '=>'): ('_20?', 0),
        (49, 'ID'): ('_20?', 0), (49, '['): ('_20?', 0),
        (49, 'array'): ('_20?', 0), (49, 'def'): ('_20?', 0),
        (49, 'let'): ('_20?', 0), (49, '{'): ('_20?', 0),
        (49, '|'): ('_20?', 0), (49, '}'): ('_20?', 0), (50, '<'): ('_38?', 0),
        (50, '=<'): ('_38?', 0), (50, '=>'): ('_38?', 0),
        (50, 'ID'): ('_38?', 0), (50, 'array'): ('_38?', 0),
        (50, 'def'): ('_38?', 0), (50, 'let'): ('_38?', 0),
        (50, '{'): ('_38?', 0), (50, '|'): ('_38?', 0), (50, '}'): ('_38?', 0),
        (51, '<'): ('_41?', 0), (51, '=<'): ('_41?', 0),
        (51, '=>'): ('_41?', 0), (51, 'ID'): ('_41?', 0),
        (51, 'def'): ('_41?', 0), (51, 'let'): ('_41?', 0),
        (51, '{'): ('_41?', 0), (51, '|'): ('_41?', 0), (51, '}'): ('_41?', 0),
        (52, '<'): ('component', 5), (52, '=<'): ('component', 5),
        (52, '=>'): ('component', 5), (52, 'ID'): ('component', 5),
        (52, 'def'): ('component', 5), (52, 'let'): ('component', 5),
        (52, '{'): ('component', 5), (52, '|'): ('component', 5),
        (52, '}'): ('component', 5), (54, '('): ('_19?', 2),
        (54, '<'): ('_19?', 2), (54, '=<'): ('_19?', 2),
        (54, '=>'): ('_19?', 2), (54, 'ID'): ('_19?', 2),
        (54, '['): ('_19?', 2), (54, 'array'): ('_19?', 2),
        (54, 'def'): ('_19?', 2), (54, 'let'): ('_19?', 2),
        (54, '{'): ('_19?', 2), (54, '|'): ('_19?', 2), (54, '}'): ('_19?', 2),
        (55, ','): ('_20?', 1), (55, '<'): ('_20?', 1),
        (55, '=<'): ('_20?', 1), (55, '=>'): ('_20?', 1),
        (55, 'ID'): ('_20?', 1), (55, '['): ('_20?', 1),
        (55, ']'): ('_20?', 1), (55, 'array'): ('_20?', 1),
        (55, 'def'): ('_20?', 1), (55, 'let'): ('_20?', 1),
        (55, '{'): ('_20?', 1), (55, '|'): ('_20?', 1), (55, '}'): ('_20?', 1),
        (57, '<'): ('_38?', 0), (57, '=<'): ('_38?', 0),
        (57, '=>'): ('_38?', 0), (57, 'ID'): ('_38?', 0),
        (57, 'array'): ('_38?', 0), (57, 'def'): ('_38?', 0),
        (57, 'let'): ('_38?', 0), (57, '{'): ('_38?', 0),
        (57, '|'): ('_38?', 0), (57, '}'): ('_38?', 0), (58, '<'): ('_41?', 0),
        (58, '=<'): ('_41?', 0), (58, '=>'): ('_41?', 0),
        (58, 'ID'): ('_41?', 0), (58, 'def'): ('_41?', 0),
        (58, 'let'): ('_41?', 0), (58, '{'): ('_41?', 0),
        (58, '|'): ('_41?', 0), (58, '}'): ('_41?', 0),
        (59, '<'): ('let_stmt', 4), (59, '=<'): ('let_stmt', 4),
        (59, '=>'): ('let_stmt', 4), (59, 'ID'): ('let_stmt', 4),
        (59, 'def'): ('let_stmt', 4), (59, 'let'): ('let_stmt', 4),
        (59, '{'): ('let_stmt', 4), (59, '|'): ('let_stmt', 4),
        (59, '}'): ('let_stmt', 4), (62, '<'): ('_38?', 0),
        (62, '=<'): ('_38?', 0), (62, '=>'): ('_38?', 0),
        (62, 'ID'): ('_38?', 0), (62, 'def'): ('_38?', 0),
        (62, 'let'): ('_38?', 0), (62, '{'): ('_38?', 0),
        (62, '|'): ('_38?', 0), (62, '}'): ('_38?', 0),
        (63, '<'): ('piperef', 4), (63, '=<'): ('piperef', 4),
        (63, '=>'): ('piperef', 4), (63, 'ID'): ('piperef', 4),
        (63, 'def'): ('piperef', 4), (63, 'let'): ('piperef', 4),
        (63, '{'): ('piperef', 4), (63, '|'): ('piperef', 4),
        (63, '}'): ('piperef', 4), (64, '<'): ('_38?', 0),
        (64, '=<'): ('_38?', 0), (64, '=>'): ('_38?', 0),
        (64, 'ID'): ('_38?', 0), (64, 'def'): ('_38?', 0),
        (64, 'let'): ('_38?', 0), (64, '{'): ('_38?', 0),
        (64, '|'): ('_38?', 0), (64, '}'): ('_38?', 0),
        (65, '<'): ('piperef', 2), (65, '=<'): ('piperef', 2),
        (65, '=>'): ('piperef', 2), (65, 'ID'): ('piperef', 2),
        (65, 'def'): ('piperef', 2), (65, 'let'): ('piperef', 2),
        (65, '{'): ('piperef', 2), (65, '|'): ('piperef', 2),
        (65, '}'): ('piperef', 2), (66, 'ID'): ('_piperef_left', 1),
        (67, 'ID'): ('_piperef_left', 1), (68, '<'): ('_piperef_right', 1),
        (68, '=<'): ('_piperef_right', 1), (68, '=>'): ('_piperef_right', 1),
        (68, 'ID'): ('_piperef_right', 1), (68, '['): ('_piperef_right', 1),
        (68, 'def'): ('_piperef_right', 1), (68, 'let'): ('_piperef_right', 1),
        (68, '{'): ('_piperef_right', 1), (68, '|'): ('_piperef_right', 1),
        (68, '}'): ('_piperef_right', 1), (69, '<'): ('_piperef_right', 1),
        (69, '=<'): ('_piperef_right', 1), (69, '=>'): ('_piperef_right', 1),
        (69, 'ID'): ('_piperef_right', 1), (69, '['): ('_piperef_right', 1),
        (69, 'def'): ('_piperef_right', 1), (69, 'let'): ('_piperef_right', 1),
        (69, '{'): ('_piperef_right', 1), (69, '|'): ('_piperef_right', 1),
        (69, '}'): ('_piperef_right', 1), (72, ':'): ('value_expr', 3),
        (72, ';'): ('value_expr', 3), (72, '<'): ('value_expr', 3),
        (72, '=<'): ('value_expr', 3), (72, '=>'): ('value_expr', 3),
        (72, 'ID'): ('value_expr', 3), (72, '['): ('value_expr', 3),
        (72, 'array'): ('value_expr', 3), (72, 'def'): ('value_expr', 3),
        (72, 'is'): ('value_expr', 3), (72, 'let'): ('value_expr', 3),
        (72, '{'): ('value_expr', 3), (72, '|'): ('value_expr', 3),
        (72, '}'): ('value_expr', 3), (73, '('): ('_40?', 0),
        (73, '{'): ('_34?', 0), (74, ']'): ('_28?', 0),
        (76, ')'): ('typespec', 4), (76, ','): ('typespec', 4),
        (76, ':='): ('typespec', 4), (76, ';'): ('typespec', 4),
        (76, '<'): ('typespec', 4), (76, '=<'): ('typespec', 4),
        (76, '=>'): ('typespec', 4), (76, 'ID'): ('typespec', 4),
        (76, 'array'): ('typespec', 4), (76, 'def'): ('typespec', 4),
        (76, 'is'): ('typespec', 4), (76, 'let'): ('typespec', 4),
        (76, 'when'): ('typespec', 4), (76, '{'): ('typespec', 4),
        (76, '|'): ('typespec', 4), (76, '}'): ('typespec', 4),
        (77, '('): ('_40?', 0), (77, '{'): ('_34?', 0), (78, ']'): ('_28?', 2),
        (79, ','): ('_30*', 0), (79, '=>'): ('_30*', 0),
        (79, ']'): ('_30*', 0), (80, '=>'): ('typespec_list', 2),
        (80, ']'): ('typespec_list', 2), (81, '('): ('_40?', 0),
        (81, '{'): ('_34?', 0), (82, ','): ('_30*', 3),
        (82, '=>'): ('_30*', 3), (82, ']'): ('_30*', 3),
        (83, ','): ('typesig', 1), (83, '=>'): ('typesig', 1),
        (83, ']'): ('typesig', 1), (84, ','): ('typesig', 1),
        (84, '=>'): ('typesig', 1), (84, ']'): ('typesig', 1),
        (85, ','): ('typesig', 1), (85, '=>'): ('typesig', 1),
        (85, ']'): ('typesig', 1), (86, ','): ('_20?', 0),
        (86, '=>'): ('_20?', 0), (86, ']'): ('_20?', 0),
        (86, 'array'): ('_20?', 0), (86, '|'): ('_20?', 0),
        (86, '}'): ('_20?', 0), (87, ','): ('_41?', 0),
        (87, '=>'): ('_41?', 0), (87, ']'): ('_41?', 0),
        (87, '|'): ('_41?', 0), (87, '}'): ('_41?', 0),
        (88, ','): ('typeref', 3), (88, '=>'): ('typeref', 3),
        (88, ']'): ('typeref', 3), (88, '|'): ('typeref', 3),
        (88, '}'): ('typeref', 3), (90, ','): ('as_array', 2),
        (90, '<'): ('as_array', 2), (90, '=<'): ('as_array', 2),
        (90, '=>'): ('as_array', 2), (90, 'ID'): ('as_array', 2),
        (90, ']'): ('as_array', 2), (90, 'def'): ('as_array', 2),
        (90, 'let'): ('as_array', 2), (90, '{'): ('as_array', 2),
        (90, '|'): ('as_array', 2), (90, '}'): ('as_array', 2),
        (92, '{'): ('_34?', 0), (92, '|'): ('_cluster_type_item', 0),
        (92, '}'): ('_cluster_type_item', 0), (93, '|'): ('_37*', 0),
        (93, '}'): ('_37*', 0), (95, ','): ('_41?', 0),
        (95, '=>'): ('_41?', 0), (95, ']'): ('_41?', 0),
        (95, '|'): ('_41?', 0), (95, '}'): ('_41?', 0),
        (96, ','): ('cluster_type', 6), (96, '=>'): ('cluster_type', 6),
        (96, ']'): ('cluster_type', 6), (96, '|'): ('cluster_type', 6),
        (96, '}'): ('cluster_type', 6), (97, '('): ('_53*', 0),
        (97, ','): ('_53*', 0), (97, '.'): ('_53*', 0),
        (97, '=>'): ('_53*', 0), (97, ']'): ('_53*', 0),
        (97, 'array'): ('_53*', 0), (97, '|'): ('_53*', 0),
        (97, '}'): ('_53*', 0), (98, '{'): ('_34?', 2), (99, '{'): ('_34?', 0),
        (99, '|'): ('_cluster_type_item', 0),
        (99, '}'): ('_cluster_type_item', 0), (100, '|'): ('_37*', 3),
        (100, '}'): ('_37*', 3), (101, '|'): ('_cluster_type_item', 1),
        (101, '}'): ('_cluster_type_item', 1),
        (102, '|'): ('_cluster_type_item', 1),
        (102, '}'): ('_cluster_type_item', 1),
        (103, '|'): ('_cluster_type_item', 1),
        (103, '}'): ('_cluster_type_item', 1),
        (104, '|'): ('_cluster_type_item', 1),
        (104, '}'): ('_cluster_type_item', 1),
        (105, '|'): ('any_cluster_type', 1),
        (105, '}'): ('any_cluster_type', 1), (108, '|'): ('_38?', 0),
        (108, '}'): ('_38?', 0), (109, '|'): ('cluster_pipe_type', 4),
        (109, '}'): ('cluster_pipe_type', 4), (110, ')'): ('_38?', 1),
        (110, ','): ('_38?', 1), (110, ':='): ('_38?', 1),
        (110, '<'): ('_38?', 1), (110, '=<'): ('_38?', 1),
        (110, '=>'): ('_38?', 1), (110, 'ID'): ('_38?', 1),
        (110, 'array'): ('_38?', 1), (110, 'def'): ('_38?', 1),
        (110, 'is'): ('_38?', 1), (110, 'let'): ('_38?', 1),
        (110, 'when'): ('_38?', 1), (110, '{'): ('_38?', 1),
        (110, '|'): ('_38?', 1), (110, '}'): ('_38?', 1),
        (111, ','): ('value_type', 1), (111, '=>'): ('value_type', 1),
        (111, ']'): ('value_type', 1), (112, ','): ('value_type', 1),
        (112, '=>'): ('value_type', 1), (112, ']'): ('value_type', 1),
        (115, ')'): ('_43*', 0), (115, ','): ('_43*', 0),
        (117, ','): ('_41?', 0), (117, '=>'): ('_41?', 0),
        (117, ']'): ('_41?', 0), (118, ','): ('rec_v_type', 6),
        (118, '=>'): ('rec_v_type', 6), (118, ']'): ('rec_v_type', 6),
        (119, '('): ('_40?', 1), (120, '('): ('_40?', 1),
        (121, ','): ('_41?', 1), (121, '<'): ('_41?', 1),
        (121, '=<'): ('_41?', 1), (121, '=>'): ('_41?', 1),
        (121, 'ID'): ('_41?', 1), (121, ']'): ('_41?', 1),
        (121, 'def'): ('_41?', 1), (121, 'let'): ('_41?', 1),
        (121, '{'): ('_41?', 1), (121, '|'): ('_41?', 1),
        (121, '}'): ('_41?', 1), (123, ')'): ('_43*', 3),
        (123, ','): ('_43*', 3), (125, ')'): ('rec_v_type_item', 2),
        (125, ','): ('rec_v_type_item', 2), (128, ')'): ('_46*', 0),
        (128, ','): ('_46*', 0), (130, ','): ('_41?', 0),
        (130, '=>'): ('_41?', 0), (130, ']'): ('_41?', 0),
        (131, ','): ('enum_v_type', 6), (131, '=>'): ('enum_v_type', 6),
        (131, ']'): ('enum_v_type', 6), (133, ')'): ('_46*', 3),
        (133, ','): ('_46*', 3), (134, ')'): ('_48?', 0),
        (134, ','): ('_48?', 0), (135, ')'): ('enum_v_type_item', 2),
        (135, ','): ('enum_v_type_item', 2), (137, ')'): ('_48?', 2),
        (137, ','): ('_48?', 2), (138, ')'): ('_51*', 0),
        (138, ','): ('_51*', 0), (139, ')'): ('expr_list', 2),
        (141, ')'): ('_51*', 3), (141, ','): ('_51*', 3),
        (142, ')'): ('expr', 1), (142, ','): ('expr', 1),
        (143, ')'): ('_logicfun', 1), (143, ','): ('_logicfun', 1),
        (143, 'and'): ('_logicfun', 1), (143, 'or'): ('_logicfun', 1),
        (144, ')'): ('_logicfun', 1), (144, ','): ('_logicfun', 1),
        (144, 'and'): ('_logicfun', 1), (144, 'or'): ('_logicfun', 1),
        (145, ')'): ('_logicfun', 1), (145, ','): ('_logicfun', 1),
        (145, 'and'): ('_logicfun', 1), (145, 'or'): ('_logicfun', 1),
        (148, ')'): ('conjuction', 3), (148, ','): ('conjuction', 3),
        (148, 'and'): ('conjuction', 3), (148, 'or'): ('conjuction', 3),
        (150, ')'): ('disjuction', 3), (150, ','): ('disjuction', 3),
        (150, 'and'): ('disjuction', 3), (150, 'or'): ('disjuction', 3),
        (151, ')'): ('_testative', 1), (151, ','): ('_testative', 1),
        (151, '/='): ('_testative', 1), (151, '<'): ('_testative', 1),
        (151, '<='): ('_testative', 1), (151, '='): ('_testative', 1),
        (151, '>'): ('_testative', 1), (151, '>='): ('_testative', 1),
        (151, 'and'): ('_testative', 1), (151, 'or'): ('_testative', 1),
        (152, ')'): ('_testative', 1), (152, ','): ('_testative', 1),
        (152, '/='): ('_testative', 1), (152, '<'): ('_testative', 1),
        (152, '<='): ('_testative', 1), (152, '='): ('_testative', 1),
        (152, '>'): ('_testative', 1), (152, '>='): ('_testative', 1),
        (152, 'and'): ('_testative', 1), (152, 'or'): ('_testative', 1),
        (153, ')'): ('_testative', 1), (153, ','): ('_testative', 1),
        (153, '/='): ('_testative', 1), (153, '<'): ('_testative', 1),
        (153, '<='): ('_testative', 1), (153, '='): ('_testative', 1),
        (153, '>'): ('_testative', 1), (153, '>='): ('_testative', 1),
        (153, 'and'): ('_testative', 1), (153, 'or'): ('_testative', 1),
        (154, ')'): ('_testative', 1), (154, ','): ('_testative', 1),
        (154, '/='): ('_testative', 1), (154, '<'): ('_testative', 1),
        (154, '<='): ('_testative', 1), (154, '='): ('_testative', 1),
        (154, '>'): ('_testative', 1), (154, '>='): ('_testative', 1),
        (154, 'and'): ('_testative', 1), (154, 'or'): ('_testative', 1),
        (155, ')'): ('_testative', 1), (155, ','): ('_testative', 1),
        (155, '/='): ('_testative', 1), (155, '<'): ('_testative', 1),
        (155, '<='): ('_testative', 1), (155, '='): ('_testative', 1),
        (155, '>'): ('_testative', 1), (155, '>='): ('_testative', 1),
        (155, 'and'): ('_testative', 1), (155, 'or'): ('_testative', 1),
        (156, ')'): ('_testative', 1), (156, ','): ('_testative', 1),
        (156, '/='): ('_testative', 1), (156, '<'): ('_testative', 1),
        (156, '<='): ('_testative', 1), (156, '='): ('_testative', 1),
        (156, '>'): ('_testative', 1), (156, '>='): ('_testative', 1),
        (156, 'and'): ('_testative', 1), (156, 'or'): ('_testative', 1),
        (157, ')'): ('_testative', 1), (157, ','): ('_testative', 1),
        (157, '/='): ('_testative', 1), (157, '<'): ('_testative', 1),
        (157, '<='): ('_testative', 1), (157, '='): ('_testative', 1),
        (157, '>'): ('_testative', 1), (157, '>='): ('_testative', 1),
        (157, 'and'): ('_testative', 1), (157, 'or'): ('_testative', 1),
        (159, ')'): ('equality', 3), (159, ','): ('equality', 3),
        (159, '/='): ('equality', 3), (159, '<'): ('equality', 3),
        (159, '<='): ('equality', 3), (159, '='): ('equality', 3),
        (159, '>'): ('equality', 3), (159, '>='): ('equality', 3),
        (159, 'and'): ('equality', 3), (159, 'or'): ('equality', 3),
        (161, ')'): ('inequality', 3), (161, ','): ('inequality', 3),
        (161, '/='): ('inequality', 3), (161, '<'): ('inequality', 3),
        (161, '<='): ('inequality', 3), (161, '='): ('inequality', 3),
        (161, '>'): ('inequality', 3), (161, '>='): ('inequality', 3),
        (161, 'and'): ('inequality', 3), (161, 'or'): ('inequality', 3),
        (163, ')'): ('less_than', 3), (163, ','): ('less_than', 3),
        (163, '/='): ('less_than', 3), (163, '<'): ('less_than', 3),
        (163, '<='): ('less_than', 3), (163, '='): ('less_than', 3),
        (163, '>'): ('less_than', 3), (163, '>='): ('less_than', 3),
        (163, 'and'): ('less_than', 3), (163, 'or'): ('less_than', 3),
        (165, ')'): ('less_eq_than', 3), (165, ','): ('less_eq_than', 3),
        (165, '/='): ('less_eq_than', 3), (165, '<'): ('less_eq_than', 3),
        (165, '<='): ('less_eq_than', 3), (165, '='): ('less_eq_than', 3),
        (165, '>'): ('less_eq_than', 3), (165, '>='): ('less_eq_than', 3),
        (165, 'and'): ('less_eq_than', 3), (165, 'or'): ('less_eq_than', 3),
        (167, ')'): ('greater_than', 3), (167, ','): ('greater_than', 3),
        (167, '/='): ('greater_than', 3), (167, '<'): ('greater_than', 3),
        (167, '<='): ('greater_than', 3), (167, '='): ('greater_than', 3),
        (167, '>'): ('greater_than', 3), (167, '>='): ('greater_than', 3),
        (167, 'and'): ('greater_than', 3), (167, 'or'): ('greater_than', 3),
        (169, ')'): ('greater_eq_than', 3), (169, ','): ('greater_eq_than', 3),
        (169, '/='): ('greater_eq_than', 3),
        (169, '<'): ('greater_eq_than', 3),
        (169, '<='): ('greater_eq_than', 3),
        (169, '='): ('greater_eq_than', 3), (169, '>'): ('greater_eq_than', 3),
        (169, '>='): ('greater_eq_than', 3),
        (169, 'and'): ('greater_eq_than', 3),
        (169, 'or'): ('greater_eq_than', 3), (170, ')'): ('_additive', 1),
        (170, '+'): ('_additive', 1), (170, ','): ('_additive', 1),
        (170, '-'): ('_additive', 1), (170, '/='): ('_additive', 1),
        (170, '<'): ('_additive', 1), (170, '<='): ('_additive', 1),
        (170, '='): ('_additive', 1), (170, '>'): ('_additive', 1),
        (170, '>='): ('_additive', 1), (170, 'and'): ('_additive', 1),
        (170, 'or'): ('_additive', 1), (171, ')'): ('_additive', 1),
        (171, '+'): ('_additive', 1), (171, ','): ('_additive', 1),
        (171, '-'): ('_additive', 1), (171, '/='): ('_additive', 1),
        (171, '<'): ('_additive', 1), (171, '<='): ('_additive', 1),
        (171, '='): ('_additive', 1), (171, '>'): ('_additive', 1),
        (171, '>='): ('_additive', 1), (171, 'and'): ('_additive', 1),
        (171, 'or'): ('_additive', 1), (172, ')'): ('_additive', 1),
        (172, '+'): ('_additive', 1), (172, ','): ('_additive', 1),
        (172, '-'): ('_additive', 1), (172, '/='): ('_additive', 1),
        (172, '<'): ('_additive', 1), (172, '<='): ('_additive', 1),
        (172, '='): ('_additive', 1), (172, '>'): ('_additive', 1),
        (172, '>='): ('_additive', 1), (172, 'and'): ('_additive', 1),
        (172, 'or'): ('_additive', 1), (174, ')'): ('addition', 3),
        (174, '+'): ('addition', 3), (174, ','): ('addition', 3),
        (174, '-'): ('addition', 3), (174, '/='): ('addition', 3),
        (174, '<'): ('addition', 3), (174, '<='): ('addition', 3),
        (174, '='): ('addition', 3), (174, '>'): ('addition', 3),
        (174, '>='): ('addition', 3), (174, 'and'): ('addition', 3),
        (174, 'or'): ('addition', 3), (176, ')'): ('difference', 3),
        (176, '+'): ('difference', 3), (176, ','): ('difference', 3),
        (176, '-'): ('difference', 3), (176, '/='): ('difference', 3),
        (176, '<'): ('difference', 3), (176, '<='): ('difference', 3),
        (176, '='): ('difference', 3), (176, '>'): ('difference', 3),
        (176, '>='): ('difference', 3), (176, 'and'): ('difference', 3),
        (176, 'or'): ('difference', 3), (177, ')'): ('_multiplicative', 1),
        (177, '*'): ('_multiplicative', 1), (177, '+'): ('_multiplicative', 1),
        (177, ','): ('_multiplicative', 1), (177, '-'): ('_multiplicative', 1),
        (177, '/'): ('_multiplicative', 1),
        (177, '/='): ('_multiplicative', 1),
        (177, '<'): ('_multiplicative', 1),
        (177, '<='): ('_multiplicative', 1),
        (177, '='): ('_multiplicative', 1), (177, '>'): ('_multiplicative', 1),
        (177, '>='): ('_multiplicative', 1),
        (177, 'and'): ('_multiplicative', 1),
        (177, 'or'): ('_multiplicative', 1),
        (178, ')'): ('_multiplicative', 1), (178, '*'): ('_multiplicative', 1),
        (178, '+'): ('_multiplicative', 1), (178, ','): ('_multiplicative', 1),
        (178, '-'): ('_multiplicative', 1), (178, '/'): ('_multiplicative', 1),
        (178, '/='): ('_multiplicative', 1),
        (178, '<'): ('_multiplicative', 1),
        (178, '<='): ('_multiplicative', 1),
        (178, '='): ('_multiplicative', 1), (178, '>'): ('_multiplicative', 1),
        (178, '>='): ('_multiplicative', 1),
        (178, 'and'): ('_multiplicative', 1),
        (178, 'or'): ('_multiplicative', 1),
        (179, ')'): ('_multiplicative', 1), (179, '*'): ('_multiplicative', 1),
        (179, '+'): ('_multiplicative', 1), (179, ','): ('_multiplicative', 1),
        (179, '-'): ('_multiplicative', 1), (179, '/'): ('_multiplicative', 1),
        (179, '/='): ('_multiplicative', 1),
        (179, '<'): ('_multiplicative', 1),
        (179, '<='): ('_multiplicative', 1),
        (179, '='): ('_multiplicative', 1), (179, '>'): ('_multiplicative', 1),
        (179, '>='): ('_multiplicative', 1),
        (179, 'and'): ('_multiplicative', 1),
        (179, 'or'): ('_multiplicative', 1), (181, ')'): ('product', 3),
        (181, '*'): ('product', 3), (181, '+'): ('product', 3),
        (181, ','): ('product', 3), (181, '-'): ('product', 3),
        (181, '/'): ('product', 3), (181, '/='): ('product', 3),
        (181, '<'): ('product', 3), (181, '<='): ('product', 3),
        (181, '='): ('product', 3), (181, '>'): ('product', 3),
        (181, '>='): ('product', 3), (181, 'and'): ('product', 3),
        (181, 'or'): ('product', 3), (183, ')'): ('quotient', 3),
        (183, '*'): ('quotient', 3), (183, '+'): ('quotient', 3),
        (183, ','): ('quotient', 3), (183, '-'): ('quotient', 3),
        (183, '/'): ('quotient', 3), (183, '/='): ('quotient', 3),
        (183, '<'): ('quotient', 3), (183, '<='): ('quotient', 3),
        (183, '='): ('quotient', 3), (183, '>'): ('quotient', 3),
        (183, '>='): ('quotient', 3), (183, 'and'): ('quotient', 3),
        (183, 'or'): ('quotient', 3), (184, ')'): ('_exponentiative', 1),
        (184, '*'): ('_exponentiative', 1),
        (184, '**'): ('_exponentiative', 1),
        (184, '+'): ('_exponentiative', 1), (184, ','): ('_exponentiative', 1),
        (184, '-'): ('_exponentiative', 1), (184, '/'): ('_exponentiative', 1),
        (184, '/='): ('_exponentiative', 1),
        (184, '<'): ('_exponentiative', 1),
        (184, '<='): ('_exponentiative', 1),
        (184, '='): ('_exponentiative', 1), (184, '>'): ('_exponentiative', 1),
        (184, '>='): ('_exponentiative', 1),
        (184, 'and'): ('_exponentiative', 1),
        (184, 'or'): ('_exponentiative', 1),
        (185, ')'): ('_exponentiative', 1), (185, '*'): ('_exponentiative', 1),
        (185, '**'): ('_exponentiative', 1),
        (185, '+'): ('_exponentiative', 1), (185, ','): ('_exponentiative', 1),
        (185, '-'): ('_exponentiative', 1), (185, '/'): ('_exponentiative', 1),
        (185, '/='): ('_exponentiative', 1),
        (185, '<'): ('_exponentiative', 1),
        (185, '<='): ('_exponentiative', 1),
        (185, '='): ('_exponentiative', 1), (185, '>'): ('_exponentiative', 1),
        (185, '>='): ('_exponentiative', 1),
        (185, 'and'): ('_exponentiative', 1),
        (185, 'or'): ('_exponentiative', 1),
        (186, ')'): ('_exponentiative', 1), (186, '*'): ('_exponentiative', 1),
        (186, '**'): ('_exponentiative', 1),
        (186, '+'): ('_exponentiative', 1), (186, ','): ('_exponentiative', 1),
        (186, '-'): ('_exponentiative', 1), (186, '/'): ('_exponentiative', 1),
        (186, '/='): ('_exponentiative', 1),
        (186, '<'): ('_exponentiative', 1),
        (186, '<='): ('_exponentiative', 1),
        (186, '='): ('_exponentiative', 1), (186, '>'): ('_exponentiative', 1),
        (186, '>='): ('_exponentiative', 1),
        (186, 'and'): ('_exponentiative', 1),
        (186, 'or'): ('_exponentiative', 1), (188, ')'): ('complement', 2),
        (188, '*'): ('complement', 2), (188, '**'): ('complement', 2),
        (188, '+'): ('complement', 2), (188, ','): ('complement', 2),
        (188, '-'): ('complement', 2), (188, '/'): ('complement', 2),
        (188, '/='): ('complement', 2), (188, '<'): ('complement', 2),
        (188, '<='): ('complement', 2), (188, '='): ('complement', 2),
        (188, '>'): ('complement', 2), (188, '>='): ('complement', 2),
        (188, 'and'): ('complement', 2), (188, 'or'): ('complement', 2),
        (190, ')'): ('power', 3), (190, '*'): ('power', 3),
        (190, '**'): ('power', 3), (190, '+'): ('power', 3),
        (190, ','): ('power', 3), (190, '-'): ('power', 3),
        (190, '/'): ('power', 3), (190, '/='): ('power', 3),
        (190, '<'): ('power', 3), (190, '<='): ('power', 3),
        (190, '='): ('power', 3), (190, '>'): ('power', 3),
        (190, '>='): ('power', 3), (190, 'and'): ('power', 3),
        (190, 'or'): ('power', 3), (191, '('): ('_structured', 1),
        (191, ')'): ('_structured', 1), (191, '*'): ('_structured', 1),
        (191, '**'): ('_structured', 1), (191, '+'): ('_structured', 1),
        (191, ','): ('_structured', 1), (191, '-'): ('_structured', 1),
        (191, '.'): ('_structured', 1), (191, '/'): ('_structured', 1),
        (191, '/='): ('_structured', 1), (191, '<'): ('_structured', 1),
        (191, '<='): ('_structured', 1), (191, '='): ('_structured', 1),
        (191, '>'): ('_structured', 1), (191, '>='): ('_structured', 1),
        (191, 'and'): ('_structured', 1), (191, 'or'): ('_structured', 1),
        (192, '('): ('_structured', 1), (192, ')'): ('_structured', 1),
        (192, '*'): ('_structured', 1), (192, '**'): ('_structured', 1),
        (192, '+'): ('_structured', 1), (192, ','): ('_structured', 1),
        (192, '-'): ('_structured', 1), (192, '.'): ('_structured', 1),
        (192, '/'): ('_structured', 1), (192, '/='): ('_structured', 1),
        (192, '<'): ('_structured', 1), (192, '<='): ('_structured', 1),
        (192, '='): ('_structured', 1), (192, '>'): ('_structured', 1),
        (192, '>='): ('_structured', 1), (192, 'and'): ('_structured', 1),
        (192, 'or'): ('_structured', 1), (193, '('): ('_structured', 1),
        (193, ')'): ('_structured', 1), (193, '*'): ('_structured', 1),
        (193, '**'): ('_structured', 1), (193, '+'): ('_structured', 1),
        (193, ','): ('_structured', 1), (193, '-'): ('_structured', 1),
        (193, '.'): ('_structured', 1), (193, '/'): ('_structured', 1),
        (193, '/='): ('_structured', 1), (193, '<'): ('_structured', 1),
        (193, '<='): ('_structured', 1), (193, '='): ('_structured', 1),
        (193, '>'): ('_structured', 1), (193, '>='): ('_structured', 1),
        (193, 'and'): ('_structured', 1), (193, 'or'): ('_structured', 1),
        (194, '('): ('_structured', 1), (194, ')'): ('_structured', 1),
        (194, '*'): ('_structured', 1), (194, '**'): ('_structured', 1),
        (194, '+'): ('_structured', 1), (194, ','): ('_structured', 1),
        (194, '-'): ('_structured', 1), (194, '.'): ('_structured', 1),
        (194, '/'): ('_structured', 1), (194, '/='): ('_structured', 1),
        (194, '<'): ('_structured', 1), (194, '<='): ('_structured', 1),
        (194, '='): ('_structured', 1), (194, '>'): ('_structured', 1),
        (194, '>='): ('_structured', 1), (194, 'and'): ('_structured', 1),
        (194, 'or'): ('_structured', 1), (195, '('): ('_structured', 1),
        (195, ')'): ('_structured', 1), (195, '*'): ('_structured', 1),
        (195, '**'): ('_structured', 1), (195, '+'): ('_structured', 1),
        (195, ','): ('_structured', 1), (195, '-'): ('_structured', 1),
        (195, '.'): ('_structured', 1), (195, '/'): ('_structured', 1),
        (195, '/='): ('_structured', 1), (195, '<'): ('_structured', 1),
        (195, '<='): ('_structured', 1), (195, '='): ('_structured', 1),
        (195, '>'): ('_structured', 1), (195, '>='): ('_structured', 1),
        (195, 'and'): ('_structured', 1), (195, 'or'): ('_structured', 1),
        (196, '('): ('_structured', 1), (196, ')'): ('_structured', 1),
        (196, '*'): ('_structured', 1), (196, '**'): ('_structured', 1),
        (196, '+'): ('_structured', 1), (196, ','): ('_structured', 1),
        (196, '-'): ('_structured', 1), (196, '.'): ('_structured', 1),
        (196, '/'): ('_structured', 1), (196, '/='): ('_structured', 1),
        (196, '<'): ('_structured', 1), (196, '<='): ('_structured', 1),
        (196, '='): ('_structured', 1), (196, '>'): ('_structured', 1),
        (196, '>='): ('_structured', 1), (196, 'and'): ('_structured', 1),
        (196, 'or'): ('_structured', 1), (198, '('): ('field_by_name', 3),
        (198, ')'): ('field_by_name', 3), (198, '*'): ('field_by_name', 3),
        (198, '**'): ('field_by_name', 3), (198, '+'): ('field_by_name', 3),
        (198, ','): ('field_by_name', 3), (198, '-'): ('field_by_name', 3),
        (198, '.'): ('field_by_name', 3), (198, '/'): ('field_by_name', 3),
        (198, '/='): ('field_by_name', 3), (198, '<'): ('field_by_name', 3),
        (198, '<='): ('field_by_name', 3), (198, '='): ('field_by_name', 3),
        (198, '>'): ('field_by_name', 3), (198, '>='): ('field_by_name', 3),
        (198, 'and'): ('field_by_name', 3), (198, 'or'): ('field_by_name', 3),
        (199, '('): ('ap_fun', 2), (199, ')'): ('ap_fun', 2),
        (199, '*'): ('ap_fun', 2), (199, '**'): ('ap_fun', 2),
        (199, '+'): ('ap_fun', 2), (199, ','): ('ap_fun', 2),
        (199, '-'): ('ap_fun', 2), (199, '.'): ('ap_fun', 2),
        (199, '/'): ('ap_fun', 2), (199, '/='): ('ap_fun', 2),
        (199, '<'): ('ap_fun', 2), (199, '<='): ('ap_fun', 2),
        (199, '='): ('ap_fun', 2), (199, '>'): ('ap_fun', 2),
        (199, '>='): ('ap_fun', 2), (199, 'and'): ('ap_fun', 2),
        (199, 'or'): ('ap_fun', 2), (200, '('): ('_53*', 0),
        (200, '.'): ('_53*', 0), (200, ':'): ('_53*', 0),
        (200, '<'): ('_53*', 0), (200, '=<'): ('_53*', 0),
        (200, '=>'): ('_53*', 0), (200, 'ID'): ('_53*', 0),
        (200, '['): ('_53*', 0), (200, 'array'): ('_53*', 0),
        (200, 'def'): ('_53*', 0), (200, 'let'): ('_53*', 0),
        (200, '{'): ('_53*', 0), (200, '|'): ('_53*', 0),
        (200, '}'): ('_53*', 0), (201, '('): ('qual_id', 2),
        (201, ','): ('qual_id', 2), (201, ':'): ('qual_id', 2),
        (201, '<'): ('qual_id', 2), (201, '=<'): ('qual_id', 2),
        (201, '=>'): ('qual_id', 2), (201, 'ID'): ('qual_id', 2),
        (201, '['): ('qual_id', 2), (201, ']'): ('qual_id', 2),
        (201, 'array'): ('qual_id', 2), (201, 'def'): ('qual_id', 2),
        (201, 'let'): ('qual_id', 2), (201, '{'): ('qual_id', 2),
        (201, '|'): ('qual_id', 2), (201, '}'): ('qual_id', 2),
        (203, '('): ('_53*', 3), (203, ','): ('_53*', 3),
        (203, '.'): ('_53*', 3), (203, ':'): ('_53*', 3),
        (203, '<'): ('_53*', 3), (203, '=<'): ('_53*', 3),
        (203, '=>'): ('_53*', 3), (203, 'ID'): ('_53*', 3),
        (203, '['): ('_53*', 3), (203, ']'): ('_53*', 3),
        (203, 'array'): ('_53*', 3), (203, 'def'): ('_53*', 3),
        (203, 'let'): ('_53*', 3), (203, '{'): ('_53*', 3),
        (203, '|'): ('_53*', 3), (203, '}'): ('_53*', 3),
        (205, '('): ('brackets', 3), (205, ')'): ('brackets', 3),
        (205, '*'): ('brackets', 3), (205, '**'): ('brackets', 3),
        (205, '+'): ('brackets', 3), (205, ','): ('brackets', 3),
        (205, '-'): ('brackets', 3), (205, '.'): ('brackets', 3),
        (205, '/'): ('brackets', 3), (205, '/='): ('brackets', 3),
        (205, '<'): ('brackets', 3), (205, '<='): ('brackets', 3),
        (205, '='): ('brackets', 3), (205, '>'): ('brackets', 3),
        (205, '>='): ('brackets', 3), (205, 'and'): ('brackets', 3),
        (205, 'or'): ('brackets', 3), (206, ')'): ('expr_list', 0),
        (208, '('): ('arg_list', 3), (208, ')'): ('arg_list', 3),
        (208, '*'): ('arg_list', 3), (208, '**'): ('arg_list', 3),
        (208, '+'): ('arg_list', 3), (208, ','): ('arg_list', 3),
        (208, '-'): ('arg_list', 3), (208, '.'): ('arg_list', 3),
        (208, '/'): ('arg_list', 3), (208, '/='): ('arg_list', 3),
        (208, '<'): ('arg_list', 3), (208, '<='): ('arg_list', 3),
        (208, '='): ('arg_list', 3), (208, '=<'): ('arg_list', 3),
        (208, '=>'): ('arg_list', 3), (208, '>'): ('arg_list', 3),
        (208, '>='): ('arg_list', 3), (208, 'ID'): ('arg_list', 3),
        (208, '['): ('arg_list', 3), (208, ']'): ('arg_list', 3),
        (208, 'and'): ('arg_list', 3), (208, 'array'): ('arg_list', 3),
        (208, 'def'): ('arg_list', 3), (208, 'let'): ('arg_list', 3),
        (208, 'or'): ('arg_list', 3), (208, '{'): ('arg_list', 3),
        (208, '|'): ('arg_list', 3), (208, '}'): ('arg_list', 3)
    }
    _goto = {
        (0, '_0+'): 2, (0, 'def_prototype'): 5, (0, 'def_stmt'): 3,
        (0, 'start'): 1, (2, 'def_prototype'): 5, (2, 'def_stmt'): 4,
        (6, '_def_body'): 7, (6, 'cluster'): 25, (6, 'typespec'): 26,
        (6, 'value_expr'): 27, (10, '_1?'): 11, (10, 'param_list'): 14,
        (11, '_38?'): 12, (11, 'typespec'): 110, (12, '_3?'): 13,
        (12, 'when_cond'): 15, (16, 'param'): 17, (17, '_5*'): 18,
        (20, 'param'): 21, (22, '_38?'): 23, (22, 'typespec'): 110,
        (23, '_48?'): 24, (28, '_(10)'): 35, (28, '_piperef_left'): 60,
        (28, 'cluster'): 30, (28, 'component'): 29, (28, 'def_prototype'): 5,
        (28, 'def_stmt'): 33, (28, 'let_stmt'): 32, (28, 'piperef'): 31,
        (28, 'qual_id'): 48, (36, '_17?'): 37, (36, 'when_cond'): 41,
        (37, '_(10)'): 34, (37, '_11+'): 28, (37, '_piperef_left'): 60,
        (37, 'cluster'): 30, (37, 'component'): 29, (37, 'def_prototype'): 5,
        (37, 'def_stmt'): 33, (37, 'let_stmt'): 32, (37, 'pipeline'): 38,
        (37, 'piperef'): 31, (37, 'qual_id'): 48, (38, '_15*'): 39,
        (43, '_17?'): 44, (43, 'when_cond'): 41, (44, '_(10)'): 34,
        (44, '_11+'): 28, (44, '_piperef_left'): 60, (44, 'cluster'): 30,
        (44, 'component'): 29, (44, 'def_prototype'): 5, (44, 'def_stmt'): 33,
        (44, 'let_stmt'): 32, (44, 'pipeline'): 45, (44, 'piperef'): 31,
        (44, 'qual_id'): 48, (46, 'value_expr'): 47, (48, '_19?'): 49,
        (49, '_20?'): 50, (49, 'arg_list'): 55, (50, '_38?'): 51,
        (50, 'typespec'): 110, (51, '_41?'): 52, (51, 'as_array'): 121,
        (53, 'qual_id'): 54, (56, 'value_expr'): 57, (57, '_38?'): 58,
        (57, 'typespec'): 110, (58, '_41?'): 59, (58, 'as_array'): 121,
        (61, '_piperef_right'): 62, (62, '_38?'): 63, (62, 'typespec'): 110,
        (64, '_38?'): 65, (64, 'typespec'): 110, (70, '_additive'): 157,
        (70, '_exponentiative'): 179, (70, '_logicfun'): 142,
        (70, '_multiplicative'): 172, (70, '_structured'): 186,
        (70, '_testative'): 145, (70, 'addition'): 170, (70, 'ap_fun'): 192,
        (70, 'brackets'): 196, (70, 'complement'): 184,
        (70, 'conjuction'): 143, (70, 'difference'): 171,
        (70, 'disjuction'): 144, (70, 'equality'): 151, (70, 'expr'): 71,
        (70, 'field_by_name'): 191, (70, 'greater_eq_than'): 156,
        (70, 'greater_than'): 155, (70, 'inequality'): 152,
        (70, 'less_eq_than'): 154, (70, 'less_than'): 153, (70, 'power'): 185,
        (70, 'product'): 177, (70, 'quotient'): 178, (73, '_34?'): 91,
        (73, '_40?'): 113, (73, 'cluster_type'): 84, (73, 'enum_v_type'): 112,
        (73, 'qual_id'): 86, (73, 'rec_v_type'): 111, (73, 'typeref'): 83,
        (73, 'typesig'): 79, (73, 'typespec_list'): 74, (73, 'value_type'): 85,
        (74, '_28?'): 75, (77, '_34?'): 91, (77, '_40?'): 113,
        (77, 'cluster_type'): 84, (77, 'enum_v_type'): 112,
        (77, 'qual_id'): 86, (77, 'rec_v_type'): 111, (77, 'typeref'): 83,
        (77, 'typesig'): 79, (77, 'typespec_list'): 78, (77, 'value_type'): 85,
        (79, '_30*'): 80, (81, '_34?'): 91, (81, '_40?'): 113,
        (81, 'cluster_type'): 84, (81, 'enum_v_type'): 112,
        (81, 'qual_id'): 86, (81, 'rec_v_type'): 111, (81, 'typeref'): 83,
        (81, 'typesig'): 82, (81, 'value_type'): 85, (86, '_20?'): 87,
        (86, 'arg_list'): 55, (87, '_41?'): 88, (87, 'as_array'): 121,
        (89, 'arg_list'): 90, (92, '_34?'): 91, (92, '_cluster_type_item'): 93,
        (92, 'any_cluster_type'): 102, (92, 'cluster_pipe_type'): 104,
        (92, 'cluster_type'): 101, (92, 'qual_id'): 86, (92, 'typeref'): 103,
        (93, '_37*'): 94, (95, '_41?'): 96, (95, 'as_array'): 121,
        (97, '_53*'): 201, (99, '_34?'): 91, (99, '_cluster_type_item'): 100,
        (99, 'any_cluster_type'): 102, (99, 'cluster_pipe_type'): 104,
        (99, 'cluster_type'): 101, (99, 'qual_id'): 86, (99, 'typeref'): 103,
        (108, '_38?'): 109, (108, 'typespec'): 110,
        (114, 'rec_v_type_item'): 115, (115, '_43*'): 116, (117, '_41?'): 118,
        (117, 'as_array'): 121, (122, 'rec_v_type_item'): 123,
        (124, 'typespec'): 125, (127, 'enum_v_type_item'): 128,
        (128, '_46*'): 129, (130, '_41?'): 131, (130, 'as_array'): 121,
        (132, 'enum_v_type_item'): 133, (134, '_48?'): 135,
        (136, '_additive'): 157, (136, '_exponentiative'): 179,
        (136, '_logicfun'): 142, (136, '_multiplicative'): 172,
        (136, '_structured'): 186, (136, '_testative'): 145,
        (136, 'addition'): 170, (136, 'ap_fun'): 192, (136, 'brackets'): 196,
        (136, 'complement'): 184, (136, 'conjuction'): 143,
        (136, 'difference'): 171, (136, 'disjuction'): 144,
        (136, 'equality'): 151, (136, 'expr'): 137,
        (136, 'field_by_name'): 191, (136, 'greater_eq_than'): 156,
        (136, 'greater_than'): 155, (136, 'inequality'): 152,
        (136, 'less_eq_than'): 154, (136, 'less_than'): 153,
        (136, 'power'): 185, (136, 'product'): 177, (136, 'quotient'): 178,
        (138, '_51*'): 139, (140, '_additive'): 157,
        (140, '_exponentiative'): 179, (140, '_logicfun'): 142,
        (140, '_multiplicative'): 172, (140, '_structured'): 186,
        (140, '_testative'): 145, (140, 'addition'): 170, (140, 'ap_fun'): 192,
        (140, 'brackets'): 196, (140, 'complement'): 184,
        (140, 'conjuction'): 143, (140, 'difference'): 171,
        (140, 'disjuction'): 144, (140, 'equality'): 151, (140, 'expr'): 141,
        (140, 'field_by_name'): 191, (140, 'greater_eq_than'): 156,
        (140, 'greater_than'): 155, (140, 'inequality'): 152,
        (140, 'less_eq_than'): 154, (140, 'less_than'): 153,
        (140, 'power'): 185, (140, 'product'): 177, (140, 'quotient'): 178,
        (147, '_additive'): 157, (147, '_exponentiative'): 179,
        (147, '_multiplicative'): 172, (147, '_structured'): 186,
        (147, '_testative'): 148, (147, 'addition'): 170, (147, 'ap_fun'): 192,
        (147, 'brackets'): 196, (147, 'complement'): 184,
        (147, 'difference'): 171, (147, 'equality'): 151,
        (147, 'field_by_name'): 191, (147, 'greater_eq_than'): 156,
        (147, 'greater_than'): 155, (147, 'inequality'): 152,
        (147, 'less_eq_than'): 154, (147, 'less_than'): 153,
        (147, 'power'): 185, (147, 'product'): 177, (147, 'quotient'): 178,
        (149, '_additive'): 157, (149, '_exponentiative'): 179,
        (149, '_multiplicative'): 172, (149, '_structured'): 186,
        (149, '_testative'): 150, (149, 'addition'): 170, (149, 'ap_fun'): 192,
        (149, 'brackets'): 196, (149, 'complement'): 184,
        (149, 'difference'): 171, (149, 'equality'): 151,
        (149, 'field_by_name'): 191, (149, 'greater_eq_than'): 156,
        (149, 'greater_than'): 155, (149, 'inequality'): 152,
        (149, 'less_eq_than'): 154, (149, 'less_than'): 153,
        (149, 'power'): 185, (149, 'product'): 177, (149, 'quotient'): 178,
        (158, '_additive'): 159, (158, '_exponentiative'): 179,
        (158, '_multiplicative'): 172, (158, '_structured'): 186,
        (158, 'addition'): 170, (158, 'ap_fun'): 192, (158, 'brackets'): 196,
        (158, 'complement'): 184, (158, 'difference'): 171,
        (158, 'field_by_name'): 191, (158, 'power'): 185,
        (158, 'product'): 177, (158, 'quotient'): 178, (160, '_additive'): 161,
        (160, '_exponentiative'): 179, (160, '_multiplicative'): 172,
        (160, '_structured'): 186, (160, 'addition'): 170,
        (160, 'ap_fun'): 192, (160, 'brackets'): 196, (160, 'complement'): 184,
        (160, 'difference'): 171, (160, 'field_by_name'): 191,
        (160, 'power'): 185, (160, 'product'): 177, (160, 'quotient'): 178,
        (162, '_additive'): 163, (162, '_exponentiative'): 179,
        (162, '_multiplicative'): 172, (162, '_structured'): 186,
        (162, 'addition'): 170, (162, 'ap_fun'): 192, (162, 'brackets'): 196,
        (162, 'complement'): 184, (162, 'difference'): 171,
        (162, 'field_by_name'): 191, (162, 'power'): 185,
        (162, 'product'): 177, (162, 'quotient'): 178, (164, '_additive'): 165,
        (164, '_exponentiative'): 179, (164, '_multiplicative'): 172,
        (164, '_structured'): 186, (164, 'addition'): 170,
        (164, 'ap_fun'): 192, (164, 'brackets'): 196, (164, 'complement'): 184,
        (164, 'difference'): 171, (164, 'field_by_name'): 191,
        (164, 'power'): 185, (164, 'product'): 177, (164, 'quotient'): 178,
        (166, '_additive'): 167, (166, '_exponentiative'): 179,
        (166, '_multiplicative'): 172, (166, '_structured'): 186,
        (166, 'addition'): 170, (166, 'ap_fun'): 192, (166, 'brackets'): 196,
        (166, 'complement'): 184, (166, 'difference'): 171,
        (166, 'field_by_name'): 191, (166, 'power'): 185,
        (166, 'product'): 177, (166, 'quotient'): 178, (168, '_additive'): 169,
        (168, '_exponentiative'): 179, (168, '_multiplicative'): 172,
        (168, '_structured'): 186, (168, 'addition'): 170,
        (168, 'ap_fun'): 192, (168, 'brackets'): 196, (168, 'complement'): 184,
        (168, 'difference'): 171, (168, 'field_by_name'): 191,
        (168, 'power'): 185, (168, 'product'): 177, (168, 'quotient'): 178,
        (173, '_exponentiative'): 179, (173, '_multiplicative'): 174,
        (173, '_structured'): 186, (173, 'ap_fun'): 192,
        (173, 'brackets'): 196, (173, 'complement'): 184,
        (173, 'field_by_name'): 191, (173, 'power'): 185,
        (173, 'product'): 177, (173, 'quotient'): 178,
        (175, '_exponentiative'): 179, (175, '_multiplicative'): 176,
        (175, '_structured'): 186, (175, 'ap_fun'): 192,
        (175, 'brackets'): 196, (175, 'complement'): 184,
        (175, 'field_by_name'): 191, (175, 'power'): 185,
        (175, 'product'): 177, (175, 'quotient'): 178,
        (180, '_exponentiative'): 181, (180, '_structured'): 186,
        (180, 'ap_fun'): 192, (180, 'brackets'): 196, (180, 'complement'): 184,
        (180, 'field_by_name'): 191, (180, 'power'): 185,
        (182, '_exponentiative'): 183, (182, '_structured'): 186,
        (182, 'ap_fun'): 192, (182, 'brackets'): 196, (182, 'complement'): 184,
        (182, 'field_by_name'): 191, (182, 'power'): 185,
        (186, 'arg_list'): 199, (187, '_structured'): 188,
        (187, 'ap_fun'): 192, (187, 'brackets'): 196,
        (187, 'field_by_name'): 191, (188, 'arg_list'): 199,
        (189, '_structured'): 190, (189, 'ap_fun'): 192,
        (189, 'brackets'): 196, (189, 'field_by_name'): 191,
        (190, 'arg_list'): 199, (200, '_53*'): 201, (204, '_additive'): 157,
        (204, '_exponentiative'): 179, (204, '_logicfun'): 146,
        (204, '_multiplicative'): 172, (204, '_structured'): 186,
        (204, '_testative'): 145, (204, 'addition'): 170, (204, 'ap_fun'): 192,
        (204, 'brackets'): 196, (204, 'complement'): 184,
        (204, 'conjuction'): 143, (204, 'difference'): 171,
        (204, 'disjuction'): 144, (204, 'equality'): 151,
        (204, 'field_by_name'): 191, (204, 'greater_eq_than'): 156,
        (204, 'greater_than'): 155, (204, 'inequality'): 152,
        (204, 'less_eq_than'): 154, (204, 'less_than'): 153,
        (204, 'power'): 185, (204, 'product'): 177, (204, 'quotient'): 178,
        (206, '_additive'): 157, (206, '_exponentiative'): 179,
        (206, '_logicfun'): 142, (206, '_multiplicative'): 172,
        (206, '_structured'): 186, (206, '_testative'): 145,
        (206, 'addition'): 170, (206, 'ap_fun'): 192, (206, 'brackets'): 196,
        (206, 'complement'): 184, (206, 'conjuction'): 143,
        (206, 'difference'): 171, (206, 'disjuction'): 144,
        (206, 'equality'): 151, (206, 'expr'): 138, (206, 'expr_list'): 207,
        (206, 'field_by_name'): 191, (206, 'greater_eq_than'): 156,
        (206, 'greater_than'): 155, (206, 'inequality'): 152,
        (206, 'less_eq_than'): 154, (206, 'less_than'): 153,
        (206, 'power'): 185, (206, 'product'): 177, (206, 'quotient'): 178
    }
    _shift = {
        (0, 'def'): 9, (1, EOF): 209, (2, 'def'): 9, (5, 'is'): 6,
        (6, '('): 70, (6, '['): 73, (6, '{'): 36, (7, ';'): 8, (9, 'ID'): 10,
        (10, '('): 16, (11, '['): 73, (12, 'when'): 46, (16, 'ID'): 22,
        (18, ')'): 19, (18, ','): 20, (20, 'ID'): 22, (22, '['): 73,
        (23, ':='): 136, (28, '<'): 67, (28, '=<'): 66, (28, '=>'): 64,
        (28, 'ID'): 200, (28, 'def'): 9, (28, 'let'): 56, (28, '{'): 36,
        (36, 'when'): 46, (37, '<'): 67, (37, '=<'): 66, (37, '=>'): 64,
        (37, 'ID'): 200, (37, 'def'): 9, (37, 'let'): 56, (37, '{'): 36,
        (39, '|'): 43, (39, '}'): 40, (41, ':'): 42, (43, 'when'): 46,
        (44, '<'): 67, (44, '=<'): 66, (44, '=>'): 64, (44, 'ID'): 200,
        (44, 'def'): 9, (44, 'let'): 56, (44, '{'): 36, (46, '('): 70,
        (48, ':'): 53, (49, '('): 206, (50, '['): 73, (51, 'array'): 89,
        (53, 'ID'): 200, (56, '('): 70, (57, '['): 73, (58, 'array'): 89,
        (60, 'ID'): 61, (61, '>'): 68, (61, '>='): 69, (62, '['): 73,
        (64, '['): 73, (70, '('): 204, (70, '.'): 195, (70, 'ID'): 194,
        (70, 'NUMBER'): 193, (70, 'not'): 187, (71, ')'): 72, (73, 'ID'): 97,
        (73, 'enum'): 126, (73, 'record'): 119, (73, 'union'): 120,
        (74, '=>'): 77, (75, ']'): 76, (77, 'ID'): 97, (77, 'enum'): 126,
        (77, 'record'): 119, (77, 'union'): 120, (80, ','): 81, (81, 'ID'): 97,
        (81, 'enum'): 126, (81, 'record'): 119, (81, 'union'): 120,
        (86, '('): 206, (87, 'array'): 89, (89, '('): 206, (91, '{'): 92,
        (92, '*'): 105, (92, '<'): 106, (92, 'ID'): 97, (94, '|'): 99,
        (94, '}'): 95, (95, 'array'): 89, (97, ':'): 98, (99, '*'): 105,
        (99, '<'): 106, (99, 'ID'): 97, (106, 'ID'): 107, (107, '>'): 108,
        (108, '['): 73, (113, '('): 114, (114, 'ID'): 124, (116, ')'): 117,
        (116, ','): 122, (117, 'array'): 89, (122, 'ID'): 124, (124, '['): 73,
        (126, '('): 127, (127, 'ID'): 134, (129, ')'): 130, (129, ','): 132,
        (130, 'array'): 89, (132, 'ID'): 134, (134, ':='): 136,
        (136, '('): 204, (136, '.'): 195, (136, 'ID'): 194,
        (136, 'NUMBER'): 193, (136, 'not'): 187, (139, ','): 140,
        (140, '('): 204, (140, '.'): 195, (140, 'ID'): 194,
        (140, 'NUMBER'): 193, (140, 'not'): 187, (142, 'and'): 147,
        (142, 'or'): 149, (145, '/='): 160, (145, '<'): 162, (145, '<='): 164,
        (145, '='): 158, (145, '>'): 166, (145, '>='): 168, (146, ')'): 205,
        (146, 'and'): 147, (146, 'or'): 149, (147, '('): 204, (147, '.'): 195,
        (147, 'ID'): 194, (147, 'NUMBER'): 193, (147, 'not'): 187,
        (148, '/='): 160, (148, '<'): 162, (148, '<='): 164, (148, '='): 158,
        (148, '>'): 166, (148, '>='): 168, (149, '('): 204, (149, '.'): 195,
        (149, 'ID'): 194, (149, 'NUMBER'): 193, (149, 'not'): 187,
        (150, '/='): 160, (150, '<'): 162, (150, '<='): 164, (150, '='): 158,
        (150, '>'): 166, (150, '>='): 168, (157, '+'): 173, (157, '-'): 175,
        (158, '('): 204, (158, '.'): 195, (158, 'ID'): 194,
        (158, 'NUMBER'): 193, (158, 'not'): 187, (159, '+'): 173,
        (159, '-'): 175, (160, '('): 204, (160, '.'): 195, (160, 'ID'): 194,
        (160, 'NUMBER'): 193, (160, 'not'): 187, (161, '+'): 173,
        (161, '-'): 175, (162, '('): 204, (162, '.'): 195, (162, 'ID'): 194,
        (162, 'NUMBER'): 193, (162, 'not'): 187, (163, '+'): 173,
        (163, '-'): 175, (164, '('): 204, (164, '.'): 195, (164, 'ID'): 194,
        (164, 'NUMBER'): 193, (164, 'not'): 187, (165, '+'): 173,
        (165, '-'): 175, (166, '('): 204, (166, '.'): 195, (166, 'ID'): 194,
        (166, 'NUMBER'): 193, (166, 'not'): 187, (167, '+'): 173,
        (167, '-'): 175, (168, '('): 204, (168, '.'): 195, (168, 'ID'): 194,
        (168, 'NUMBER'): 193, (168, 'not'): 187, (169, '+'): 173,
        (169, '-'): 175, (172, '*'): 180, (172, '/'): 182, (173, '('): 204,
        (173, '.'): 195, (173, 'ID'): 194, (173, 'NUMBER'): 193,
        (173, 'not'): 187, (174, '*'): 180, (174, '/'): 182, (175, '('): 204,
        (175, '.'): 195, (175, 'ID'): 194, (175, 'NUMBER'): 193,
        (175, 'not'): 187, (176, '*'): 180, (176, '/'): 182, (179, '**'): 189,
        (180, '('): 204, (180, '.'): 195, (180, 'ID'): 194,
        (180, 'NUMBER'): 193, (180, 'not'): 187, (181, '**'): 189,
        (182, '('): 204, (182, '.'): 195, (182, 'ID'): 194,
        (182, 'NUMBER'): 193, (182, 'not'): 187, (183, '**'): 189,
        (186, '('): 206, (186, '.'): 197, (187, '('): 204, (187, '.'): 195,
        (187, 'ID'): 194, (187, 'NUMBER'): 193, (188, '('): 206,
        (188, '.'): 197, (189, '('): 204, (189, '.'): 195, (189, 'ID'): 194,
        (189, 'NUMBER'): 193, (190, '('): 206, (190, '.'): 197,
        (197, 'ID'): 198, (201, '.'): 202, (202, 'ID'): 203, (204, '('): 204,
        (204, '.'): 195, (204, 'ID'): 194, (204, 'NUMBER'): 193,
        (204, 'not'): 187, (206, '('): 204, (206, '.'): 195, (206, 'ID'): 194,
        (206, 'NUMBER'): 193, (206, 'not'): 187, (207, ')'): 208
    }

    def __init__(self, max_err=None, errcorr_pre=4, errcorr_post=4):
        """Create a new parser instance.

        The constructor arguments are all optional, they control the
        handling of parse errors: `max_err` can be given to bound the
        number of errors reported during one run of the parser.
        `errcorr_pre` controls how many tokens before an invalid token
        the parser considers when trying to repair the input.
        `errcorr_post` controls how far beyond an invalid token the
        parser reads when evaluating the quality of an attempted
        repair.
        """
        self.max_err = max_err
        self.m = errcorr_pre
        self.n = errcorr_post

    @staticmethod
    def leaves(tree):
        """Iterate over the leaves of a parse tree.

        This function can be used to reconstruct the input from a
        parse tree.
        """
        if tree[0] in Parser.terminals:
            yield tree
        else:
            for x in tree[1:]:
                for t in Parser.leaves(x):
                    yield t

    def _parse(self, input, stack, state):
        """Internal function to construct a parse tree.

        'Input' is the input token stream, 'stack' is the inital stack
        and 'state' is the inital state of the automaton.

        Returns a 4-tuple (done, count, state, error).  'done' is a
        boolean indicationg whether parsing is completed, 'count' is
        number of successfully shifted tokens, and 'error' is None on
        success or else the first token which could not be parsed.
        """
        read_next = True
        count = 0
        while state != self._halting_state:
            if read_next:
                try:
                    lookahead = next(input)
                except StopIteration:
                    return (False,count,state,None)
                read_next = False
            token = lookahead[0]

            if (state,token) in self._shift:
                stack.append((state,lookahead))
                state = self._shift[(state,token)]
                read_next = True
                count += 1
            elif (state,token) in self._reduce:
                X,n = self._reduce[(state,token)]
                if n > 0:
                    state = stack[-n][0]
                    tree = [ X ]
                    for s in stack[-n:]:
                        if s[1][0] in self._transparent:
                            tree.extend(s[1][1:])
                        else:
                            tree.append(s[1])
                    tree = tuple(tree)
                    del stack[-n:]
                else:
                    tree = (X,)
                stack.append((state,tree))
                state = self._goto[(state,X)]
            else:
                return (False,count,state,lookahead)
        return (True,count,state,None)

    def _try_parse(self, input, stack, state):
        count = 0
        while state != self._halting_state and count < len(input):
            token = input[count][0]

            if (state,token) in self._shift:
                stack.append(state)
                state = self._shift[(state,token)]
                count += 1
            elif (state,token) in self._reduce:
                X,n = self._reduce[(state,token)]
                if n > 0:
                    state = stack[-n]
                    del stack[-n:]
                stack.append(state)
                state = self._goto[(state,X)]
            else:
                break
        return count

    def parse(self, input):
        """Parse the tokens from `input` and construct a parse tree.

        `input` must be an interable over tuples.  The first element
        of each tuple must be a terminal symbol of the grammar which
        is used for parsing.  All other element of the tuple are just
        copied into the constructed parse tree.

        If `input` is invalid, a ParseErrors exception is raised.
        Otherwise the function returns the parse tree.
        """
        errors = []
        input = chain(input, [(self.EOF,)])
        stack = []
        state = 0
        while True:
            done,_,state,lookahead = self._parse(input, stack, state)
            if done:
                break

            expect = [ t for s,t in self._reduce.keys()+self._shift.keys()
                       if s == state ]
            errors.append((lookahead, expect))
            if self.max_err is not None and len(errors) >= self.max_err:
                raise self.ParseErrors(errors, None)

            queue = []
            def split_input(m, stack, lookahead, input, queue):
                for s in stack:
                    for t in self.leaves(s[1]):
                        queue.append(t)
                        if len(queue) > m:
                            yield queue.pop(0)
                queue.append(lookahead)
            in2 = split_input(self.m, stack, lookahead, input, queue)
            stack = []
            done,_,state,lookahead = self._parse(in2, stack, 0)
            m = len(queue)
            for i in range(0, self.n):
                try:
                    queue.append(input.next())
                except StopIteration:
                    break

            def vary_queue(queue, m):
                for i in range(m-1, -1, -1):
                    for t in self.terminals:
                        yield queue[:i]+[(t,)]+queue[i:]
                    if queue[i][0] == self.EOF:
                        continue
                    for t in self.terminals:
                        if t == queue[i]:
                            continue
                        yield queue[:i]+[(t,)]+queue[i+1:]
                    yield queue[:i]+queue[i+1:]
            best_val = len(queue)-m+1
            best_queue = queue
            for q2 in vary_queue(queue, m):
                pos = self._try_parse(q2, [ s[0] for s in stack ], state)
                val = len(q2) - pos
                if val < best_val:
                    best_val = val
                    best_queue = q2
                    if val == len(q2):
                        break
            if best_val >= len(queue)-m+1:
                raise self.ParseErrors(errors, None)
            input = chain(best_queue, input)

        tree = stack[0][1]
        if errors:
            raise self.ParseErrors(errors, tree)
        return tree
