⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cc

📁 C语言前端编译器,yacc/lex编写,可自行修改代码.
💻 CC
字号:
// Copyright 2002 by Keith Vallerio.
// All rights reserved.

#include "ArgPack.h"
#include <iostream>
#include <fstream>
#include "database.h"

void do_parse(string s);
/*###########################################################################*/
int main(int argc, char *argv[]) {
	try {
		// read input arguments and store settings in one class
		ArgPack::init(argc, argv, cout);
		ofstream os_;

		// generate a database to contain all processing information
		DB single_db;

		// get input filename and run lex and yacc (parse) it
		string str = ArgPack::write_ap().get_fname();
		do_parse(str);

		// if interpret flag set, analyze program structure
		if (ArgPack::ap().interpret()) {
			DB::write_db().interpret();

			// if profile flag set, profile, recompile and generate TG
			if (ArgPack::ap().profile()) {
				DB::write_db().profile();
				DB::write_db().print_task_graphs();
				// also generate TG in "standard" format
				DB::write_db().print_standard_task_graphs();
			}

			// print both vcg files
			DB::write_db().print_tgraph_vcg();
			DB::db().print_tree_vcg();
		}

	// for error conditions
	} catch (ArgPack::init_error & ie) {
		cout << ie.what();
	}
}













⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -