示例#1
0
文件: generic.c 项目: gm2-pisa/midas
INT cd_gen(INT cmd, EQUIPMENT * pequipment)
{
   INT status;

   switch (cmd) {
   case CMD_INIT:
      status = gen_init(pequipment);
      break;

   case CMD_START:
     status = gen_start(pequipment);
     break;
     
   case CMD_STOP:
      status = gen_stop(pequipment);
      break;

   case CMD_EXIT:
      status = gen_exit(pequipment);
      break;

   case CMD_IDLE:
      status = gen_idle(pequipment);
      break;

   default:
      cm_msg(MERROR, "Generic class driver", "Received unknown command %d", cmd);
      status = FE_ERR_DRIVER;
      break;
   }

   return status;
}
示例#2
0
文件: int_cxx.cpp 项目: mp-lee/core
static void gen_estore( const act* action, int column, bool special)
{
	const gpre_req* request = action->act_request;
	align(column);
	gen_compile(request, column);
	gen_start(request, request->req_primary, column, special);
}
示例#3
0
文件: main.cpp 项目: borneq/Ulam-lang
int main(int argc, char **argv)
{
	atexit(FINISH);

	if (argc != 2)
		ERROR("Source file not specified.");
	SourceFile = argv[1];
	DebugStream.open("compile.txt", ios::out | ios::trunc);
	DebugStream << "\n### SPOKOL(TM) Compiler ###\n\n";
	DebugStream << "Copyleft 2002 by Omega Red\n[[email protected]]\n";
	DebugStream << "[Built " __DATE__ " " __TIME__ "]\n\n";
	DebugStream << "Source file: " << SourceFile << "\n\n";
	lex_analyze();
	if (ErrorOccured)
		ERROR("Lexical analysis failed.");
	syn_analyze();
	if (ErrorOccured)
		ERROR("Syntax analysis failed.");
	sem_analyze();
	if (ErrorOccured)
		ERROR("Semantic analysis failed.");
	gen_start();
	if (ErrorOccured)
		ERROR("Code generation failed.");
	DebugStream.close();

	return 0;
}
示例#4
0
文件: int_cxx.cpp 项目: mp-lee/core
static void gen_s_start( const act* action, int column)
{
	const gpre_req* request = action->act_request;
	gen_compile(request, column);

    const gpre_port* port = request->req_vport;
	if (port)
		asgn_from(port->por_references, column);

	gen_start(request, port, column, false);
}
示例#5
0
static void
trigger(struct context *ctx, event_type_t type, void *rarg, void *carg)
{
    struct gen *g = &ctx->conn_gen;
    struct dist_info *di = &ctx->conn_dist;
    event_type_t firing_event = (di->type == DIST_NONE) ? EVENT_GEN_CONN_FIRE :
                                EVENT_INVALID;

    ASSERT(type == EVENT_GEN_CONN_TRIGGER);

    gen_start(g, ctx, di, make_conn, NULL, firing_event);
}
static void
trigger(struct context *ctx, event_type_t type, void *rarg, void *carg)
{
    struct conn *conn = carg;
    struct gen *g = &conn->call_gen;
    struct dist_info *di = &ctx->call_dist;
    event_type_t firing_event = (di->type == DIST_NONE) ? EVENT_GEN_CALL_FIRE :
                                EVENT_INVALID;

    ASSERT(type == EVENT_GEN_CALL_TRIGGER);
    ASSERT(conn->ctx == ctx);

    gen_start(g, ctx, di, issue_call, conn, firing_event);
}