From: <ibr...@us...> - 2013-05-17 18:46:11
|
Revision: 4650 http://sourceforge.net/p/tora/code/4650 Author: ibre5041 Date: 2013-05-17 18:46:06 +0000 (Fri, 17 May 2013) Log Message: ----------- Modified Paths: -------------- branches/tora3/extlibs/parsing.cpp/OraclePLSQL.g branches/tora3/extlibs/parsing.cpp/S3.g branches/tora3/extlibs/parsing.cpp/s2.cpp branches/tora3/extlibs/parsing.cpp/s3.cpp Modified: branches/tora3/extlibs/parsing.cpp/OraclePLSQL.g =================================================================== --- branches/tora3/extlibs/parsing.cpp/OraclePLSQL.g 2013-05-17 12:23:03 UTC (rev 4649) +++ branches/tora3/extlibs/parsing.cpp/OraclePLSQL.g 2013-05-17 18:46:06 UTC (rev 4650) @@ -986,7 +986,7 @@ // ( k_enable | k_disable )? // ( k_when LPAREN expression /*TODO condition*/ RPAREN )? // ( plsql_block | k_call routine_clause | comp_block) - ~('DECLARE'|'BEGIN')* + ~('DECLARE'|'BEGIN'|'CALL')* (k_declare|k_begin) => plsql_block SEMI ; Modified: branches/tora3/extlibs/parsing.cpp/S3.g =================================================================== --- branches/tora3/extlibs/parsing.cpp/S3.g 2013-05-17 12:23:03 UTC (rev 4649) +++ branches/tora3/extlibs/parsing.cpp/S3.g 2013-05-17 18:46:06 UTC (rev 4650) @@ -29,27 +29,36 @@ public: Evaluator(const char*text) : m_text(text) {}; Evaluator(std::string text) : m_text(text) {}; + std::string const& toString() { return m_text; }; private: std::string m_text; }; } start_rule returns[S3Parser::Evaluator *evaluator, std::string message] - : parse + : r=parse + { + $evaluator = $r.evaluator; + $message = $r.message; + } ; -parse - : r=receive { - S3Parser::Evaluator *e = $r.evaluator; - std::string m = $r.message; - } +parse returns[S3Parser::Evaluator *evaluator, std::string message] + : r=receive + { + S3Parser::Evaluator *e = $r.evaluator; + std::string m = $r.message; + $evaluator = $r.evaluator; + $message = $r.message; + } ; receive returns[S3Parser::Evaluator *evaluator, std::string message] - : RECEIVE f=FILENAME { - $evaluator = new S3Parser::Evaluator($f.text); - $message = "Some message here..."; - } + : RECEIVE f=FILENAME + { + $evaluator = new S3Parser::Evaluator($f.text); + $message = "Some message here..."; + } ; RECEIVE: 'RECEIVE'; Modified: branches/tora3/extlibs/parsing.cpp/s2.cpp =================================================================== --- branches/tora3/extlibs/parsing.cpp/s2.cpp 2013-05-17 12:23:03 UTC (rev 4649) +++ branches/tora3/extlibs/parsing.cpp/s2.cpp 2013-05-17 18:46:06 UTC (rev 4650) @@ -170,6 +170,8 @@ // Finally, now that we have our lexer constructed, we can create the parser // psr = new S2Parser(tstream); // javaParserNew is generated by ANTLR3 + S2Parser::start_rule_return r = psr->start_rule(); + std::cout << r.getTree()->toStringTree() << std::endl; // Note that this means only that the methods are always called via the object // pointer and the first argument to any method, is a pointer to the structure itself. Modified: branches/tora3/extlibs/parsing.cpp/s3.cpp =================================================================== --- branches/tora3/extlibs/parsing.cpp/s3.cpp 2013-05-17 12:23:03 UTC (rev 4649) +++ branches/tora3/extlibs/parsing.cpp/s3.cpp 2013-05-17 18:46:06 UTC (rev 4650) @@ -170,7 +170,11 @@ // Finally, now that we have our lexer constructed, we can create the parser // psr = new S3Parser(tstream); // javaParserNew is generated by ANTLR3 - + S3Parser::start_rule_return r = psr->start_rule(); + std::cout << r.getTree()->toStringTree() << std::endl; + std::cout << "Message: " << r.message << std::endl; + std::cout << "Evaluator.Message: " << r.evaluator->toString() << std::endl; + // Note that this means only that the methods are always called via the object // pointer and the first argument to any method, is a pointer to the structure itself. // It also has the side advantage, if you are using an IDE such as VS2005 that can do it This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |