#include "cdefs.h"
cint bnf2c_globals = 0;
extern cint boolean_True;
extern cint boolean_False;
extern cint object_Undefined;
extern cptr scope_curr;
extern cint scope_global;
extern cptr scope_methods[meth_max];
extern cint boolean_True;
extern cint object_Undefined;
extern cptr identifier_methods[meth_max];
extern cptr idstring_methods[meth_max];
extern cptr integer_methods[meth_max];
extern cptr slist_methods[meth_max];
cint bnf2c_g1;
cint bnf2c_g2;
cint bnf2c_g3;
cint bnf2c_g4;
cint bnf2c_g5;
cint bnf2c_g6;
cint bnf2c_g7;
cint bnf2c_g8;
cint bnf2c_g9;
cint bnf2c_g10;
cint bnf2c_g11;
cint bnf2c_g12;
cint bnf2c_g13;
cint bnf2c_g14;
cint bnf2c_g15;
cint bnf2c_g16;
cint bnf2c_g17;
cint bnf2c_g18;
cint bnf2c_g19;
cint bnf2c_g20;
cint bnf2c_g21;
cint bnf2c_g22;

void import_bnf2c(){
cint saved_curr;
cint t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33, t34, t35, t36, t37, t38, t39, t40, t41, t42, t43, t44, t45, t46, t47, t48, t49, t50, t51, t52, t53, t54, t55, t56, t57, t58, t59, t60, t61, t62, t63, t64, t65, t66, t67, t68, t69, t70, t71, t72, t73, t74, t75, t76, t77, t78, t79, t80, t81, t82, t83, t84, t85, t86, t87, t88, t89, t90, t91, t92, t93, t94, t95, t96, t97, t98, t99, t100, t101, t102, t103, t104, t105, t106, t107, t108, t109, t110, t111, t112, t113, t114, t115, t116, t117, t118, t119, t120, t121, t122, t123, t124, t125, t126, t127, t128, t129, t130, t131, t132, t133, t134, t135, t136, t137, t138, t139, t140, t141, t142, t143, t144, t145, t146, t147, t148, t149, t150, t151, t152, t153, t154, t155, t156, t157, t158, t159, t160;
if (!bnf2c_globals){
debug_set_module("bnf2c");
saved_curr = scope_curr;scope_curr = mem_malloc(scope_methods[0]); scope_curr[0] = scope_methods;
scope_curr = scope_alloc(scope_curr, scope_global);
{
bnf2c_g1=(t1 = (t3 = mem_malloc(idstring_methods[0]), ((cptr)t3)[0] = idstring_methods, t3), t2 = ((cptr)(((cptr)t1)[0]))[3], ((f0)t2)((cint)t1, (cint)"!opsys"));
bnf2c_g2=(t4 = (t6 = mem_malloc(idstring_methods[0]), ((cptr)t6)[0] = idstring_methods, t6), t5 = ((cptr)(((cptr)t4)[0]))[3], ((f0)t5)((cint)t4, (cint)"!scanner"));
bnf2c_g3=(t7 = (t9 = mem_malloc(idstring_methods[0]), ((cptr)t9)[0] = idstring_methods, t9), t8 = ((cptr)(((cptr)t7)[0]))[3], ((f0)t8)((cint)t7, (cint)"!parser"));
bnf2c_g4=(t10 = (t12 = mem_malloc(idstring_methods[0]), ((cptr)t12)[0] = idstring_methods, t12), t11 = ((cptr)(((cptr)t10)[0]))[3], ((f0)t11)((cint)t10, (cint)"!printscn"));
bnf2c_g5=(t13 = (t15 = mem_malloc(idstring_methods[0]), ((cptr)t15)[0] = idstring_methods, t15), t14 = ((cptr)(((cptr)t13)[0]))[3], ((f0)t14)((cint)t13, (cint)"!printpar"));
bnf2c_g6=(t16 = (t18 = mem_malloc(idstring_methods[0]), ((cptr)t18)[0] = idstring_methods, t18), t17 = ((cptr)(((cptr)t16)[0]))[3], ((f0)t17)((cint)t16, (cint)"!printbld"));
bnf2c_g7=(t19 = (t21 = mem_malloc(identifier_methods[0]), ((cptr)t21)[0] = identifier_methods, t21), t20 = ((cptr)(((cptr)t19)[0]))[3], ((f0)t20)((cint)t19, (cint)"File_name"));
bnf2c_g8=(t22 = (t24 = mem_malloc(identifier_methods[0]), ((cptr)t24)[0] = identifier_methods, t24), t23 = ((cptr)(((cptr)t22)[0]))[3], ((f0)t23)((cint)t22, (cint)"Extension"));
bnf2c_g10=(t25 = (t27 = mem_malloc(identifier_methods[0]), ((cptr)t27)[0] = identifier_methods, t27), t26 = ((cptr)(((cptr)t25)[0]))[3], ((f0)t26)((cint)t25, (cint)"split"));
bnf2c_g11=(t28 = (t30 = mem_malloc(idstring_methods[0]), ((cptr)t30)[0] = idstring_methods, t30), t29 = ((cptr)(((cptr)t28)[0]))[3], ((f0)t29)((cint)t28, (cint)"."));
bnf2c_g12=(t31 = (t33 = mem_malloc(identifier_methods[0]), ((cptr)t33)[0] = identifier_methods, t33), t32 = ((cptr)(((cptr)t31)[0]))[3], ((f0)t32)((cint)t31, (cint)"locase"));
bnf2c_g13=(t34 = (t36 = mem_malloc(identifier_methods[0]), ((cptr)t36)[0] = identifier_methods, t36), t35 = ((cptr)(((cptr)t34)[0]))[3], ((f0)t35)((cint)t34, (cint)"Command_line"));
bnf2c_g14=(t37 = (t39 = mem_malloc(integer_methods[0]), ((cptr)t39)[0] = integer_methods, t39), t38 = ((cptr)(((cptr)t37)[0]))[3], ((f0)t38)((cint)t37, (cint)"2"));
bnf2c_g15=(t40 = (t42 = mem_malloc(idstring_methods[0]), ((cptr)t42)[0] = idstring_methods, t42), t41 = ((cptr)(((cptr)t40)[0]))[3], ((f0)t41)((cint)t40, (cint)"bnf"));
bnf2c_g16=(t43 = (t45 = mem_malloc(idstring_methods[0]), ((cptr)t45)[0] = idstring_methods, t45), t44 = ((cptr)(((cptr)t43)[0]))[3], ((f0)t44)((cint)t43, (cint)"Source file should be called: "));
bnf2c_g17=(t46 = (t48 = mem_malloc(idstring_methods[0]), ((cptr)t48)[0] = idstring_methods, t48), t47 = ((cptr)(((cptr)t46)[0]))[3], ((f0)t47)((cint)t46, (cint)".slm"));
bnf2c_g18=(t49 = (t51 = mem_malloc(identifier_methods[0]), ((cptr)t51)[0] = identifier_methods, t51), t50 = ((cptr)(((cptr)t49)[0]))[3], ((f0)t50)((cint)t49, (cint)"Parse"));
bnf2c_g19=(t52 = (t54 = mem_malloc(idstring_methods[0]), ((cptr)t54)[0] = idstring_methods, t54), t53 = ((cptr)(((cptr)t52)[0]))[3], ((f0)t53)((cint)t52, (cint)".bnf"));
bnf2c_g20=(t55 = (t57 = mem_malloc(identifier_methods[0]), ((cptr)t57)[0] = identifier_methods, t57), t56 = ((cptr)(((cptr)t55)[0]))[3], ((f0)t56)((cint)t55, (cint)"Print_scanner"));
bnf2c_g21=(t58 = (t60 = mem_malloc(identifier_methods[0]), ((cptr)t60)[0] = identifier_methods, t60), t59 = ((cptr)(((cptr)t58)[0]))[3], ((f0)t59)((cint)t58, (cint)"Print_parser"));
bnf2c_g22=(t61 = (t63 = mem_malloc(identifier_methods[0]), ((cptr)t63)[0] = identifier_methods, t63), t62 = ((cptr)(((cptr)t61)[0]))[3], ((f0)t62)((cint)t61, (cint)"Print_builder"));
};
{
{
(t64 = (t66 = bnf2c_g1, ((cptr)t66)[1] += 1, t66), t65 = ((cptr)(((cptr)t64)[0]))[49], ((f0)t65)((cint)t64));
(t67 = (t69 = bnf2c_g2, ((cptr)t69)[1] += 1, t69), t68 = ((cptr)(((cptr)t67)[0]))[49], ((f0)t68)((cint)t67));
(t70 = (t72 = bnf2c_g3, ((cptr)t72)[1] += 1, t72), t71 = ((cptr)(((cptr)t70)[0]))[49], ((f0)t71)((cint)t70));
(t73 = (t75 = bnf2c_g4, ((cptr)t75)[1] += 1, t75), t74 = ((cptr)(((cptr)t73)[0]))[49], ((f0)t74)((cint)t73));
(t76 = (t78 = bnf2c_g5, ((cptr)t78)[1] += 1, t78), t77 = ((cptr)(((cptr)t76)[0]))[49], ((f0)t77)((cint)t76));
(t79 = (t81 = bnf2c_g6, ((cptr)t81)[1] += 1, t81), t80 = ((cptr)(((cptr)t79)[0]))[49], ((f0)t80)((cint)t79));
};
debug_set_line_num_and_col((cint)3, (cint)1);
{
(t82 = (t84 = (t86 = bnf2c_g7, ((cptr)t86)[1] += 1, t86), t85 = ((cptr)(((cptr)t84)[0]))[69], ((f0)t85)((cint)t84, (cint)(t87 = bnf2c_g8, ((cptr)t87)[1] += 1, t87))), t83 = ((cptr)(((cptr)t82)[0]))[13], ((f0)t83)((cint)t82, (cint)(((bnf2c_g9=(t88 = (t90 = (t92 = (t94 = bnf2c_g10, ((cptr)t94)[1] += 1, t94), t93 = ((cptr)(((cptr)t92)[0]))[77], ((f0)t93)((cint)t92, (cint)(t95 = bnf2c_g11, ((cptr)t95)[1] += 1, t95))), t91 = ((cptr)(((cptr)t90)[0]))[77], ((f0)t91)((cint)t90, (cint)(t96 = (t98 = (t100 = bnf2c_g12, ((cptr)t100)[1] += 1, t100), t99 = ((cptr)(((cptr)t98)[0]))[77], ((f0)t99)((cint)t98, (cint)(t101 = (t103 = (t105 = bnf2c_g13, ((cptr)t105)[1] += 1, t105), t104 = ((cptr)(((cptr)t103)[0]))[77], ((f0)t104)((cint)t103, (cint)(t106 = bnf2c_g14, ((cptr)t106)[1] += 1, t106))), t102 = ((cptr)(((cptr)t101)[0]))[38], ((f0)t102)((cint)t101)))), t97 = ((cptr)(((cptr)t96)[0]))[38], ((f0)t97)((cint)t96)))), t89 = ((cptr)(((cptr)t88)[0]))[38], ((f0)t89)((cint)t88)))!=object_Undefined)?bnf2c_g9:(t107 = (t109 = (t111 = (t113 = (t115 = mem_malloc(slist_methods[0]), ((cptr)t115)[0] = slist_methods, t115), t114 = ((cptr)(((cptr)t113)[0]))[3], ((f0)t114)((cint)t113, (cint)2)), t112 = ((cptr)(((cptr)t111)[0]))[7], ((f0)t112)((cint)t111, (cint)(t116 = (t118 = (t120 = bnf2c_g12, ((cptr)t120)[1] += 1, t120), t119 = ((cptr)(((cptr)t118)[0]))[77], ((f0)t119)((cint)t118, (cint)(t121 = (t123 = (t125 = bnf2c_g13, ((cptr)t125)[1] += 1, t125), t124 = ((cptr)(((cptr)t123)[0]))[77], ((f0)t124)((cint)t123, (cint)(t126 = bnf2c_g14, ((cptr)t126)[1] += 1, t126))), t122 = ((cptr)(((cptr)t121)[0]))[38], ((f0)t122)((cint)t121)))), t117 = ((cptr)(((cptr)t116)[0]))[38], ((f0)t117)((cint)t116)))), t110 = ((cptr)(((cptr)t109)[0]))[7], ((f0)t110)((cint)t109, (cint)(t127 = bnf2c_g15, ((cptr)t127)[1] += 1, t127))), t108 = ((cptr)(((cptr)t107)[0]))[107], ((f0)t108)((cint)t107)))));
debug_set_line_num_and_col((cint)6, (cint)1);
};
debug_set_line_num_and_col((cint)6, (cint)1);
if (((t128 = (t130 = (t132 = (t134 = bnf2c_g8, ((cptr)t134)[1] += 1, t134), t133 = ((cptr)(((cptr)t132)[0]))[38], ((f0)t133)((cint)t132)), t131 = ((cptr)(((cptr)t130)[0]))[36], ((f0)t131)((cint)t130, (cint)(t135 = bnf2c_g15, ((cptr)t135)[1] += 1, t135))), t129 = ((cptr)(((cptr)t128)[0]))[95], ((f0)t129)((cint)t128))==boolean_True)){
{
debug_set_line_num_and_col((cint)7, (cint)6);
debug_set_line_num_and_col((cint)7, (cint)7);
stdout_Put((cint)(t136 = bnf2c_g16, ((cptr)t136)[1] += 1, t136));
debug_set_line_num_and_col((cint)7, (cint)39);
stdout_Put((cint)(t137 = (t139 = bnf2c_g7, ((cptr)t139)[1] += 1, t139), t138 = ((cptr)(((cptr)t137)[0]))[38], ((f0)t138)((cint)t137)));
debug_set_line_num_and_col((cint)7, (cint)48);
stdout_Put((cint)(t140 = bnf2c_g17, ((cptr)t140)[1] += 1, t140));
debug_set_line_num_and_col((cint)8, (cint)1);
stdout_Put_eol();
debug_set_line_num_and_col((cint)8, (cint)1);
};
debug_set_line_num_and_col((cint)8, (cint)1);
}
else
{
{
(t141 = (t143 = (t145 = bnf2c_g18, ((cptr)t145)[1] += 1, t145), t144 = ((cptr)(((cptr)t143)[0]))[73], ((f0)t144)((cint)t143, (cint)(t146 = (t148 = (t150 = bnf2c_g7, ((cptr)t150)[1] += 1, t150), t149 = ((cptr)(((cptr)t148)[0]))[38], ((f0)t149)((cint)t148)), t147 = ((cptr)(((cptr)t146)[0]))[97], ((f0)t147)((cint)t146, (cint)(t151 = bnf2c_g19, ((cptr)t151)[1] += 1, t151))))), t142 = ((cptr)(((cptr)t141)[0]))[16], ((f0)t142)((cint)t141));
debug_set_line_num_and_col((cint)11, (cint)3);
};
debug_set_line_num_and_col((cint)11, (cint)3);
{
(t152 = (t154 = bnf2c_g20, ((cptr)t154)[1] += 1, t154), t153 = ((cptr)(((cptr)t152)[0]))[16], ((f0)t153)((cint)t152));
debug_set_line_num_and_col((cint)12, (cint)3);
};
debug_set_line_num_and_col((cint)12, (cint)3);
{
(t155 = (t157 = bnf2c_g21, ((cptr)t157)[1] += 1, t157), t156 = ((cptr)(((cptr)t155)[0]))[16], ((f0)t156)((cint)t155));
debug_set_line_num_and_col((cint)13, (cint)3);
};
debug_set_line_num_and_col((cint)13, (cint)3);
{
(t158 = (t160 = bnf2c_g22, ((cptr)t160)[1] += 1, t160), t159 = ((cptr)(((cptr)t158)[0]))[16], ((f0)t159)((cint)t158));
debug_set_line_num_and_col((cint)14, (cint)1);
};
debug_set_line_num_and_col((cint)14, (cint)1);
}
;
debug_set_line_num_and_col((cint)15, (cint)1);
};
bnf2c_globals = scope_curr;
scope_curr = saved_curr;
};
scope_import_exports(scope_curr, bnf2c_globals);
}

