#include "run-time.h"

/* Typedefs for referenced classes */

#define  define__KLsimple_object_vectorGVKd(nrepeated) \
  typedef struct { \
    D wrapper; \
    D size_; \
    D vector_element_[nrepeated+1]; \
  } _KLsimple_object_vectorGVKd_##nrepeated;
define__KLsimple_object_vectorGVKd(16);
define__KLsimple_object_vectorGVKd(4);
define__KLsimple_object_vectorGVKd(2);
define__KLsimple_object_vectorGVKd(6);
define__KLsimple_object_vectorGVKd(10);
define__KLsimple_object_vectorGVKd(0);
define__KLsimple_object_vectorGVKd(1);

typedef struct {
  D wrapper;
  D instanceQ_iep_;
  D debug_name_;
  D class_implementation_class_;
  D class_subtype_bit_;
  D class_module_;
} _KLclassGVKd;

#define  define__KLmm_wrapperGVKi(nrepeated) \
  typedef struct { \
    D wrapper; \
    D mm_wrapper_implementation_class_; \
    D mm_wrapper_subtype_mask_; \
    DWORD mm_wrapper_fixed_part_; \
    DWORD mm_wrapper_variable_part_; \
    D mm_wrapper_number_patterns_; \
    DWORD mm_wrapper_pattern_element_[nrepeated+1]; \
  } _KLmm_wrapperGVKi_##nrepeated;
define__KLmm_wrapperGVKi(1);
define__KLmm_wrapperGVKi(0);

typedef struct {
  D wrapper;
  D xep_;
  D function_signature_;
  D mep_;
} _KLsimple_methodGVKe;

typedef struct {
  D wrapper;
  D instanceQ_iep_;
  D debug_name_;
  D class_implementation_class_;
  D class_subtype_bit_;
  D class_module_;
} _KLfunction_classGVKi;

typedef struct {
  D wrapper;
  D head_;
  D tail_;
} _KLempty_listGVKd;

typedef struct {
  D wrapper;
} _KLobjectGVKd;

typedef struct {
  D wrapper;
} _KLunboundGVKe;

typedef struct {
  D wrapper;
} _KLbooleanGVKd;

typedef struct {
  D wrapper;
  D namespace_name_;
  D home_library_;
} _KLmoduleGVKe;

#define  define__KLbyte_stringGVKd(nrepeated) \
  typedef struct { \
    D wrapper; \
    D size_; \
    char string_element_[nrepeated+1]; \
  } _KLbyte_stringGVKd_##nrepeated;
define__KLbyte_stringGVKd(5);
define__KLbyte_stringGVKd(16);

typedef struct {
  D wrapper;
  D namespace_name_;
  D library_major_version_;
  D library_minor_version_;
  D library_build_count_;
  D used_libraries_;
  D all_used_libraries_;
  D runtime_module_;
  D library_defined_generics_;
  D library_number_static_dispatches_;
  D library_number_dynamic_dispatches_;
} _KLlibraryGVKe;

typedef struct {
  D wrapper;
  D library_major_version_;
  D library_minor_version_;
  D library_build_count_;
  D used_library_;
  D used_library_binding_;
} _KLused_libraryGVKe;

typedef struct {
  D wrapper;
  D symbol_name_;
} _KLsymbolGVKd;

typedef struct {
  D wrapper;
  D element_type_;
} _KLlimited_collectionGVKe;

typedef struct {
  D wrapper;
} _KLstretchy_collectionGVKd;

typedef struct {
  D wrapper;
} _KLmutable_collectionGVKd;

typedef struct {
  D wrapper;
} _KLexplicit_key_collectionGVKd;

typedef struct {
  D wrapper;
} _KLcollectionGVKd;

typedef struct {
  D wrapper;
} _KLmutable_explicit_key_collectionGVKd;

typedef struct {
  D wrapper;
} _KLmutable_object_with_elementsGVKe;

typedef struct {
  D wrapper;
  D element_type_;
  D table_vector_;
  D initial_entries_;
  D grow_size_function_;
  D weakQ_;
} _KLtableGVKd;

typedef struct {
  D wrapper;
} _KLconditionGVKd;

typedef struct {
  D wrapper;
} _KLobject_with_elementsGVKe;

typedef struct {
  D wrapper;
} _KLsealed_constructorGVgrammar_compiler;

typedef struct {
  D wrapper;
  D rule_index_;
  D rule_lhs_;
  D rule_user_rule_;
  D rule_item_;
} _KLruleGVgrammar_compiler;

