From: Foster B. <fos...@us...> - 2006-02-03 18:21:33
|
Update of /cvsroot/adobe-source/adobe-source/adobe/test/eve_smoke In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1031/adobe/test/eve_smoke Modified Files: default.eve main.cpp Log Message: asl 1.0.13 Index: default.eve =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/eve_smoke/default.eve,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** default.eve 2 Apr 2005 05:47:37 -0000 1.1 --- default.eve 3 Feb 2006 18:20:48 -0000 1.2 *************** *** 1,11 **** dialog() { ! row() ! { ! button (name: "Hello"); ! } ! column() ! { ! button (name: "world!"); ! } } --- 1,11 ---- dialog() { ! row() ! { ! button (name: "Hello"); ! } ! column() ! { ! button (name: "world!"); ! } } Index: main.cpp =================================================================== RCS file: /cvsroot/adobe-source/adobe-source/adobe/test/eve_smoke/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 2 Jun 2005 23:14:19 -0000 1.3 --- main.cpp 3 Feb 2006 18:20:48 -0000 1.4 *************** *** 1,6 **** /* ! Copyright 2005 Ralph Thomas and Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ --- 1,6 ---- /* ! Copyright 2005 Ralph Thomas and Adobe Systems Incorporated ! Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt ! or a copy at http://opensource.adobe.com/licenses.html) */ *************** *** 23,26 **** --- 23,30 ---- /*************************************************************************************************/ + + namespace { + + /*************************************************************************************************/ // // position_t assemble( ... ) *************** *** 30,59 **** /// doing that for now. /// - /// \param parent the parent node. A position_t is an any. - /// \param parse_location the file name and line number for this data. /// \param name the name of the thing to make. /// \param parameters the parameters for the thing to make. - /// \param brief Nearby comments? - /// \param detailed Nearby comments /// /// \return an any containing the created widget. // ! adobe::eve::position_t assemble( const adobe::eve::position_t& /*parent*/, ! const adobe::line_position_t& /*parse_location*/, ! adobe::name_t name, ! const adobe::array_t& parameters, ! const std::string& /*brief*/, ! const std::string& /*detailed*/ ) { ! std::cout << "Create: " << name.get() << std::endl; ! ! adobe::dictionary_t dict(adobe::eve::evaluate_arguments()( parameters )); ! adobe::dictionary_t::const_iterator first(dict.begin()); ! adobe::dictionary_t::const_iterator last(dict.end()); ! ! for (; first != last; ++first) ! std::cout << "\t" << first->first << " = \"" << first->second << "\"" << std::endl; ! return adobe::eve::position_t(); } --- 34,49 ---- /// doing that for now. /// /// \param name the name of the thing to make. /// \param parameters the parameters for the thing to make. /// /// \return an any containing the created widget. // ! adobe::eve_callback_suite_t::position_t assemble( adobe::name_t name, ! const adobe::dictionary_t& parameters) { ! std::cout << "Create: " << name.get() << std::endl; ! std::cout << parameters << std::endl; ! return adobe::eve_callback_suite_t::position_t(); } *************** *** 69,95 **** void testParse( boost::filesystem::path& fileName ) { ! // ! // Open our input stream. ! // ! boost::filesystem::ifstream stream( fileName ); ! if (!stream.is_open()) ! { ! std::stringstream err; ! err << "Could not open file: " << fileName.native_file_string(); ! throw std::runtime_error(err.str()); ! } ! // ! // Call the Eve parser. ! // ! adobe::eve::parse( stream, adobe::line_position_t( fileName.native_file_string().c_str() ), ! adobe::eve::position_t(), &assemble ); } /*************************************************************************************************/ // // int main() --- 59,94 ---- void testParse( boost::filesystem::path& fileName ) { ! // ! // Open our input stream. ! // ! boost::filesystem::ifstream stream( fileName ); ! if (!stream.is_open()) ! { ! std::stringstream err; ! err << "Could not open file: " << fileName.native_file_string(); ! throw std::runtime_error(err.str()); ! } ! // ! // Call the Eve parser. ! // ! ! adobe::basic_sheet_t layout_sheet; ! adobe::virtual_machine_t evaluator; ! ! adobe::parse(stream, adobe::line_position_t(fileName.native_file_string().c_str()), ! adobe::eve_callback_suite_t::position_t(), adobe::bind_layout(boost::bind(&assemble, _2, _3), ! layout_sheet, evaluator)); } /*************************************************************************************************/ + } // namespace + + /*************************************************************************************************/ + // // int main() *************** *** 104,139 **** int main( int argc, char* argv[] ) { ! bool success(true); ! // ! // Try to open the filename given on the command line, otherwise ! // try to open "default.eve". ! // ! try ! { ! boost::filesystem::path file_path("default.eve"); ! if( argc > 1 ) file_path = boost::filesystem::path(argv[1], boost::filesystem::native); ! // ! // Call our testParse function with the selected filename. ! // ! testParse( file_path ); ! } ! catch( const std::exception& error ) ! { ! // ! // Oops, something didn't work out. ! // ! std::cerr << "Exception: " << error.what() << std::endl; ! } ! catch( ... ) ! { ! std::cerr << "Unknown exception" << std::endl; ! } ! return success ? 0 : 1; } --- 103,138 ---- int main( int argc, char* argv[] ) { ! bool success(true); ! // ! // Try to open the filename given on the command line, otherwise ! // try to open "default.eve". ! // ! try ! { ! boost::filesystem::path file_path("default.eve"); ! if( argc > 1 ) file_path = boost::filesystem::path(argv[1], boost::filesystem::native); ! // ! // Call our testParse function with the selected filename. ! // ! testParse( file_path ); ! } ! catch( const std::exception& error ) ! { ! // ! // Oops, something didn't work out. ! // ! std::cerr << "Exception: " << error.what() << std::endl; ! } ! catch( ... ) ! { ! std::cerr << "Unknown exception" << std::endl; ! } ! return success ? 0 : 1; } |