virtual int run(int, char*[]) { // // Down-cast the proxy to a Directory proxy. // DirectoryPrx rootDir = DirectoryPrx::checkedCast(communicator()->propertyToProxy("RootDir.Proxy")); if(!rootDir) { throw "Invalid proxy"; } ParserPtr p = new Parser(rootDir); return p->parse(); }
int compile_chain(string filename) { cout << "[ Compiling... ]" << endl; InputPtr input = Input::open_file(filename); if (input != nullptr) { ScannerPtr scanner = ScannerPtr(new Scanner(input)); SemanticAnalyzerPtr analyzer = SemanticAnalyzerPtr(new SemanticAnalyzer(filename)); ParserPtr parser = ParserPtr(new Parser(scanner, analyzer)); parser->parse(); parser->get_analyzer()->generate_all(); report_msg_type("Success", "Compilation terminated successfully"); } else { return -1; } cout << "[ End ]" << endl; return 0; }
virtual int run(int, char*[]) { // // Create a proxy for the root directory // Ice::ObjectPrx base = communicator()->stringToProxy("RootDir:default -p 10000"); // // Down-cast the proxy to a Directory proxy. // DirectoryPrx rootDir = DirectoryPrx::checkedCast(base); if(!rootDir) { throw "Invalid proxy"; } ParserPtr p = new Parser(rootDir); return p->parse(); }