typedef struct {
  D wrapper;
  D term_token_;
  D term_index_;
  D term_first_set_;
} _KLtermGVgrammar_compiler;

typedef struct {
  D wrapper;
  D term_token_;
  D term_index_;
  D term_first_set_;
} _KLterminalGVgrammar_compiler;

typedef struct {
  D wrapper;
  D term_token_;
  D term_index_;
  D term_first_set_;
  D nont_rules_;
  D nont_derivs_;
  D nont_epsilon_item_;
  D nont_error_rule_index_;
  D nont_deriv_first_set_;
} _KLnon_terminalGVgrammar_compiler;

typedef struct {
  D wrapper;
  D item_index_;
  D item_rule_;
  D item_lr1_closure_;
} _KLitemGVgrammar_compiler;

typedef struct {
  D wrapper;
  D element_type_;
  D table_vector_;
  D initial_entries_;
  D grow_size_function_;
  D weakQ_;
} _KLitem_set_tableGVgrammar_compiler;

typedef struct {
  D wrapper;
  D item_index_;
  D item_rule_;
  D item_lr1_closure_;
} _KLempty_itemGVgrammar_compiler;

typedef struct {
  D wrapper;
  D item_index_;
  D item_rule_;
  D item_lr1_closure_;
  D item_first_term_;
  D item_next_item_;
  D item_first_set_;
} _KLnon_empty_itemGVgrammar_compiler;

typedef struct {
  D wrapper;
  D grammar_rules_;
  D grammar_error_rules_;
  D grammar_terminals_;
  D grammar_goto_table_;
  D grammar_action_table_;
  D grammar_rule_reduction_table_;
} _KLgrammarGVgrammar_compiler;

typedef struct {
  D wrapper;
  D Pgrammar_user_rules_;
  D Pgrammar_user_error_rules_;
  D Pgrammar_terminal_tokens_;
  D Pgrammar_rules_;
  D Pgrammar_non_terminals_;
  D Pgrammar_items_;
  D Pgrammar_item_sets_;
  D Pgrammar_error_action_table_;
  D Pgrammar_lookaheads_;
  D Pgrammar_gotos_;
  D Pgrammar_actions_;
  D Pgrammar_propagation_queue_;
} _KLgvarsGVgrammar_compiler;

typedef struct {
  D wrapper;
  D deriv_item_initial_;
  D deriv_item_result_;
  D deriv_item_terminal_;
} _KLderiv_itemGVgrammar_compiler;

typedef struct {
  D wrapper;
  D deriv_rule_to_;
  D deriv_rule_terminals_;
} _KLderiv_ruleGVgrammar_compiler;

typedef struct {
  D wrapper;
  D pentry_from_key_;
  D pentry_goto_key_;
  D pentry_next_;
} _KLpropagation_entryGVgrammar_compiler;

typedef struct {
  D wrapper;
  D aentry_shiftQ_;
  D aentry_item_;
} _KLaction_entryGVgrammar_compiler;

typedef struct {
  D wrapper;
  D grammar_conflict_terminal_;
  D grammar_conflict_action_1_;
  D grammar_conflict_rule_1_;
  D grammar_conflict_position_1_;
  D grammar_conflict_action_2_;
  D grammar_conflict_rule_2_;
  D grammar_conflict_position_2_;
} _KLgrammar_conflictGVgrammar_compiler;


/* Typedefs for defined classes */


/* Referenced object declarations */

