#include <string.h>
#include "cdefs.h"
extern cptr identifier_methods[meth_max];
extern cptr idstring_methods[meth_max];
extern cptr integer_methods[meth_max];
extern cptr sstring_methods[meth_max];
extern int Start_col;
extern int Curr_line_num;

cptr Saved_start_col;
cptr Saved_curr_line_num;

cptr CExport;
cptr CMap_declaration;
cptr Cadd_to_list;
cptr CType_declaration;
cptr Cendif;
cptr CFunc;
cptr Crepeat_until;
cptr CParameter_values;
cptr Celsif;
cptr CProc;
cptr Crepeat_loop;
cptr CObject_initialization;
cptr Creturn;
cptr Ctoken;
cptr CProcedure_call;
cptr Csubscripted_name;
cptr Celse;
cptr CStart_col;
cptr Cwhile_loop;
cptr Cand;
cptr Cexit;
cptr Cneg;
cptr CObject_declaration;
cptr CFor_loop;
cptr Cmult;
cptr Cdiv;
cptr Cplus;
cptr CTokstring;
cptr Cmin;
cptr Creturn_val;
cptr Cconditional_statement;
cptr Cstart_list;
cptr Cge;
cptr CParameterized_name;
cptr CTokname;
cptr Cif;
cptr Cnot;
cptr CCurr_line_num;
cptr Cle;
cptr Cne;
cptr Ceq;
cptr CConcat;
cptr Cfunc_id;
cptr Cgt;
cptr Cadd_statement;
cptr Clr_name;
cptr CSimple_class_name;
cptr Cproc_id;
cptr Cor;
cptr Clt;
cptr CAssign;
cptr Cmulti_object_declaration;
cptr CModule;
cptr CList_literal;
cptr CSimple_name;
cptr Cinteger;
cptr CClass_name;
cptr CString;
cptr CImport;

void import_cbuilder(){}