extern void import_scanner();
extern void import_parser();
extern void import_builder();
extern void import_custbld();
extern void import_walker();
extern void import_custwalk();
extern void import_bnfdef();
extern void import_printbld();
extern void import_printscn();
extern void import_printpar();
extern void import_bnftoscn();
extern void import_strtoscn();
extern void import_compstar();
extern void import_bnftopar();
extern void import_opsys();
extern cint clib_ArgC;
extern cptr clib_ArgV;
extern cptr identifier_methods[meth_max];
extern cptr procedure_methods[meth_max];

void main(cint argc, cptr argv){
  cptr f, m;
  cptr Iscanner, Pscanner;
  cptr Iparser, Pparser;
  cptr Ibuilder, Pbuilder;
  cptr Icustbld, Pcustbld;
  cptr Iwalker, Pwalker;
  cptr Icustwalk, Pcustwalk;
  cptr Ibnfdef, Pbnfdef;
  cptr Iprintbld, Pprintbld;
  cptr Iprintscn, Pprintscn;
  cptr Iprintpar, Pprintpar;
  cptr Ibnftoscn, Pbnftoscn;
  cptr Istrtoscn, Pstrtoscn;
  cptr Icompstar, Pcompstar;
  cptr Ibnftopar, Pbnftopar;
  cptr Ibnf2c, Pbnf2c;
  cptr Iopsys, Popsys;
  clib_ArgC = argc; clib_ArgV = argv;
  interp_init();
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Iscanner = identifier_alloc((cint)m, (cint)"!scanner");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pscanner = procedure_alloc((cint)m, (cint)import_scanner, (cint)Iscanner);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Iparser = identifier_alloc((cint)m, (cint)"!parser");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pparser = procedure_alloc((cint)m, (cint)import_parser, (cint)Iparser);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Ibuilder = identifier_alloc((cint)m, (cint)"!builder");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pbuilder = procedure_alloc((cint)m, (cint)import_builder, (cint)Ibuilder);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Icustbld = identifier_alloc((cint)m, (cint)"!custbld");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pcustbld = procedure_alloc((cint)m, (cint)import_custbld, (cint)Icustbld);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Iwalker = identifier_alloc((cint)m, (cint)"!walker");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pwalker = procedure_alloc((cint)m, (cint)import_walker, (cint)Iwalker);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Icustwalk = identifier_alloc((cint)m, (cint)"!custwalk");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pcustwalk = procedure_alloc((cint)m, (cint)import_custwalk, (cint)Icustwalk);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Ibnfdef = identifier_alloc((cint)m, (cint)"!bnfdef");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pbnfdef = procedure_alloc((cint)m, (cint)import_bnfdef, (cint)Ibnfdef);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Iprintbld = identifier_alloc((cint)m, (cint)"!printbld");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pprintbld = procedure_alloc((cint)m, (cint)import_printbld, (cint)Iprintbld);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Iprintscn = identifier_alloc((cint)m, (cint)"!printscn");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pprintscn = procedure_alloc((cint)m, (cint)import_printscn, (cint)Iprintscn);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Iprintpar = identifier_alloc((cint)m, (cint)"!printpar");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pprintpar = procedure_alloc((cint)m, (cint)import_printpar, (cint)Iprintpar);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Ibnftoscn = identifier_alloc((cint)m, (cint)"!bnftoscn");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pbnftoscn = procedure_alloc((cint)m, (cint)import_bnftoscn, (cint)Ibnftoscn);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Istrtoscn = identifier_alloc((cint)m, (cint)"!strtoscn");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pstrtoscn = procedure_alloc((cint)m, (cint)import_strtoscn, (cint)Istrtoscn);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Icompstar = identifier_alloc((cint)m, (cint)"!compstar");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pcompstar = procedure_alloc((cint)m, (cint)import_compstar, (cint)Icompstar);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Ibnftopar = identifier_alloc((cint)m, (cint)"!bnftopar");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pbnftopar = procedure_alloc((cint)m, (cint)import_bnftopar, (cint)Ibnftopar);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Ibnf2c = identifier_alloc((cint)m, (cint)"!bnf2c");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Pbnf2c = procedure_alloc((cint)m, (cint)import_bnf2c, (cint)Ibnf2c);
  m = mem_malloc(identifier_methods[0]); m[0] = identifier_methods;
  Iopsys = identifier_alloc((cint)m, (cint)"!opsys");
  m = mem_malloc(procedure_methods[0]); m[0] = procedure_methods;
  Popsys = procedure_alloc((cint)m, (cint)import_opsys, (cint)Iopsys);
  import_bnf2c();
  interp_fini();
  exit(0);
};