extern _KLclassGVKd KLsimple_object_vectorGVKd;
extern _KLclassGVKd KLclassGVKd;
extern _KLmm_wrapperGVKi_0 KLclassGVKdW;
extern _KLclassGVKd KLmm_wrapperGVKi;
extern _KLmm_wrapperGVKi_1 KLmm_wrapperGVKiW;
extern _KLmm_wrapperGVKi_0 KLsimple_object_vectorGVKdW;
D Kinitialize_class_dispatch_keys_vectoredVKgI (D);
D KdoVKdMM0I (D, D, D);
extern _KLsimple_methodGVKe Kaugment_rcpl_position_data_multipleVKi;
extern _KLfunction_classGVKi KLsimple_methodGVKe;
extern _KLclassGVKd KLfunction_classGVKi;
extern _KLmm_wrapperGVKi_0 KLfunction_classGVKiW;
extern _KLmm_wrapperGVKi_0 KLsimple_methodGVKeW;
extern _KLempty_listGVKd KPempty_listVKi;
extern _KLclassGVKd KLempty_listGVKd;
extern _KLmm_wrapperGVKi_0 KLempty_listGVKdW;
extern _KLsimple_methodGVKe Kaugment_class_known_jointVKiMM0;
D KPlibrary_version_checkVKeI (D, D);
extern _KLclassGVKd KLobjectGVKd;
extern _KLmm_wrapperGVKi_0 KLobjectGVKdW;
extern _KLunboundGVKe KPunboundVKi;
extern _KLclassGVKd KLunboundGVKe;
extern _KLmm_wrapperGVKi_0 KLunboundGVKeW;
extern _KLbooleanGVKd KPtrueVKi;
extern _KLclassGVKd KLbooleanGVKd;
extern _KLmm_wrapperGVKi_0 KLbooleanGVKdW;
extern _KLbooleanGVKd KPfalseVKi;
extern _KLclassGVKd KLmoduleGVKe;
extern _KLmm_wrapperGVKi_0 KLmoduleGVKeW;
extern _KLclassGVKd KLbyte_stringGVKd;
extern _KLmm_wrapperGVKi_0 KLbyte_stringGVKdW;
extern _KLclassGVKd KLlibraryGVKe;
extern _KLmm_wrapperGVKi_0 KLlibraryGVKeW;
extern _KLsimple_object_vectorGVKd_0 KPempty_vectorVKi;
extern _KLclassGVKd KLused_libraryGVKe;
extern _KLmm_wrapperGVKi_0 KLused_libraryGVKeW;
extern _KLlibraryGVKe Kdylan_libraryYdylan_userVdylan;
extern _KLclassGVKd KLsymbolGVKd;
extern _KLmm_wrapperGVKi_0 KLsymbolGVKdW;
extern _KLlibraryGVKe Kcommon_dylan_libraryYdylan_userVcommon_dylan;
extern _KLclassGVKd KLlimited_collectionGVKe;
extern _KLmm_wrapperGVKi_0 KLlimited_collectionGVKeW;
extern _KLclassGVKd KLstretchy_collectionGVKd;
extern _KLmm_wrapperGVKi_0 KLstretchy_collectionGVKdW;
extern _KLclassGVKd KLmutable_collectionGVKd;
extern _KLmm_wrapperGVKi_0 KLmutable_collectionGVKdW;
extern _KLclassGVKd KLexplicit_key_collectionGVKd;
extern _KLmm_wrapperGVKi_0 KLexplicit_key_collectionGVKdW;
extern _KLclassGVKd KLcollectionGVKd;
extern _KLmm_wrapperGVKi_0 KLcollectionGVKdW;
extern _KLclassGVKd KLmutable_explicit_key_collectionGVKd;
extern _KLmm_wrapperGVKi_0 KLmutable_explicit_key_collectionGVKdW;
extern _KLclassGVKd KLmutable_object_with_elementsGVKe;
extern _KLmm_wrapperGVKi_0 KLmutable_object_with_elementsGVKeW;
extern _KLclassGVKd KLtableGVKd;
extern _KLmm_wrapperGVKi_0 KLtableGVKdW;
extern _KLclassGVKd KLconditionGVKd;
extern _KLmm_wrapperGVKi_0 KLconditionGVKdW;
extern _KLclassGVKd KLobject_with_elementsGVKe;
extern _KLmm_wrapperGVKi_0 KLobject_with_elementsGVKeW;
extern _KLclassGVKd KLsealed_constructorGVgrammar_compiler;
extern _KLclassGVKd KLruleGVgrammar_compiler;
extern _KLclassGVKd KLtermGVgrammar_compiler;
extern _KLclassGVKd KLterminalGVgrammar_compiler;
extern _KLclassGVKd KLnon_terminalGVgrammar_compiler;
extern _KLclassGVKd KLitemGVgrammar_compiler;
extern _KLclassGVKd KLitem_set_tableGVgrammar_compiler;
extern _KLclassGVKd KLempty_itemGVgrammar_compiler;
extern _KLclassGVKd KLnon_empty_itemGVgrammar_compiler;
extern _KLclassGVKd KLgrammarGVgrammar_compiler;
extern _KLclassGVKd KLgvarsGVgrammar_compiler;
extern _KLclassGVKd KLderiv_itemGVgrammar_compiler;
extern _KLclassGVKd KLderiv_ruleGVgrammar_compiler;
extern _KLclassGVKd KLpropagation_entryGVgrammar_compiler;
extern _KLclassGVKd KLaction_entryGVgrammar_compiler;
extern _KLclassGVKd KLgrammar_conflictGVgrammar_compiler;

/* Defined object declarations */

