void interpreter::process_insn(Instruction insn) { switch(insn) { case BC_DLOAD: process_load<d_t>(); break; case BC_ILOAD: process_load<i_t>(); break; case BC_SLOAD: process_load<s_t>(); break; case BC_DLOAD0: process_load_val<d_t>(0); break; case BC_ILOAD0: process_load_val<i_t>(0); break; //case BC_SLOAD0: process_load_val<s_t>(constantById(zero_string_id_).c_str()); break; case BC_DLOAD1: process_load_val<d_t>(1); break; case BC_ILOAD1: process_load_val<i_t>(1); break; case BC_DLOADM1: process_load_val<d_t>(-1); break; case BC_ILOADM1: process_load_val<i_t>(-1); break; case BC_DADD: process_binary<d_t>(insn); break; case BC_IADD: process_binary<i_t>(insn); break; case BC_DSUB: process_binary<d_t>(insn); break; case BC_ISUB: process_binary<i_t>(insn); break; case BC_DMUL: process_binary<d_t>(insn); break; case BC_IMUL: process_binary<i_t>(insn); break; case BC_DDIV: process_binary<d_t>(insn); break; case BC_IDIV: process_binary<i_t>(insn); break; case BC_IMOD: process_binary<i_t>(insn); break; case BC_DNEG: process_unary<d_t>(insn); break; case BC_INEG: process_unary<i_t>(insn); break; case BC_IAOR: process_binary<i_t>(insn); break; case BC_IAAND: process_binary<i_t>(insn); break; case BC_IAXOR: process_binary<i_t>(insn); break; case BC_IPRINT: process_print<i_t>(); break; case BC_DPRINT: process_print<d_t>(); break; case BC_SPRINT: process_print<s_t>(); break; case BC_POP: stack_.pop(); break; case BC_LOADDVAR: process_load_local<d_t>(); break; case BC_LOADIVAR: process_load_local<i_t>(); break; case BC_LOADSVAR: process_load_local<s_t>(); break; case BC_STOREDVAR: process_store_local<d_t>(); break; case BC_STOREIVAR: process_store_local<i_t>(); break; case BC_STORESVAR: process_store_local<s_t>(); break; case BC_LOADCTXDVAR: process_load_ctx<d_t>(); break; case BC_LOADCTXIVAR: process_load_ctx<i_t>(); break; case BC_LOADCTXSVAR: process_load_ctx<s_t>(); break; case BC_STORECTXDVAR: process_store_ctx<d_t>(); break; case BC_STORECTXIVAR: process_store_ctx<i_t>(); break; case BC_STORECTXSVAR: process_store_ctx<s_t>(); break; case BC_CALL: process_call(); break; case BC_RETURN: return_ = true; break; default: throw unsupported_insn(insn); } }
void process_send(ErlMessage* emsg, int erl_fd) { ETERM* master_pattern = erl_format("{call, Pid, Cmd}"); if (erl_match(master_pattern, emsg->msg)) { TRACE(("matched master pattern")); process_call(master_pattern, erl_fd); } else { erl_err_msg("could not match the master pattern."); } TRACE(("leaving process_send")); erl_free_term(master_pattern); }
Datum token_type(PG_FUNCTION_ARGS) { FuncCallContext *funcctx; Datum result; SET_FUNCOID(); if (SRF_IS_FIRSTCALL()) { funcctx = SRF_FIRSTCALL_INIT(); setup_firstcall(fcinfo, funcctx, PG_GETARG_OID(0)); } funcctx = SRF_PERCALL_SETUP(); if ((result = process_call(funcctx)) != (Datum) 0) SRF_RETURN_NEXT(funcctx, result); SRF_RETURN_DONE(funcctx); }
Datum token_type_current(PG_FUNCTION_ARGS) { FuncCallContext *funcctx; Datum result; SET_FUNCOID(); if (SRF_IS_FIRSTCALL()) { funcctx = SRF_FIRSTCALL_INIT(); if (current_parser_id == InvalidOid) current_parser_id = name2id_prs(char2text("default")); setup_firstcall(fcinfo, funcctx, current_parser_id); } funcctx = SRF_PERCALL_SETUP(); if ((result = process_call(funcctx)) != (Datum) 0) SRF_RETURN_NEXT(funcctx, result); SRF_RETURN_DONE(funcctx); }
Datum token_type_byname(PG_FUNCTION_ARGS) { FuncCallContext *funcctx; Datum result; SET_FUNCOID(); if (SRF_IS_FIRSTCALL()) { text *name = PG_GETARG_TEXT_P(0); funcctx = SRF_FIRSTCALL_INIT(); setup_firstcall(fcinfo, funcctx, name2id_prs(name)); PG_FREE_IF_COPY(name, 0); } funcctx = SRF_PERCALL_SETUP(); if ((result = process_call(funcctx)) != (Datum) 0) SRF_RETURN_NEXT(funcctx, result); SRF_RETURN_DONE(funcctx); }
void IR_GVN::process_bb(IR_BB * bb, bool & change) { C<IR*> * ct; for (IR * ir = IR_BB_ir_list(bb).get_head(&ct); ir != NULL; ir = IR_BB_ir_list(bb).get_next(&ct)) { switch (IR_type(ir)) { case IR_ST: case IR_STPR: case IR_IST: process_st(ir, change); break; case IR_CALL: case IR_ICALL: process_call(ir, change); break; case IR_TRUEBR: case IR_FALSEBR: comp_vn(BR_det(ir), change); break; case IR_SWITCH: comp_vn(SWITCH_vexp(ir), change); break; case IR_IGOTO: comp_vn(IGOTO_vexp(ir), change); break; case IR_RETURN: comp_vn(RET_exp(ir), change); break; case IR_REGION: process_region(ir, change); break; case IR_PHI: process_phi(ir, change); break; case IR_GOTO: break; default: IS_TRUE0(0); } } }
int AddGroup(string name, string owner) { mixed *group; string savefile, *savefilea; int i; if (!name || !owner) return 0; if (!ARCH_SECURITY || process_call()) return -1; // Darf nicht if (member(grouplist, name)) return -2; // Gibt es schon if (!master()->find_userinfo(owner)) return -3; savefilea = old_explode(name,"."); savefile = implode(savefilea,"/"); if (file_size(NEWSPATH+savefile+".o")>=0) return -4; // Notwendige Directories anlegen for (i = 0; i < sizeof(savefilea)-1; i++) { mkdir(NEWSPATH+implode(savefilea[0..i],"/")); } group=({});
// generates code to implement node's action static void implement_node(ast_node node){ if (node != NULL){ if (node->node_type == ROOT){ process_root(node); } // generate code for assignment operator else if (node->node_type == OP_ASSIGN){ process_assign(node); } // generate code for negate operator else if (node->node_type == OP_NEG) { process_negate(node); } // generate code for +, -, *, /, %, =, !=, <, <=, >, >= else if (node->node_type > 0 && node->node_type <= 16 && node->node_type != 14 && node->node_type != 15){ process_math(node); } else if (node->node_type == OP_INC){ process_inc(node, "1"); } else if (node->node_type == OP_DEC){ process_inc(node, "-1"); } else if (node->node_type == IF_STMT){ process_if(node); } else if (node->node_type == IF_ELSE_STMT){ process_ifelse(node); } else if (node->node_type == CMPD){ process_cmpd(node); } else if (node->node_type == WHILE_STMT){ process_while(node); } else if (node->node_type == DO_WHILE_STMT){ process_dowhile(node); } else if (node->node_type == OP_AND){ process_and(node); } else if (node->node_type == OP_OR){ process_or(node); } else if (node->node_type == FOR_STRT || node->node_type == FOR_COND || node->node_type == FOR_UPDT){ process_for_header(node); } else if (node->node_type == FOR_STMT){ process_for(node); } else if (node->node_type == READ_STMT){ process_read(node); } else if (node->node_type == PRINT_STMT){ process_print(node); } else if (node->node_type == RETURN_STMT){ process_return(node); } else if (node->node_type == FUNCDEC){ process_function(node); } else if (node->node_type == PARAMS){ process_params(node); } else if (node->node_type == INT_TYPE || node->node_type == DOUBLE_TYPE){ process_vardec(node); } else if (node->node_type == CALL){ process_call(node); } else if (node->node_type == IDENT){ process_id(node); } else if (node->node_type == ARRAY){ process_array(node); } } }