コード例 #1
0
ファイル: lisp.cpp プロジェクト: wakama2/lisp2
static void runFromFile(Context *ctx, const char *filename) {
	FILE *fp = fopen(filename, "r");
	if(fp == NULL) {
		fprintf(stderr, "file open error: %s\n", filename);
		return;
	}
	FileReader fr(fp);
	compileAndRun(ctx, &fr);
	fclose(fp);
}
コード例 #2
0
ファイル: runcompile.cpp プロジェクト: enefry/cpad
/* 此函数仅打开编译执行界面  */
void RunCompile::showCompileAndRun(QString getCompiler, QString getWorkingDir, QStringList getArgs, QString fn)
{
    getConfig(getCompiler, getWorkingDir, getArgs, fn);
    compileAndRun();
    twoLayout->addWidget(compileLable, 0, 0);
    twoLayout->addWidget(compileToRun, 0, 1);
    twoLayout->addWidget(clearCompile, 0, 2);
    twoLayout->addWidget(compileEdit, 1, 0, 1, 3);
    twoWidget->setLayout(twoLayout);
    this->setWidget(twoWidget);

    setWindowTitle(tr("编译并运行"));
    setMinimumHeight(150);
    show();
}
コード例 #3
0
ファイル: lisp.cpp プロジェクト: wakama2/lisp2
static void runInteractive(Context *ctx) {
	// init readline
	read_history(HISTFILE);
	// start
	while(true) {
		char *in = readline(">>");
		if(in == NULL || strcmp(in, "exit") == 0 || strcmp(in, "quit") == 0) {
			if(in != NULL) free(in);
			break;
		}
		CharReader r(in);
		compileAndRun(ctx, &r);
		if(strlen(in) > 0) {
			add_history(in);
			write_history(HISTFILE);
		}
		free(in);
	}
}
コード例 #4
0
ファイル: e2e.cpp プロジェクト: slak44/test-lang
TEST_F(E2ETest, PrintAlphabet) {
  EXPECT_EQ(
    compileAndRun("data/end-to-end/alphabet.xylene"),
    ProgramResult({0, "abcdefghijklmnopqrstuvwxyz", ""})
  );
}
コード例 #5
0
ファイル: runcompile.cpp プロジェクト: enefry/cpad
void RunCompile::compilePrograms()
{
    compileAndRun();
}