/* ** ** Grammar for ATS/Anairiats ** This [yats] file is automatically generated by ** $ATSHOME/utils/atsgrammar/atsgrammar --format=yats ** */ /* ****** ****** */ /* ** Time of Generation: Sat Dec 4 09:49:31 2010 */ /* ****** ****** */ %{ #include // for [fprintf] #include "ats_memory.h" // HX: loading [ats_types.h] as well #define malloc ats_malloc_ngc #define realloc ats_realloc_ngc /* ****** ****** */ typedef ats_ptr_type c0har_t ; typedef ats_ptr_type e0xtcode_t ; typedef ats_ptr_type f0loat_t ; typedef ats_ptr_type f0loatsp_t ; typedef ats_ptr_type i0nt_t ; typedef ats_ptr_type i0ntsp_t ; typedef ats_ptr_type s0tring_t ; typedef ats_ptr_type t0kn_t ; typedef ats_ptr_type abskind_t ; typedef ats_ptr_type dcstkind_t ; typedef ats_ptr_type datakind_t ; typedef ats_ptr_type stadefkind_t ; typedef ats_ptr_type valkind_t ; typedef ats_ptr_type funkind_t ; typedef ats_ptr_type lamkind_t ; typedef lamkind_t fixkind_t ; typedef ats_ptr_type srpifkindtok_t ; typedef ats_ptr_type i0de_t ; typedef ats_ptr_type i0delst_t ; typedef ats_ptr_type i0delstlst_t ; typedef ats_ptr_type i0dext_t ; typedef ats_ptr_type l0ab_t ; typedef ats_ptr_type p0rec_t ; typedef ats_ptr_type e0xp_t ; typedef ats_ptr_type e0xplst_t ; typedef ats_ptr_type e0xpopt_t ; typedef ats_ptr_type e0fftag_t ; typedef ats_ptr_type e0fftaglst_t ; typedef ats_ptr_type e0fftaglstopt_t ; typedef ats_ptr_type s0rtq_t ; typedef ats_ptr_type s0rt_t ; typedef ats_ptr_type s0rtlst_t ; typedef ats_ptr_type s0rtopt_t ; typedef ats_ptr_type s0rtpol_t ; typedef ats_ptr_type d0atsrtcon_t ; typedef ats_ptr_type d0atsrtconlst_t ; typedef ats_ptr_type d0atsrtdec_t ; typedef ats_ptr_type d0atsrtdeclst_t ; typedef ats_ptr_type s0taq_t ; typedef ats_ptr_type d0ynq_t ; typedef ats_ptr_type sqi0de_t ; typedef ats_ptr_type dqi0de_t ; typedef ats_ptr_type arrqi0de_t ; typedef ats_ptr_type tmpqi0de_t ; typedef ats_ptr_type s0arg_t ; typedef ats_ptr_type s0arglst_t ; typedef ats_ptr_type s0arglstlst_t ; typedef ats_ptr_type s0exp_t ; typedef ats_ptr_type s0expext_t ; // for external types typedef ats_ptr_type s0explst_t ; typedef ats_ptr_type s0expopt_t ; typedef ats_ptr_type s0explstlst_t ; typedef ats_ptr_type s0explstopt_t ; typedef ats_ptr_type labs0explst_t ; typedef ats_ptr_type s0arrind_t ; typedef ats_ptr_type t1mps0explstlst_t ; // with location information typedef ats_ptr_type s0rtext_t ; typedef ats_ptr_type s0qua_t ; typedef ats_ptr_type s0qualst_t ; typedef ats_ptr_type s0qualstlst_t ; typedef ats_ptr_type s0qualstopt_t ; typedef ats_ptr_type impqi0de_t ; typedef ats_ptr_type sp0at_t ; typedef ats_ptr_type d0atarg_t ; typedef ats_ptr_type d0atarglst_t ; typedef ats_ptr_type s0rtdef_t ; typedef ats_ptr_type s0rtdeflst_t ; typedef ats_ptr_type s0tacon_t ; typedef ats_ptr_type s0taconlst_t ; typedef ats_ptr_type s0tacst_t ; typedef ats_ptr_type s0tacstlst_t ; typedef ats_ptr_type s0tavar_t ; typedef ats_ptr_type s0tavarlst_t ; typedef ats_ptr_type s0expdef_t ; typedef ats_ptr_type s0expdeflst_t ; typedef ats_ptr_type s0aspdec_t ; typedef ats_ptr_type d0atcon_t ; typedef ats_ptr_type d0atconlst_t ; typedef ats_ptr_type d0atdec_t ; typedef ats_ptr_type d0atdeclst_t ; typedef ats_ptr_type e0xndec_t ; typedef ats_ptr_type e0xndeclst_t ; typedef ats_ptr_type p0arg_t ; typedef ats_ptr_type p0arglst_t ; typedef ats_ptr_type d0arg_t ; typedef ats_ptr_type d0arglst_t ; typedef ats_ptr_type m0acarg_t ; typedef ats_ptr_type m0acarglst_t ; typedef ats_ptr_type extnamopt_t ; typedef ats_ptr_type d0cstdec_t ; typedef ats_ptr_type d0cstdeclst_t ; typedef ats_ptr_type p0at_t ; typedef ats_ptr_type p0atlst_t ; typedef ats_ptr_type labp0atlst_t ; typedef ats_ptr_type s0vararg_t ; typedef ats_ptr_type s0exparg_t ; typedef ats_ptr_type f0arg_t ; typedef ats_ptr_type f0arglst_t ; typedef ats_ptr_type s0elop_t ; typedef ats_ptr_type witht0ype_t ; typedef ats_ptr_type d0exp_t ; typedef ats_ptr_type d0explst_t ; typedef ats_ptr_type d0expopt_t ; typedef ats_ptr_type labd0explst_t ; typedef ats_ptr_type d0arrind_t ; typedef ats_ptr_type ifhead_t ; typedef ats_ptr_type casehead_t ; typedef ats_ptr_type loophead_t ; typedef ats_ptr_type tryhead_t ; typedef ats_ptr_type m0atch_t ; typedef ats_ptr_type m0atchlst_t ; typedef ats_ptr_type guap0at_t ; typedef ats_ptr_type c0lau_t ; typedef ats_ptr_type c0laulst_t ; typedef ats_ptr_type sc0lau_t ; typedef ats_ptr_type sc0laulst_t ; typedef ats_ptr_type i0nvarg_t ; typedef ats_ptr_type i0nvarglst_t ; typedef ats_ptr_type i0nvresstate_t ; typedef ats_ptr_type loopi0nv_t ; typedef ats_ptr_type initestpost_t ; typedef ats_ptr_type v0aldec_t ; typedef ats_ptr_type v0aldeclst_t ; typedef ats_ptr_type f0undec_t ; typedef ats_ptr_type f0undeclst_t ; typedef ats_ptr_type v0arwth_t ; typedef ats_ptr_type v0ardec_t ; typedef ats_ptr_type v0ardeclst_t ; typedef ats_ptr_type m0acdef_t ; typedef ats_ptr_type m0acdeflst_t ; typedef ats_ptr_type i0mpdec_t ; typedef ats_ptr_type d0ec_t ; typedef ats_ptr_type d0eclst_t ; typedef ats_ptr_type d0ecllst_t ; typedef ats_ptr_type guad0ec_t ; /* ****** ****** */ extern abskind_t abskind_prop (void) ; extern abskind_t abskind_type (void) ; extern abskind_t abskind_t0ype (void) ; extern abskind_t abskind_view (void) ; extern abskind_t abskind_viewtype (void) ; extern abskind_t abskind_viewt0ype (void) ; extern dcstkind_t dcstkind_fun (void) ; extern dcstkind_t dcstkind_val (void) ; extern dcstkind_t dcstkind_castfn (void) ; extern dcstkind_t dcstkind_praxi (void) ; extern dcstkind_t dcstkind_prfun (void) ; extern dcstkind_t dcstkind_prval (void) ; extern datakind_t datakind_prop (void) ; extern datakind_t datakind_type (void) ; extern datakind_t datakind_view (void) ; extern datakind_t datakind_viewtype (void) ; extern stadefkind_t stadefkind_generic (void) ; extern stadefkind_t stadefkind_prop (t0kn_t) ; extern stadefkind_t stadefkind_type (t0kn_t) ; extern stadefkind_t stadefkind_view (t0kn_t) ; extern stadefkind_t stadefkind_viewtype (t0kn_t) ; extern valkind_t valkind_val (void) ; extern valkind_t valkind_valminus (void) ; extern valkind_t valkind_valplus (void) ; extern valkind_t valkind_prval (void) ; extern funkind_t funkind_fn (void) ; extern funkind_t funkind_fnstar (void) ; extern funkind_t funkind_fun (void) ; extern funkind_t funkind_castfn (void) ; extern funkind_t funkind_prfn (void) ; extern funkind_t funkind_prfun (void) ; extern lamkind_t lamkind_lam (t0kn_t) ; extern lamkind_t lamkind_atlam (t0kn_t) ; extern lamkind_t lamkind_llam (t0kn_t) ; extern lamkind_t lamkind_atllam (t0kn_t) ; extern fixkind_t fixkind_fix (t0kn_t) ; extern fixkind_t fixkind_atfix (t0kn_t) ; extern srpifkindtok_t srpifkindtok_if (t0kn_t) ; extern srpifkindtok_t srpifkindtok_ifdef (t0kn_t) ; extern srpifkindtok_t srpifkindtok_ifndef (t0kn_t) ; /* ****** ****** */ extern i0de_t i0de_make_ampersand (t0kn_t) ; extern i0de_t i0de_make_backslash (t0kn_t) ; extern i0de_t i0de_make_bang (t0kn_t) ; extern i0de_t i0de_make_eq (t0kn_t) ; extern i0de_t i0de_make_gt (t0kn_t) ; extern i0de_t i0de_make_gtlt (t0kn_t) ; extern i0de_t i0de_make_lt (t0kn_t) ; extern i0de_t i0de_make_minusgt (t0kn_t) ; extern i0de_t i0de_make_minuslt (t0kn_t) ; extern i0de_t i0de_make_minusltgt (t0kn_t) ; extern i0de_t i0de_make_module (t0kn_t) ; extern i0de_t i0de_make_r0ead (t0kn_t) ; extern i0de_t i0de_make_tilda (t0kn_t) ; extern i0de_t i0de_make_t0ype (t0kn_t) ; extern i0de_t i0de_make_viewt0ype (t0kn_t) ; extern i0de_t i0de_make_DO (t0kn_t) ; extern i0de_t i0de_make_IN (t0kn_t) ; extern i0de_t i0de_make_WHILE (t0kn_t) ; extern i0delst_t i0delst_nil (void) ; extern i0delst_t i0delst_sing (i0de_t) ; extern i0delst_t i0delst_cons (i0de_t, i0delst_t) ; extern i0delstlst_t i0delstlst_nil (void) ; extern i0delstlst_t i0delstlst_cons (i0delst_t, i0delstlst_t) ; extern l0ab_t l0ab_ide (i0de_t) ; extern l0ab_t l0ab_int (i0nt_t) ; extern i0de_t stai0de_make (i0de_t) ; /* ****** ****** */ extern p0rec_t p0rec_emp (void) ; extern p0rec_t p0rec_ide (i0de_t) ; extern p0rec_t p0rec_int (i0nt_t) ; extern p0rec_t p0rec_opr (i0de_t, i0de_t/*opr*/, i0nt_t) ; /* ****** ****** */ extern e0xp_t e0xp_app (e0xp_t, e0xp_t) ; extern e0xp_t e0xp_char (c0har_t) ; extern e0xp_t e0xp_eval (t0kn_t, e0xp_t, t0kn_t) ; extern e0xp_t e0xp_float (f0loat_t) ; extern e0xp_t e0xp_ide (i0de_t) ; extern e0xp_t e0xp_int (i0nt_t) ; extern e0xp_t e0xp_list (t0kn_t, e0xplst_t, t0kn_t) ; extern e0xp_t e0xp_string (s0tring_t) ; extern e0xplst_t e0xplst_nil (void) ; extern e0xplst_t e0xplst_cons (e0xp_t, e0xplst_t) ; extern e0xpopt_t e0xpopt_none (void) ; extern e0xpopt_t e0xpopt_some (e0xp_t) ; /* ****** ****** */ extern e0fftag_t e0fftag_cst (int, i0de_t) ; extern e0fftag_t e0fftag_var (i0de_t) ; extern e0fftag_t e0fftag_var_fun (t0kn_t) ; extern e0fftag_t e0fftag_int (i0nt_t) ; extern e0fftaglst_t e0fftaglst_nil (void) ; extern e0fftaglst_t e0fftaglst_cons (e0fftag_t, e0fftaglst_t) ; extern e0fftaglstopt_t e0fftaglstopt_none (void) ; extern e0fftaglstopt_t e0fftaglstopt_some (e0fftaglst_t) ; /* ****** ****** */ extern s0rtq_t s0rtq_str (s0tring_t) ; extern s0rtq_t s0rtq_sym (i0de_t) ; extern s0rt_t s0rt_prop (t0kn_t) ; extern s0rt_t s0rt_type (t0kn_t) ; extern s0rt_t s0rt_t0ype (t0kn_t) ; extern s0rt_t s0rt_view (t0kn_t) ; extern s0rt_t s0rt_viewtype (t0kn_t) ; extern s0rt_t s0rt_viewt0ype (t0kn_t) ; extern s0rt_t s0rt_app (s0rt_t, s0rt_t) ; extern s0rt_t s0rt_ide (i0de_t) ; extern s0rt_t s0rt_qid (s0rtq_t, i0de_t) ; extern s0rt_t s0rt_list (t0kn_t, s0rtlst_t, t0kn_t) ; extern s0rt_t s0rt_tup (t0kn_t, s0rtlst_t, t0kn_t) ; extern s0rtlst_t s0rtlst_nil (void) ; extern s0rtlst_t s0rtlst_cons (s0rt_t, s0rtlst_t) ; extern s0rtopt_t s0rtopt_none (void) ; extern s0rtopt_t s0rtopt_some (s0rt_t) ; extern s0rtpol_t s0rtpol_make (s0rt_t, int) ; /* ****** ****** */ /* ** datasort declaration */ extern d0atsrtcon_t d0atsrtcon_make_none (i0de_t) ; extern d0atsrtcon_t d0atsrtcon_make_some (i0de_t, s0rt_t) ; extern d0atsrtconlst_t d0atsrtconlst_nil (void) ; extern d0atsrtconlst_t d0atsrtconlst_cons (d0atsrtcon_t, d0atsrtconlst_t) ; extern d0atsrtdec_t d0atsrtdec_make (i0de_t, d0atsrtconlst_t) ; extern d0atsrtdeclst_t d0atsrtdeclst_nil (void) ; extern d0atsrtdeclst_t d0atsrtdeclst_cons (d0atsrtdec_t, d0atsrtdeclst_t) ; /* ****** ****** */ /* ** static qualifiers */ extern s0taq_t s0taq_symdot (i0de_t) ; extern s0taq_t s0taq_symcolon (i0de_t) ; extern s0taq_t s0taq_fildot (s0tring_t) ; /* ** dynamic qualifiers */ extern d0ynq_t d0ynq_symcolon(i0de_t) ; extern d0ynq_t d0ynq_symdot(i0de_t) ; extern d0ynq_t d0ynq_symdot_symcolon(i0de_t, i0de_t) ; extern d0ynq_t d0ynq_fildot(s0tring_t) ; extern d0ynq_t d0ynq_fildot_symcolon(s0tring_t, i0de_t) ; /* ****** ****** */ /* ** (qualified) static identifiers */ extern sqi0de_t sqi0de_make_none (i0de_t) ; extern sqi0de_t sqi0de_make_some (s0taq_t, i0de_t) ; /* ** (qualified) dynamic identifiers */ extern dqi0de_t dqi0de_make_none (i0de_t) ; extern dqi0de_t dqi0de_make_some (d0ynq_t, i0de_t) ; /* ** (qualified) array identifiers */ extern arrqi0de_t arrqi0de_make_none (i0de_t) ; extern arrqi0de_t arrqi0de_make_some (d0ynq_t, i0de_t) ; /* ** (qualified) template identifiers */ extern tmpqi0de_t tmpqi0de_make_none (i0de_t) ; extern tmpqi0de_t tmpqi0de_make_some (d0ynq_t, i0de_t) ; /* ****** ****** */ /* ** static arguments */ extern s0arg_t s0arg_make (i0de_t, s0rtopt_t) ; extern s0arg_t s0arg_make_none (i0de_t) ; extern s0arglst_t s0arglst_nil (void) ; extern s0arglst_t s0arglst_cons (s0arg_t, s0arglst_t) ; extern s0arglstlst_t s0arglstlst_nil (void) ; extern s0arglstlst_t s0arglstlst_cons (s0arglst_t, s0arglstlst_t) ; extern s0arglstlst_t s0arglstlst_cons_ide (i0de_t, s0arglstlst_t) ; /* ****** ****** */ extern impqi0de_t impqi0de_make_none (dqi0de_t) ; extern impqi0de_t impqi0de_make_some (tmpqi0de_t, s0explst_t, t1mps0explstlst_t, t0kn_t) ; /* ****** ****** */ extern sp0at_t sp0at_con (sqi0de_t, s0arglst_t, t0kn_t) ; /* ****** ****** */ /* ** static expressions */ extern s0exp_t s0exp_ann (s0exp_t, s0rt_t) ; extern s0exp_t s0exp_app (s0exp_t, s0exp_t) ; extern s0exp_t s0exp_char (c0har_t) ; extern s0exp_t s0exp_exi (t0kn_t, int/*funres*/, s0qualst_t, t0kn_t) ; extern s0expext_t s0expext_nam (t0kn_t, s0tring_t/*name*/) ; extern s0expext_t s0expext_app (s0expext_t/*fun*/, s0exp_t/*arg*/) ; extern s0exp_t s0exp_extern (s0expext_t) ; extern s0exp_t s0exp_ide (i0de_t) ; extern s0exp_t s0exp_imp (t0kn_t, e0fftaglst_t, t0kn_t) ; extern s0exp_t s0exp_imp_emp (t0kn_t) ; extern s0exp_t s0exp_int (i0nt_t) ; extern s0exp_t s0exp_intsp_err (i0nt_t) ; /* error handling */ extern s0exp_t s0exp_lams (t0kn_t, s0arglstlst_t, s0rtopt_t, s0exp_t) ; extern s0exp_t s0exp_list (t0kn_t, s0explst_t, t0kn_t) ; extern s0exp_t s0exp_list2 (t0kn_t, s0explst_t, s0explst_t, t0kn_t) ; /* // HX-2010-12-04: inadequate design extern s0exp_t s0exp_named (i0de_t, s0exp_t) ; */ extern s0exp_t s0exp_opide (t0kn_t, i0de_t) ; extern s0exp_t s0exp_qid (s0taq_t, i0de_t) ; extern s0exp_t s0exp_struct (t0kn_t, labs0explst_t, t0kn_t) ; extern s0exp_t s0exp_tyarr (t0kn_t, s0exp_t, s0arrind_t) ; extern s0exp_t s0exp_tyrec (int, t0kn_t, labs0explst_t, t0kn_t) ; extern s0exp_t s0exp_tyrec_ext (t0kn_t, s0tring_t, labs0explst_t, t0kn_t) ; extern s0exp_t s0exp_tytup (int, t0kn_t, s0explst_t, t0kn_t) ; extern s0exp_t s0exp_tytup2 (int, t0kn_t, s0explst_t, s0explst_t, t0kn_t) ; extern s0exp_t s0exp_uni (t0kn_t, s0qualst_t, t0kn_t) ; extern s0exp_t s0exp_union (t0kn_t, s0exp_t, labs0explst_t, t0kn_t) ; extern s0explst_t s0explst_nil (void) ; extern s0explst_t s0explst_cons (s0exp_t, s0explst_t) ; extern s0expopt_t s0expopt_none (void) ; extern s0expopt_t s0expopt_some (s0exp_t) ; extern s0explstlst_t s0explstlst_nil (void) ; extern s0explstlst_t s0explstlst_cons (s0explst_t, s0explstlst_t) ; extern s0explstopt_t s0explstopt_none (void) ; extern s0explstopt_t s0explstopt_some (s0explst_t) ; extern labs0explst_t labs0explst_nil (void) ; extern labs0explst_t labs0explst_cons (l0ab_t, s0exp_t, labs0explst_t) ; extern s0arrind_t s0arrind_make_sing (s0explst_t, t0kn_t) ; extern s0arrind_t s0arrind_make_cons (s0explst_t, s0arrind_t) ; extern t1mps0explstlst_t gtlt_t1mps0expseqseq_nil (void) ; extern t1mps0explstlst_t gtlt_t1mps0expseqseq_cons_tok (t0kn_t, s0explst_t, t1mps0explstlst_t) ; // end of [extern] /* ****** ****** */ extern s0rtext_t s0rtext_srt (s0rt_t) ; extern s0rtext_t s0rtext_sub (t0kn_t, i0de_t, s0rtext_t, s0exp_t, s0explst_t, t0kn_t) ; extern s0qua_t s0qua_prop(s0exp_t) ; extern s0qua_t s0qua_vars(i0de_t, i0delst_t, s0rtext_t) ; extern s0qualst_t s0qualst_nil (void) ; extern s0qualst_t s0qualst_cons (s0qua_t, s0qualst_t) ; extern s0qualstlst_t s0qualstlst_nil (void) ; extern s0qualstlst_t s0qualstlst_cons (s0qualst_t, s0qualstlst_t) ; extern s0qualstopt_t s0qualstopt_none (void) ; extern s0qualstopt_t s0qualstopt_some (s0qualst_t) ; /* ****** ****** */ extern d0atarg_t d0atarg_srt (s0rtpol_t) ; extern d0atarg_t d0atarg_id_srt (i0de_t, s0rtpol_t) ; extern d0atarglst_t d0atarglst_nil (void) ; extern d0atarglst_t d0atarglst_cons (d0atarg_t, d0atarglst_t) ; /* ****** ****** */ extern s0rtdef_t s0rtdef_make (i0de_t, s0rtext_t) ; extern s0rtdeflst_t s0rtdeflst_nil (void) ; extern s0rtdeflst_t s0rtdeflst_cons (s0rtdef_t, s0rtdeflst_t) ; /* ****** ****** */ extern s0tacon_t s0tacon_make_none_none (i0de_t) ; extern s0tacon_t s0tacon_make_some_none (i0de_t, d0atarglst_t, t0kn_t) ; extern s0tacon_t s0tacon_make_none_some (i0de_t, s0exp_t) ; extern s0tacon_t s0tacon_make_some_some (i0de_t, d0atarglst_t, s0exp_t) ; extern s0taconlst_t s0taconlst_nil (void) ; extern s0taconlst_t s0taconlst_cons (s0tacon_t, s0taconlst_t) ; extern s0tacst_t s0tacst_make_none (i0de_t, s0rt_t) ; extern s0tacst_t s0tacst_make_some (i0de_t, d0atarglst_t, s0rt_t) ; extern s0tacstlst_t s0tacstlst_nil (void) ; extern s0tacstlst_t s0tacstlst_cons (s0tacst_t, s0tacstlst_t) ; extern s0tavar_t s0tavar_make (i0de_t, s0rt_t) ; extern s0tavarlst_t s0tavarlst_nil (void) ; extern s0tavarlst_t s0tavarlst_cons (s0tavar_t, s0tavarlst_t) ; /* ****** ****** */ extern s0expdef_t s0expdef_make (i0de_t, s0arglstlst_t, s0rtopt_t, s0exp_t) ; extern s0expdeflst_t s0expdeflst_nil (void) ; extern s0expdeflst_t s0expdeflst_cons (s0expdef_t, s0expdeflst_t) ; // extern s0aspdec_t s0aspdec_make (i0de_t, s0arglstlst_t, s0rtopt_t, s0exp_t) ; // extern d0atcon_t d0atcon_make (s0qualstlst_t, i0de_t, s0explstopt_t, s0expopt_t) ; extern d0atconlst_t d0atconlst_nil (void) ; extern d0atconlst_t d0atconlst_cons (d0atcon_t, d0atconlst_t) ; // extern d0atdec_t d0atdec_make_none (i0de_t, d0atconlst_t) ; extern d0atdec_t d0atdec_make_some (i0de_t, d0atarglst_t, t0kn_t, d0atconlst_t) ; extern d0atdeclst_t d0atdeclst_nil (void) ; extern d0atdeclst_t d0atdeclst_cons (d0atdec_t, d0atdeclst_t) ; // extern e0xndec_t e0xndec_make (s0qualstlst_t, i0de_t, s0expopt_t) ; extern e0xndeclst_t e0xndeclst_nil (void) ; extern e0xndeclst_t e0xndeclst_cons (e0xndec_t, e0xndeclst_t) ; /* ****** ****** */ extern p0arg_t p0arg_make_none (i0de_t) ; extern p0arg_t p0arg_make_some (i0de_t, s0exp_t) ; extern p0arglst_t p0arglst_nil (void) ; extern p0arglst_t p0arglst_cons (p0arg_t, p0arglst_t) ; // extern d0arg_t d0arg_var (i0de_t) ; extern d0arg_t d0arg_dyn (t0kn_t, p0arglst_t, t0kn_t) ; extern d0arg_t d0arg_dyn2 (t0kn_t, p0arglst_t, p0arglst_t, t0kn_t) ; extern d0arg_t d0arg_sta (t0kn_t, s0qualst_t, t0kn_t) ; extern d0arglst_t d0arglst_nil (void) ; extern d0arglst_t d0arglst_cons (d0arg_t, d0arglst_t) ; // extern m0acarg_t m0acarg_one (i0de_t) ; extern m0acarg_t m0acarg_lst (t0kn_t, i0delst_t, t0kn_t) ; extern m0acarglst_t m0acarglst_nil () ; extern m0acarglst_t m0acarglst_cons (m0acarg_t, m0acarglst_t) ; /* ****** ****** */ extern extnamopt_t extnamopt_none (void) ; extern extnamopt_t extnamopt_some (s0tring_t) ; extern d0cstdec_t d0cstdec_make (i0de_t, d0arglst_t, e0fftaglstopt_t, s0exp_t, extnamopt_t) ; extern d0cstdeclst_t d0cstdeclst_nil (void) ; extern d0cstdeclst_t d0cstdeclst_cons (d0cstdec_t, d0cstdeclst_t) ; /* ****** ****** */ extern p0at_t p0at_ann (p0at_t, s0exp_t) ; extern p0at_t p0at_apps (p0at_t, p0atlst_t) ; extern p0at_t p0at_as (i0de_t, p0at_t) ; extern p0at_t p0at_char (c0har_t) ; extern p0at_t p0at_exist (t0kn_t, s0arglst_t, t0kn_t) ; extern p0at_t p0at_float (f0loat_t); extern p0at_t p0at_free (t0kn_t, p0at_t); extern p0at_t p0at_ide (i0de_t) ; extern p0at_t p0at_int (i0nt_t) ; extern p0at_t p0at_list (t0kn_t, p0atlst_t, t0kn_t) ; extern p0at_t p0at_list2 (t0kn_t, p0atlst_t, p0atlst_t, t0kn_t) ; extern p0at_t p0at_lst (t0kn_t, p0atlst_t, t0kn_t) ; extern p0at_t p0at_qid (d0ynq_t, i0de_t) ; extern p0at_t p0at_opide (t0kn_t, i0de_t) ; extern p0at_t p0at_rec (int, t0kn_t, labp0atlst_t, t0kn_t) ; extern p0at_t p0at_ref (t0kn_t, i0de_t); extern p0at_t p0at_refas (t0kn_t, i0de_t, p0at_t); extern p0at_t p0at_svararg (t0kn_t, s0vararg_t, t0kn_t) ; extern p0at_t p0at_string (s0tring_t) ; extern p0at_t p0at_tup (int, t0kn_t, p0atlst_t, t0kn_t) ; extern p0at_t p0at_tup2 (int, t0kn_t, p0atlst_t, p0atlst_t, t0kn_t) ; // extern p0atlst_t p0atlst_nil (void) ; extern p0atlst_t p0atlst_cons (p0at_t, p0atlst_t) ; // extern labp0atlst_t labp0atlst_nil (void) ; extern labp0atlst_t labp0atlst_dot (void) ; extern labp0atlst_t labp0atlst_cons (l0ab_t, p0at_t, labp0atlst_t) ; // extern s0vararg_t s0vararg_one (void) ; extern s0vararg_t s0vararg_all (void) ; extern s0vararg_t s0vararg_seq (s0arglst_t) ; /* ****** ****** */ extern s0exparg_t s0exparg_one (void) ; extern s0exparg_t s0exparg_all (void) ; extern s0exparg_t s0exparg_seq (s0explst_t) ; extern f0arg_t f0arg_sta1 (t0kn_t, s0qualst_t, t0kn_t) ; extern f0arg_t f0arg_sta2 (t0kn_t, s0arglst_t, t0kn_t) ; extern f0arg_t f0arg_dyn (p0at_t) ; extern f0arg_t f0arg_met_none (t0kn_t) ; extern f0arg_t f0arg_met_some (t0kn_t, s0explst_t, t0kn_t) ; extern f0arglst_t f0arglst_nil (void) ; extern f0arglst_t f0arglst_cons (f0arg_t, f0arglst_t) ; extern s0elop_t s0elop_make (int, t0kn_t) ; extern witht0ype_t witht0ype_none (void) ; extern witht0ype_t witht0ype_prop (s0exp_t) ; extern witht0ype_t witht0ype_type (s0exp_t) ; extern witht0ype_t witht0ype_view (s0exp_t) ; extern witht0ype_t witht0ype_viewtype (s0exp_t) ; /* ****** ****** */ /* ** dynamic expressions */ extern d0exp_t d0exp_ann (d0exp_t, s0exp_t) ; // extern d0exp_t d0exp_apps (d0exp_t, d0explst_t) ; // extern d0exp_t d0exp_arrinit_none (t0kn_t, s0exp_t, d0explst_t /*elt*/, t0kn_t) ; extern d0exp_t d0exp_arrinit_some (t0kn_t, s0exp_t, d0exp_t /*asz*/, d0explst_t /*elt*/, t0kn_t) ; // extern d0exp_t d0exp_arrsize (t0kn_t, s0exp_t, t0kn_t/*lparen*/, d0explst_t, t0kn_t/*rparen*/) ; // extern d0exp_t d0exp_arrsub (arrqi0de_t, d0arrind_t) ; // extern d0exp_t d0exp_char (t0kn_t) ; // extern d0exp_t d0exp_caseof (casehead_t, d0exp_t, t0kn_t, c0laulst_t) ; // extern d0exp_t d0exp_crypt (int, t0kn_t) ; // extern d0exp_t d0exp_decseq (t0kn_t, d0eclst_t, t0kn_t) ; // extern d0exp_t d0exp_delay (int/*lin*/, t0kn_t) ; // extern d0exp_t d0exp_dynload (t0kn_t) ; // // HX: [d0exp_effmask_*] are implemented in [ats_effect.dats] // extern d0exp_t d0exp_effmask_all (t0kn_t) ; extern d0exp_t d0exp_effmask_exn (t0kn_t) ; extern d0exp_t d0exp_effmask_ntm (t0kn_t) ; extern d0exp_t d0exp_effmask_ref (t0kn_t) ; // extern d0exp_t d0exp_empty (void) ; // extern d0exp_t d0exp_exist (t0kn_t, s0exparg_t, t0kn_t, d0exp_t, t0kn_t) ; // extern d0exp_t d0exp_extval (t0kn_t, s0exp_t, s0tring_t, t0kn_t) ; // extern d0exp_t d0exp_fix (fixkind_t, i0de_t, f0arglst_t, s0expopt_t, e0fftaglstopt_t, d0exp_t) ; // extern d0exp_t d0exp_float (f0loat_t) ; extern d0exp_t d0exp_floatsp (f0loatsp_t) ; // extern d0exp_t d0exp_foldat (t0kn_t, d0explst_t) ; // extern d0exp_t d0exp_for_itp (loophead_t, initestpost_t, d0exp_t) ; // extern d0exp_t d0exp_freeat (t0kn_t, d0explst_t) ; // extern d0exp_t d0exp_ide (i0de_t) ; extern d0exp_t d0exp_idext (i0de_t) ; // extern d0exp_t d0exp_if_none (ifhead_t, d0exp_t, d0exp_t) ; extern d0exp_t d0exp_if_some (ifhead_t, d0exp_t, d0exp_t, d0exp_t) ; // extern d0exp_t d0exp_int (i0nt_t) ; extern d0exp_t d0exp_intsp (i0ntsp_t) ; // extern d0exp_t d0exp_lam (lamkind_t, f0arglst_t, s0expopt_t, e0fftaglstopt_t, d0exp_t) ; // extern d0exp_t d0exp_let_seq (t0kn_t, d0eclst_t, t0kn_t, d0explst_t, t0kn_t) ; // extern d0exp_t d0exp_list (t0kn_t, d0explst_t, t0kn_t) ; extern d0exp_t d0exp_list2 (t0kn_t, d0explst_t, d0explst_t, t0kn_t) ; // extern d0exp_t d0exp_lst ( int, t0kn_t, s0expopt_t, t0kn_t/*lparen*/, d0explst_t, t0kn_t/*rparen*/ ) ; // end of [d0exp_lst] extern d0exp_t d0exp_lst_quote (t0kn_t, d0explst_t, t0kn_t) ; // extern d0exp_t d0exp_loopexn (int, t0kn_t) ; // extern d0exp_t d0exp_macsyn_cross (t0kn_t, d0explst_t, t0kn_t) ; extern d0exp_t d0exp_macsyn_decode (t0kn_t, d0explst_t, t0kn_t) ; extern d0exp_t d0exp_macsyn_encode_seq (t0kn_t, d0explst_t, t0kn_t) ; // extern d0exp_t d0exp_opide (t0kn_t, i0de_t) ; extern d0exp_t d0exp_ptrof (t0kn_t) ; extern d0exp_t d0exp_qid (d0ynq_t, i0de_t) ; extern d0exp_t d0exp_raise (t0kn_t, d0exp_t) ; extern d0exp_t d0exp_rec (int, t0kn_t, labd0explst_t, t0kn_t) ; extern d0exp_t d0exp_scaseof (casehead_t, s0exp_t, t0kn_t, sc0laulst_t) ; extern d0exp_t d0exp_sel_lab (t0kn_t, l0ab_t) ; extern d0exp_t d0exp_sel_ind (t0kn_t, d0arrind_t) ; extern d0exp_t d0exp_seq (t0kn_t, d0explst_t, t0kn_t) ; extern d0exp_t d0exp_sexparg (t0kn_t, s0exparg_t, t0kn_t) ; extern d0exp_t d0exp_sif (ifhead_t, s0exp_t, d0exp_t, d0exp_t) ; extern d0exp_t d0exp_string (s0tring_t) ; extern d0exp_t d0exp_tmpid (tmpqi0de_t, s0explst_t, t1mps0explstlst_t, t0kn_t) ; extern d0exp_t d0exp_trywith_seq (tryhead_t, d0explst_t, t0kn_t, c0laulst_t) ; extern d0exp_t d0exp_tup (int, t0kn_t, d0explst_t, t0kn_t) ; extern d0exp_t d0exp_tup2 (int, t0kn_t, d0explst_t, d0explst_t, t0kn_t) ; extern d0exp_t d0exp_viewat (t0kn_t) ; extern d0exp_t d0exp_where (d0exp_t, d0eclst_t, t0kn_t) ; extern d0exp_t d0exp_while (loophead_t, d0exp_t, d0exp_t) ; // extern d0exp_t d0exp_FILENAME (t0kn_t) ; // a special string constant extern d0exp_t d0exp_LOCATION (t0kn_t) ; // a special string constant // extern d0explst_t d0explst_nil (void) ; extern d0explst_t d0explst_cons (d0exp_t, d0explst_t) ; extern d0explst_t d0explst_sing (d0exp_t) ; // extern d0expopt_t d0expopt_none (void) ; extern d0expopt_t d0expopt_some (d0exp_t) ; // extern labd0explst_t labd0explst_nil (void) ; extern labd0explst_t labd0explst_cons (l0ab_t, d0exp_t, labd0explst_t) ; // extern d0arrind_t d0arrind_make_sing (d0explst_t, t0kn_t) ; extern d0arrind_t d0arrind_make_cons (d0explst_t, d0arrind_t) ; /* ****** ****** */ extern ifhead_t ifhead_make (t0kn_t, i0nvresstate_t) ; extern casehead_t casehead_make (int, t0kn_t, i0nvresstate_t) ; extern loophead_t loophead_make_none (t0kn_t) ; extern loophead_t loophead_make_some (t0kn_t, loopi0nv_t, t0kn_t) ; extern tryhead_t tryhead_make (t0kn_t) ; /* ****** ****** */ /* ** pattern matching */ extern m0atch_t m0atch_make_none (d0exp_t) ; extern m0atch_t m0atch_make_some (d0exp_t, p0at_t) ; extern m0atchlst_t m0atchlst_nil (void) ; extern m0atchlst_t m0atchlst_cons (m0atch_t, m0atchlst_t) ; extern guap0at_t guap0at_make_none (p0at_t) ; extern guap0at_t guap0at_make_some (p0at_t, d0exp_t) ; extern c0lau_t c0lau_make (guap0at_t, int, int, d0exp_t) ; extern c0laulst_t c0laulst_nil (void) ; extern c0laulst_t c0laulst_cons (c0lau_t, c0laulst_t) ; extern sc0lau_t sc0lau_make (sp0at_t, d0exp_t) ; extern sc0laulst_t sc0laulst_nil (void) ; extern sc0laulst_t sc0laulst_cons (sc0lau_t, sc0laulst_t) ; /* ****** ****** */ extern i0nvarg_t i0nvarg_make_none (i0de_t) ; extern i0nvarg_t i0nvarg_make_some (i0de_t, s0exp_t) ; extern i0nvarglst_t i0nvarglst_nil (void) ; extern i0nvarglst_t i0nvarglst_cons (i0nvarg_t, i0nvarglst_t) ; extern i0nvresstate_t i0nvresstate_none (void) ; extern i0nvresstate_t i0nvresstate_some (s0qualstopt_t, i0nvarglst_t) ; extern loopi0nv_t loopi0nv_make (s0qualstopt_t, s0explstopt_t, i0nvarglst_t, i0nvresstate_t) ; extern initestpost_t initestpost_make (t0kn_t, d0explst_t, t0kn_t, d0explst_t, t0kn_t, d0explst_t, t0kn_t) ; // end of [extern] /* ****** ****** */ extern v0aldec_t v0aldec_make (p0at_t, d0exp_t, witht0ype_t) ; extern v0aldeclst_t v0aldeclst_nil (void) ; extern v0aldeclst_t v0aldeclst_cons (v0aldec_t, v0aldeclst_t) ; extern f0undec_t f0undec_make_none (i0de_t, f0arglst_t, d0exp_t, witht0ype_t) ; extern f0undec_t f0undec_make_some (i0de_t, f0arglst_t, e0fftaglstopt_t, s0exp_t, d0exp_t, witht0ype_t) ; extern f0undeclst_t f0undeclst_nil (void) ; extern f0undeclst_t f0undeclst_cons (f0undec_t, f0undeclst_t) ; extern v0arwth_t v0arwth_none () ; extern v0arwth_t v0arwth_some (i0de_t) ; extern v0ardec_t v0ardec_make_some_none (int /*stadyn*/, i0de_t, v0arwth_t, s0exp_t) ; extern v0ardec_t v0ardec_make_none_some (int /*stadyn*/, i0de_t, v0arwth_t, d0exp_t) ; extern v0ardec_t v0ardec_make_some_some (int /*stadyn*/, i0de_t, s0exp_t, v0arwth_t, d0exp_t) ; extern v0ardeclst_t v0ardeclst_nil (void) ; extern v0ardeclst_t v0ardeclst_cons (v0ardec_t, v0ardeclst_t) ; /* ****** ****** */ extern m0acdef_t m0acdef_make (i0de_t, m0acarglst_t, d0exp_t) ; extern m0acdeflst_t m0acdeflst_nil (void) ; extern m0acdeflst_t m0acdeflst_cons (m0acdef_t, m0acdeflst_t) ; /* ****** ****** */ extern i0mpdec_t i0mpdec_make (impqi0de_t, f0arglst_t, s0expopt_t, d0exp_t) ; // end of [i0mpdec_make] /* ****** ****** */ /* ** static and dynamic declarations */ extern d0ec_t d0ec_infix (t0kn_t, p0rec_t, int, i0delst_t) ; extern d0ec_t d0ec_prefix (t0kn_t, p0rec_t, i0delst_t) ; extern d0ec_t d0ec_postfix (t0kn_t, p0rec_t, i0delst_t) ; extern d0ec_t d0ec_nonfix (t0kn_t, i0delst_t) ; extern d0ec_t d0ec_symintr (t0kn_t, i0delst_t) ; extern d0ec_t d0ec_include (int/*0:sta/1:dyn*/, s0tring_t) ; extern d0ec_t d0ec_e0xpundef (i0de_t) ; extern d0ec_t d0ec_e0xpdef (i0de_t, e0xpopt_t) ; extern d0ec_t d0ec_e0xpact_assert (e0xp_t) ; extern d0ec_t d0ec_e0xpact_error (e0xp_t) ; extern d0ec_t d0ec_e0xpact_print (e0xp_t) ; extern d0ec_t d0ec_srtdefs (s0rtdef_t, s0rtdeflst_t) ; extern d0ec_t d0ec_datsrts (int/*para*/, d0atsrtdec_t, d0atsrtdeclst_t) ; extern d0ec_t d0ec_stacons (abskind_t, s0tacon_t, s0taconlst_t) ; extern d0ec_t d0ec_stacsts (s0tacst_t, s0tacstlst_t) ; extern d0ec_t d0ec_stavars (s0tavar_t, s0tavarlst_t) ; extern d0ec_t d0ec_sexpdefs (stadefkind_t, s0expdef_t, s0expdeflst_t) ; extern d0ec_t d0ec_propdefs (t0kn_t, s0expdef_t, s0expdeflst_t) ; extern d0ec_t d0ec_typedefs (t0kn_t, s0expdef_t, s0expdeflst_t) ; extern d0ec_t d0ec_viewdefs (t0kn_t, s0expdef_t, s0expdeflst_t) ; extern d0ec_t d0ec_viewtypedefs (t0kn_t, s0expdef_t, s0expdeflst_t) ; extern d0ec_t d0ec_saspdec (s0aspdec_t) ; extern d0ec_t d0ec_dcstdecs (dcstkind_t, s0qualstlst_t, d0cstdec_t, d0cstdeclst_t) ; extern d0ec_t d0ec_datdecs (datakind_t, d0atdec_t, d0atdeclst_t, s0explstopt_t) ; extern d0ec_t d0ec_exndecs (t0kn_t, e0xndec_t, e0xndeclst_t) ; // extern d0ec_t d0ec_classdec_none (t0kn_t, i0de_t) ; extern d0ec_t d0ec_classdec_some (t0kn_t, i0de_t, s0exp_t) ; // extern d0ec_t d0ec_overload (t0kn_t, i0de_t, dqi0de_t) ; extern d0ec_t d0ec_overload_lrbrackets (t0kn_t, t0kn_t, t0kn_t, dqi0de_t) ; // extern d0ec_t d0ec_dynload (s0tring_t) ; extern d0ec_t d0ec_staload_none (s0tring_t) ; extern d0ec_t d0ec_staload_some (i0de_t, s0tring_t) ; extern d0ec_t d0ec_extype (s0tring_t, s0exp_t) ; extern d0ec_t d0ec_extval (s0tring_t, d0exp_t) ; extern d0ec_t d0ec_extcode_dyn (e0xtcode_t) ; extern d0ec_t d0ec_extcode_sta (e0xtcode_t) ; extern d0ec_t d0ec_valdecs (valkind_t, v0aldec_t, v0aldeclst_t) ; extern d0ec_t d0ec_valdecs_par (v0aldec_t, v0aldeclst_t) ; extern d0ec_t d0ec_valdecs_rec (v0aldec_t, v0aldeclst_t) ; extern d0ec_t d0ec_fundecs (funkind_t, s0qualstlst_t, f0undec_t, f0undeclst_t) ; extern d0ec_t d0ec_vardecs (v0ardec_t, v0ardeclst_t) ; extern d0ec_t d0ec_macdefs (int, m0acdef_t, m0acdeflst_t) ; extern d0ec_t d0ec_impdec (t0kn_t, s0arglstlst_t, i0mpdec_t) ; extern d0ec_t d0ec_local (t0kn_t, d0eclst_t, d0eclst_t, t0kn_t) ; extern d0ec_t d0ec_guadec (srpifkindtok_t, guad0ec_t) ; extern guad0ec_t guad0ec_one (e0xp_t, d0eclst_t, t0kn_t) ; extern guad0ec_t guad0ec_two (e0xp_t, d0eclst_t, d0eclst_t, t0kn_t) ; extern guad0ec_t guad0ec_cons (e0xp_t, d0eclst_t, srpifkindtok_t, guad0ec_t) ; extern d0eclst_t d0eclst_nil (void) ; extern d0eclst_t d0eclst_cons (d0ec_t, d0eclst_t) ; extern d0ecllst_t d0ecllst_nil (void) ; extern d0ecllst_t d0ecllst_cons (d0ecllst_t, d0ec_t) ; extern d0eclst_t d0ecllst_reverse (d0ecllst_t) ; /* ****** ****** */ typedef union { t0kn_t t0kn ; c0har_t c0har ; e0xtcode_t e0xtcode ; f0loat_t f0loat ; f0loatsp_t f0loatsp ; i0nt_t i0nt ; i0ntsp_t i0ntsp ; s0tring_t s0tring ; i0de_t i0de ; i0delst_t i0delst ; l0ab_t l0ab ; p0rec_t p0rec ; abskind_t abskind ; dcstkind_t dcstkind ; datakind_t datakind ; stadefkind_t stadefkind ; valkind_t valkind ; funkind_t funkind ; lamkind_t lamkind ; fixkind_t fixkind ; srpifkindtok_t srpifkindtok ; e0xp_t e0xp ; e0xplst_t e0xplst ; e0xpopt_t e0xpopt ; e0fftag_t e0fftag ; e0fftaglst_t e0fftaglst ; e0fftaglstopt_t e0fftaglstopt ; s0rt_t s0rt ; s0rtq_t s0rtq ; s0rtlst_t s0rtlst ; s0rtopt_t s0rtopt ; s0rtpol_t s0rtpol ; d0atsrtcon_t d0atsrtcon ; d0atsrtconlst_t d0atsrtconlst ; d0atsrtdec_t d0atsrtdec ; d0atsrtdeclst_t d0atsrtdeclst ; s0taq_t s0taq ; d0ynq_t d0ynq ; sqi0de_t sqi0de ; dqi0de_t dqi0de ; arrqi0de_t arrqi0de ; tmpqi0de_t tmpqi0de ; s0arg_t s0arg ; s0arglst_t s0arglst ; s0arglstlst_t s0arglstlst ; sp0at_t sp0at ; s0exp_t s0exp ; s0expext_t s0expext ; s0explst_t s0explst ; s0expopt_t s0expopt ; s0explstlst_t s0explstlst ; s0explstopt_t s0explstopt ; labs0explst_t labs0explst ; s0arrind_t s0arrind ; t1mps0explstlst_t t1mps0explstlst ; s0qua_t s0qua ; s0qualst_t s0qualst ; s0qualstlst_t s0qualstlst ; s0qualstopt_t s0qualstopt ; s0rtext_t s0rtext ; impqi0de_t impqi0de ; s0rtdef_t s0rtdef ; s0rtdeflst_t s0rtdeflst ; d0atarg_t d0atarg ; d0atarglst_t d0atarglst ; s0tacon_t s0tacon ; s0taconlst_t s0taconlst ; s0tacst_t s0tacst ; s0tacstlst_t s0tacstlst ; s0tavar_t s0tavar ; s0tavarlst_t s0tavarlst ; s0expdef_t s0expdef ; s0expdeflst_t s0expdeflst ; s0aspdec_t s0aspdec ; d0atcon_t d0atcon ; d0atconlst_t d0atconlst ; d0atdec_t d0atdec ; d0atdeclst_t d0atdeclst ; e0xndec_t e0xndec ; e0xndeclst_t e0xndeclst ; p0arg_t p0arg ; p0arglst_t p0arglst ; d0arg_t d0arg ; d0arglst_t d0arglst ; extnamopt_t extnamopt ; d0cstdec_t d0cstdec ; d0cstdeclst_t d0cstdeclst ; s0vararg_t s0vararg ; s0exparg_t s0exparg ; s0elop_t s0elop ; witht0ype_t witht0ype ; p0at_t p0at ; p0atlst_t p0atlst ; labp0atlst_t labp0atlst ; f0arg_t f0arg ; f0arglst_t f0arglst ; d0exp_t d0exp ; d0explst_t d0explst ; d0expopt_t d0expopt ; labd0explst_t labd0explst ; d0arrind_t d0arrind ; ifhead_t ifhead ; casehead_t casehead ; loophead_t loophead ; tryhead_t tryhead ; m0atch_t m0atch ; m0atchlst_t m0atchlst ; guap0at_t guap0at ; c0lau_t c0lau ; c0laulst_t c0laulst ; sc0lau_t sc0lau ; sc0laulst_t sc0laulst ; i0nvarg_t i0nvarg ; i0nvarglst_t i0nvarglst ; i0nvresstate_t i0nvresstate ; loopi0nv_t loopi0nv ; initestpost_t initestpost ; m0acarg_t m0acarg ; m0acarglst_t m0acarglst ; m0acdef_t m0acdef ; m0acdeflst_t m0acdeflst ; v0aldec_t v0aldec ; v0aldeclst_t v0aldeclst ; f0undec_t f0undec ; f0undeclst_t f0undeclst ; v0arwth_t v0arwth ; v0ardec_t v0ardec ; v0ardeclst_t v0ardeclst ; i0mpdec_t i0mpdec ; d0ec_t d0ec ; d0eclst_t d0eclst ; } YYSTYPE_union ; #define YYSTYPE YYSTYPE_union %} /* ****** ****** */ /* ** terminals */ %token ISSTATIC %token ISDYNAMIC %token TOKEN_eof %token LITERAL_char %token LITERAL_extcode %token LITERAL_float %token LITERAL_floatsp %token LITERAL_int %token LITERAL_intsp %token LITERAL_string %token IDENTIFIER_alp %token IDENTIFIER_sym %token IDENTIFIER_arr %token IDENTIFIER_tmp %token IDENTIFIER_ext %token IDENTIFIER_dlr %token IDENTIFIER_srp %token ABSPROP %token ABSTYPE %token ABST0YPE %token ABSVIEW %token ABSVIEWTYPE %token ABSVIEWT0YPE %token AND %token AS %token ASSUME %token ATLAM %token ATLLAM %token ATFIX %token BEGIN %token BREAK %token CASE %token CASEMINUS %token CASEPLUS %token CASTFN %token CLASSDEC %token CONTINUE %token DATASORT %token DATAPARASORT %token DATAPROP %token DATATYPE %token DATAVIEW %token DATAVIEWTYPE %token DO %token DYN %token DYNLOAD %token ELSE %token END %token EXCEPTION %token EXTERN %token FIX %token FN %token FNSTAR %token FOR %token FORSTAR %token FUN %token IF %token IMPLEMENT %token IN %token INFIX %token INFIXL %token INFIXR %token LAM %token LET %token LLAM %token LOCAL %token MACDEF %token MACRODEF %token NONFIX %token OF %token OP %token OVERLOAD %token PAR %token POSTFIX %token PRAXI %token PREFIX %token PRFN %token PRFUN %token PROPDEF %token PROPMINUS %token PROPPLUS %token PRVAL %token REC %token R0EAD %token SCASE %token SIF %token SORTDEF %token STA %token STADEF %token STAIF %token STALOAD %token STAVAR %token SYMELIM %token SYMINTR %token THEN %token TRY %token TYPEDEF %token TYPEMINUS %token TYPEPLUS %token T0YPE %token T0YPEMINUS %token T0YPEPLUS %token VAL %token VALMINUS %token VALPLUS %token VAR %token VIEWDEF %token VIEWMINUS %token VIEWPLUS %token VIEWTYPEDEF %token VIEWTYPEMINUS %token VIEWTYPEPLUS %token VIEWT0YPE %token VIEWT0YPEMINUS %token VIEWT0YPEPLUS %token WHEN %token WHERE %token WHILE %token WHILESTAR %token WITH %token WITHPROP %token WITHTYPE %token WITHVIEW %token WITHVIEWTYPE %token AMPERSAND %token BACKQUOTE %token BACKSLASH %token BANG %token BAR %token COMMA %token COLON %token SEMICOLON %token DOT %token EQ %token LT %token GT %token DOLLAR %token HASH %token TILDA %token DOTDOT %token DOTDOTDOT %token EQLT %token EQGT %token EQLTGT %token EQGTGT %token EQSLASHEQGT %token EQSLASHEQGTGT %token GTLT %token DOTLT %token GTDOT %token DOTLTGTDOT %token MINUSLT %token MINUSGT %token MINUSLTGT %token COLONLT %token COLONLTGT %token BACKQUOTELPAREN %token COMMALPAREN %token PERCENTLPAREN %token DLRARRSZ %token DLRLST_T %token DLRLST_VT %token DLRREC_T %token DLRREC_VT %token DLRTUP_T %token DLRTUP_VT %token DLRDELAY %token DLRLDELAY %token DLRDYNLOAD %token DLREFFMASK_ALL %token DLREFFMASK_EXN %token DLREFFMASK_NTM %token DLREFFMASK_REF %token DLRDECRYPT %token DLRENCRYPT %token DLREXTERN %token DLREXTVAL %token DLREXTYPE %token DLREXTYPE_STRUCT %token DLRFOLD %token DLRUNFOLD %token DLRRAISE %token DLRTYPEOF %token SRPFILENAME %token SRPLOCATION %token SRPCHARCOUNT %token SRPLINECOUNT %token SRPASSERT %token SRPDEFINE %token SRPELSE %token SRPELIF %token SRPELIFDEF %token SRPELIFNDEF %token SRPENDIF %token SRPERROR %token SRPIF %token SRPIFDEF %token SRPIFNDEF %token SRPINCLUDE %token SRPPRINT %token SRPTHEN %token SRPUNDEF %token FOLDAT %token FREEAT %token VIEWAT %token LPAREN %token RPAREN %token LBRACKET %token RBRACKET %token LBRACE %token RBRACE %token ATLPAREN %token ATLBRACKET %token ATLBRACE %token QUOTELPAREN %token QUOTELBRACKET %token QUOTELBRACE %token HASHLPAREN %token HASHLBRACKET %token HASHLBRACE /* ****** ****** */ /* ** precedence */ %nonassoc PATAS %nonassoc PATFREE %nonassoc SEXPLAM %nonassoc DEXPLAM %nonassoc DEXPFIX %nonassoc CLAUS %nonassoc DEXPCASE %nonassoc DEXPIF %nonassoc DEXPRAISE %nonassoc DEXPTRY %nonassoc DEXPFOR %nonassoc DEXPWHILE %nonassoc ELSE %nonassoc WHERE %right COLON /* : : */ %nonassoc BARCLAUSSEQNONE %nonassoc BAR %nonassoc GT %nonassoc TMPSEXP %nonassoc TMPSARG %nonassoc SARRIND %nonassoc LBRACKET %nonassoc SEXPDARGSEQEMPTY %nonassoc LBRACE /* ****** ****** */ /* ** nonterminals */ %type theStartEntry %type abskind %type dcstkind %type datakind %type stadefkind %type valkind %type funkind %type lamkind %type fixkind %type srpifkind %type srpelifkind // %type srpthenopt %type i0de %type i0de_dlr %type i0deseq %type i0dext %type l0ab %type stai0de %type p0rec %type e0xp %type atme0xp %type e0xpseq %type commae0xpseq %type e0xpopt %type e0ffid %type e0fftag %type e0fftagseq %type commae0fftagseq %type colonwith %type s0rt %type s0rtq %type s0rtid %type atms0rt %type s0rtseq %type commas0rtseq %type s0rtpol %type d0atsrtcon %type d0atsrtconseq %type bard0atsrtconseq %type d0atsrtdec %type andd0atsrtdecseq %type s0taq %type d0ynq %type si0de %type sqi0de %type commasi0deseq %type di0de %type dqi0de %type pi0de %type fi0de %type arri0de %type arrqi0de %type tmpi0de %type tmpqi0de %type colons0rtopt %type s0arg %type s0argseq %type commas0argseq %type s0argseqseq %type decs0argseq %type commadecs0argseq %type decs0argseqseq %type sp0at %type s0exp %type atms0exp %type apps0exp %type exts0exp %type s0expelt %type s0arrind %type s0qua %type s0quaseq %type barsemis0quaseq %type s0rtext %type s0expseq %type barsemis0expseq %type commas0expseq %type s0expseq1 %type labs0expseq %type commalabs0expseq %type t0mps0exp %type t1mps0exp %type t1mps0expseq %type commat1mps0expseq %type gtlt_t1mps0expseqseq %type impqi0de %type s0rtdef %type ands0rtdefseq %type d0atarg %type d0atargseq %type commad0atargseq %type s0tacon %type ands0taconseq %type s0tacst %type ands0tacstseq %type s0tavar %type ands0tavarseq %type s0expdef %type ands0expdefseq %type s0aspdec %type conq0uaseq %type coni0ndopt %type cona0rgopt %type d0atcon %type d0atconseq %type bard0atconseq %type d0atdec %type andd0atdecseq %type s0expdefseqopt %type e0xndec %type ande0xndecseq %type p0arg %type p0argseq %type commap0argseq %type d0arg %type d0argseq %type extnamopt %type d0cstdec %type andd0cstdecseq %type s0vararg %type s0exparg %type s0elop %type witht0ype %type p0at %type atmp0at %type argp0at %type argp0atseq %type p0atseq %type commap0atseq %type labp0atseq %type commalabp0atseq %type f0arg1 %type f0arg1seq %type f0arg2 %type f0arg2seq %type d0exp %type atmd0exp %type s0expdarg %type s0expdargseq %type argd0exp %type argd0expseq %type d0arrind %type colons0expopt %type funarrow %type caseinv %type ifhead %type sifhead %type casehead %type scasehead %type forhead %type whilehead %type tryhead %type d0expcommaseq %type commad0expseq %type d0expsemiseq0 %type d0expsemiseq1 %type labd0expseq %type commalabd0expseq %type m0atch %type m0atchseq %type andm0atchseq %type guap0at %type c0lau %type c0lauseq %type barc0lauseq %type sc0lau %type sc0lauseq %type barsc0lauseq %type i0nvqua %type i0nvmet %type i0nvarg %type i0nvargseq %type commai0nvargseq %type i0nvargstate %type i0nvresqua %type i0nvresstate %type loopi0nv %type initestpost %type m0arg %type m0argseq %type commam0argseq %type m0acarg %type m0acargseq %type m0acdef %type andm0acdefseq %type v0aldec %type andv0aldecseq %type f0undec %type andf0undecseq %type v0arwth %type v0ardec %type andv0ardecseq %type i0mpdec %type d0ec %type d0ecarg %type d0ecargseq // %type semicolonseq %type d0ec_sta %type guad0ec_sta %type d0ecseq_sta %type d0ecseq_sta_rev %type d0ec_dyn %type guad0ec_dyn %type d0ecseq_dyn %type d0ecseq_dyn_rev /* ****** ****** */ %start theStartEntry /* ****** ****** */ %% /* ****** ****** */ /* ** production rules */ theStartEntry : ISSTATIC d0ecseq_sta TOKEN_eof { $$ = $2 ; return 0 ; } | ISDYNAMIC d0ecseq_dyn TOKEN_eof { $$ = $2 ; return 0 ; } ; /* theStartEntry */ abskind : ABSPROP { $$ = abskind_prop () ; } | ABSTYPE { $$ = abskind_type () ; } | ABST0YPE { $$ = abskind_t0ype () ; } | ABSVIEW { $$ = abskind_view () ; } | ABSVIEWTYPE { $$ = abskind_viewtype () ; } | ABSVIEWT0YPE { $$ = abskind_viewt0ype () ; } ; /* abskind */ dcstkind : FUN { $$ = dcstkind_fun () ; } | VAL { $$ = dcstkind_val () ; } | CASTFN { $$ = dcstkind_castfn () ; } | PRAXI { $$ = dcstkind_praxi () ; } | PRFUN { $$ = dcstkind_prfun () ; } | PRVAL { $$ = dcstkind_prval () ; } ; /* dcstkind */ datakind : DATAPROP { $$ = datakind_prop () ; } | DATATYPE { $$ = datakind_type () ; } | DATAVIEW { $$ = datakind_view () ; } | DATAVIEWTYPE { $$ = datakind_viewtype () ; } ; /* datakind */ stadefkind : STADEF { $$ = stadefkind_generic () ; } | PROPDEF { $$ = stadefkind_prop ($1) ; } | TYPEDEF { $$ = stadefkind_type ($1) ; } | VIEWDEF { $$ = stadefkind_view ($1) ; } | VIEWTYPEDEF { $$ = stadefkind_viewtype ($1) ; } ; /* stadefkind */ valkind : VAL { $$ = valkind_val () ; } | VALMINUS { $$ = valkind_valminus () ; } | VALPLUS { $$ = valkind_valplus () ; } | PRVAL { $$ = valkind_prval () ; } ; /* valkind */ funkind : FN { $$ = funkind_fn () ; } | FNSTAR { $$ = funkind_fnstar () ; } | FUN { $$ = funkind_fun () ; } | CASTFN { $$ = funkind_castfn () ; } | PRFN { $$ = funkind_prfn () ; } | PRFUN { $$ = funkind_prfun () ; } ; /* funkind */ lamkind : LAM { $$ = lamkind_lam ($1) ; } | ATLAM { $$ = lamkind_atlam ($1) ; } | LLAM { $$ = lamkind_llam ($1) ; } | ATLLAM { $$ = lamkind_atllam ($1) ; } ; /* lamkind */ fixkind : FIX { $$ = fixkind_fix ($1) ; } | ATFIX { $$ = fixkind_atfix ($1) ; } ; /* fixkind */ srpifkind : SRPIF { $$ = srpifkindtok_if ($1) ; } | SRPIFDEF { $$ = srpifkindtok_ifdef ($1) ; } | SRPIFNDEF { $$ = srpifkindtok_ifndef ($1) ; } ; /* srpifkind */ srpelifkind : SRPELIF { $$ = srpifkindtok_if ($1) ; } | SRPELIFDEF { $$ = srpifkindtok_ifdef ($1) ; } | SRPELIFNDEF { $$ = srpifkindtok_ifndef ($1) ; } ; /* srpelifkind */ srpthenopt : /*(empty)*/ { ; } | SRPTHEN { ; } ; /* srpthenopt */ i0de : IDENTIFIER_alp { $$ = $1 ; } | IDENTIFIER_sym { $$ = $1 ; } | AMPERSAND { $$ = i0de_make_ampersand($1) ; } | BACKSLASH { $$ = i0de_make_backslash($1) ; } | BANG { $$ = i0de_make_bang($1) ; } | EQ { $$ = i0de_make_eq($1) ; } | GT { $$ = i0de_make_gt($1) ; } | GTLT { $$ = i0de_make_gtlt($1) ; } | LT { $$ = i0de_make_lt($1) ; } | MINUSGT { $$ = i0de_make_minusgt($1) ; } | MINUSLTGT { $$ = i0de_make_minusltgt($1) ; } | TILDA { $$ = i0de_make_tilda($1) ; } ; /* i0de */ i0de_dlr : IDENTIFIER_dlr { $$ = $1 ; } ; /* i0de_dlr */ i0deseq : /*(empty)*/ { $$ = i0delst_nil() ; } | i0de i0deseq { $$ = i0delst_cons($1, $2) ; } ; /* i0deseq */ i0dext : IDENTIFIER_ext { $$ = $1 ; } | DO { $$ = i0de_make_DO($1) ; } | WHILE { $$ = i0de_make_WHILE($1) ; } ; /* i0dext */ l0ab : i0de { $$ = l0ab_ide($1) ; } | LITERAL_int { $$ = l0ab_int($1) ; } | LPAREN l0ab RPAREN { $$ = $2 ; } ; /* l0ab */ stai0de : IDENTIFIER_alp { $$ = stai0de_make($1) ; } ; /* stai0de */ p0rec : /*(empty)*/ { $$ = p0rec_emp() ; } | LITERAL_int { $$ = p0rec_int($1) ; } | LPAREN i0de RPAREN { $$ = p0rec_ide($2) ; } | LPAREN i0de IDENTIFIER_sym LITERAL_int RPAREN { $$ = p0rec_opr($2, $3, $4) ; } ; /* p0rec */ e0xp : e0xp atme0xp { $$ = e0xp_app($1, $2) ; } | atme0xp { $$ = $1 ; } ; /* e0xp */ atme0xp : LITERAL_char { $$ = e0xp_char($1) ; } | LITERAL_float { $$ = e0xp_float($1) ; } | LITERAL_int { $$ = e0xp_int($1) ; } | LITERAL_string { $$ = e0xp_string($1) ; } | i0de { $$ = e0xp_ide($1) ; } | LPAREN e0xpseq RPAREN { $$ = e0xp_list($1, $2, $3) ; } | PERCENTLPAREN e0xp RPAREN { $$ = e0xp_eval($1, $2, $3) ; } ; /* atme0xp */ e0xpseq : /*(empty)*/ { $$ = e0xplst_nil() ; } | e0xp commae0xpseq { $$ = e0xplst_cons($1, $2) ; } ; /* e0xpseq */ commae0xpseq : /*(empty)*/ { $$ = e0xplst_nil() ; } | COMMA e0xp commae0xpseq { $$ = e0xplst_cons($2, $3) ; } ; /* commae0xpseq */ e0xpopt : /*(empty)*/ { $$ = e0xpopt_none() ; } | e0xp { $$ = e0xpopt_some($1) ; } ; /* e0xpopt */ e0ffid : IDENTIFIER_alp { $$ = $1 ; } ; /* e0ffid */ e0fftag : BANG e0ffid { $$ = e0fftag_cst (0, $2) ; } | TILDA e0ffid { $$ = e0fftag_cst (1, $2) ; } | e0ffid { $$ = e0fftag_var($1) ; } | FUN { $$ = e0fftag_var_fun($1) ; } | LITERAL_int { $$ = e0fftag_int($1) ; } ; /* e0fftag */ e0fftagseq : /*(empty)*/ { $$ = e0fftaglst_nil() ; } | e0fftag commae0fftagseq { $$ = e0fftaglst_cons($1, $2) ; } ; /* e0fftagseq */ commae0fftagseq : /*(empty)*/ { $$ = e0fftaglst_nil() ; } | COMMA e0fftag commae0fftagseq { $$ = e0fftaglst_cons($2, $3) ; } ; /* commae0fftagseq */ colonwith : COLON { $$ = e0fftaglstopt_none() ; } | COLONLTGT { $$ = e0fftaglstopt_some(e0fftaglst_nil()) ; } | COLONLT e0fftagseq GT { $$ = e0fftaglstopt_some($2) ; } ; /* colonwith */ s0rt : s0rt atms0rt { $$ = s0rt_app($1, $2) ; } | atms0rt { $$ = $1 ; } ; /* s0rt */ s0rtq : i0de_dlr DOT { $$ = s0rtq_sym($1) ; } | DOLLAR LITERAL_string DOT { $$ = s0rtq_str($2) ; } ; /* s0rtq */ s0rtid : IDENTIFIER_alp { $$ = $1 ; } | IDENTIFIER_sym { $$ = $1 ; } | T0YPE { $$ = i0de_make_t0ype($1) ; } | VIEWT0YPE { $$ = i0de_make_viewt0ype($1) ; } | BACKSLASH { $$ = i0de_make_backslash($1) ; } | MINUSGT { $$ = i0de_make_minusgt($1) ; } | MINUSLTGT { $$ = i0de_make_minusltgt($1) ; } ; /* s0rtid */ atms0rt : s0rtid { $$ = s0rt_ide($1) ; } | s0rtq s0rtid { $$ = s0rt_qid($1, $2) ; } | LPAREN s0rtseq RPAREN { $$ = s0rt_list($1, $2, $3) ; } | ATLPAREN s0rtseq RPAREN { $$ = s0rt_tup($1, $2, $3) ; } ; /* atms0rt */ s0rtseq : /*(empty)*/ { $$ = s0rtlst_nil() ; } | s0rt commas0rtseq { $$ = s0rtlst_cons($1, $2) ; } ; /* s0rtseq */ commas0rtseq : /*(empty)*/ { $$ = s0rtlst_nil() ; } | COMMA s0rt commas0rtseq { $$ = s0rtlst_cons($2, $3) ; } ; /* commas0rtseq */ s0rtpol : s0rt { $$ = s0rtpol_make($1, 0) ; } | PROPMINUS { $$ = s0rtpol_make(s0rt_prop($1), -1) ; } | PROPPLUS { $$ = s0rtpol_make(s0rt_prop($1), 1) ; } | TYPEMINUS { $$ = s0rtpol_make(s0rt_type($1), -1) ; } | TYPEPLUS { $$ = s0rtpol_make(s0rt_type($1), 1) ; } | T0YPEMINUS { $$ = s0rtpol_make(s0rt_t0ype($1), -1) ; } | T0YPEPLUS { $$ = s0rtpol_make(s0rt_t0ype($1), 1) ; } | VIEWMINUS { $$ = s0rtpol_make(s0rt_view($1), -1) ; } | VIEWPLUS { $$ = s0rtpol_make(s0rt_view($1), 1) ; } | VIEWTYPEMINUS { $$ = s0rtpol_make(s0rt_viewtype($1), -1) ; } | VIEWTYPEPLUS { $$ = s0rtpol_make(s0rt_viewtype($1), 1) ; } | VIEWT0YPEMINUS { $$ = s0rtpol_make(s0rt_viewt0ype($1), -1) ; } | VIEWT0YPEPLUS { $$ = s0rtpol_make(s0rt_viewt0ype($1), 1) ; } ; /* s0rtpol */ d0atsrtcon : i0de { $$ = d0atsrtcon_make_none($1) ; } | i0de OF s0rt { $$ = d0atsrtcon_make_some($1, $3) ; } ; /* d0atsrtcon */ d0atsrtconseq : bard0atsrtconseq { $$ = $1 ; } | d0atsrtcon bard0atsrtconseq { $$ = d0atsrtconlst_cons($1, $2) ; } ; /* d0atsrtconseq */ bard0atsrtconseq : /*(empty)*/ { $$ = d0atsrtconlst_nil() ; } | BAR d0atsrtcon bard0atsrtconseq { $$ = d0atsrtconlst_cons($2, $3) ; } ; /* bard0atsrtconseq */ d0atsrtdec : i0de EQ d0atsrtconseq { $$ = d0atsrtdec_make($1, $3) ; } ; /* d0atsrtdec */ andd0atsrtdecseq : /*(empty)*/ { $$ = d0atsrtdeclst_nil() ; } | AND d0atsrtdec andd0atsrtdecseq { $$ = d0atsrtdeclst_cons($2, $3) ; } ; /* andd0atsrtdecseq */ s0taq : i0de_dlr DOT { $$ = s0taq_symdot($1) ; } | i0de_dlr COLON { $$ = s0taq_symcolon($1) ; } | DOLLAR LITERAL_string DOT { $$ = s0taq_fildot($2) ; } ; /* s0taq */ d0ynq : i0de_dlr DOT { $$ = d0ynq_symdot($1) ; } | i0de_dlr COLON { $$ = d0ynq_symcolon($1) ; } | i0de_dlr i0de_dlr COLON { $$ = d0ynq_symdot_symcolon ($1, $2) ; } | DOLLAR LITERAL_string DOT { $$ = d0ynq_fildot($2) ; } | DOLLAR LITERAL_string i0de_dlr COLON { $$ = d0ynq_fildot_symcolon($2, $3) ; } ; /* d0ynq */ si0de : IDENTIFIER_alp { $$ = $1 ; } | IDENTIFIER_sym { $$ = $1 ; } | R0EAD { $$ = i0de_make_r0ead($1) ; } | AMPERSAND { $$ = i0de_make_ampersand($1) ; } | BACKSLASH { $$ = i0de_make_backslash($1) ; } | BANG { $$ = i0de_make_bang($1) ; } | GT { $$ = i0de_make_gt($1) ; } | LT { $$ = i0de_make_lt($1) ; } | MINUSGT { $$ = i0de_make_minusgt($1) ; } | TILDA { $$ = i0de_make_tilda($1) ; } ; /* si0de */ sqi0de : si0de { $$ = sqi0de_make_none($1) ; } | s0taq si0de { $$ = sqi0de_make_some($1, $2) ; } ; /* sqi0de */ commasi0deseq : /*(empty)*/ { $$ = i0delst_nil() ; } | COMMA si0de commasi0deseq { $$ = i0delst_cons($2, $3) ; } ; /* commasi0deseq */ di0de : IDENTIFIER_alp { $$ = $1 ; } | IDENTIFIER_sym { $$ = $1 ; } | BACKSLASH { $$ = i0de_make_backslash($1) ; } | BANG { $$ = i0de_make_bang($1) ; } | EQ { $$ = i0de_make_eq($1) ; } | GT { $$ = i0de_make_gt($1) ; } | GTLT { $$ = i0de_make_gtlt($1) ; } | LT { $$ = i0de_make_lt($1) ; } | TILDA { $$ = i0de_make_tilda($1) ; } ; /* di0de */ dqi0de : di0de { $$ = dqi0de_make_none($1) ; } | d0ynq di0de { $$ = dqi0de_make_some($1, $2) ; } ; /* dqi0de */ pi0de : IDENTIFIER_alp { $$ = $1 ; } | IDENTIFIER_sym { $$ = $1 ; } ; /* pi0de */ fi0de : di0de { $$ = $1 ; } | OP di0de { $$ = $2 ; } ; /* fi0de */ arri0de : IDENTIFIER_arr { $$ = $1 ; } ; /* arri0de */ arrqi0de : arri0de { $$ = arrqi0de_make_none($1) ; } | d0ynq arri0de { $$ = arrqi0de_make_some($1, $2) ; } ; /* arrqi0de */ tmpi0de : IDENTIFIER_tmp { $$ = $1 ; } ; /* tmpi0de */ tmpqi0de : tmpi0de { $$ = tmpqi0de_make_none($1) ; } | d0ynq tmpi0de { $$ = tmpqi0de_make_some($1, $2) ; } ; /* tmpqi0de */ colons0rtopt : /*(empty)*/ { $$ = s0rtopt_none() ; } | COLON s0rt { $$ = s0rtopt_some($2) ; } ; /* colons0rtopt */ s0arg : si0de colons0rtopt { $$ = s0arg_make($1, $2) ; } ; /* s0arg */ s0argseq : /*(empty)*/ { $$ = s0arglst_nil() ; } | s0arg commas0argseq { $$ = s0arglst_cons($1, $2) ; } ; /* s0argseq */ commas0argseq : /*(empty)*/ { $$ = s0arglst_nil() ; } | COMMA s0arg commas0argseq { $$ = s0arglst_cons($2, $3) ; } ; /* commas0argseq */ s0argseqseq : /*(empty)*/ { $$ = s0arglstlst_nil() ; } | si0de s0argseqseq { $$ = s0arglstlst_cons_ide($1, $2) ; } | LPAREN s0argseq RPAREN s0argseqseq { $$ = s0arglstlst_cons($2, $4); } ; /* s0argseqseq */ decs0argseq : /*(empty)*/ { $$ = s0arglst_nil() ; } %prec TMPSARG | s0arg commadecs0argseq { $$ = s0arglst_cons($1, $2) ; } ; /* decs0argseq */ commadecs0argseq : /*(empty)*/ { $$ = s0arglst_nil() ; } %prec TMPSARG | COMMA s0arg commadecs0argseq { $$ = s0arglst_cons($2, $3) ; } ; /* commadecs0argseq */ decs0argseqseq : /*(empty)*/ { $$ = s0arglstlst_nil() ; } | LBRACE decs0argseq RBRACE decs0argseqseq { $$ = s0arglstlst_cons($2, $4) ; } ; /* decs0argseqseq */ sp0at : sqi0de LPAREN s0argseq RPAREN { $$ = sp0at_con($1, $3, $4) ; } ; /* sp0at */ s0exp : apps0exp { $$ = $1 ; } | exts0exp { $$ = s0exp_extern($1) ; } | s0exp COLON s0rt { $$ = s0exp_ann($1, $3) ; } | LAM s0argseqseq colons0rtopt EQGT s0exp { $$ = s0exp_lams($1, $2, $3, $5) ; } %prec SEXPLAM ; /* s0exp */ atms0exp : LITERAL_char { $$ = s0exp_char($1) ; } | LITERAL_int { $$ = s0exp_int($1) ; } | LITERAL_intsp { $$ = s0exp_intsp_err($1) ; } | si0de { $$ = s0exp_ide($1) ; } | OP si0de { $$ = s0exp_opide($1, $2) ; } | s0taq si0de { $$ = s0exp_qid($1, $2) ; } | LPAREN s0expseq RPAREN { $$ = s0exp_list($1, $2, $3) ; } | LPAREN s0expseq BAR s0expseq RPAREN { $$ = s0exp_list2($1, $2, $4, $5) ; } | ATLPAREN s0expseq RPAREN { $$ = s0exp_tytup(0, $1, $2, $3) ; } | QUOTELPAREN s0expseq RPAREN { $$ = s0exp_tytup(1, $1, $2, $3) ; } | DLRTUP_T LPAREN s0expseq RPAREN { $$ = s0exp_tytup(2, $1, $3, $4) ; } | DLRTUP_VT LPAREN s0expseq RPAREN { $$ = s0exp_tytup(3, $1, $3, $4) ; } | ATLPAREN s0expseq BAR s0expseq RPAREN { $$ = s0exp_tytup2(0, $1, $2, $4, $5) ; } | QUOTELPAREN s0expseq BAR s0expseq RPAREN { $$ = s0exp_tytup2(1, $1, $2, $4, $5) ; } | DLRTUP_T LPAREN s0expseq BAR s0expseq RPAREN { $$ = s0exp_tytup2(2, $1, $3, $5, $6) ; } | DLRTUP_VT LPAREN s0expseq BAR s0expseq RPAREN { $$ = s0exp_tytup2(3, $1, $3, $5, $6) ; } | ATLBRACE labs0expseq RBRACE { $$ = s0exp_tyrec(0, $1, $2, $3) ; } | QUOTELBRACE labs0expseq RBRACE { $$ = s0exp_tyrec(1, $1, $2, $3) ; } | DLRREC_T LBRACE labs0expseq RBRACE { $$ = s0exp_tyrec(2, $1, $3, $4) ; } | DLRREC_VT LBRACE labs0expseq RBRACE { $$ = s0exp_tyrec(3, $1, $3, $4) ; } | DLREXTYPE_STRUCT LITERAL_string OF LBRACE labs0expseq RBRACE { $$ = s0exp_tyrec_ext($1, $2, $5, $6) ; } | ATLBRACKET s0exp RBRACKET LBRACKET s0arrind { $$ = s0exp_tyarr($1, $2, $5) ; } | MINUSLT e0fftagseq GT { $$ = s0exp_imp($1, $2, $3) ; } | MINUSLTGT { $$ = s0exp_imp_emp($1) ; } | LBRACE s0quaseq RBRACE { $$ = s0exp_uni($1, $2, $3) ; } | LBRACKET s0quaseq RBRACKET { $$ = s0exp_exi($1, 0/*funres*/, $2, $3) ; } | HASHLBRACKET s0quaseq RBRACKET { $$ = s0exp_exi($1, 1/*funres*/, $2, $3) ; } ; /* atms0exp */ apps0exp : apps0exp atms0exp { $$ = s0exp_app($1, $2) ; } | atms0exp { $$ = $1 ; } ; /* apps0exp */ exts0exp : DLREXTYPE LITERAL_string { $$ = s0expext_nam($1, $2) ; } | exts0exp atms0exp { $$ = s0expext_app($1, $2) ; } ; /* exts0exp */ s0expelt : /*(empty)*/ { $$ = s0expopt_none () ; } | LBRACE s0exp RBRACE { $$ = s0expopt_some ($2) ; } ; /* s0expelt */ s0arrind : s0expseq RBRACKET { $$ = s0arrind_make_sing($1, $2) ; } %prec SARRIND | s0expseq RBRACKET LBRACKET s0arrind { $$ = s0arrind_make_cons($1, $4) ; } ; /* s0arrind */ s0qua : apps0exp { $$ = s0qua_prop($1) ; } | si0de commasi0deseq COLON s0rtext { $$ = s0qua_vars($1, $2, $4) ; } ; /* s0qua */ s0quaseq : /*(empty)*/ { $$ = s0qualst_nil() ; } | s0qua barsemis0quaseq { $$ = s0qualst_cons($1, $2) ; } ; /* s0quaseq */ barsemis0quaseq : /*(empty)*/ { $$ = s0qualst_nil() ; } | BAR s0qua barsemis0quaseq { $$ = s0qualst_cons($2, $3) ; } | SEMICOLON s0qua barsemis0quaseq { $$ = s0qualst_cons($2, $3) ; } ; /* barsemis0quaseq */ s0rtext : s0rt { $$ = s0rtext_srt($1) ; } | LBRACE si0de COLON s0rtext BAR s0exp barsemis0expseq RBRACE { $$ = s0rtext_sub($1, $2, $4, $6, $7, $8) ; } ; /* s0rtext */ s0expseq : /*(empty)*/ { $$ = s0explst_nil() ; } | s0expseq1 { $$ = $1 ; } ; /* s0expseq */ barsemis0expseq : /*(empty)*/ { $$ = s0explst_nil() ; } | BAR s0exp barsemis0expseq { $$ = s0explst_cons($2, $3) ; } | SEMICOLON s0exp barsemis0expseq { $$ = s0explst_cons($2, $3) ; } ; /* barsemis0expseq */ commas0expseq : /*(empty)*/ { $$ = s0explst_nil() ; } | COMMA s0exp commas0expseq { $$ = s0explst_cons($2, $3) ; } ; /* commas0expseq */ s0expseq1 : s0exp commas0expseq { $$ = s0explst_cons($1, $2) ; } ; /* s0expseq1 */ labs0expseq : /*(empty)*/ { $$ = labs0explst_nil() ; } | l0ab EQ s0exp commalabs0expseq { $$ = labs0explst_cons($1, $3, $4) ; } ; /* labs0expseq */ commalabs0expseq : /*(empty)*/ { $$ = labs0explst_nil() ; } | COMMA l0ab EQ s0exp commalabs0expseq { $$ = labs0explst_cons($2, $4, $5) ; } ; /* commalabs0expseq */ t0mps0exp : atms0exp { $$ = $1 ; } | t0mps0exp atms0exp { $$ = s0exp_app($1, $2) ; } ; /* t0mps0exp */ t1mps0exp : t0mps0exp { $$ = $1 ; } %prec TMPSEXP ; /* t1mps0exp */ t1mps0expseq : /*(empty)*/ { $$ = s0explst_nil() ; } %prec TMPSEXP | t1mps0exp commat1mps0expseq { $$ = s0explst_cons($1, $2) ; } ; /* t1mps0expseq */ commat1mps0expseq : /*(empty)*/ { $$ = s0explst_nil() ; } %prec TMPSEXP | COMMA t1mps0exp commat1mps0expseq { $$ = s0explst_cons($2, $3) ; } ; /* commat1mps0expseq */ gtlt_t1mps0expseqseq : /*(empty)*/ { $$ = gtlt_t1mps0expseqseq_nil() ; } | GTLT t1mps0expseq gtlt_t1mps0expseqseq { $$ = gtlt_t1mps0expseqseq_cons_tok($1, $2, $3) ; } ; /* gtlt_t1mps0expseqseq */ impqi0de : dqi0de { $$ = impqi0de_make_none($1) ; } | tmpqi0de t1mps0expseq gtlt_t1mps0expseqseq GT { $$ = impqi0de_make_some($1, $2, $3, $4) ; } ; /* impqi0de */ s0rtdef : s0rtid EQ s0rtext { $$ = s0rtdef_make($1, $3) ; } ; /* s0rtdef */ ands0rtdefseq : /*(empty)*/ { $$ = s0rtdeflst_nil() ; } | AND s0rtdef ands0rtdefseq { $$ = s0rtdeflst_cons($2, $3) ; } ; /* ands0rtdefseq */ d0atarg : s0rtpol { $$ = d0atarg_srt($1) ; } | i0de COLON s0rtpol { $$ = d0atarg_id_srt($1, $3) ; } ; /* d0atarg */ d0atargseq : /*(empty)*/ { $$ = d0atarglst_nil() ; } | d0atarg commad0atargseq { $$ = d0atarglst_cons($1, $2) ; } ; /* d0atargseq */ commad0atargseq : /*(empty)*/ { $$ = d0atarglst_nil() ; } | COMMA d0atarg commad0atargseq { $$ = d0atarglst_cons($2, $3) ; } ; /* commad0atargseq */ s0tacon : si0de { $$ = s0tacon_make_none_none($1) ; } | si0de LPAREN d0atargseq RPAREN { $$ = s0tacon_make_some_none($1, $3, $4) ; } | si0de EQ s0exp { $$ = s0tacon_make_none_some($1, $3) ; } | si0de LPAREN d0atargseq RPAREN EQ s0exp { $$ = s0tacon_make_some_some($1, $3, $6) ; } ; /* s0tacon */ ands0taconseq : /*(empty)*/ { $$ = s0taconlst_nil() ; } | AND s0tacon ands0taconseq { $$ = s0taconlst_cons($2, $3) ; } ; /* ands0taconseq */ s0tacst : si0de COLON s0rt { $$ = s0tacst_make_none($1, $3) ; } | si0de LPAREN d0atargseq RPAREN COLON s0rt { $$ = s0tacst_make_some($1, $3, $6) ; } ; /* s0tacst */ ands0tacstseq : /*(empty)*/ { $$ = s0tacstlst_nil() ; } | AND s0tacst ands0tacstseq { $$ = s0tacstlst_cons($2, $3) ; } ; /* ands0tacstseq */ s0tavar : si0de COLON s0rt { $$ = s0tavar_make($1, $3) ; } ; /* s0tavar */ ands0tavarseq : /*(empty)*/ { $$ = s0tavarlst_nil() ; } | AND s0tavar ands0tavarseq { $$ = s0tavarlst_cons($2, $3) ; } ; /* ands0tavarseq */ s0expdef : si0de s0argseqseq colons0rtopt EQ s0exp { $$ = s0expdef_make ($1, $2, $3, $5) ; } ; /* s0expdef */ ands0expdefseq : /*(empty)*/ { $$ = s0expdeflst_nil() ; } | AND s0expdef ands0expdefseq { $$ = s0expdeflst_cons($2, $3) ; } ; /* ands0expdefseq */ s0aspdec : sqi0de s0argseqseq colons0rtopt EQ s0exp { $$ = s0aspdec_make($1, $2, $3, $5) ; } ; /* s0aspdec */ conq0uaseq : /*(empty)*/ { $$ = s0qualstlst_nil() ; } | LBRACE s0quaseq RBRACE conq0uaseq { $$ = s0qualstlst_cons($2, $4) ; } ; /* conq0uaseq */ coni0ndopt : /*(empty)*/ { $$ = s0expopt_none() ; } | LPAREN s0expseq RPAREN { $$ = s0expopt_some(s0exp_list($1, $2, $3)) ; } ; /* coni0ndopt */ cona0rgopt : /*(empty)*/ { $$ = s0expopt_none() ; } | OF s0exp { $$ = s0expopt_some($2) ; } ; /* cona0rgopt */ d0atcon : conq0uaseq di0de coni0ndopt cona0rgopt { $$ = d0atcon_make($1, $2, $3, $4) ; } ; /* d0atcon */ d0atconseq : bard0atconseq { $$ = $1 ; } | d0atcon bard0atconseq { $$ = d0atconlst_cons($1, $2) ; } ; /* d0atconseq */ bard0atconseq : /*(empty)*/ { $$ = d0atconlst_nil() ; } | BAR d0atcon bard0atconseq { $$ = d0atconlst_cons($2, $3) ; } ; /* bard0atconseq */ d0atdec : si0de EQ d0atconseq { $$ = d0atdec_make_none($1, $3) ; } | si0de LPAREN d0atargseq RPAREN EQ d0atconseq { $$ = d0atdec_make_some($1, $3, $4, $6) ; } ; /* d0atdec */ andd0atdecseq : /*(empty)*/ { $$ = d0atdeclst_nil() ; } | AND d0atdec andd0atdecseq { $$ = d0atdeclst_cons($2, $3) ; } ; /* andd0atdecseq */ s0expdefseqopt : /*(empty)*/ { $$ = s0expdeflst_nil() ; } | WHERE s0expdef ands0expdefseq { $$ = s0expdeflst_cons($2, $3) ; } ; /* s0expdefseqopt */ e0xndec : conq0uaseq di0de cona0rgopt { $$ = e0xndec_make($1, $2, $3) ; } ; /* e0xndec */ ande0xndecseq : /*(empty)*/ { $$ = e0xndeclst_nil() ; } | AND e0xndec ande0xndecseq { $$ = e0xndeclst_cons($2, $3) ; } ; /* ande0xndecseq */ p0arg : pi0de { $$ = p0arg_make_none($1) ; } | pi0de COLON s0exp { $$ = p0arg_make_some($1, $3) ; } ; /* p0arg */ p0argseq : /*(empty)*/ { $$ = p0arglst_nil() ; } | p0arg commap0argseq { $$ = p0arglst_cons($1, $2) ; } ; /* p0argseq */ commap0argseq : /*(empty)*/ { $$ = p0arglst_nil() ; } | COMMA p0arg commap0argseq { $$ = p0arglst_cons($2, $3) ; } ; /* commap0argseq */ d0arg : pi0de { $$ = d0arg_var($1) ; } | LPAREN p0argseq RPAREN { $$ = d0arg_dyn($1, $2, $3) ; } | LPAREN p0argseq BAR p0argseq RPAREN { $$ = d0arg_dyn2($1, $2, $4, $5) ; } | LBRACE s0quaseq RBRACE { $$ = d0arg_sta($1, $2, $3) ; } ; /* d0arg */ d0argseq : /*(empty)*/ { $$ = d0arglst_nil() ; } | d0arg d0argseq { $$ = d0arglst_cons($1, $2) ; } ; /* d0argseq */ extnamopt : /*(empty)*/ { $$ = extnamopt_none() ; } | EQ LITERAL_string { $$ = extnamopt_some($2) ; } ; /* extnamopt */ d0cstdec : di0de d0argseq colonwith s0exp extnamopt { $$ = d0cstdec_make($1, $2, $3, $4, $5) ; } ; /* d0cstdec */ andd0cstdecseq : /*(empty)*/ { $$ = d0cstdeclst_nil() ; } | AND d0cstdec andd0cstdecseq { $$ = d0cstdeclst_cons($2, $3) ; } ; /* andd0cstdecseq */ s0vararg : DOTDOT { $$ = s0vararg_one() ; } | DOTDOTDOT { $$ = s0vararg_all() ; } | s0argseq { $$ = s0vararg_seq($1) ; } ; /* s0vararg */ s0exparg : DOTDOT { $$ = s0exparg_one() ; } | DOTDOTDOT { $$ = s0exparg_all() ; } | s0expseq1 { $$ = s0exparg_seq($1) ; } ; /* s0exparg */ s0elop : DOT { $$ = s0elop_make (0, $1) ; } | MINUSGT { $$ = s0elop_make (1, $1) ; } ; /* s0elop */ witht0ype : /*(empty)*/ { $$ = witht0ype_none() ; } | WITHPROP s0exp { $$ = witht0ype_prop($2) ; } | WITHTYPE s0exp { $$ = witht0ype_type($2) ; } | WITHVIEW s0exp { $$ = witht0ype_view($2) ; } | WITHVIEWTYPE s0exp { $$ = witht0ype_viewtype($2) ; } ; /* witht0ype */ p0at : atmp0at argp0atseq { $$ = p0at_apps($1, $2) ; } | p0at COLON s0exp { $$ = p0at_ann($1, $3) ; } | pi0de AS p0at { $$ = p0at_as($1, $3) ; } %prec PATAS | BANG pi0de AS p0at { $$ = p0at_refas($1, $2, $4) ; } %prec PATAS | TILDA p0at { $$ = p0at_free($1, $2) ; } %prec PATFREE ; /* p0at */ atmp0at : LITERAL_char { $$ = p0at_char($1) ; } | LITERAL_int { $$ = p0at_int($1) ; } | LITERAL_float { $$ = p0at_float($1) ; } | LITERAL_string { $$ = p0at_string($1) ; } | pi0de { $$ = p0at_ide($1) ; } | BANG pi0de { $$ = p0at_ref($1, $2) ; } | OP pi0de { $$ = p0at_opide($1, $2) ; } | d0ynq pi0de { $$ = p0at_qid($1, $2) ; } | LPAREN p0atseq RPAREN { $$ = p0at_list($1, $2, $3) ; } | LPAREN p0atseq BAR p0atseq RPAREN { $$ = p0at_list2($1, $2, $4, $5) ; } | QUOTELBRACKET p0atseq RBRACKET { $$ = p0at_lst($1, $2, $3) ; } | ATLPAREN p0atseq RPAREN { $$ = p0at_tup(0, $1, $2, $3) ; } | QUOTELPAREN p0atseq RPAREN { $$ = p0at_tup(1, $1, $2, $3) ; } | ATLPAREN p0atseq BAR p0atseq RPAREN { $$ = p0at_tup2(0, $1, $2, $4, $5) ; } | QUOTELPAREN p0atseq BAR p0atseq RPAREN { $$ = p0at_tup2(1, $1, $2, $4, $5) ; } | ATLBRACE labp0atseq RBRACE { $$ = p0at_rec(0, $1, $2, $3) ; } | QUOTELBRACE labp0atseq RBRACE { $$ = p0at_rec(1, $1, $2, $3) ; } | LBRACKET s0argseq RBRACKET { $$ = p0at_exist($1, $2, $3) ; } ; /* atmp0at */ argp0at : atmp0at { $$ = $1 ; } | LBRACE s0vararg RBRACE { $$ = p0at_svararg($1, $2, $3) ; } ; /* argp0at */ argp0atseq : /*(empty)*/ { $$ = p0atlst_nil() ; } | argp0at argp0atseq { $$ = p0atlst_cons($1, $2) ; } ; /* argp0atseq */ p0atseq : /*(empty)*/ { $$ = p0atlst_nil() ; } | p0at commap0atseq { $$ = p0atlst_cons($1, $2) ; } ; /* p0atseq */ commap0atseq : /*(empty)*/ { $$ = p0atlst_nil() ; } | COMMA p0at commap0atseq { $$ = p0atlst_cons($2, $3) ; } ; /* commap0atseq */ labp0atseq : DOTDOTDOT { $$ = labp0atlst_dot() ; } | l0ab EQ p0at commalabp0atseq { $$ = labp0atlst_cons($1, $3, $4) ; } ; /* labp0atseq */ commalabp0atseq : /*(empty)*/ { $$ = labp0atlst_nil() ; } | COMMA DOTDOTDOT { $$ = labp0atlst_dot() ; } | COMMA l0ab EQ p0at commalabp0atseq { $$ = labp0atlst_cons($2, $4, $5) ; } ; /* commalabp0atseq */ f0arg1 : LBRACE s0quaseq RBRACE { $$ = f0arg_sta1($1, $2, $3) ; } | atmp0at { $$ = f0arg_dyn($1) ; } | DOTLT s0expseq GTDOT { $$ = f0arg_met_some($1, $2, $3) ; } | DOTLTGTDOT { $$ = f0arg_met_none($1) ; } ; /* f0arg1 */ f0arg1seq : /*(empty)*/ { $$ = f0arglst_nil() ; } | f0arg1 f0arg1seq { $$ = f0arglst_cons($1, $2) ; } ; /* f0arg1seq */ f0arg2 : LBRACE s0argseq RBRACE { $$ = f0arg_sta2($1, $2, $3) ; } | atmp0at { $$ = f0arg_dyn($1) ; } ; /* f0arg2 */ f0arg2seq : /*(empty)*/ { $$ = f0arglst_nil() ; } | f0arg2 f0arg2seq { $$ = f0arglst_cons($1, $2) ; } ; /* f0arg2seq */ d0exp : atmd0exp argd0expseq { $$ = d0exp_apps($1, $2) ; } | d0exp COLON s0exp { $$ = d0exp_ann($1, $3) ; } | ifhead d0exp THEN d0exp { $$ = d0exp_if_none($1, $2, $4) ; } %prec DEXPIF | ifhead d0exp THEN d0exp ELSE d0exp { $$ = d0exp_if_some($1, $2, $4, $6) ; } %prec DEXPIF | sifhead s0exp THEN d0exp ELSE d0exp { $$ = d0exp_sif($1, $2, $4, $6) ; } %prec DEXPIF | casehead d0exp OF c0lauseq { $$ = d0exp_caseof($1, $2, $3, $4) ; } %prec DEXPCASE | scasehead s0exp OF sc0lauseq { $$ = d0exp_scaseof($1, $2, $3, $4) ; } %prec DEXPCASE | lamkind f0arg1seq colons0expopt funarrow d0exp { $$ = d0exp_lam($1, $2, $3, $4, $5 ) ; } %prec DEXPLAM | fixkind di0de f0arg1seq colons0expopt funarrow d0exp { $$ = d0exp_fix($1, $2, $3, $4, $5, $6) ; } %prec DEXPLAM | forhead initestpost d0exp { $$ = d0exp_for_itp ($1, $2, $3) ; } %prec DEXPFOR | whilehead atmd0exp d0exp { $$ = d0exp_while ($1, $2, $3) ; } %prec DEXPWHILE | DLRRAISE d0exp { $$ = d0exp_raise($1, $2) ; } %prec DEXPRAISE | tryhead d0expsemiseq0 WITH c0lauseq { $$ = d0exp_trywith_seq($1, $2, $3, $4) ; } %prec DEXPTRY | d0exp WHERE LBRACE d0ecseq_dyn RBRACE { $$ = d0exp_where ($1, $4, $5) ; } ; /* d0exp */ atmd0exp : LITERAL_char { $$ = d0exp_char($1) ; } | LITERAL_float { $$ = d0exp_float($1) ; } | LITERAL_floatsp { $$ = d0exp_floatsp($1) ; } | LITERAL_int { $$ = d0exp_int($1) ; } | LITERAL_intsp { $$ = d0exp_intsp($1) ; } | LITERAL_string { $$ = d0exp_string($1) ; } | SRPFILENAME { $$ = d0exp_FILENAME($1) ; } | SRPLOCATION { $$ = d0exp_LOCATION($1) ; } | di0de { $$ = d0exp_ide($1) ; } | OP di0de { $$ = d0exp_opide($1, $2) ; } | d0ynq i0de { $$ = d0exp_qid($1, $2) ; } | i0dext { $$ = d0exp_idext($1) ; } | AMPERSAND { $$ = d0exp_ptrof($1) ; } | BREAK { $$ = d0exp_loopexn(0, $1) ; } | CONTINUE { $$ = d0exp_loopexn(1, $1) ; } | FOLDAT s0expdargseq { $$ = d0exp_foldat($1, $2) ; } | FREEAT s0expdargseq { $$ = d0exp_freeat($1, $2) ; } | VIEWAT { $$ = d0exp_viewat($1) ; } | DLRDECRYPT { $$ = d0exp_crypt (-1, $1) ; } | DLRENCRYPT { $$ = d0exp_crypt ( 1, $1) ; } | DLRDELAY { $$ = d0exp_delay(0, $1) ; } | DLRLDELAY { $$ = d0exp_delay(1, $1) ; } | DLRDYNLOAD { $$ = d0exp_dynload($1) ; } | DLREFFMASK_ALL { $$ = d0exp_effmask_all($1) ; } | DLREFFMASK_EXN { $$ = d0exp_effmask_exn($1) ; } | DLREFFMASK_NTM { $$ = d0exp_effmask_ntm($1) ; } | DLREFFMASK_REF { $$ = d0exp_effmask_ref($1) ; } | ATLBRACKET s0exp RBRACKET LPAREN d0expcommaseq RPAREN { $$ = d0exp_arrinit_none ($1, $2, $5, $6) ; } | ATLBRACKET s0exp RBRACKET LBRACKET d0exp RBRACKET LPAREN d0expcommaseq RPAREN { $$ = d0exp_arrinit_some ($1, $2, $5, $8, $9) ; } | DLRARRSZ s0expelt LPAREN d0expcommaseq RPAREN { $$ = d0exp_arrsize ($1, $2, $3, $4, $5) ; } | arrqi0de d0arrind { $$ = d0exp_arrsub ($1, $2) ; } | s0elop l0ab { $$ = d0exp_sel_lab ($1, $2) ; } | s0elop LBRACKET d0arrind { $$ = d0exp_sel_ind ($1, $3) ; } | tmpqi0de t1mps0expseq gtlt_t1mps0expseqseq GT { $$ = d0exp_tmpid ($1, $2, $3, $4) ; } | HASHLBRACKET s0exparg BAR d0exp RBRACKET { $$ = d0exp_exist ($1, $2, $3, $4, $5) ; } | LPAREN d0expcommaseq RPAREN { $$ = d0exp_list ($1, $2, $3) ; } | LPAREN d0expcommaseq BAR d0expcommaseq RPAREN { $$ = d0exp_list2 ($1, $2, $4, $5) ; } | DLRLST_T s0expelt LPAREN d0expcommaseq RPAREN { $$ = d0exp_lst (0, $1, $2, $3, $4, $5) ; } | DLRLST_VT s0expelt LPAREN d0expcommaseq RPAREN { $$ = d0exp_lst (1, $1, $2, $3, $4, $5) ; } | QUOTELBRACKET d0expcommaseq RBRACKET { $$ = d0exp_lst_quote ($1, $2, $3) ; } | BEGIN d0expsemiseq0 END { $$ = d0exp_seq ($1, $2, $3) ; } | LPAREN d0expsemiseq1 RPAREN { $$ = d0exp_seq ($1, $2, $3) ; } | ATLPAREN d0expcommaseq RPAREN { $$ = d0exp_tup (0, $1, $2, $3) ; } | QUOTELPAREN d0expcommaseq RPAREN { $$ = d0exp_tup (1, $1, $2, $3) ; } | DLRTUP_T LPAREN d0expcommaseq RPAREN { $$ = d0exp_tup (2, $1, $3, $4) ; } | DLRTUP_VT LPAREN d0expcommaseq RPAREN { $$ = d0exp_tup (3, $1, $3, $4) ; } | ATLPAREN d0expcommaseq BAR d0expcommaseq RPAREN { $$ = d0exp_tup2 (0, $1, $2, $4, $5) ; } | QUOTELPAREN d0expcommaseq BAR d0expcommaseq RPAREN { $$ = d0exp_tup2 (1, $1, $2, $4, $5) ; } | ATLBRACE labd0expseq RBRACE { $$ = d0exp_rec (0, $1, $2, $3) ; } | QUOTELBRACE labd0expseq RBRACE { $$ = d0exp_rec (1, $1, $2, $3) ; } | DLRREC_T LBRACE labd0expseq RBRACE { $$ = d0exp_rec (2, $1, $3, $4) ; } | DLRREC_VT LBRACE labd0expseq RBRACE { $$ = d0exp_rec (3, $1, $3, $4) ; } | DLREXTVAL LPAREN s0exp COMMA LITERAL_string RPAREN { $$ = d0exp_extval($1, $3, $5, $6) ; } | PERCENTLPAREN d0exp RPAREN { $$ = d0exp_macsyn_cross($1, $2, $3) ; } | COMMALPAREN d0exp RPAREN { $$ = d0exp_macsyn_decode($1, $2, $3) ; } | BACKQUOTELPAREN d0expsemiseq0 RPAREN { $$ = d0exp_macsyn_encode_seq($1, $2, $3) ; } | LET d0ecseq_dyn IN d0expsemiseq0 END { $$ = d0exp_let_seq($1, $2, $3, $4, $5) ; } | LBRACE d0ecseq_dyn RBRACE { $$ = d0exp_decseq($1, $2, $3) ; } ; /* atmd0exp */ s0expdarg : LBRACE s0exparg RBRACE { $$ = d0exp_sexparg($1, $2, $3) ; } ; /* s0expdarg */ s0expdargseq : /*(empty)*/ { $$ = d0explst_nil() ; } %prec SEXPDARGSEQEMPTY | s0expdarg s0expdargseq { $$ = d0explst_cons($1, $2) ; } ; /* s0expdargseq */ argd0exp : atmd0exp { $$ = $1 ; } | s0expdarg { $$ = $1 ; } ; /* argd0exp */ argd0expseq : /*(empty)*/ { $$ = d0explst_nil() ; } | argd0exp argd0expseq { $$ = d0explst_cons($1, $2) ; } ; /* argd0expseq */ d0arrind : d0expcommaseq RBRACKET { $$ = d0arrind_make_sing($1, $2) ; } | d0expcommaseq RBRACKET LBRACKET d0arrind { $$ = d0arrind_make_cons($1, $4) ; } ; /* d0arrind */ colons0expopt : /*(empty)*/ { $$ = s0expopt_none() ; } | COLON s0exp { $$ = s0expopt_some($2) ; } ; /* colons0expopt */ funarrow : EQGT { $$ = e0fftaglstopt_none() ; } | EQLTGT { $$ = e0fftaglstopt_some(e0fftaglst_nil()) ; } | EQLT e0fftagseq GT { $$ = e0fftaglstopt_some($2) ; } ; /* funarrow */ caseinv : /*(empty)*/ { $$ = i0nvresstate_none() ; } | i0nvresstate EQGT { $$ = $1 ; } ; /* caseinv */ ifhead : IF caseinv { $$ = ifhead_make($1, $2) ; } ; /* ifhead */ sifhead : SIF caseinv { $$ = ifhead_make($1, $2) ; } ; /* sifhead */ casehead : CASE caseinv { $$ = casehead_make(0, $1, $2) ; } | CASEMINUS caseinv { $$ = casehead_make(-1, $1, $2) ; } | CASEPLUS caseinv { $$ = casehead_make(1, $1, $2) ; } ; /* casehead */ scasehead : SCASE caseinv { $$ = casehead_make(0, $1, $2) ; } ; /* scasehead */ forhead : FOR { $$ = loophead_make_none($1) ; } | FORSTAR loopi0nv EQGT { $$ = loophead_make_some($1, $2, $3) ; } ; /* forhead */ whilehead : WHILESTAR loopi0nv EQGT { $$ = loophead_make_some($1, $2, $3) ; } ; /* whilehead */ tryhead : TRY { $$ = tryhead_make($1) ; } ; /* tryhead */ d0expcommaseq : /*(empty)*/ { $$ = d0explst_nil() ; } | d0exp commad0expseq { $$ = d0explst_cons($1, $2) ; } ; /* d0expcommaseq */ commad0expseq : /*(empty)*/ { $$ = d0explst_nil() ; } | COMMA d0exp commad0expseq { $$ = d0explst_cons($2, $3) ; } ; /* commad0expseq */ d0expsemiseq0 : /*(empty)*/ { $$ = d0explst_nil() ; } | d0exp { $$ = d0explst_sing($1) ; } | d0exp SEMICOLON d0expsemiseq0 { $$ = d0explst_cons($1, $3) ; } ; /* d0expsemiseq0 */ d0expsemiseq1 : d0exp SEMICOLON d0expsemiseq0 { $$ = d0explst_cons($1, $3) ; } ; /* d0expsemiseq1 */ labd0expseq : /*(empty)*/ { $$ = labd0explst_nil() ; } | l0ab EQ d0exp commalabd0expseq { $$ = labd0explst_cons($1, $3, $4) ; } ; /* labd0expseq */ commalabd0expseq : /*(empty)*/ { $$ = labd0explst_nil() ; } | COMMA l0ab EQ d0exp commalabd0expseq { $$ = labd0explst_cons($2, $4, $5) ; } ; /* commalabd0expseq */ m0atch : d0exp { $$ = m0atch_make_none ($1) ; } | d0exp AS p0at { $$ = m0atch_make_some ($1, $3) ; } ; /* m0atch */ m0atchseq : m0atch andm0atchseq { $$ = m0atchlst_cons ($1, $2 ) ; } ; /* m0atchseq */ andm0atchseq : /*(empty)*/ { $$ = m0atchlst_nil () ; } | AND m0atch andm0atchseq { $$ = m0atchlst_cons ($2, $3 ) ; } ; /* andm0atchseq */ guap0at : p0at { $$ = guap0at_make_none($1) ; } | p0at WHEN m0atchseq { $$ = guap0at_make_some($1, $3) ; } ; /* guap0at */ c0lau : guap0at EQGT d0exp { $$ = c0lau_make ($1, 0, 0, $3) ; } %prec CLAUS | guap0at EQGTGT d0exp { $$ = c0lau_make ($1, 1, 0, $3) ; } %prec CLAUS | guap0at EQSLASHEQGT d0exp { $$ = c0lau_make ($1, 0, 1, $3) ; } %prec CLAUS | guap0at EQSLASHEQGTGT d0exp { $$ = c0lau_make ($1, 1, 1, $3) ; } %prec CLAUS ; /* c0lau */ c0lauseq : barc0lauseq { $$ = $1 ; } | c0lau barc0lauseq { $$ = c0laulst_cons($1, $2) ; } ; /* c0lauseq */ barc0lauseq : /*(empty)*/ { $$ = c0laulst_nil() ; } %prec BARCLAUSSEQNONE | BAR c0lau barc0lauseq { $$ = c0laulst_cons($2, $3) ; } ; /* barc0lauseq */ sc0lau : sp0at EQGT d0exp { $$ = sc0lau_make($1, $3) ; } %prec CLAUS ; /* sc0lau */ sc0lauseq : barsc0lauseq { $$ = $1 ; } | sc0lau barsc0lauseq { $$ = sc0laulst_cons($1, $2) ; } ; /* sc0lauseq */ barsc0lauseq : /*(empty)*/ { $$ = sc0laulst_nil() ; } %prec BARCLAUSSEQNONE | BAR sc0lau barsc0lauseq { $$ = sc0laulst_cons($2, $3) ; } ; /* barsc0lauseq */ i0nvqua : /*(empty)*/ { $$ = s0qualstopt_none() ; } | LBRACE s0quaseq RBRACE { $$ = s0qualstopt_some($2) ; } ; /* i0nvqua */ i0nvmet : /*(empty)*/ { $$ = s0explstopt_none() ; } | DOTLT s0expseq GTDOT { $$ = s0explstopt_some($2) ; } | DOTLTGTDOT { $$ = s0explstopt_some(s0explstopt_none()) ; } ; /* i0nvmet */ i0nvarg : di0de COLON { $$ = i0nvarg_make_none($1) ; } | di0de COLON s0exp { $$ = i0nvarg_make_some($1, $3) ; } ; /* i0nvarg */ i0nvargseq : /*(empty)*/ { $$ = i0nvarglst_nil() ; } | i0nvarg commai0nvargseq { $$ = i0nvarglst_cons($1, $2) ; } ; /* i0nvargseq */ commai0nvargseq : /*(empty)*/ { $$ = i0nvarglst_nil() ; } | COMMA i0nvarg commai0nvargseq { $$ = i0nvarglst_cons($2, $3) ; } ; /* commai0nvargseq */ i0nvargstate : LPAREN i0nvargseq RPAREN { $$ = $2 ; } ; /* i0nvargstate */ i0nvresqua : /*(empty)*/ { $$ = s0qualstopt_none() ; } | LBRACKET s0quaseq RBRACKET { $$ = s0qualstopt_some($2) ; } ; /* i0nvresqua */ i0nvresstate : /*(empty)*/ { $$ = i0nvresstate_none() ; } | COLON i0nvresqua LPAREN i0nvargseq RPAREN { $$ = i0nvresstate_some($2, $4) ; } ; /* i0nvresstate */ loopi0nv : i0nvqua i0nvmet i0nvargstate i0nvresstate { $$ = loopi0nv_make($1, $2, $3, $4) ; } ; /* loopi0nv */ initestpost : LPAREN d0expcommaseq SEMICOLON d0expcommaseq SEMICOLON d0expcommaseq RPAREN { $$ = initestpost_make ($1,$2,$3,$4,$5,$6,$7) ; } ; /* initestpost */ m0arg : pi0de { $$ = $1 ; } ; /* m0arg */ m0argseq : /*(empty)*/ { $$ = i0delst_nil() ; } | m0arg commam0argseq { $$ = i0delst_cons($1, $2) ; } ; /* m0argseq */ commam0argseq : /*(empty)*/ { $$ = i0delst_nil() ; } | COMMA m0arg commam0argseq { $$ = i0delst_cons($2, $3) ; } ; /* commam0argseq */ m0acarg : m0arg { $$ = m0acarg_one ($1) ; } | LPAREN m0argseq RPAREN { $$ = m0acarg_lst ($1, $2, $3) ; } ; /* m0acarg */ m0acargseq : /*(empty)*/ { $$ = m0acarglst_nil () ; } | m0acarg m0acargseq { $$ = m0acarglst_cons ($1, $2) ; } ; /* m0acargseq */ m0acdef : di0de m0acargseq EQ d0exp { $$ = m0acdef_make($1, $2, $4) ; } ; /* m0acdef */ andm0acdefseq : /*(empty)*/ { $$ = m0acdeflst_nil() ; } | AND m0acdef andm0acdefseq { $$ = m0acdeflst_cons($2, $3) ; } ; /* andm0acdefseq */ v0aldec : p0at EQ d0exp witht0ype { $$ = v0aldec_make ($1, $3, $4) ; } ; /* v0aldec */ andv0aldecseq : /*(empty)*/ { $$ = v0aldeclst_nil() ; } | AND v0aldec andv0aldecseq { $$ = v0aldeclst_cons($2, $3) ; } ; /* andv0aldecseq */ f0undec : fi0de f0arg1seq EQ d0exp witht0ype { $$ = f0undec_make_none($1, $2, $4, $5) ; } | fi0de f0arg1seq colonwith s0exp EQ d0exp witht0ype { $$ = f0undec_make_some($1, $2, $3, $4, $6, $7) ; } ; /* f0undec */ andf0undecseq : /*(empty)*/ { $$ = f0undeclst_nil() ; } | AND f0undec andf0undecseq { $$ = f0undeclst_cons($2, $3) ; } ; /* andf0undecseq */ v0arwth : /*(empty)*/ { $$ = v0arwth_none () ; } | WITH pi0de { $$ = v0arwth_some ($2) ; } ; /* v0arwth */ v0ardec : pi0de v0arwth EQ d0exp { $$ = v0ardec_make_none_some(0, $1, $2, $4) ; } | BANG pi0de v0arwth EQ d0exp { $$ = v0ardec_make_none_some(1, $2, $3, $5) ; } | pi0de COLON s0exp v0arwth { $$ = v0ardec_make_some_none(0, $1, $3, $4) ; } | pi0de COLON s0exp v0arwth EQ d0exp { $$ = v0ardec_make_some_some(0, $1, $3, $4, $6) ; } ; /* v0ardec */ andv0ardecseq : /*(empty)*/ { $$ = v0ardeclst_nil() ; } | AND v0ardec andv0ardecseq { $$ = v0ardeclst_cons($2, $3) ; } ; /* andv0ardecseq */ i0mpdec : impqi0de f0arg2seq colons0expopt EQ d0exp { $$ = i0mpdec_make($1, $2, $3, $5) ; } ; /* i0mpdec */ d0ec : INFIX p0rec i0deseq { $$ = d0ec_infix($1, $2, 0, $3) ; } | INFIXL p0rec i0deseq { $$ = d0ec_infix($1, $2, -1, $3) ; } | INFIXR p0rec i0deseq { $$ = d0ec_infix($1, $2, 1, $3) ; } | PREFIX p0rec i0deseq { $$ = d0ec_prefix($1, $2, $3) ; } | POSTFIX p0rec i0deseq { $$ = d0ec_postfix($1, $2, $3) ; } | NONFIX i0deseq { $$ = d0ec_nonfix($1, $2) ; } | SYMINTR i0deseq { $$ = d0ec_symintr($1, $2) ; } | SRPUNDEF i0de { $$ = d0ec_e0xpundef($2) ; } | SRPDEFINE i0de e0xpopt { $$ = d0ec_e0xpdef($2, $3) ; } | SRPASSERT e0xp { $$ = d0ec_e0xpact_assert($2) ; } | SRPERROR e0xp { $$ = d0ec_e0xpact_error($2) ; } | SRPPRINT e0xp { $$ = d0ec_e0xpact_print($2) ; } | SORTDEF s0rtdef ands0rtdefseq { $$ = d0ec_srtdefs($2, $3) ; } | DATASORT d0atsrtdec andd0atsrtdecseq { $$ = d0ec_datsrts(0, $2, $3) ; } | DATAPARASORT d0atsrtdec andd0atsrtdecseq { $$ = d0ec_datsrts(1, $2, $3) ; } | abskind s0tacon ands0taconseq { $$ = d0ec_stacons($1, $2, $3) ; } | STA s0tacst ands0tacstseq { $$ = d0ec_stacsts($2, $3) ; } | STAVAR s0tavar ands0tavarseq { $$ = d0ec_stavars($2, $3) ; } | stadefkind s0expdef ands0expdefseq { $$ = d0ec_sexpdefs($1, $2, $3) ; } | ASSUME s0aspdec { $$ = d0ec_saspdec($2) ; } | datakind d0atdec andd0atdecseq s0expdefseqopt { $$ = d0ec_datdecs($1, $2, $3, $4) ; } | EXCEPTION e0xndec ande0xndecseq { $$ = d0ec_exndecs($1, $2, $3) ; } | CLASSDEC si0de { $$ = d0ec_classdec_none ($1, $2) ; } | CLASSDEC si0de COLON s0exp { $$ = d0ec_classdec_some ($1, $2, $4) ; } | OVERLOAD di0de WITH dqi0de { $$ = d0ec_overload($1, $2, $4) ; } | OVERLOAD LBRACKET RBRACKET WITH dqi0de { $$ = d0ec_overload_lrbrackets($1, $2, $3, $5) ; } | MACDEF m0acdef andm0acdefseq { $$ = d0ec_macdefs(0, $2, $3) ; } | MACDEF REC m0acdef andm0acdefseq { $$ = d0ec_macdefs(-1/*error*/, $3, $4) ; } | MACRODEF m0acdef andm0acdefseq { $$ = d0ec_macdefs(1, $2, $3) ; } | MACRODEF REC m0acdef andm0acdefseq { $$ = d0ec_macdefs(2, $3, $4) ; } | DYNLOAD LITERAL_string { $$ = d0ec_dynload($2) ; } | STALOAD LITERAL_string { $$ = d0ec_staload_none($2) ; } | STALOAD stai0de EQ LITERAL_string { $$ = d0ec_staload_some($2, $4) ; } ; /* d0ec */ d0ecarg : LBRACE s0quaseq RBRACE { $$ = $2 ; } ; /* d0ecarg */ d0ecargseq : /*(empty)*/ { $$ = s0qualstlst_nil() ; } | d0ecarg d0ecargseq { $$ = s0qualstlst_cons($1, $2) ; } ; /* d0ecargseq */ semicolonseq : /*(empty)*/ { ; } | semicolonseq SEMICOLON { ; } ; /* semicolonseq */ d0ec_sta : d0ec { $$ = $1 ; } | dcstkind d0ecargseq d0cstdec andd0cstdecseq { $$ = d0ec_dcstdecs($1, $2, $3, $4) ; } | LITERAL_extcode { $$ = d0ec_extcode_sta($1) ; } | srpifkind guad0ec_sta { $$ = d0ec_guadec($1, $2) ; } | SRPINCLUDE LITERAL_string { $$ = d0ec_include(0/*sta*/, $2) ; } | LOCAL d0ecseq_sta IN d0ecseq_sta END { $$ = d0ec_local($1, $2, $4, $5) ; } ; /* d0ec_sta */ guad0ec_sta : e0xp srpthenopt d0ecseq_sta SRPENDIF { $$ = guad0ec_one($1, $3, $4) ; } | e0xp srpthenopt d0ecseq_sta SRPELSE d0ecseq_sta SRPENDIF { $$ = guad0ec_two($1, $3, $5, $6) ; } | e0xp srpthenopt d0ecseq_sta srpelifkind guad0ec_sta { $$ = guad0ec_cons($1, $3, $4, $5) ; } ; /* guad0ec_sta */ d0ecseq_sta : d0ecseq_sta_rev { $$ = d0ecllst_reverse($1) ; } ; /* d0ecseq_sta */ d0ecseq_sta_rev : /*(empty)*/ { $$ = d0ecllst_nil() ; } | d0ecseq_sta_rev d0ec_sta semicolonseq { $$ = d0ecllst_cons($1, $2) ; } ; /* d0ecseq_sta_rev */ d0ec_dyn : d0ec { $$ = $1 ; } | EXTERN dcstkind d0ecargseq d0cstdec andd0cstdecseq { $$ = d0ec_dcstdecs($2, $3, $4, $5) ; } | EXTERN TYPEDEF LITERAL_string EQ s0exp { $$ = d0ec_extype($3, $5) ; } | EXTERN VAL LITERAL_string EQ d0exp { $$ = d0ec_extval($3, $5) ; } | valkind v0aldec andv0aldecseq { $$ = d0ec_valdecs($1, $2, $3) ; } | VAL PAR v0aldec andv0aldecseq { $$ = d0ec_valdecs_par($3, $4) ; } | VAL REC v0aldec andv0aldecseq { $$ = d0ec_valdecs_rec($3, $4) ; } | funkind d0ecargseq f0undec andf0undecseq { $$ = d0ec_fundecs($1, $2, $3, $4) ; } | VAR v0ardec andv0ardecseq { $$ = d0ec_vardecs($2, $3) ; } | IMPLEMENT decs0argseqseq i0mpdec { $$ = d0ec_impdec($1, $2, $3) ; } | LOCAL d0ecseq_dyn IN d0ecseq_dyn END { $$ = d0ec_local($1, $2, $4, $5) ; } | LITERAL_extcode { $$ = d0ec_extcode_dyn($1) ; } | srpifkind guad0ec_dyn { $$ = d0ec_guadec($1, $2) ; } | SRPINCLUDE LITERAL_string { $$ = d0ec_include(1/*dyn*/, $2) ; } ; /* d0ec_dyn */ guad0ec_dyn : e0xp srpthenopt d0ecseq_dyn SRPENDIF { $$ = guad0ec_one($1, $3, $4) ; } | e0xp srpthenopt d0ecseq_dyn SRPELSE d0ecseq_dyn SRPENDIF { $$ = guad0ec_two($1, $3, $5, $6) ; } | e0xp srpthenopt d0ecseq_dyn srpelifkind guad0ec_dyn { $$ = guad0ec_cons($1, $3, $4, $5) ; } ; /* guad0ec_dyn */ d0ecseq_dyn : d0ecseq_dyn_rev { $$ = d0ecllst_reverse($1) ; } ; /* d0ecseq_dyn */ d0ecseq_dyn_rev : /*(empty)*/ { $$ = d0ecllst_nil() ; } | d0ecseq_dyn_rev d0ec_dyn semicolonseq { $$ = d0ecllst_cons($1, $2) ; } ; /* d0ecseq_dyn_rev */ /* ****** ****** */ %% /* ****** ****** */ int yylex_tok0 = -1 ; int yylex() { // int tok ; // if (yylex_tok0 >= 0) { tok = yylex_tok0 ; yylex_tok0 = -1 ; } else { tok = atsopt_lexer_token_get () ; } // end of [if] /* ** fprintf (stdout, "tok = %i\n", tok) ; */ return tok ; // } /* end of [yylex_tok0] */ // // HX: needed in [ats_lexer.lats] // ats_void_type yylval_char_set(c0har_t val) { yylval.c0har = val ; return ; } ats_void_type yylval_extcode_set(e0xtcode_t val) { yylval.e0xtcode = val ; return ; } ats_void_type yylval_float_set(f0loat_t val) { yylval.f0loat = val ; return ; } ats_void_type yylval_floatsp_set(f0loatsp_t val) { yylval.f0loatsp = val ; return ; } ats_void_type yylval_ide_set(i0de_t val) { yylval.i0de = val ; return ; } ats_void_type yylval_int_set(i0nt_t val) { yylval.i0nt = val ; return ; } ats_void_type yylval_intsp_set(i0ntsp_t val) { yylval.i0ntsp = val ; return ; } ats_void_type yylval_string_set(s0tring_t val) { yylval.s0tring = val ; return ; } ats_void_type yylval_token_set(t0kn_t val) { yylval.t0kn = val ; return ; } // HX: implemented in [ats_filename.dats] extern ats_void_type atsopt_filename_prerr () ; // extern ats_ptr_type lexing_fstpos_get () ; extern ats_void_type lexing_prerr_position (ats_ptr_type) ; // void yyerror(char *s) { fprintf (stderr, "%s: ", s) ; atsopt_filename_prerr () ; fprintf (stderr, ": [") ; lexing_prerr_position (lexing_fstpos_get ()) ; fprintf (stderr, "]\n") ; exit (1) ; // HX: no error recovery yet; maybe in future return ; } /* end of [yyerror] */ ats_ptr_type yyparse_main ( ats_int_type tok0 ) { /* ** HX: must take care of garbage collection */ // fprintf (stderr, "yyparse_main: &yyss = %p\n", &yyss) ; // ATS_GC_MARKROOT (&yyss, sizeof(short*)) ; // [ats_malloc_ngc] is used // fprintf (stderr, "yyparse_main: &yyvs = %p\n", &yyvs) ; // ATS_GC_MARKROOT (&yyvs, sizeof(YYSTYPE*)) ; // [ats_malloc_ngc] is used /* ** HX-2010-02-25: ** if BISON is used then [yyval] is a stack variable and ** thus there is no need to treat it as a GC root explicitly */ extern YYSTYPE yyval; // fprintf (stderr, "yyparse_main: &yyval = %p\n", &yyval) ; ATS_GC_MARKROOT (&yyval, sizeof(YYSTYPE)) ; // extern YYSTYPE yylval; // fprintf (stderr, "yyparse_main: &yylval = %p\n", &yylval) ; ATS_GC_MARKROOT (&yylval, sizeof(YYSTYPE)) ; // yylex_tok0 = tok0 ; // yyparse () ; // return yyval.d0eclst ; } /* end of [yyparse_main] */ /* ****** ****** */ // end of [ats_grammar.yats]