int Init_cbuilder(){
  CTokname = mem_malloc(identifier_methods[0]);
  CTokname[0] = identifier_methods;
  identifier_alloc(CTokname, "Tokname");
  CTokstring = mem_malloc(identifier_methods[0]);
  CTokstring[0] = identifier_methods;
  identifier_alloc(CTokstring, "Tokstring");
  CStart_col = mem_malloc(identifier_methods[0]);
  CStart_col[0] = identifier_methods;
  identifier_alloc(CStart_col, "Start_col");
  CCurr_line_num = mem_malloc(identifier_methods[0]);
  CCurr_line_num[0] = identifier_methods;
  identifier_alloc(CCurr_line_num, "Curr_line_num");
  CExport = mem_malloc(identifier_methods[0]);
  CExport[0] = identifier_methods;
  identifier_alloc(CExport, "Build_export");
  CMap_declaration = mem_malloc(identifier_methods[0]);
  CMap_declaration[0] = identifier_methods;
  identifier_alloc(CMap_declaration, "Build_map_declaration");
  Cadd_to_list = mem_malloc(identifier_methods[0]);
  Cadd_to_list[0] = identifier_methods;
  identifier_alloc(Cadd_to_list, "Build_add_to_list");
  CType_declaration = mem_malloc(identifier_methods[0]);
  CType_declaration[0] = identifier_methods;
  identifier_alloc(CType_declaration, "Build_type_declaration");
  Cendif = mem_malloc(identifier_methods[0]);
  Cendif[0] = identifier_methods;
  identifier_alloc(Cendif, "Build_endif");
  CFunc = mem_malloc(identifier_methods[0]);
  CFunc[0] = identifier_methods;
  identifier_alloc(CFunc, "Build_func");
  Crepeat_until = mem_malloc(identifier_methods[0]);
  Crepeat_until[0] = identifier_methods;
  identifier_alloc(Crepeat_until, "Build_repeat_until");
  CParameter_values = mem_malloc(identifier_methods[0]);
  CParameter_values[0] = identifier_methods;
  identifier_alloc(CParameter_values, "Build_parameter_values");
  Celsif = mem_malloc(identifier_methods[0]);
  Celsif[0] = identifier_methods;
  identifier_alloc(Celsif, "Build_elsif");
  CProc = mem_malloc(identifier_methods[0]);
  CProc[0] = identifier_methods;
  identifier_alloc(CProc, "Build_proc");
  Crepeat_loop = mem_malloc(identifier_methods[0]);
  Crepeat_loop[0] = identifier_methods;
  identifier_alloc(Crepeat_loop, "Build_repeat_loop");
  CObject_initialization = mem_malloc(identifier_methods[0]);
  CObject_initialization[0] = identifier_methods;
  identifier_alloc(CObject_initialization, "Build_object_initialization");
  Creturn = mem_malloc(identifier_methods[0]);
  Creturn[0] = identifier_methods;
  identifier_alloc(Creturn, "Build_return");
  Ctoken = mem_malloc(identifier_methods[0]);
  Ctoken[0] = identifier_methods;
  identifier_alloc(Ctoken, "Build_token");
  CProcedure_call = mem_malloc(identifier_methods[0]);
  CProcedure_call[0] = identifier_methods;
  identifier_alloc(CProcedure_call, "Build_procedure_call");
  Csubscripted_name = mem_malloc(identifier_methods[0]);
  Csubscripted_name[0] = identifier_methods;
  identifier_alloc(Csubscripted_name, "Build_subscripted_name");
  Celse = mem_malloc(identifier_methods[0]);
  Celse[0] = identifier_methods;
  identifier_alloc(Celse, "Build_else");
  Cwhile_loop = mem_malloc(identifier_methods[0]);
  Cwhile_loop[0] = identifier_methods;
  identifier_alloc(Cwhile_loop, "Build_while_loop");
  Cand = mem_malloc(identifier_methods[0]);
  Cand[0] = identifier_methods;
  identifier_alloc(Cand, "Build_and");
  Cexit = mem_malloc(identifier_methods[0]);
  Cexit[0] = identifier_methods;
  identifier_alloc(Cexit, "Build_exit");
  Cneg = mem_malloc(identifier_methods[0]);
  Cneg[0] = identifier_methods;
  identifier_alloc(Cneg, "Build_neg");
  CObject_declaration = mem_malloc(identifier_methods[0]);
  CObject_declaration[0] = identifier_methods;
  identifier_alloc(CObject_declaration, "Build_object_declaration");
  CFor_loop = mem_malloc(identifier_methods[0]);
  CFor_loop[0] = identifier_methods;
  identifier_alloc(CFor_loop, "Build_for_loop");
  Cmult = mem_malloc(identifier_methods[0]);
  Cmult[0] = identifier_methods;
  identifier_alloc(Cmult, "Build_mult");
  Cdiv = mem_malloc(identifier_methods[0]);
  Cdiv[0] = identifier_methods;
  identifier_alloc(Cdiv, "Build_div");
  Cplus = mem_malloc(identifier_methods[0]);
  Cplus[0] = identifier_methods;
  identifier_alloc(Cplus, "Build_plus");
  Cmin = mem_malloc(identifier_methods[0]);
  Cmin[0] = identifier_methods;
  identifier_alloc(Cmin, "Build_min");
  Creturn_val = mem_malloc(identifier_methods[0]);
  Creturn_val[0] = identifier_methods;
  identifier_alloc(Creturn_val, "Build_return_val");
  Cconditional_statement = mem_malloc(identifier_methods[0]);
  Cconditional_statement[0] = identifier_methods;
  identifier_alloc(Cconditional_statement, "Build_conditional_statement");
  Cstart_list = mem_malloc(identifier_methods[0]);
  Cstart_list[0] = identifier_methods;
  identifier_alloc(Cstart_list, "Build_start_list");
  Cge = mem_malloc(identifier_methods[0]);
  Cge[0] = identifier_methods;
  identifier_alloc(Cge, "Build_ge");
  CParameterized_name = mem_malloc(identifier_methods[0]);
  CParameterized_name[0] = identifier_methods;
  identifier_alloc(CParameterized_name, "Build_parameterized_name");
  Cif = mem_malloc(identifier_methods[0]);
  Cif[0] = identifier_methods;
  identifier_alloc(Cif, "Build_if");
  Cnot = mem_malloc(identifier_methods[0]);
  Cnot[0] = identifier_methods;
  identifier_alloc(Cnot, "Build_not");
  Cle = mem_malloc(identifier_methods[0]);
  Cle[0] = identifier_methods;
  identifier_alloc(Cle, "Build_le");
  Cne = mem_malloc(identifier_methods[0]);
  Cne[0] = identifier_methods;
  identifier_alloc(Cne, "Build_ne");
  Ceq = mem_malloc(identifier_methods[0]);
  Ceq[0] = identifier_methods;
  identifier_alloc(Ceq, "Build_eq");
  CConcat = mem_malloc(identifier_methods[0]);
  CConcat[0] = identifier_methods;
  identifier_alloc(CConcat, "Build_concat");
  Cfunc_id = mem_malloc(identifier_methods[0]);
  Cfunc_id[0] = identifier_methods;
  identifier_alloc(Cfunc_id, "Build_func_id");
  Cgt = mem_malloc(identifier_methods[0]);
  Cgt[0] = identifier_methods;
  identifier_alloc(Cgt, "Build_gt");
  Cadd_statement = mem_malloc(identifier_methods[0]);
  Cadd_statement[0] = identifier_methods;
  identifier_alloc(Cadd_statement, "Build_add_statement");
  Clr_name = mem_malloc(identifier_methods[0]);
  Clr_name[0] = identifier_methods;
  identifier_alloc(Clr_name, "Build_lr_name");
  CSimple_class_name = mem_malloc(identifier_methods[0]);
  CSimple_class_name[0] = identifier_methods;
  identifier_alloc(CSimple_class_name, "Build_simple_class_name");
  Cproc_id = mem_malloc(identifier_methods[0]);
  Cproc_id[0] = identifier_methods;
  identifier_alloc(Cproc_id, "Build_proc_id");
  Cor = mem_malloc(identifier_methods[0]);
  Cor[0] = identifier_methods;
  identifier_alloc(Cor, "Build_or");
  Clt = mem_malloc(identifier_methods[0]);
  Clt[0] = identifier_methods;
  identifier_alloc(Clt, "Build_lt");
  CAssign = mem_malloc(identifier_methods[0]);
  CAssign[0] = identifier_methods;
  identifier_alloc(CAssign, "Build_assign");
  Cmulti_object_declaration = mem_malloc(identifier_methods[0]);
  Cmulti_object_declaration[0] = identifier_methods;
  identifier_alloc(Cmulti_object_declaration, "Build_multi_object_declaration");
  CModule = mem_malloc(identifier_methods[0]);
  CModule[0] = identifier_methods;
  identifier_alloc(CModule, "Build_module");
  CList_literal = mem_malloc(identifier_methods[0]);
  CList_literal[0] = identifier_methods;
  identifier_alloc(CList_literal, "Build_list_literal");
  CSimple_name = mem_malloc(identifier_methods[0]);
  CSimple_name[0] = identifier_methods;
  identifier_alloc(CSimple_name, "Build_simple_name");
  Cinteger = mem_malloc(identifier_methods[0]);
  Cinteger[0] = identifier_methods;
  identifier_alloc(Cinteger, "Build_integer");
  CClass_name = mem_malloc(identifier_methods[0]);
  CClass_name[0] = identifier_methods;
  identifier_alloc(CClass_name, "Build_class_name");
  CString = mem_malloc(identifier_methods[0]);
  CString[0] = identifier_methods;
  identifier_alloc(CString, "Build_string");
  CImport = mem_malloc(identifier_methods[0]);
  CImport[0] = identifier_methods;
  identifier_alloc(CImport, "Build_import");
  Saved_start_col = mem_malloc(integer_methods[0]);
  Saved_start_col[0] = integer_methods;
  Saved_start_col = integer_ialloc(Saved_start_col, 1);
  Saved_curr_line_num = mem_malloc(integer_methods[0]);
  Saved_curr_line_num[0] = integer_methods;
  Saved_curr_line_num = integer_ialloc(Saved_curr_line_num, 1);
  CStart_col[1] += 1; Saved_start_col[1] += 1;
  identifier_OpAssign(CStart_col, Saved_start_col, 0);
  CCurr_line_num[1] += 1; Saved_curr_line_num[1] += 1;
  identifier_OpAssign(CCurr_line_num, Saved_curr_line_num, 0);
};