static _KLsimple_object_vectorGVKd_10 K1;
static _KLsimple_object_vectorGVKd_10 K2;
static _KLsimple_object_vectorGVKd_6 K3;
static _KLsimple_object_vectorGVKd_6 K4;
extern _KLlibraryGVKe Kgrammar_compiler_libraryYdylan_userVgrammar_compiler;
extern _KLmoduleGVKe Kgrammar_compiler_moduleYdylan_userVgrammar_compiler;
static _KLbyte_stringGVKd_16 K9;
static _KLsimple_object_vectorGVKd_2 K10;
static _KLused_libraryGVKe K11;
static _KLused_libraryGVKe K12;
static _KLsymbolGVKd KJtight_;
static _KLbyte_stringGVKd_5 K14;
static _KLsimple_object_vectorGVKd_1 K15;
static _KLsimple_object_vectorGVKd_2 K16;
static _KLsimple_object_vectorGVKd_2 K17;
static _KLsimple_object_vectorGVKd_4 K18;
static _KLsimple_object_vectorGVKd_1 K19;
static _KLsimple_object_vectorGVKd_1 K20;
static _KLsimple_object_vectorGVKd_1 K21;
static _KLsimple_object_vectorGVKd_1 K22;
static _KLsimple_object_vectorGVKd_1 K23;
static _KLsimple_object_vectorGVKd_1 K24;
static _KLsimple_object_vectorGVKd_1 K25;
static _KLsimple_object_vectorGVKd_1 K26;
static _KLsimple_object_vectorGVKd_1 K27;
static _KLsimple_object_vectorGVKd_16 K28;

/* Indirection variables */

static D IKJtight_ = &KJtight_;

/* Variables */

D grammar_compiler_moduleYdylan_userVgrammar_compiler = &Kgrammar_compiler_moduleYdylan_userVgrammar_compiler;
D grammar_compiler_libraryYdylan_userVgrammar_compiler = &Kgrammar_compiler_libraryYdylan_userVgrammar_compiler;

/* Objects */

static _KLsimple_object_vectorGVKd_10 K1 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 41,
  &K19,
  &K20,
  &K21,
  &K22,
  &K23,
  &K24,
  &K25,
  &K26,
  &K23,
  &K27
};

static _KLsimple_object_vectorGVKd_10 K2 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 41,
  &KLlimited_collectionGVKe,
  &KLstretchy_collectionGVKd,
  &KLmutable_collectionGVKd,
  &KLtableGVKd,
  &KLconditionGVKd,
  &KLexplicit_key_collectionGVKd,
  &KLmutable_object_with_elementsGVKe,
  &KLcollectionGVKd,
  &KLobject_with_elementsGVKe,
  &KLmutable_explicit_key_collectionGVKd
};

static _KLsimple_object_vectorGVKd_6 K3 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 25,
  &K15,
  &K16,
  &K17,
  &K18,
  &K15,
  &K17
};

static _KLsimple_object_vectorGVKd_6 K4 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 25,
  &KLlimited_collectionGVKe,
  &KLstretchy_collectionGVKd,
  &KLmutable_collectionGVKd,
  &KLexplicit_key_collectionGVKd,
  &KLcollectionGVKd,
  &KLmutable_explicit_key_collectionGVKd
};

_KLlibraryGVKe Kgrammar_compiler_libraryYdylan_userVgrammar_compiler = {
  &KLlibraryGVKeW /* wrapper */,
  &K9,
  (D) 1,
  (D) 1,
  (D) 130087221,
  &K10,
  &KPempty_vectorVKi,
  &KPfalseVKi,
  &KPempty_vectorVKi,
  (D) 1553,
  (D) 569
};

_KLmoduleGVKe Kgrammar_compiler_moduleYdylan_userVgrammar_compiler = {
  &KLmoduleGVKeW /* wrapper */,
  &K9,
  &Kgrammar_compiler_libraryYdylan_userVgrammar_compiler
};

static _KLbyte_stringGVKd_16 K9 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 65,
  "grammar-compiler"
};

static _KLsimple_object_vectorGVKd_2 K10 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &K11,
  &K12
};

static _KLused_libraryGVKe K11 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 1,
  (D) 1,
  (D) 128002773,
  &Kcommon_dylan_libraryYdylan_userVcommon_dylan,
  &KJtight_
};

static _KLused_libraryGVKe K12 = {
  &KLused_libraryGVKeW /* wrapper */,
  (D) 9,
  (D) 5,
  (D) 128132821,
  &Kdylan_libraryYdylan_userVdylan,
  &KJtight_
};