int Build_token(char* tokname, char* inpline, int i, int j){
  cptr tkn, tkstr; char* tok;
  tkn = mem_malloc(idstring_methods[0]);
  tkn[0] = idstring_methods;
  tkn = idstring_alloc(tkn, tokname);
  CTokname[1] += 1; identifier_OpAssign(CTokname, tkn, 0);
  tok = mem_malloc(j-i+1);
  strncpy(tok, inpline+i, j-i); tok[j-i] = 0;
  tkstr = mem_malloc(sstring_methods[0]);
  tkstr[0] = sstring_methods;
  tkstr = sstring_alloc(tkstr, tok);
  CTokstring[1] += 1; identifier_OpAssign(CTokstring, tkstr, 0);
  Ctoken[1] += 1; identifier_Call(Ctoken);
};

int Build_add_statement(){
  CStart_col[1] += 1; Saved_start_col[1] += 1;
  Saved_start_col = integer_update_hashval(Saved_start_col, Start_col+1);
  identifier_OpAssign(CStart_col, Saved_start_col, 0);
  CCurr_line_num[1] += 1; Saved_curr_line_num[1] += 1;
  Saved_curr_line_num = integer_update_hashval(Saved_curr_line_num, Curr_line_num);
  identifier_OpAssign(CCurr_line_num, Saved_curr_line_num, 0);
  Cadd_statement[1] += 1;
  identifier_Call(Cadd_statement);
};


int Build_export(){
  CExport[1] += 1;
  identifier_Call(CExport);
};

int Build_map_declaration(){
  CMap_declaration[1] += 1;
  identifier_Call(CMap_declaration);
};

int Build_add_to_list(){
  Cadd_to_list[1] += 1;
  identifier_Call(Cadd_to_list);
};

int Build_type_declaration(){
  CType_declaration[1] += 1;
  identifier_Call(CType_declaration);
};

int Build_endif(){
  Cendif[1] += 1;
  identifier_Call(Cendif);
};

int Build_func(){
  CFunc[1] += 1;
  identifier_Call(CFunc);
};

int Build_repeat_until(){
  Crepeat_until[1] += 1;
  identifier_Call(Crepeat_until);
};

int Build_parameter_values(){
  CParameter_values[1] += 1;
  identifier_Call(CParameter_values);
};

int Build_elsif(){
  Celsif[1] += 1;
  identifier_Call(Celsif);
};

int Build_proc(){
  CProc[1] += 1;
  identifier_Call(CProc);
};

int Build_repeat_loop(){
  Crepeat_loop[1] += 1;
  identifier_Call(Crepeat_loop);
};

int Build_object_initialization(){
  CObject_initialization[1] += 1;
  identifier_Call(CObject_initialization);
};

int Build_return(){
  Creturn[1] += 1;
  identifier_Call(Creturn);
};

int Build_procedure_call(){
  CProcedure_call[1] += 1;
  identifier_Call(CProcedure_call);
};

int Build_subscripted_name(){
  Csubscripted_name[1] += 1;
  identifier_Call(Csubscripted_name);
};