static _KLsymbolGVKd KJtight_ = {
  &KLsymbolGVKdW /* wrapper */,
  &K14
};

static _KLbyte_stringGVKd_5 K14 = {
  &KLbyte_stringGVKdW /* wrapper */,
  (D) 21,
  "tight"
};

static _KLsimple_object_vectorGVKd_1 K15 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  &KLmutable_object_with_elementsGVKe
};

static _KLsimple_object_vectorGVKd_2 K16 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &KLmutable_object_with_elementsGVKe,
  &KLlimited_collectionGVKe
};

static _KLsimple_object_vectorGVKd_2 K17 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 9,
  &KLlimited_collectionGVKe,
  &KLstretchy_collectionGVKd
};

static _KLsimple_object_vectorGVKd_4 K18 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 17,
  &KLmutable_object_with_elementsGVKe,
  &KLlimited_collectionGVKe,
  &KLstretchy_collectionGVKd,
  &KLmutable_collectionGVKd
};

static _KLsimple_object_vectorGVKd_1 K19 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 21
};

static _KLsimple_object_vectorGVKd_1 K20 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 25
};

static _KLsimple_object_vectorGVKd_1 K21 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 29
};

static _KLsimple_object_vectorGVKd_1 K22 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 41
};

static _KLsimple_object_vectorGVKd_1 K23 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 9
};

static _KLsimple_object_vectorGVKd_1 K24 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 33
};

static _KLsimple_object_vectorGVKd_1 K25 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 13
};

static _KLsimple_object_vectorGVKd_1 K26 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 17
};

static _KLsimple_object_vectorGVKd_1 K27 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 5,
  (D) 37
};

static _KLsimple_object_vectorGVKd_16 K28 = {
  &KLsimple_object_vectorGVKdW /* wrapper */,
  (D) 65,
  &KLsealed_constructorGVgrammar_compiler,
  &KLruleGVgrammar_compiler,
  &KLtermGVgrammar_compiler,
  &KLterminalGVgrammar_compiler,
  &KLnon_terminalGVgrammar_compiler,
  &KLitemGVgrammar_compiler,
  &KLitem_set_tableGVgrammar_compiler,
  &KLempty_itemGVgrammar_compiler,
  &KLnon_empty_itemGVgrammar_compiler,
  &KLgrammarGVgrammar_compiler,
  &KLgvarsGVgrammar_compiler,
  &KLderiv_itemGVgrammar_compiler,
  &KLderiv_ruleGVgrammar_compiler,
  &KLpropagation_entryGVgrammar_compiler,
  &KLaction_entryGVgrammar_compiler,
  &KLgrammar_conflictGVgrammar_compiler
};

/* Code */


/* SYSTEM INIT CODE */

void _Init_grammar_compiler__X_grammar_compiler_library_for_system () {
  extern D KPresolve_symbolVKiI(D);
  {
    D T0;

    T0 = KPresolve_symbolVKiI(&KJtight_);
    if (T0 != &KJtight_) {
      primitive_slot_value_setter(T0, &K11, 4);
      primitive_slot_value_setter(T0, &K12, 4);
    }
  }
  return;
}

/* USER INIT CODE */

void _Init_grammar_compiler__X_grammar_compiler_library_for_user () {
{
  _KLsimple_object_vectorGVKd_1 T0 = {&KLsimple_object_vectorGVKdW, (D) 5};
  _KLsimple_object_vectorGVKd_1 T1 = {&KLsimple_object_vectorGVKdW, (D) 5};
  D T2;

  Kinitialize_class_dispatch_keys_vectoredVKgI(&K28);
  T0.vector_element_[0] = &K1;
  KdoVKdMM0I(&Kaugment_rcpl_position_data_multipleVKi, &K2, &T0);
  T1.vector_element_[0] = &K3;
  T2 = KdoVKdMM0I(&Kaugment_class_known_jointVKiMM0, &K4, &T1);
  goto I0;
}
I0:

{
  D T0;

  T0 = &KPfalseVKi;
  goto I5;
}
I5:

{
  D T0;
  D T1;

  // /Users/bruce/Development/dylan/opendylan/sources/lib/grammar-compiler/grammar-compiler-library.dylan:7
  T0 = primitive_runtime_module_handle();
  // /Users/bruce/Development/dylan/opendylan/sources/lib/grammar-compiler/grammar-compiler-library.dylan:7
  T1 = KPlibrary_version_checkVKeI(&Kgrammar_compiler_libraryYdylan_userVgrammar_compiler, T0);
  goto I6;
}
I6:

  return;
}


/* eof */