int Build_else(){
  Celse[1] += 1;
  identifier_Call(Celse);
};

int Build_while_loop(){
  Cwhile_loop[1] += 1;
  identifier_Call(Cwhile_loop);
};

int Build_and(){
  Cand[1] += 1;
  identifier_Call(Cand);
};

int Build_exit(){
  Cexit[1] += 1;
  identifier_Call(Cexit);
};

int Build_neg(){
  Cneg[1] += 1;
  identifier_Call(Cneg);
};

int Build_object_declaration(){
  CObject_declaration[1] += 1;
  identifier_Call(CObject_declaration);
};

int Build_for_loop(){
  CFor_loop[1] += 1;
  identifier_Call(CFor_loop);
};

int Build_mult(){
  Cmult[1] += 1;
  identifier_Call(Cmult);
};

int Build_div(){
  Cdiv[1] += 1;
  identifier_Call(Cdiv);
};

int Build_plus(){
  Cplus[1] += 1;
  identifier_Call(Cplus);
};

int Build_min(){
  Cmin[1] += 1;
  identifier_Call(Cmin);
};

int Build_return_val(){
  Creturn_val[1] += 1;
  identifier_Call(Creturn_val);
};

int Build_conditional_statement(){
  Cconditional_statement[1] += 1;
  identifier_Call(Cconditional_statement);
};

int Build_start_list(){
  Cstart_list[1] += 1;
  identifier_Call(Cstart_list);
};

int Build_ge(){
  Cge[1] += 1;
  identifier_Call(Cge);
};

int Build_parameterized_name(){
  CParameterized_name[1] += 1;
  identifier_Call(CParameterized_name);
};

int Build_if(){
  Cif[1] += 1;
  identifier_Call(Cif);
};

int Build_not(){
  Cnot[1] += 1;
  identifier_Call(Cnot);
};

int Build_le(){
  Cle[1] += 1;
  identifier_Call(Cle);
};

int Build_ne(){
  Cne[1] += 1;
  identifier_Call(Cne);
};

int Build_eq(){
  Ceq[1] += 1;
  identifier_Call(Ceq);
};

int Build_concat(){
  CConcat[1] += 1;
  identifier_Call(CConcat);
};

int Build_func_id(){
  Cfunc_id[1] += 1;
  identifier_Call(Cfunc_id);
};

int Build_gt(){
  Cgt[1] += 1;
  identifier_Call(Cgt);
};

int Build_lr_name(){
  Clr_name[1] += 1;
  identifier_Call(Clr_name);
};

int Build_simple_class_name(){
  CSimple_class_name[1] += 1;
  identifier_Call(CSimple_class_name);
};

int Build_proc_id(){
  Cproc_id[1] += 1;
  identifier_Call(Cproc_id);
};

int Build_or(){
  Cor[1] += 1;
  identifier_Call(Cor);
};

int Build_lt(){
  Clt[1] += 1;
  identifier_Call(Clt);
};

int Build_assign(){
  CAssign[1] += 1;
  identifier_Call(CAssign);
};

int Build_multi_object_declaration(){
  Cmulti_object_declaration[1] += 1;
  identifier_Call(Cmulti_object_declaration);
};

int Build_module(){
  CModule[1] += 1;
  identifier_Call(CModule);
};

int Build_list_literal(){
  CList_literal[1] += 1;
  identifier_Call(CList_literal);
};

int Build_simple_name(){
  CSimple_name[1] += 1;
  identifier_Call(CSimple_name);
};

int Build_integer(){
  Cinteger[1] += 1;
  identifier_Call(Cinteger);
};

int Build_class_name(){
  CClass_name[1] += 1;
  identifier_Call(CClass_name);
};

int Build_string(){
  CString[1] += 1;
  identifier_Call(CString);
};

int Build_import(){
  CImport[1] += 1;
  identifier_Call(CImport);
};
