You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Braden M. <br...@us...> - 2006-11-22 00:05:22
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3665/src/libopenvrml/openvrml Modified Files: browser.cpp browser.h Log Message: Factored creation of openvrml::resource_istreams to a dedicated abstract factory, openvrml::resource_fetcher. This allows the code associated with resource fetching to live at least as long as the browser instance, which it needs to do if there are any outstanding fetches happening when the browser instance is destroyed. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.194 retrieving revision 1.195 diff -C2 -d -r1.194 -r1.195 *** browser.cpp 17 Nov 2006 06:47:25 -0000 1.194 --- browser.cpp 22 Nov 2006 00:05:18 -0000 1.195 *************** *** 4591,4594 **** --- 4591,4748 ---- /** + * @class openvrml::resource_fetcher + * + * @brief An abstract factory for @c resource_istream%s. + * + * A concrete implementation of this interface must be passed to + * <code>browser</code>'s constructor. + * + * @sa openvrml::browser + */ + + /** + * @brief Destroy. + */ + openvrml::resource_fetcher::~resource_fetcher() OPENVRML_NOTHROW + {} + + /** + * @brief Fetch a network resource. + * + * @param[in] uri a Uniform Resource Identifier. + * + * This function delegates to @c resource_fetcher::do_get_resource. + * + * @return the requested resource as a stream. + */ + std::auto_ptr<openvrml::resource_istream> + openvrml::resource_fetcher::get_resource(const std::string & uri) + { + return this->do_get_resource(uri); + } + + /** + * @fn std::auto_ptr<openvrml::resource_istream> openvrml::resource_fetcher::do_get_resource(const std::string & uri) + * + * @brief Fetch a network resource. + * + * Called by @c resource_fetcher::get_resource, clients of OpenVRML are + * required to provide an implementation for this function. OpenVRML depends + * on the implementation of this function for all of its input needs. As + * such, what kind of resources OpenVRML is capable of resolving is entirely + * dependent on code provided by the application. A trivial implementation + * designed to handle only @c file resources can use @c std::filebuf: + * + * @code + * std::auto_ptr<openvrml::resource_istream> + * my_resource_fetcher::do_get_resource(const std::string & uri) + * { + * using std::auto_ptr; + * using std::invalid_argument; + * using std::string; + * using openvrml::resource_istream; + * + * class file_resource_istream : public resource_istream { + * std::string url_; + * std::filebuf buf_; + * + * public: + * explicit file_resource_istream(const std::string & path): + * resource_istream(&this->buf_) + * { + * // + * // Note that the failbit is set in the constructor if no data + * // can be read from the stream. This is important. If the + * // failbit is not set on such a stream, OpenVRML will attempt + * // to read data from a stream that cannot provide it. + * // + * if (!this->buf_.open(path.c_str(), ios_base::in)) { + * this->setstate(ios_base::failbit); + * } + * } + * + * void url(const std::string & str) + * { + * this->url_ = str; + * } + * + * private: + * virtual const std::string url() const + * { + * return this->url_; + * } + * + * virtual const std::string type() const + * { + * // + * // A real application should use OS facilities for this; + * // however, that is beyond the scope of this example (which + * // is intended to be portable and stupid). + * // + * using std::find; + * using std::string; + * using boost::algorithm::iequals; + * using boost::next; + * string media_type = "application/octet-stream"; + * const string::const_reverse_iterator dot_pos = + * find(this->url_.rbegin(), this->url_.rend(), '.'); + * if (dot_pos == this->url_.rend() + * || next(dot_pos.base()) == this->url_.end()) { + * return media_type; + * } + * const string::const_iterator hash_pos = + * find(next(dot_pos.base()), this->url_.end(), '#'); + * const string ext(dot_pos.base(), hash_pos); + * if (iequals(ext, "wrl")) { + * media_type = "model/vrml"; + * } else if (iequals(ext, "png")) { + * media_type = "image/png"; + * } else if (iequals(ext, "jpg") || iequals(ext, "jpeg")) { + * media_type = "image/jpeg"; + * } + * return media_type; + * } + * + * virtual bool data_available() const + * { + * return !!(*this); + * } + * }; + * + * const string scheme = uri.substr(0, uri.find_first_of(':')); + * if (scheme != "file") { + * throw invalid_argument('\"' + scheme + "\" URI scheme not " + * "supported"); + * } + * // + * // file:// + * // ^ + * // 01234567 + * // + * string path = uri.substr(uri.find_first_of('/', 7)); + * + * auto_ptr<resource_istream> in(new file_resource_istream(path)); + * static_cast<file_resource_istream *>(in.get())->url(uri); + * + * return in; + * } + * @endcode + * + * The @p uri parameter is provided by OpenVRML and can be assumed to be an + * absolute URI. As such, it will always have a scheme through which the + * client code can choose a resolution mechanism. For more information on URI + * syntax, see <a + * href="ftp://ftp.rfc-editor.org/in-notes/std/std66.txt">Internet + * STD 66</a>. + * + * @param[in] uri an absolute Uniform Resource Identifier. + * + * @return the requested resource as a stream. + * + * @sa ftp://ftp.rfc-editor.org/in-notes/std/std66.txt + */ + + + /** * @class openvrml::stream_listener * *************** *** 4909,4915 **** * @brief Encapsulates a VRML browser. * ! * @c browser is the foundation of the OpenVRML runtime. Users need to ! * inherit this class and override @c browser::do_get_resource and provide an ! * implementation of @c resource_istream. */ --- 5063,5077 ---- * @brief Encapsulates a VRML browser. * ! * @c browser is the foundation of the OpenVRML runtime. @c browser is ! * instantiated with an implementation of @c resource_fetcher, which is ! * provided by application code. The @c resource_fetcher instance must have a ! * longer lifetime than the @c browser instance, since the @c resource_fetcher ! * instance could be used during destruction of the @c browser. Note, ! * however, that <code>browser</code>'s destructor will block until all ! * threads that may use the @c resource_fetcher have completed. So it is ! * sufficient to have the @c browser and the @c resource_fetcher destroyed ! * sequentially in the same thread. ! * ! * @sa openvrml::resource_fetcher */ *************** *** 5464,5473 **** * @brief Constructor. * ! * @param[in] out output stream for console output. ! * @param[in] err output stream for error console output. * * @exception std::bad_alloc if memory allocation fails. */ ! openvrml::browser::browser(std::ostream & out, std::ostream & err) OPENVRML_THROW1(std::bad_alloc): null_node_metatype_(new null_node_metatype(*this)), --- 5626,5638 ---- * @brief Constructor. * ! * @param[in] fetcher a @c resource_fetcher implementation. ! * @param[in] out output stream for console output. ! * @param[in] err output stream for error console output. * * @exception std::bad_alloc if memory allocation fails. */ ! openvrml::browser::browser(resource_fetcher & fetcher, ! std::ostream & out, ! std::ostream & err) OPENVRML_THROW1(std::bad_alloc): null_node_metatype_(new null_node_metatype(*this)), *************** *** 5484,5487 **** --- 5649,5653 ---- viewer_(0), modified_(false), + fetcher_(fetcher), out_(&out), err_(&err), *************** *** 5780,5917 **** /** - * @brief Fetch a network resource. - * - * @param[in] uri a Uniform Resource Identifier. - * - * @return the requested resource as a stream. - */ - std::auto_ptr<openvrml::resource_istream> - openvrml::browser::get_resource(const std::string & uri) - { - return this->do_get_resource(uri); - } - - /** - * @fn std::auto_ptr<openvrml::resource_istream> openvrml::browser::do_get_resource(const std::string & uri) - * - * @brief Fetch a network resource. - * - * Called by @c browser::get_resource, clients of OpenVRML are required to - * provide an implementation for this function. OpenVRML depends on the - * implementation of this function for all of its input needs. As such, what - * kind of resources OpenVRML is capable of resolving is entirely dependent on - * code provided by the application. A trivial implementation designed to - * handle only @c file resources can use @c std::filebuf: - * - * @code - * std::auto_ptr<openvrml::resource_istream> - * my_browser::do_get_resource(const std::string & uri) - * { - * using std::auto_ptr; - * using std::invalid_argument; - * using std::string; - * using openvrml::resource_istream; - * - * class file_resource_istream : public resource_istream { - * std::string url_; - * std::filebuf buf_; - * - * public: - * explicit file_resource_istream(const std::string & path): - * resource_istream(&this->buf_) - * { - * // - * // Note that the failbit is set in the constructor if no data - * // can be read from the stream. This is important. If the - * // failbit is not set on such a stream, OpenVRML will attempt - * // to read data from a stream that cannot provide it. - * // - * if (!this->buf_.open(path.c_str(), ios_base::in)) { - * this->setstate(ios_base::failbit); - * } - * } - * - * void url(const std::string & str) - * { - * this->url_ = str; - * } - * - * private: - * virtual const std::string url() const - * { - * return this->url_; - * } - * - * virtual const std::string type() const - * { - * // - * // A real application should use OS facilities for this; - * // however, that is beyond the scope of this example (which - * // is intended to be portable and stupid). - * // - * using std::find; - * using std::string; - * using boost::algorithm::iequals; - * using boost::next; - * string media_type = "application/octet-stream"; - * const string::const_reverse_iterator dot_pos = - * find(this->url_.rbegin(), this->url_.rend(), '.'); - * if (dot_pos == this->url_.rend() - * || next(dot_pos.base()) == this->url_.end()) { - * return media_type; - * } - * const string::const_iterator hash_pos = - * find(next(dot_pos.base()), this->url_.end(), '#'); - * const string ext(dot_pos.base(), hash_pos); - * if (iequals(ext, "wrl")) { - * media_type = "model/vrml"; - * } else if (iequals(ext, "png")) { - * media_type = "image/png"; - * } else if (iequals(ext, "jpg") || iequals(ext, "jpeg")) { - * media_type = "image/jpeg"; - * } - * return media_type; - * } - * - * virtual bool data_available() const - * { - * return !!(*this); - * } - * }; - * - * const string scheme = uri.substr(0, uri.find_first_of(':')); - * if (scheme != "file") { - * throw invalid_argument('\"' + scheme + "\" URI scheme not " - * "supported"); - * } - * // - * // file:// - * // ^ - * // 01234567 - * // - * string path = uri.substr(uri.find_first_of('/', 7)); - * - * auto_ptr<resource_istream> in(new file_resource_istream(path)); - * static_cast<file_resource_istream *>(in.get())->url(uri); - * - * return in; - * } - * @endcode - * - * The @p uri parameter is provided by OpenVRML and can be assumed to be an - * absolute URI. As such, it will always have a scheme through which the - * client code can choose a resolution mechanism. For more information on URI - * syntax, see <a - * href="ftp://ftp.rfc-editor.org/in-notes/std/std66.txt">Internet - * STD 66</a>. - * - * @param[in] uri an absolute Uniform Resource Identifier. - * - * @return the requested resource as a stream. - * - * @sa ftp://ftp.rfc-editor.org/in-notes/std/std66.txt - */ - - /** * @brief Get the browser name. * --- 5946,5949 ---- *************** *** 7200,7204 **** try { ! in = this->browser().get_resource(absolute_uri); } catch (...) { throw unreachable_url(); --- 7232,7236 ---- try { ! in = this->browser().fetcher_.get_resource(absolute_uri); } catch (...) { throw unreachable_url(); Index: browser.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.h,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** browser.h 28 Jul 2006 07:04:19 -0000 1.61 --- browser.h 22 Nov 2006 00:05:18 -0000 1.62 *************** *** 53,56 **** --- 53,68 ---- + class OPENVRML_API resource_fetcher { + public: + virtual ~resource_fetcher() OPENVRML_NOTHROW = 0; + + std::auto_ptr<resource_istream> get_resource(const std::string & uri); + + private: + virtual std::auto_ptr<resource_istream> + do_get_resource(const std::string & uri) = 0; + }; + + class OPENVRML_API stream_listener { public: *************** *** 171,174 **** --- 183,187 ---- class OPENVRML_API browser : boost::noncopyable { + friend class scene; friend class Vrml97Parser; friend class X3DVrmlParser; *************** *** 241,244 **** --- 254,259 ---- mutable boost::mutex modified_mutex_; + resource_fetcher & fetcher_; + mutable boost::mutex out_mutex_; std::ostream * const out_; *************** *** 255,259 **** bool flags_need_updating; ! browser(std::ostream & out, std::ostream & err) OPENVRML_THROW1(std::bad_alloc); virtual ~browser() OPENVRML_NOTHROW; --- 270,276 ---- bool flags_need_updating; ! browser(resource_fetcher & fetcher, ! std::ostream & out, ! std::ostream & err) OPENVRML_THROW1(std::bad_alloc); virtual ~browser() OPENVRML_NOTHROW; *************** *** 284,288 **** void viewer(openvrml::viewer * v) OPENVRML_THROW1(viewer_in_use); openvrml::viewer * viewer() const OPENVRML_NOTHROW; - std::auto_ptr<resource_istream> get_resource(const std::string & uri); virtual const char * name() const OPENVRML_NOTHROW; --- 301,304 ---- *************** *** 341,348 **** protected: bool headlight_on(); - - private: - virtual std::auto_ptr<resource_istream> - do_get_resource(const std::string & uri) = 0; }; --- 357,360 ---- |
From: Braden M. <br...@us...> - 2006-11-22 00:05:20
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3665/src/openvrml-gtkplug Modified Files: gtkvrmlbrowser.cpp Log Message: Factored creation of openvrml::resource_istreams to a dedicated abstract factory, openvrml::resource_fetcher. This allows the code associated with resource fetching to live at least as long as the browser instance, which it needs to do if there are any outstanding fetches happening when the browser instance is destroyed. Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/gtkvrmlbrowser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gtkvrmlbrowser.cpp 1 Oct 2006 05:47:07 -0000 1.2 --- gtkvrmlbrowser.cpp 22 Nov 2006 00:05:19 -0000 1.3 *************** *** 97,105 **** G_GNUC_INTERNAL GdkGLConfig * gl_config; ! class G_GNUC_INTERNAL browser : public openvrml::browser { GIOChannel * request_channel_; public: ! explicit browser(GIOChannel & request_channel); private: --- 97,105 ---- G_GNUC_INTERNAL GdkGLConfig * gl_config; ! class G_GNUC_INTERNAL resource_fetcher : public openvrml::resource_fetcher { GIOChannel * request_channel_; public: ! explicit resource_fetcher(GIOChannel & request_channel); private: *************** *** 121,125 **** gpointer); ! ::browser browser_; GtkVrmlBrowser & vrml_browser_; guint timer; --- 121,126 ---- gpointer); ! ::resource_fetcher fetcher_; ! openvrml::browser browser_; GtkVrmlBrowser & vrml_browser_; guint timer; *************** *** 473,483 **** namespace { ! browser::browser(GIOChannel & request_channel): ! openvrml::browser(std::cout, std::cerr), request_channel_(&request_channel) {} std::auto_ptr<openvrml::resource_istream> ! browser::do_get_resource(const std::string & uri) { using openvrml_player::plugin_streambuf; --- 474,483 ---- namespace { ! resource_fetcher::resource_fetcher(GIOChannel & request_channel): request_channel_(&request_channel) {} std::auto_ptr<openvrml::resource_istream> ! resource_fetcher::do_get_resource(const std::string & uri) { using openvrml_player::plugin_streambuf; *************** *** 542,546 **** GtkGLViewer::GtkGLViewer(GIOChannel & request_channel, GtkVrmlBrowser & vrml_browser): ! browser_(request_channel), vrml_browser_(vrml_browser), timer(0), --- 542,547 ---- GtkGLViewer::GtkGLViewer(GIOChannel & request_channel, GtkVrmlBrowser & vrml_browser): ! fetcher_(request_channel), ! browser_(this->fetcher_, std::cout, std::cerr), vrml_browser_(vrml_browser), timer(0), |
From: Braden M. <br...@us...> - 2006-11-22 00:05:20
|
Update of /cvsroot/openvrml/openvrml/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3665/doc Modified Files: index.doc Log Message: Factored creation of openvrml::resource_istreams to a dedicated abstract factory, openvrml::resource_fetcher. This allows the code associated with resource fetching to live at least as long as the browser instance, which it needs to do if there are any outstanding fetches happening when the browser instance is destroyed. Index: index.doc =================================================================== RCS file: /cvsroot/openvrml/openvrml/doc/index.doc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.doc 25 Oct 2006 22:33:20 -0000 1.4 --- index.doc 22 Nov 2006 00:05:18 -0000 1.5 *************** *** 56,60 **** * supported by modern Web browsers (significantly, @c ftp and @c http). * ! * @subsubsection introducing_resource_istream 2.1.2 Introducing resource_istream * * OpenVRML accomplishes this extensibility by extending the C++ IOStreams --- 56,60 ---- * supported by modern Web browsers (significantly, @c ftp and @c http). * ! * @subsubsection resource_istream 2.1.2 resource_istream and resource_fetcher * * OpenVRML accomplishes this extensibility by extending the C++ IOStreams *************** *** 72,83 **** * it and providing implementations for its pure virtual functions. * ! * @subsubsection introducing_browser 2.1.3 Introducing browser * ! * The centerpiece of the OpenVRML library is @c openvrml::browser. This ! * class provides the interface for loading VRML/X3D worlds. Most management ! * of the runtime will be handled through its member functions. Like ! * @c resource_istream, @c browser is an abstract class that users must inherit. ! * However, @c browser has only one pure virtual function you must implement: ! * the one responsible for creating @c resource_istream%s. * * @code --- 72,82 ---- * it and providing implementations for its pure virtual functions. * ! * OpenVRML constructs @c resource_istream instances through the @c ! * resource_fetcher interface. @c resource_fetcher is an <a ! * href="http://en.wikipedia.org/wiki/Abstract_factory_pattern">abstract ! * factory</a> that also must be implemented by user code. * ! * @c resource_fetcher has a single pure virtual function that must be ! * implemented: * * @code *************** *** 85,92 **** * @endcode * ! * The API documentation for @c openvrml::browser::do_get_resource provides ! * more details on the requirements for this function's implementation. ! * Briefly, your implementation will return a @c std::auto_ptr to an instance ! * of your class that implements @c openvrml::resource_istream. * * @note Most “factory functions” (i.e., functions that return an --- 84,93 ---- * @endcode * ! * @c do_get_resource is, essentially, a construction function for concrete ! * @c resource_istream%s. The API documentation for ! * @c openvrml::resource_fetcher::do_get_resource provides details on the ! * requirements for this function's implementation. Briefly, your ! * implementation will return a @c std::auto_ptr to an instance of your class ! * that implements @c openvrml::resource_istream. * * @note Most “factory functions” (i.e., functions that return an *************** *** 95,98 **** --- 96,108 ---- * a return value signals that the caller is taking ownership of the resource. * + * @subsubsection introducing_browser 2.1.3 Introducing browser + * + * The centerpiece of the OpenVRML library is @c openvrml::browser. This + * class provides the interface for loading VRML/X3D worlds. Most management + * of the runtime will be handled through its member functions. @c browser is + * instantiated with a concrete subclass of @c resource_fetcher along with + * @c std::ostream instances where normal console output and error console output + * should be sent. + * * @subsubsection resource_istream_impl_considerations 2.1.4 resource_istream implementation considerations * *************** *** 107,111 **** * OpenVRML's stream reading thread is reading the buffer. * ! * The IOstreams framework is typically extended by inheriting * @c std::streambuf to implement new sources and sinks for data. (Full * treatment of this topic is beyond the scope of this document; see <a --- 117,121 ---- * OpenVRML's stream reading thread is reading the buffer. * ! * The IOStreams framework is typically extended by inheriting * @c std::streambuf to implement new sources and sinks for data. (Full * treatment of this topic is beyond the scope of this document; see <a |
From: Braden M. <br...@us...> - 2006-11-22 00:05:20
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3665 Modified Files: ChangeLog Log Message: Factored creation of openvrml::resource_istreams to a dedicated abstract factory, openvrml::resource_fetcher. This allows the code associated with resource fetching to live at least as long as the browser instance, which it needs to do if there are any outstanding fetches happening when the browser instance is destroyed. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1379 retrieving revision 1.1380 diff -C2 -d -r1.1379 -r1.1380 *** ChangeLog 20 Nov 2006 03:20:28 -0000 1.1379 --- ChangeLog 22 Nov 2006 00:05:17 -0000 1.1380 *************** *** 1,2 **** --- 1,58 ---- + 2006-11-21 Braden McDaniel <br...@en...> + + Factored creation of openvrml::resource_istreams to a dedicated + abstract factory, openvrml::resource_fetcher. This allows the + code associated with resource fetching to live at least as long as + the browser instance, which it needs to do if there are any + outstanding fetches happening when the browser instance is + destroyed. + + * doc/index.doc: Updates to reflect addition of + openvrml::resource_fetcher. + * examples/sdl_viewer.cpp: Inherit openvrml::resource_fetcher to + implement do_get_resource instead of openvrml::browser. + * src/libopenvrml/openvrml/browser.cpp + (openvrml::resource_fetcher::~resource_fetcher()): Destructor. + (openvrml::resource_fetcher::get_resource(const std::string &)): + Delegate to do_get_resource. + (openvrml::browser::browser(resource_fetcher &, std::ostream &, + std::ostream &)): Initialize openvrml::browser::fetcher_. + (openvrml::browser::get_resource(const std::string &)): Removed + function. + (openvrml::scene::get_resource(const std::vector<std::string> &) + const): Delegate instead to browser::fetcher_. + * src/libopenvrml/openvrml/browser.h + (openvrml::resource_fetcher): Added class. + (openvrml::browser): Granted friendship to openvrml::scene so that + it can access browser::fetcher_; added browser::fetcher_ member; + changed constructor to take an openvrml::resource_fetcher + reference; removed browser::get_resource and + browser::do_get_resource members. + * src/openvrml-gtkplug/gtkvrmlbrowser.cpp + (browser): Removed class. + (resource_fetcher): Added class. + (GtkGLViewer): Added concrete resource_fetcher member; changed + browser_ member to be an openvrml::browser. + (GtkGLViewer::GtkGLViewer(GIOChannel &, GtkVrmlBrowser &)): + Initialize fetcher_ with the GIOChannel; initialize browser_ with + fetcher_. + * tests/Makefile.am + (noinst_HEADERS): Changed test_browser.h to + test_resource_fetcher.h. + (libtest_openvrml_la_SOURCES): Changed test_browser.cpp to + test_resource_fetcher.cpp. + * tests/browser.cpp: Use test_resource_fetcher instead of + test_browser. + * tests/parse_anchor.cpp: Use test_resource_fetcher instead of + test_browser. + * tests/parse_vrml97.cpp: Use test_resource_fetcher instead of + test_browser. + * tests/parse_x3dvrml.cpp: Use test_resource_fetcher instead of + test_browser. + * tests/test_browser.cpp: Removed file. + * tests/test_browser.h: Removed file. + * tests/test_resource_fetcher.cpp: Added file. + * tests/test_resource_fetcher.h: Added file. + 2006-11-19 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-11-22 00:05:20
|
Update of /cvsroot/openvrml/openvrml/examples In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3665/examples Modified Files: sdl_viewer.cpp Log Message: Factored creation of openvrml::resource_istreams to a dedicated abstract factory, openvrml::resource_fetcher. This allows the code associated with resource fetching to live at least as long as the browser instance, which it needs to do if there are any outstanding fetches happening when the browser instance is destroyed. Index: sdl_viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/examples/sdl_viewer.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sdl_viewer.cpp 31 Aug 2006 21:19:11 -0000 1.11 --- sdl_viewer.cpp 22 Nov 2006 00:05:18 -0000 1.12 *************** *** 39,46 **** namespace { ! class browser : public openvrml::browser { ! public: ! browser(); ! private: virtual std::auto_ptr<openvrml::resource_istream> --- 39,43 ---- namespace { ! class resource_fetcher : public openvrml::resource_fetcher { private: virtual std::auto_ptr<openvrml::resource_istream> *************** *** 106,110 **** sdl_viewer v(url); ! browser b; b.viewer(&v); --- 103,108 ---- sdl_viewer v(url); ! resource_fetcher fetcher; ! openvrml::browser b(fetcher, std::cout, std::cerr); b.viewer(&v); *************** *** 129,138 **** namespace { - browser::browser(): - openvrml::browser(std::cout, std::cerr) - {} - std::auto_ptr<openvrml::resource_istream> ! browser::do_get_resource(const std::string & uri) { using std::auto_ptr; --- 127,132 ---- namespace { std::auto_ptr<openvrml::resource_istream> ! resource_fetcher::do_get_resource(const std::string & uri) { using std::auto_ptr; |
From: Braden M. <br...@us...> - 2006-11-20 03:21:21
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16755 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Use AC_CHECK_PROGS to check for antlr-java as well. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.56 retrieving revision 1.1310.2.57 diff -C2 -d -r1.1310.2.56 -r1.1310.2.57 *** ChangeLog 18 Nov 2006 20:48:46 -0000 1.1310.2.56 --- ChangeLog 20 Nov 2006 03:21:14 -0000 1.1310.2.57 *************** *** 1,2 **** --- 1,6 ---- + 2006-11-19 Braden McDaniel <br...@en...> + + * m4/antlr.m4: Use AC_CHECK_PROGS to check for antlr-java as well. + 2006-11-18 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-11-20 03:21:16
|
Update of /cvsroot/openvrml/openvrml/m4 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16755/m4 Modified Files: Tag: OpenVRML-0_16-BRANCH antlr.m4 Log Message: Use AC_CHECK_PROGS to check for antlr-java as well. Index: antlr.m4 =================================================================== RCS file: /cvsroot/openvrml/openvrml/m4/antlr.m4,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** antlr.m4 17 Nov 2006 02:29:50 -0000 1.3.2.1 --- antlr.m4 20 Nov 2006 03:21:15 -0000 1.3.2.2 *************** *** 3,7 **** [AC_REQUIRE([OV_PROG_JAVA]) AC_ARG_VAR([ANTLR], [antlr parser generator]) ! AC_CHECK_PROG([ANTLR], [antlr]) if test -z "$ANTLR"; then AC_MSG_CHECKING([if antlr is available to the Java runtime]) --- 3,7 ---- [AC_REQUIRE([OV_PROG_JAVA]) AC_ARG_VAR([ANTLR], [antlr parser generator]) ! AC_CHECK_PROGS([ANTLR], [antlr antlr-java]) if test -z "$ANTLR"; then AC_MSG_CHECKING([if antlr is available to the Java runtime]) |
From: Braden M. <br...@us...> - 2006-11-20 03:20:33
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16320 Modified Files: ChangeLog Log Message: Use AC_CHECK_PROGS to check for antlr-java as well. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1378 retrieving revision 1.1379 diff -C2 -d -r1.1378 -r1.1379 *** ChangeLog 18 Nov 2006 20:49:21 -0000 1.1378 --- ChangeLog 20 Nov 2006 03:20:28 -0000 1.1379 *************** *** 1,2 **** --- 1,6 ---- + 2006-11-19 Braden McDaniel <br...@en...> + + * m4/antlr.m4: Use AC_CHECK_PROGS to check for antlr-java as well. + 2006-11-18 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-11-20 03:20:30
|
Update of /cvsroot/openvrml/openvrml/m4 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16320/m4 Modified Files: antlr.m4 Log Message: Use AC_CHECK_PROGS to check for antlr-java as well. Index: antlr.m4 =================================================================== RCS file: /cvsroot/openvrml/openvrml/m4/antlr.m4,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** antlr.m4 17 Nov 2006 02:30:00 -0000 1.4 --- antlr.m4 20 Nov 2006 03:20:28 -0000 1.5 *************** *** 3,7 **** [AC_REQUIRE([OV_PROG_JAVA]) AC_ARG_VAR([ANTLR], [antlr parser generator]) ! AC_CHECK_PROG([ANTLR], [antlr]) if test -z "$ANTLR"; then AC_MSG_CHECKING([if antlr is available to the Java runtime]) --- 3,7 ---- [AC_REQUIRE([OV_PROG_JAVA]) AC_ARG_VAR([ANTLR], [antlr parser generator]) ! AC_CHECK_PROGS([ANTLR], [antlr antlr-java]) if test -z "$ANTLR"; then AC_MSG_CHECKING([if antlr is available to the Java runtime]) |
From: Braden M. <br...@us...> - 2006-11-18 20:49:22
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6859 Modified Files: ChangeLog Log Message: Report accurate line and column number information in parser error messages. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1377 retrieving revision 1.1378 diff -C2 -d -r1.1377 -r1.1378 *** ChangeLog 17 Nov 2006 20:28:47 -0000 1.1377 --- ChangeLog 18 Nov 2006 20:49:21 -0000 1.1378 *************** *** 1,2 **** --- 1,48 ---- + 2006-11-18 Braden McDaniel <br...@en...> + + Report accurate line and column number information in parser error + messages. + + * src/libopenvrml/openvrml/Vrml97Parser.g + (Vrml97Scanner::col_): Use int instead of size_t; col_ should be + initialized to -1. + (Vrml97Scanner::Vrml97Scanner(std::istream &)): Initialize col_ to + -1 instead of 0; it will get incremented to 0 when we get the + first character of a line. + (Vrml97Scanner::nextToken()): Set the line and column information + before scanning the rest of the token; that way this information + points to the beginning of the token instead of past the end of + it. + (Vrml97Scanner::getNextChar()): Reset the column count to -1 + instead of 0. + (Vrml97Parser::consume()): Overridden from antlr::Parser; store + the previous token so that reportError and reportWarning can + report accurate line and column information. + (Vrml97Parser::reportError(const antlr::RecognitionException &)): + Report error information in a consistent format rather than rely + on antlr::Exception::toString. + (Vrml97Parser::reportError(const std::string & s)): Use + last_token_ to report line and column information. + (Vrml97Parser::reportWarning(const std::string & s)): Use + last_token_ to report line and column information. + (Vrml97Parser::last_token_): Used to record the previously matched + token for the purpose of reporting line and column information. + * src/libopenvrml/openvrml/X3DVrmlParser.g + (X3DVrmlParser::consume()): Overridden from antlr::Parser; store + the previous token so that reportError and reportWarning can + report accurate line and column information. + (X3DVrmlParser::reportError(const antlr::RecognitionException &)): + Report error information in a consistent format rather than rely + on antlr::Exception::toString. + (X3DVrmlParser::reportError(const std::string & s)): Use + last_token_ to report line and column information. + (X3DVrmlParser::reportWarning(const std::string & s)): Use + last_token_ to report line and column information. + (X3DVrmlParser::last_token_): Used to record the previously + matched token for the purpose of reporting line and column + information. + * tests/testsuite.at: Updated test expected results to reflect + accurate line and column number information. + 2006-11-17 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-11-18 20:49:22
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6859/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g X3DVrmlParser.g Log Message: Report accurate line and column number information in parser error messages. Index: X3DVrmlParser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/X3DVrmlParser.g,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** X3DVrmlParser.g 17 Nov 2006 06:47:25 -0000 1.22 --- X3DVrmlParser.g 18 Nov 2006 20:49:21 -0000 1.23 *************** *** 226,245 **** } virtual void reportError(const antlr::RecognitionException & ex) { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); } virtual void reportError(const std::string & s) { ! this->browser_->err(this->getFilename() + ": error: " + s); } virtual void reportWarning(const std::string & s) { ! this->browser_->err(this->getFilename() + ": warning: " + s); } private: openvrml::browser * browser_; } --- 226,261 ---- } + virtual void consume() + { + this->last_token_ = this->LT(1); + this->LLkParser::consume(); + } + virtual void reportError(const antlr::RecognitionException & ex) { ! std::ostringstream out; ! out << ex.getFilename() << ':' << ex.getLine() << ':' << ex.getColumn() ! << ": error: " << ex.getMessage(); ! this->browser_->err(out.str()); } virtual void reportError(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": error: " << s; ! this->browser_->err(out.str()); } virtual void reportWarning(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": warning: " << s; ! this->browser_->err(out.str()); } private: + antlr::RefToken last_token_; openvrml::browser * browser_; } Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Vrml97Parser.g 17 Nov 2006 06:47:25 -0000 1.70 --- Vrml97Parser.g 18 Nov 2006 20:49:21 -0000 1.71 *************** *** 108,112 **** std::istream & in_; size_t line_; ! size_t col_; int c_; int prev_char_; --- 108,112 ---- std::istream & in_; size_t line_; ! int col_; int c_; int prev_char_; *************** *** 195,199 **** in_(in), line_(1), ! col_(0), c_(' '), prev_char_('\0'), --- 195,199 ---- in_(in), line_(1), ! col_(-1), c_(' '), prev_char_('\0'), *************** *** 231,234 **** --- 231,237 ---- } + token->setLine(int(this->line_)); + token->setColumn(int(this->col_)); + if (this->c_ == EOF) { token->setType(EOF_); *************** *** 435,440 **** } - token->setLine(int(this->line_)); - token->setColumn(int(this->col_)); this->prev_token_type_ = token->getType(); --- 438,441 ---- *************** *** 449,453 **** // ! // Increment the line count (and reset the column count to zero) if the // current character is a newline character EXCEPT if the current character // is a linefeed AND the previous character is a carriage return. --- 450,454 ---- // ! // Increment the line count (and reset the column count to -1) if the // current character is a newline character EXCEPT if the current character // is a linefeed AND the previous character is a carriage return. *************** *** 456,460 **** if (!((this->c_ == 0x0a) && (this->prev_char_ == 0x0d))) { ++this->line_; ! this->col_ = 0; } } --- 457,461 ---- if (!((this->c_ == 0x0a) && (this->prev_char_ == 0x0d))) { ++this->line_; ! this->col_ = -1; } } *************** *** 620,639 **** } virtual void reportError(const antlr::RecognitionException & ex) { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); } virtual void reportError(const std::string & s) { ! this->browser_->err(this->getFilename() + ": error: " + s); } virtual void reportWarning(const std::string & s) { ! this->browser_->err(this->getFilename() + ": warning: " + s); } private: openvrml::browser * browser_; } --- 621,656 ---- } + virtual void consume() + { + this->last_token_ = this->LT(1); + this->LLkParser::consume(); + } + virtual void reportError(const antlr::RecognitionException & ex) { ! std::ostringstream out; ! out << ex.getFilename() << ':' << ex.getLine() << ':' << ex.getColumn() ! << ": error: " << ex.getMessage(); ! this->browser_->err(out.str()); } virtual void reportError(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": error: " << s; ! this->browser_->err(out.str()); } virtual void reportWarning(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": warning: " << s; ! this->browser_->err(out.str()); } private: + antlr::RefToken last_token_; openvrml::browser * browser_; } |
From: Braden M. <br...@us...> - 2006-11-18 20:49:22
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6859/tests Modified Files: testsuite.at Log Message: Report accurate line and column number information in parser error messages. Index: testsuite.at =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/testsuite.at,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** testsuite.at 17 Nov 2006 20:28:47 -0000 1.16 --- testsuite.at 18 Nov 2006 20:49:21 -0000 1.17 *************** *** 3,6 **** --- 3,18 ---- AT_BANNER([VRML97 parse tests: code that should be accepted]) + AT_SETUP([Ensure the line number is reported correctly for the last token on a line]) + AT_DATA([line-number.wrl], + [[#VRML V2.0 utf8 + Transform { + rotation 0 0 0 0 + } + ]]) + AT_CHECK([parse-vrml97 < line-number.wrl], [0], [], + [urn:X-openvrml:stream:1:3:17: warning: axis component of a rotation must be a normalized vector + ]) + AT_CLEANUP + AT_SETUP([Trivial PROTO containment]) AT_DATA([proto-containment-trivial.wrl], *************** *** 164,168 **** ]]) AT_CHECK([parse-vrml97 < unrecognized-node.wrl], [1], [], ! [urn:X-openvrml:stream:1:2:17: error: unknown node type "UnrecognizedNode" ]) AT_CLEANUP --- 176,180 ---- ]]) AT_CHECK([parse-vrml97 < unrecognized-node.wrl], [1], [], ! [urn:X-openvrml:stream:1:2:0: error: unknown node type "UnrecognizedNode" ]) AT_CLEANUP *************** *** 180,184 **** ]]) AT_CHECK([parse-vrml97 < proto-eventin-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:26: error: Interface "exposedField MFNode foo" conflicts with previous declaration ]) AT_CLEANUP --- 192,196 ---- ]]) AT_CHECK([parse-vrml97 < proto-eventin-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:22: error: Interface "exposedField MFNode foo" conflicts with previous declaration ]) AT_CLEANUP *************** *** 196,200 **** ]]) AT_CHECK([parse-vrml97 < proto-eventout-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:5:0: error: Interface "eventOut SFColor foo_changed" conflicts with previous declaration ]) AT_CLEANUP --- 208,212 ---- ]]) AT_CHECK([parse-vrml97 < proto-eventout-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:19: error: Interface "eventOut SFColor foo_changed" conflicts with previous declaration ]) AT_CLEANUP *************** *** 212,216 **** ]]) AT_CHECK([parse-vrml97 < use-def-in-different-proto-default-value.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:45: error: node "G" has not been defined in this scope ]) AT_CLEANUP --- 224,228 ---- ]]) AT_CHECK([parse-vrml97 < use-def-in-different-proto-default-value.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:43: error: node "G" has not been defined in this scope ]) AT_CLEANUP *************** *** 293,297 **** ]]) AT_CHECK([parse-x3dvrml < unsupported-component-level.x3dv], [1], [], ! [urn:X-openvrml:stream:1:3:19: error: unsupported component level ]) AT_CLEANUP --- 305,309 ---- ]]) AT_CHECK([parse-x3dvrml < unsupported-component-level.x3dv], [1], [], ! [urn:X-openvrml:stream:1:3:10: error: unsupported component level ]) AT_CLEANUP |
From: Braden M. <br...@us...> - 2006-11-18 20:48:51
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6457/tests Modified Files: Tag: OpenVRML-0_16-BRANCH testsuite.at Log Message: Report accurate line and column number information in parser error messages. Index: testsuite.at =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/testsuite.at,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -C2 -d -r1.15.2.1 -r1.15.2.2 *** testsuite.at 17 Nov 2006 20:28:32 -0000 1.15.2.1 --- testsuite.at 18 Nov 2006 20:48:46 -0000 1.15.2.2 *************** *** 3,6 **** --- 3,18 ---- AT_BANNER([VRML97 parse tests: code that should be accepted]) + AT_SETUP([Ensure the line number is reported correctly for the last token on a line]) + AT_DATA([line-number.wrl], + [[#VRML V2.0 utf8 + Transform { + rotation 0 0 0 0 + } + ]]) + AT_CHECK([parse-vrml97 < line-number.wrl], [0], [], + [urn:X-openvrml:stream:1:3:17: warning: axis component of a rotation must be a normalized vector + ]) + AT_CLEANUP + AT_SETUP([Trivial PROTO containment]) AT_DATA([proto-containment-trivial.wrl], *************** *** 164,168 **** ]]) AT_CHECK([parse-vrml97 < unrecognized-node.wrl], [1], [], ! [urn:X-openvrml:stream:1:2:17: error: unknown node type "UnrecognizedNode" ]) AT_CLEANUP --- 176,180 ---- ]]) AT_CHECK([parse-vrml97 < unrecognized-node.wrl], [1], [], ! [urn:X-openvrml:stream:1:2:0: error: unknown node type "UnrecognizedNode" ]) AT_CLEANUP *************** *** 180,184 **** ]]) AT_CHECK([parse-vrml97 < proto-eventin-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:26: error: Interface "exposedField MFNode foo" conflicts with previous declaration ]) AT_CLEANUP --- 192,196 ---- ]]) AT_CHECK([parse-vrml97 < proto-eventin-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:22: error: Interface "exposedField MFNode foo" conflicts with previous declaration ]) AT_CLEANUP *************** *** 196,200 **** ]]) AT_CHECK([parse-vrml97 < proto-eventout-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:5:0: error: Interface "eventOut SFColor foo_changed" conflicts with previous declaration ]) AT_CLEANUP --- 208,212 ---- ]]) AT_CHECK([parse-vrml97 < proto-eventout-conflict.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:19: error: Interface "eventOut SFColor foo_changed" conflicts with previous declaration ]) AT_CLEANUP *************** *** 212,216 **** ]]) AT_CHECK([parse-vrml97 < use-def-in-different-proto-default-value.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:45: error: node "G" has not been defined in this scope ]) AT_CLEANUP --- 224,228 ---- ]]) AT_CHECK([parse-vrml97 < use-def-in-different-proto-default-value.wrl], [1], [], ! [urn:X-openvrml:stream:1:4:43: error: node "G" has not been defined in this scope ]) AT_CLEANUP *************** *** 293,297 **** ]]) AT_CHECK([parse-x3dvrml < unsupported-component-level.x3dv], [1], [], ! [urn:X-openvrml:stream:1:3:19: error: unsupported component level ]) AT_CLEANUP --- 305,309 ---- ]]) AT_CHECK([parse-x3dvrml < unsupported-component-level.x3dv], [1], [], ! [urn:X-openvrml:stream:1:3:10: error: unsupported component level ]) AT_CLEANUP |
From: Braden M. <br...@us...> - 2006-11-18 20:48:48
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6457/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH Vrml97Parser.g X3DVrmlParser.g Log Message: Report accurate line and column number information in parser error messages. Index: X3DVrmlParser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/X3DVrmlParser.g,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -C2 -d -r1.21.2.1 -r1.21.2.2 *** X3DVrmlParser.g 17 Nov 2006 06:47:06 -0000 1.21.2.1 --- X3DVrmlParser.g 18 Nov 2006 20:48:46 -0000 1.21.2.2 *************** *** 226,245 **** } virtual void reportError(const antlr::RecognitionException & ex) { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); } virtual void reportError(const std::string & s) { ! this->browser_->err(this->getFilename() + ": error: " + s); } virtual void reportWarning(const std::string & s) { ! this->browser_->err(this->getFilename() + ": warning: " + s); } private: openvrml::browser * browser_; } --- 226,261 ---- } + virtual void consume() + { + this->last_token_ = this->LT(1); + this->LLkParser::consume(); + } + virtual void reportError(const antlr::RecognitionException & ex) { ! std::ostringstream out; ! out << ex.getFilename() << ':' << ex.getLine() << ':' << ex.getColumn() ! << ": error: " << ex.getMessage(); ! this->browser_->err(out.str()); } virtual void reportError(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": error: " << s; ! this->browser_->err(out.str()); } virtual void reportWarning(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": warning: " << s; ! this->browser_->err(out.str()); } private: + antlr::RefToken last_token_; openvrml::browser * browser_; } Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.68.2.1 retrieving revision 1.68.2.2 diff -C2 -d -r1.68.2.1 -r1.68.2.2 *** Vrml97Parser.g 17 Nov 2006 06:47:06 -0000 1.68.2.1 --- Vrml97Parser.g 18 Nov 2006 20:48:46 -0000 1.68.2.2 *************** *** 108,112 **** std::istream & in_; size_t line_; ! size_t col_; int c_; int prev_char_; --- 108,112 ---- std::istream & in_; size_t line_; ! int col_; int c_; int prev_char_; *************** *** 195,199 **** in_(in), line_(1), ! col_(0), c_(' '), prev_char_('\0'), --- 195,199 ---- in_(in), line_(1), ! col_(-1), c_(' '), prev_char_('\0'), *************** *** 231,234 **** --- 231,237 ---- } + token->setLine(int(this->line_)); + token->setColumn(int(this->col_)); + if (this->c_ == EOF) { token->setType(EOF_); *************** *** 435,440 **** } - token->setLine(int(this->line_)); - token->setColumn(int(this->col_)); this->prev_token_type_ = token->getType(); --- 438,441 ---- *************** *** 449,453 **** // ! // Increment the line count (and reset the column count to zero) if the // current character is a newline character EXCEPT if the current character // is a linefeed AND the previous character is a carriage return. --- 450,454 ---- // ! // Increment the line count (and reset the column count to -1) if the // current character is a newline character EXCEPT if the current character // is a linefeed AND the previous character is a carriage return. *************** *** 456,460 **** if (!((this->c_ == 0x0a) && (this->prev_char_ == 0x0d))) { ++this->line_; ! this->col_ = 0; } } --- 457,461 ---- if (!((this->c_ == 0x0a) && (this->prev_char_ == 0x0d))) { ++this->line_; ! this->col_ = -1; } } *************** *** 620,639 **** } virtual void reportError(const antlr::RecognitionException & ex) { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); } virtual void reportError(const std::string & s) { ! this->browser_->err(this->getFilename() + ": error: " + s); } virtual void reportWarning(const std::string & s) { ! this->browser_->err(this->getFilename() + ": warning: " + s); } private: openvrml::browser * browser_; } --- 621,656 ---- } + virtual void consume() + { + this->last_token_ = this->LT(1); + this->LLkParser::consume(); + } + virtual void reportError(const antlr::RecognitionException & ex) { ! std::ostringstream out; ! out << ex.getFilename() << ':' << ex.getLine() << ':' << ex.getColumn() ! << ": error: " << ex.getMessage(); ! this->browser_->err(out.str()); } virtual void reportError(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": error: " << s; ! this->browser_->err(out.str()); } virtual void reportWarning(const std::string & s) { ! std::ostringstream out; ! out << this->getFilename() << ':' << this->last_token_->getLine() ! << ':' << this->last_token_->getColumn() << ": warning: " << s; ! this->browser_->err(out.str()); } private: + antlr::RefToken last_token_; openvrml::browser * browser_; } |
From: Braden M. <br...@us...> - 2006-11-18 20:48:48
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6457 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Report accurate line and column number information in parser error messages. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.55 retrieving revision 1.1310.2.56 diff -C2 -d -r1.1310.2.55 -r1.1310.2.56 *** ChangeLog 17 Nov 2006 20:28:31 -0000 1.1310.2.55 --- ChangeLog 18 Nov 2006 20:48:46 -0000 1.1310.2.56 *************** *** 1,2 **** --- 1,48 ---- + 2006-11-18 Braden McDaniel <br...@en...> + + Report accurate line and column number information in parser error + messages. + + * src/libopenvrml/openvrml/Vrml97Parser.g + (Vrml97Scanner::col_): Use int instead of size_t; col_ should be + initialized to -1. + (Vrml97Scanner::Vrml97Scanner(std::istream &)): Initialize col_ to + -1 instead of 0; it will get incremented to 0 when we get the + first character of a line. + (Vrml97Scanner::nextToken()): Set the line and column information + before scanning the rest of the token; that way this information + points to the beginning of the token instead of past the end of + it. + (Vrml97Scanner::getNextChar()): Reset the column count to -1 + instead of 0. + (Vrml97Parser::consume()): Overridden from antlr::Parser; store + the previous token so that reportError and reportWarning can + report accurate line and column information. + (Vrml97Parser::reportError(const antlr::RecognitionException &)): + Report error information in a consistent format rather than rely + on antlr::Exception::toString. + (Vrml97Parser::reportError(const std::string & s)): Use + last_token_ to report line and column information. + (Vrml97Parser::reportWarning(const std::string & s)): Use + last_token_ to report line and column information. + (Vrml97Parser::last_token_): Used to record the previously matched + token for the purpose of reporting line and column information. + * src/libopenvrml/openvrml/X3DVrmlParser.g + (X3DVrmlParser::consume()): Overridden from antlr::Parser; store + the previous token so that reportError and reportWarning can + report accurate line and column information. + (X3DVrmlParser::reportError(const antlr::RecognitionException &)): + Report error information in a consistent format rather than rely + on antlr::Exception::toString. + (X3DVrmlParser::reportError(const std::string & s)): Use + last_token_ to report line and column information. + (X3DVrmlParser::reportWarning(const std::string & s)): Use + last_token_ to report line and column information. + (X3DVrmlParser::last_token_): Used to record the previously + matched token for the purpose of reporting line and column + information. + * tests/testsuite.at: Updated test expected results to reflect + accurate line and column number information. + 2006-11-17 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-11-17 20:28:53
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21592 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Added tests to ensure PROTOs in default field values of PROTOs are parsed correctly. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.54 retrieving revision 1.1310.2.55 diff -C2 -d -r1.1310.2.54 -r1.1310.2.55 *** ChangeLog 17 Nov 2006 06:47:06 -0000 1.1310.2.54 --- ChangeLog 17 Nov 2006 20:28:31 -0000 1.1310.2.55 *************** *** 1,4 **** --- 1,9 ---- 2006-11-17 Braden McDaniel <br...@en...> + * tests/testsuite.at: Added tests to ensure PROTOs in default + field values of PROTOs are parsed correctly. + + 2006-11-17 Braden McDaniel <br...@en...> + Write parser error and warning messages using openvrml::browser::err rather than use the libantlr default (which |
From: Braden M. <br...@us...> - 2006-11-17 20:28:52
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21592/tests Modified Files: Tag: OpenVRML-0_16-BRANCH testsuite.at Log Message: Added tests to ensure PROTOs in default field values of PROTOs are parsed correctly. Index: testsuite.at =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/testsuite.at,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -C2 -d -r1.15 -r1.15.2.1 *** testsuite.at 17 Apr 2006 07:31:00 -0000 1.15 --- testsuite.at 17 Nov 2006 20:28:32 -0000 1.15.2.1 *************** *** 74,77 **** --- 74,109 ---- AT_CLEANUP + AT_SETUP([DEF/USE in a PROTO field default value]) + AT_DATA([def-use-in-proto-default-value.wrl], + [[#VRML V2.0 utf8 + PROTO Node [ + field MFNode val [ Group { children [ DEF G Group {} ] }, + Group { children [ USE G ] } ] + ] { + Group {} + } + Node {} + ]]) + AT_CHECK([parse-vrml97 < def-use-in-proto-default-value.wrl]) + AT_CLEANUP + + AT_SETUP([PROTO in a PROTO field default value]) + AT_DATA([proto-in-proto-default-value.wrl], + [[#VRML V2.0 utf8 + PROTO Node [ + field MFNode val [ + Group { + PROTO Local [] { Group {} } + children [ Local {} ] + } + ] + ] { + Group { children IS val } + } + Node {} + ]]) + AT_CHECK([parse-vrml97 < proto-in-proto-default-value.wrl]) + AT_CLEANUP + AT_SETUP([Self-referential Script node]) AT_DATA([self-referential-script.wrl], *************** *** 168,171 **** --- 200,219 ---- AT_CLEANUP + AT_SETUP([USE a node DEFined in a different PROTO field default value]) + AT_DATA([use-def-in-different-proto-default-value.wrl], + [[#VRML V2.0 utf8 + PROTO Node [ + field SFNode val0 Group { children [ DEF G Group {} ] } + field SFNode val1 Group { children [ USE G ] } + ] { + Group {} + } + Node {} + ]]) + AT_CHECK([parse-vrml97 < use-def-in-different-proto-default-value.wrl], [1], [], + [urn:X-openvrml:stream:1:4:45: error: node "G" has not been defined in this scope + ]) + AT_CLEANUP + AT_BANNER([X3D VRML parse tests: code that should be accepted]) |
From: Braden M. <br...@us...> - 2006-11-17 20:28:52
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21624 Modified Files: ChangeLog Log Message: Added tests to ensure PROTOs in default field values of PROTOs are parsed correctly. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1376 retrieving revision 1.1377 diff -C2 -d -r1.1376 -r1.1377 *** ChangeLog 17 Nov 2006 06:47:24 -0000 1.1376 --- ChangeLog 17 Nov 2006 20:28:47 -0000 1.1377 *************** *** 1,4 **** --- 1,9 ---- 2006-11-17 Braden McDaniel <br...@en...> + * tests/testsuite.at: Added tests to ensure PROTOs in default + field values of PROTOs are parsed correctly. + + 2006-11-17 Braden McDaniel <br...@en...> + Write parser error and warning messages using openvrml::browser::err rather than use the libantlr default (which |
From: Braden M. <br...@us...> - 2006-11-17 20:28:52
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21624/tests Modified Files: testsuite.at Log Message: Added tests to ensure PROTOs in default field values of PROTOs are parsed correctly. Index: testsuite.at =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/testsuite.at,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** testsuite.at 17 Apr 2006 07:31:00 -0000 1.15 --- testsuite.at 17 Nov 2006 20:28:47 -0000 1.16 *************** *** 74,77 **** --- 74,109 ---- AT_CLEANUP + AT_SETUP([DEF/USE in a PROTO field default value]) + AT_DATA([def-use-in-proto-default-value.wrl], + [[#VRML V2.0 utf8 + PROTO Node [ + field MFNode val [ Group { children [ DEF G Group {} ] }, + Group { children [ USE G ] } ] + ] { + Group {} + } + Node {} + ]]) + AT_CHECK([parse-vrml97 < def-use-in-proto-default-value.wrl]) + AT_CLEANUP + + AT_SETUP([PROTO in a PROTO field default value]) + AT_DATA([proto-in-proto-default-value.wrl], + [[#VRML V2.0 utf8 + PROTO Node [ + field MFNode val [ + Group { + PROTO Local [] { Group {} } + children [ Local {} ] + } + ] + ] { + Group { children IS val } + } + Node {} + ]]) + AT_CHECK([parse-vrml97 < proto-in-proto-default-value.wrl]) + AT_CLEANUP + AT_SETUP([Self-referential Script node]) AT_DATA([self-referential-script.wrl], *************** *** 168,171 **** --- 200,219 ---- AT_CLEANUP + AT_SETUP([USE a node DEFined in a different PROTO field default value]) + AT_DATA([use-def-in-different-proto-default-value.wrl], + [[#VRML V2.0 utf8 + PROTO Node [ + field SFNode val0 Group { children [ DEF G Group {} ] } + field SFNode val1 Group { children [ USE G ] } + ] { + Group {} + } + Node {} + ]]) + AT_CHECK([parse-vrml97 < use-def-in-different-proto-default-value.wrl], [1], [], + [urn:X-openvrml:stream:1:4:45: error: node "G" has not been defined in this scope + ]) + AT_CLEANUP + AT_BANNER([X3D VRML parse tests: code that should be accepted]) |
From: Braden M. <br...@us...> - 2006-11-17 06:47:27
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2446 Modified Files: ChangeLog Log Message: Write parser error and warning messages using openvrml::browser::err rather than use the libantlr default (which writes directly to std::cerr). Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1375 retrieving revision 1.1376 diff -C2 -d -r1.1375 -r1.1376 *** ChangeLog 17 Nov 2006 02:29:59 -0000 1.1375 --- ChangeLog 17 Nov 2006 06:47:24 -0000 1.1376 *************** *** 1,2 **** --- 1,66 ---- + 2006-11-17 Braden McDaniel <br...@en...> + + Write parser error and warning messages using + openvrml::browser::err rather than use the libantlr default (which + writes directly to std::cerr). + + * src/libopenvrml/openvrml/Vrml97Parser.g + (Vrml97Parser::Vrml97Parser(openvrml::browser &, + antlr::TokenStream &, const std::string &)): Construct with an + openvrml::browser; call antlr::Parser::setFilename instead of + adding a member variable for the uri. + (Vrml97Parser::reportError(const antlr::RecognitionException &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (Vrml97Parser::reportError(const std::string &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (Vrml97Parser::reportWarning(const std::string &)): + Overridden from antlr::Parser; send the warning message to + openvrml::browser::err. + (Vrml97Parser::browser_): Added a pointer to the browser. + (vrmlScene): Use getFilename. + (nodeStatement): Use getFilename. + (proto): Use getFilename. + (protoInterfaceDeclaration): Use getFilename. + (protoNodeStatement): Use getFilename. + (externproto): Use getFilename. + (externInterfaceDeclaration): Use getFilename. + (routeStatement): Use getFilename. + (protoRouteStatement): Use getFilename. + (node): Use getFilename. + (nodeBodyElement): Use getFilename. + (scriptInterfaceDeclaration): Use getFilename. + (scriptFieldInterfaceDeclaration): Use getFilename. + (protoNode): Use getFilename. + (protoNodeBodyElement): Use getFilename. + (protoScriptInterfaceDeclaration): Use getFilename. + (protoScriptFieldInterfaceDeclaration): Use getFilename. + * src/libopenvrml/openvrml/X3DVrmlParser.g + (X3DVrmlParser::X3DVrmlParser(openvrml::browser &, + antlr::TokenStream &, const std::string &)): Construct with an + openvrml::browser; call antlr::Parser::setFilename instead of + adding a member variable for the uri. + (X3DVrmlParser::reportError(const antlr::RecognitionException &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (X3DVrmlParser::reportError(const std::string &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (X3DVrmlParser::reportWarning(const std::string &)): + Overridden from antlr::Parser; send the warning message to + openvrml::browser::err. + (X3DVrmlParser::browser_): Added a pointer to the browser. + (vrmlScene): Use getFilename. + (componentStatement): Use getFilename. + * src/libopenvrml/openvrml/browser.cpp + (parse_vrml(std::istream &, const std::string &, const + std::string&, const openvrml::scene &, + std::vector<boost::intrusive_ptr<openvrml::node> > &, + std::map<std::string, std::string> &)): Pass the browser to the + parser constructor. + (openvrml::browser::root_scene_loader::operator()() const): Catch + openvrml::invalid_vrml and print an error message. + 2006-11-16 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-11-17 06:47:27
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2446/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g X3DVrmlParser.g browser.cpp Log Message: Write parser error and warning messages using openvrml::browser::err rather than use the libantlr default (which writes directly to std::cerr). Index: X3DVrmlParser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/X3DVrmlParser.g,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** X3DVrmlParser.g 12 Apr 2006 20:08:15 -0000 1.21 --- X3DVrmlParser.g 17 Nov 2006 06:47:25 -0000 1.22 *************** *** 217,227 **** { public: ! X3DVrmlParser(antlr::TokenStream & lexer, const std::string & uri): antlr::LLkParser(lexer, 1), ! uri(uri) ! {} private: ! const std::string uri; } --- 217,246 ---- { public: ! X3DVrmlParser(openvrml::browser & b, ! antlr::TokenStream & lexer, ! const std::string & uri): antlr::LLkParser(lexer, 1), ! browser_(&b) ! { ! this->Parser::setFilename(uri); ! } ! ! virtual void reportError(const antlr::RecognitionException & ex) ! { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); ! } ! ! virtual void reportError(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": error: " + s); ! } ! ! virtual void reportWarning(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": warning: " + s); ! } private: ! openvrml::browser * browser_; } *************** *** 236,240 **** const profile & p = ::profile_registry_.at(profile_id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->uri); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } --- 255,259 ---- const profile & p = ::profile_registry_.at(profile_id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->getFilename()); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } *************** *** 247,251 **** throw antlr::SemanticException("unrecognized profile \"" + profile_id + "\"", ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 266,270 ---- throw antlr::SemanticException("unrecognized profile \"" + profile_id + "\"", ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 271,275 **** throw antlr::SemanticException("unrecognized component \"" + id->getText() + "\"", ! this->uri, id->getLine(), id->getColumn()); --- 290,294 ---- throw antlr::SemanticException("unrecognized component \"" + id->getText() + "\"", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 277,281 **** catch [std::invalid_argument & ex] { throw antlr::SemanticException(ex.what(), ! this->uri, id->getLine(), id->getColumn()); --- 296,300 ---- catch [std::invalid_argument & ex] { throw antlr::SemanticException(ex.what(), ! this->getFilename(), id->getLine(), id->getColumn()); Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.193 retrieving revision 1.194 diff -C2 -d -r1.193 -r1.194 *** browser.cpp 23 Oct 2006 06:39:28 -0000 1.193 --- browser.cpp 17 Nov 2006 06:47:25 -0000 1.194 *************** *** 3602,3610 **** || iequals(type, x_vrml_media_type)) { Vrml97Scanner scanner(in); ! Vrml97Parser parser(scanner, uri); parser.vrmlScene(scene, nodes, meta); } else if (iequals(type, x3d_vrml_media_type)) { X3DVrmlScanner scanner(in); ! X3DVrmlParser parser(scanner, uri); parser.vrmlScene(scene, nodes, meta); } else { --- 3602,3610 ---- || iequals(type, x_vrml_media_type)) { Vrml97Scanner scanner(in); ! Vrml97Parser parser(scene.browser(), scanner, uri); parser.vrmlScene(scene, nodes, meta); } else if (iequals(type, x3d_vrml_media_type)) { X3DVrmlScanner scanner(in); ! X3DVrmlParser parser(scene.browser(), scanner, uri); parser.vrmlScene(scene, nodes, meta); } else { *************** *** 6096,6099 **** --- 6096,6104 ---- } catch (antlr::ANTLRException & ex) { browser.err(ex.getMessage()); + } catch (invalid_vrml & ex) { + std::ostringstream out; + out << ex.url << ':' << ex.line << ':' << ex.column << ": error: " + << ex.what(); + browser.err(out.str()); } catch (unreachable_url &) { throw; Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Vrml97Parser.g 31 Aug 2006 06:45:30 -0000 1.69 --- Vrml97Parser.g 17 Nov 2006 06:47:25 -0000 1.70 *************** *** 611,621 **** { public: ! Vrml97Parser(antlr::TokenStream & lexer, const std::string & uri): antlr::LLkParser(lexer, 1), ! uri(uri) ! {} private: ! const std::string uri; } --- 611,640 ---- { public: ! Vrml97Parser(openvrml::browser & b, ! antlr::TokenStream & lexer, ! const std::string & uri): antlr::LLkParser(lexer, 1), ! browser_(&b) ! { ! this->Parser::setFilename(uri); ! } ! ! virtual void reportError(const antlr::RecognitionException & ex) ! { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); ! } ! ! virtual void reportError(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": error: " + s); ! } ! ! virtual void reportWarning(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": warning: " + s); ! } private: ! openvrml::browser * browser_; } *************** *** 629,633 **** const profile & p = ::profile_registry_.at(vrml97_profile::id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->uri); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } --- 648,652 ---- const profile & p = ::profile_registry_.at(vrml97_profile::id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->getFilename()); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } *************** *** 673,677 **** + "\" has not been defined in " + "this scope", ! this->uri, id1->getLine(), id1->getColumn()); --- 692,696 ---- + "\" has not been defined in " + "this scope", ! this->getFilename(), id1->getLine(), id1->getColumn()); *************** *** 739,745 **** if (!dynamic_pointer_cast<proto_node_metatype>( ! scene.browser().node_metatype(node_metatype_id(this->uri)))) { ! scene.browser().add_node_metatype(node_metatype_id(this->uri), ! node_metatype); } --- 758,766 ---- if (!dynamic_pointer_cast<proto_node_metatype>( ! scene.browser().node_metatype( ! node_metatype_id(this->getFilename())))) { ! scene.browser() ! .add_node_metatype(node_metatype_id(this->getFilename()), ! node_metatype); } *************** *** 755,759 **** + "\" has already been defined in " "this scope", ! this->uri, id->getLine(), id->getColumn()); --- 776,780 ---- + "\" has already been defined in " "this scope", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 786,790 **** + "\" conflicts with previous " "declaration", ! this->uri, id0->getLine(), id0->getColumn()); --- 807,811 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id0->getLine(), id0->getColumn()); *************** *** 812,816 **** + "\" conflicts with previous " "declaration", ! this->uri, id1->getLine(), id1->getColumn()); --- 833,837 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id1->getLine(), id1->getColumn()); *************** *** 924,928 **** + "\" has not been defined in " + "this scope", ! this->uri, id1->getLine(), id1->getColumn()); --- 945,949 ---- + "\" has not been defined in " + "this scope", ! this->getFilename(), id1->getLine(), id1->getColumn()); *************** *** 957,965 **** // string, we call create_file_url with an empty (relative) uri. // ! const ::uri base_uri = anonymous_stream_id(::uri(uri)) ? scene.browser().world_url().empty() ? create_file_url(::uri()) : ::uri(scene.browser().world_url()) ! : ::uri(this->uri); } : KEYWORD_EXTERNPROTO id:ID LBRACKET --- 978,986 ---- // string, we call create_file_url with an empty (relative) uri. // ! const ::uri base_uri = anonymous_stream_id(::uri(this->getFilename())) ? scene.browser().world_url().empty() ? create_file_url(::uri()) : ::uri(scene.browser().world_url()) ! : ::uri(this->getFilename()); } : KEYWORD_EXTERNPROTO id:ID LBRACKET *************** *** 1015,1019 **** + "\" has already been defined in " + "this scope", ! this->uri, id->getLine(), id->getColumn()); --- 1036,1040 ---- + "\" has already been defined in " + "this scope", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1041,1045 **** + "\" conflicts with previous " "declaration", ! this->uri, id->getLine(), id->getColumn()); --- 1062,1066 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1085,1089 **** + "\" has not been defined in this " "scope", ! this->uri, from_node_id->getLine(), from_node_id->getColumn()); --- 1106,1110 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), from_node_id->getLine(), from_node_id->getColumn()); *************** *** 1096,1100 **** + "\" has not been defined in this " "scope", ! this->uri, to_node_id->getLine(), to_node_id->getColumn()); --- 1117,1121 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), to_node_id->getLine(), to_node_id->getColumn()); *************** *** 1110,1114 **** } catch (runtime_error & ex) { throw SemanticException(ex.what(), ! this->uri, from_node_id->getLine(), from_node_id->getColumn()); --- 1131,1135 ---- } catch (runtime_error & ex) { throw SemanticException(ex.what(), ! this->getFilename(), from_node_id->getLine(), from_node_id->getColumn()); *************** *** 1132,1136 **** + "\" has not been defined in this " "scope", ! this->uri, from_node_id->getLine(), from_node_id->getColumn()); --- 1153,1157 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), from_node_id->getLine(), from_node_id->getColumn()); *************** *** 1143,1147 **** + "\" has not been defined in this " "scope", ! this->uri, to_node_id->getLine(), to_node_id->getColumn()); --- 1164,1168 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), to_node_id->getLine(), to_node_id->getColumn()); *************** *** 1166,1170 **** "no eventOut \"" + eventout_id->getText() + "\"", ! this->uri, eventout_id->getLine(), eventout_id->getColumn()); --- 1187,1191 ---- "no eventOut \"" + eventout_id->getText() + "\"", ! this->getFilename(), eventout_id->getLine(), eventout_id->getColumn()); *************** *** 1181,1185 **** "eventIn \"" + eventin_id->getText() + "\"", ! this->uri, eventin_id->getLine(), eventin_id->getColumn()); --- 1202,1206 ---- "eventIn \"" + eventin_id->getText() + "\"", ! this->getFilename(), eventin_id->getLine(), eventin_id->getColumn()); *************** *** 1189,1193 **** throw SemanticException("mismatch between eventOut and " "eventIn types", ! this->uri, eventin_id->getLine(), eventin_id->getColumn()); --- 1210,1214 ---- throw SemanticException("mismatch between eventOut and " "eventIn types", ! this->getFilename(), eventin_id->getLine(), eventin_id->getColumn()); *************** *** 1236,1240 **** throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->uri, nodeTypeId->getLine(), nodeTypeId->getColumn()); --- 1257,1261 ---- throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->getFilename(), nodeTypeId->getLine(), nodeTypeId->getColumn()); *************** *** 1254,1258 **** catch [std::invalid_argument & ex] { throw SemanticException(ex.what(), ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 1275,1279 ---- catch [std::invalid_argument & ex] { throw SemanticException(ex.what(), ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 1260,1264 **** catch [unsupported_interface & ex] { throw SemanticException(ex.what(), ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 1281,1285 ---- catch [unsupported_interface & ex] { throw SemanticException(ex.what(), ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 1267,1271 **** throw SemanticException("incorrect value type for field or " "exposedField", ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 1288,1292 ---- throw SemanticException("incorrect value type for field or " "exposedField", ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 1298,1302 **** throw SemanticException("Node has no field or exposedField \"" + id->getText() + "\"", ! this->uri, id->getLine(), id->getColumn()); --- 1319,1323 ---- throw SemanticException("Node has no field or exposedField \"" + id->getText() + "\"", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1310,1314 **** throw SemanticException("value for " + id->getText() + " already declared", ! this->uri, id->getLine(), id->getColumn()); --- 1331,1335 ---- throw SemanticException("value for " + id->getText() + " already declared", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1340,1344 **** + "\" conflicts with previous " "declaration", ! this->uri, id->getLine(), id->getColumn()); --- 1361,1365 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1380,1384 **** + "\" already declared for Script " "node", ! this->uri, id->getLine(), id->getColumn()); --- 1401,1405 ---- + "\" already declared for Script " "node", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1438,1442 **** throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->uri, nodeTypeId->getLine(), nodeTypeId->getColumn()); --- 1459,1463 ---- throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->getFilename(), nodeTypeId->getLine(), nodeTypeId->getColumn()); *************** *** 1486,1490 **** throw SemanticException("node has no interface \"" + interface_id->getText() + "\"", ! this->uri, interface_id->getLine(), interface_id->getColumn()); --- 1507,1511 ---- throw SemanticException("node has no interface \"" + interface_id->getText() + "\"", ! this->getFilename(), interface_id->getLine(), interface_id->getColumn()); *************** *** 1548,1552 **** + "\" conflicts with previous " "declaration", ! this->uri, id->getLine(), id->getColumn()); --- 1569,1573 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1591,1595 **** + "\" already declared for Script " "node", ! this->uri, id->getLine(), id->getColumn()); --- 1612,1616 ---- + "\" already declared for Script " "node", ! this->getFilename(), id->getLine(), id->getColumn()); |
From: Braden M. <br...@us...> - 2006-11-17 06:47:09
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2405/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH Vrml97Parser.g X3DVrmlParser.g browser.cpp Log Message: Write parser error and warning messages using openvrml::browser::err rather than use the libantlr default (which writes directly to std::cerr). Index: X3DVrmlParser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/X3DVrmlParser.g,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** X3DVrmlParser.g 12 Apr 2006 20:08:15 -0000 1.21 --- X3DVrmlParser.g 17 Nov 2006 06:47:06 -0000 1.21.2.1 *************** *** 217,227 **** { public: ! X3DVrmlParser(antlr::TokenStream & lexer, const std::string & uri): antlr::LLkParser(lexer, 1), ! uri(uri) ! {} private: ! const std::string uri; } --- 217,246 ---- { public: ! X3DVrmlParser(openvrml::browser & b, ! antlr::TokenStream & lexer, ! const std::string & uri): antlr::LLkParser(lexer, 1), ! browser_(&b) ! { ! this->Parser::setFilename(uri); ! } ! ! virtual void reportError(const antlr::RecognitionException & ex) ! { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); ! } ! ! virtual void reportError(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": error: " + s); ! } ! ! virtual void reportWarning(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": warning: " + s); ! } private: ! openvrml::browser * browser_; } *************** *** 236,240 **** const profile & p = ::profile_registry_.at(profile_id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->uri); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } --- 255,259 ---- const profile & p = ::profile_registry_.at(profile_id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->getFilename()); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } *************** *** 247,251 **** throw antlr::SemanticException("unrecognized profile \"" + profile_id + "\"", ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 266,270 ---- throw antlr::SemanticException("unrecognized profile \"" + profile_id + "\"", ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 271,275 **** throw antlr::SemanticException("unrecognized component \"" + id->getText() + "\"", ! this->uri, id->getLine(), id->getColumn()); --- 290,294 ---- throw antlr::SemanticException("unrecognized component \"" + id->getText() + "\"", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 277,281 **** catch [std::invalid_argument & ex] { throw antlr::SemanticException(ex.what(), ! this->uri, id->getLine(), id->getColumn()); --- 296,300 ---- catch [std::invalid_argument & ex] { throw antlr::SemanticException(ex.what(), ! this->getFilename(), id->getLine(), id->getColumn()); Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.190.2.2 retrieving revision 1.190.2.3 diff -C2 -d -r1.190.2.2 -r1.190.2.3 *** browser.cpp 23 Oct 2006 06:39:17 -0000 1.190.2.2 --- browser.cpp 17 Nov 2006 06:47:06 -0000 1.190.2.3 *************** *** 3600,3608 **** || iequals(type, x_vrml_media_type)) { Vrml97Scanner scanner(in); ! Vrml97Parser parser(scanner, uri); parser.vrmlScene(scene, nodes, meta); } else if (iequals(type, x3d_vrml_media_type)) { X3DVrmlScanner scanner(in); ! X3DVrmlParser parser(scanner, uri); parser.vrmlScene(scene, nodes, meta); } else { --- 3600,3608 ---- || iequals(type, x_vrml_media_type)) { Vrml97Scanner scanner(in); ! Vrml97Parser parser(scene.browser(), scanner, uri); parser.vrmlScene(scene, nodes, meta); } else if (iequals(type, x3d_vrml_media_type)) { X3DVrmlScanner scanner(in); ! X3DVrmlParser parser(scene.browser(), scanner, uri); parser.vrmlScene(scene, nodes, meta); } else { *************** *** 6094,6097 **** --- 6094,6102 ---- } catch (antlr::ANTLRException & ex) { browser.err(ex.getMessage()); + } catch (invalid_vrml & ex) { + std::ostringstream out; + out << ex.url << ':' << ex.line << ':' << ex.column << ": error: " + << ex.what(); + browser.err(out.str()); } catch (unreachable_url &) { throw; Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.68 retrieving revision 1.68.2.1 diff -C2 -d -r1.68 -r1.68.2.1 *** Vrml97Parser.g 2 Aug 2006 03:20:02 -0000 1.68 --- Vrml97Parser.g 17 Nov 2006 06:47:06 -0000 1.68.2.1 *************** *** 611,621 **** { public: ! Vrml97Parser(antlr::TokenStream & lexer, const std::string & uri): antlr::LLkParser(lexer, 1), ! uri(uri) ! {} private: ! const std::string uri; } --- 611,640 ---- { public: ! Vrml97Parser(openvrml::browser & b, ! antlr::TokenStream & lexer, ! const std::string & uri): antlr::LLkParser(lexer, 1), ! browser_(&b) ! { ! this->Parser::setFilename(uri); ! } ! ! virtual void reportError(const antlr::RecognitionException & ex) ! { ! this->browser_->err(this->getFilename() + ": " + ex.toString()); ! } ! ! virtual void reportError(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": error: " + s); ! } ! ! virtual void reportWarning(const std::string & s) ! { ! this->browser_->err(this->getFilename() + ": warning: " + s); ! } private: ! openvrml::browser * browser_; } *************** *** 629,633 **** const profile & p = ::profile_registry_.at(vrml97_profile::id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->uri); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } --- 648,652 ---- const profile & p = ::profile_registry_.at(vrml97_profile::id); std::auto_ptr<scope> root_scope_auto_ptr = ! p.create_root_scope(scene.browser(), this->getFilename()); const boost::shared_ptr<scope> root_scope(root_scope_auto_ptr); } *************** *** 673,677 **** + "\" has not been defined in " + "this scope", ! this->uri, id1->getLine(), id1->getColumn()); --- 692,696 ---- + "\" has not been defined in " + "this scope", ! this->getFilename(), id1->getLine(), id1->getColumn()); *************** *** 739,745 **** if (!dynamic_pointer_cast<proto_node_metatype>( ! scene.browser().node_metatype(node_metatype_id(this->uri)))) { ! scene.browser().add_node_metatype(node_metatype_id(this->uri), ! node_metatype); } --- 758,766 ---- if (!dynamic_pointer_cast<proto_node_metatype>( ! scene.browser().node_metatype( ! node_metatype_id(this->getFilename())))) { ! scene.browser() ! .add_node_metatype(node_metatype_id(this->getFilename()), ! node_metatype); } *************** *** 755,759 **** + "\" has already been defined in " "this scope", ! this->uri, id->getLine(), id->getColumn()); --- 776,780 ---- + "\" has already been defined in " "this scope", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 786,790 **** + "\" conflicts with previous " "declaration", ! this->uri, id0->getLine(), id0->getColumn()); --- 807,811 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id0->getLine(), id0->getColumn()); *************** *** 812,816 **** + "\" conflicts with previous " "declaration", ! this->uri, id1->getLine(), id1->getColumn()); --- 833,837 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id1->getLine(), id1->getColumn()); *************** *** 924,928 **** + "\" has not been defined in " + "this scope", ! this->uri, id1->getLine(), id1->getColumn()); --- 945,949 ---- + "\" has not been defined in " + "this scope", ! this->getFilename(), id1->getLine(), id1->getColumn()); *************** *** 957,965 **** // string, we call create_file_url with an empty (relative) uri. // ! const ::uri base_uri = anonymous_stream_id(::uri(uri)) ? scene.browser().world_url().empty() ? create_file_url(::uri()) : ::uri(scene.browser().world_url()) ! : ::uri(this->uri); } : KEYWORD_EXTERNPROTO id:ID LBRACKET --- 978,986 ---- // string, we call create_file_url with an empty (relative) uri. // ! const ::uri base_uri = anonymous_stream_id(::uri(this->getFilename())) ? scene.browser().world_url().empty() ? create_file_url(::uri()) : ::uri(scene.browser().world_url()) ! : ::uri(this->getFilename()); } : KEYWORD_EXTERNPROTO id:ID LBRACKET *************** *** 1015,1019 **** + "\" has already been defined in " + "this scope", ! this->uri, id->getLine(), id->getColumn()); --- 1036,1040 ---- + "\" has already been defined in " + "this scope", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1041,1045 **** + "\" conflicts with previous " "declaration", ! this->uri, id->getLine(), id->getColumn()); --- 1062,1066 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1085,1089 **** + "\" has not been defined in this " "scope", ! this->uri, from_node_id->getLine(), from_node_id->getColumn()); --- 1106,1110 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), from_node_id->getLine(), from_node_id->getColumn()); *************** *** 1096,1100 **** + "\" has not been defined in this " "scope", ! this->uri, to_node_id->getLine(), to_node_id->getColumn()); --- 1117,1121 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), to_node_id->getLine(), to_node_id->getColumn()); *************** *** 1110,1114 **** } catch (runtime_error & ex) { throw SemanticException(ex.what(), ! this->uri, from_node_id->getLine(), from_node_id->getColumn()); --- 1131,1135 ---- } catch (runtime_error & ex) { throw SemanticException(ex.what(), ! this->getFilename(), from_node_id->getLine(), from_node_id->getColumn()); *************** *** 1132,1136 **** + "\" has not been defined in this " "scope", ! this->uri, from_node_id->getLine(), from_node_id->getColumn()); --- 1153,1157 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), from_node_id->getLine(), from_node_id->getColumn()); *************** *** 1143,1147 **** + "\" has not been defined in this " "scope", ! this->uri, to_node_id->getLine(), to_node_id->getColumn()); --- 1164,1168 ---- + "\" has not been defined in this " "scope", ! this->getFilename(), to_node_id->getLine(), to_node_id->getColumn()); *************** *** 1166,1170 **** "no eventOut \"" + eventout_id->getText() + "\"", ! this->uri, eventout_id->getLine(), eventout_id->getColumn()); --- 1187,1191 ---- "no eventOut \"" + eventout_id->getText() + "\"", ! this->getFilename(), eventout_id->getLine(), eventout_id->getColumn()); *************** *** 1181,1185 **** "eventIn \"" + eventin_id->getText() + "\"", ! this->uri, eventin_id->getLine(), eventin_id->getColumn()); --- 1202,1206 ---- "eventIn \"" + eventin_id->getText() + "\"", ! this->getFilename(), eventin_id->getLine(), eventin_id->getColumn()); *************** *** 1189,1193 **** throw SemanticException("mismatch between eventOut and " "eventIn types", ! this->uri, eventin_id->getLine(), eventin_id->getColumn()); --- 1210,1214 ---- throw SemanticException("mismatch between eventOut and " "eventIn types", ! this->getFilename(), eventin_id->getLine(), eventin_id->getColumn()); *************** *** 1236,1240 **** throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->uri, nodeTypeId->getLine(), nodeTypeId->getColumn()); --- 1257,1261 ---- throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->getFilename(), nodeTypeId->getLine(), nodeTypeId->getColumn()); *************** *** 1254,1258 **** catch [std::invalid_argument & ex] { throw SemanticException(ex.what(), ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 1275,1279 ---- catch [std::invalid_argument & ex] { throw SemanticException(ex.what(), ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 1260,1264 **** catch [unsupported_interface & ex] { throw SemanticException(ex.what(), ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 1281,1285 ---- catch [unsupported_interface & ex] { throw SemanticException(ex.what(), ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 1267,1271 **** throw SemanticException("incorrect value type for field or " "exposedField", ! this->uri, LT(1)->getLine(), LT(1)->getColumn()); --- 1288,1292 ---- throw SemanticException("incorrect value type for field or " "exposedField", ! this->getFilename(), LT(1)->getLine(), LT(1)->getColumn()); *************** *** 1298,1302 **** throw SemanticException("Node has no field or exposedField \"" + id->getText() + "\"", ! this->uri, id->getLine(), id->getColumn()); --- 1319,1323 ---- throw SemanticException("Node has no field or exposedField \"" + id->getText() + "\"", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1310,1314 **** throw SemanticException("value for " + id->getText() + " already declared", ! this->uri, id->getLine(), id->getColumn()); --- 1331,1335 ---- throw SemanticException("value for " + id->getText() + " already declared", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1340,1344 **** + "\" conflicts with previous " "declaration", ! this->uri, id->getLine(), id->getColumn()); --- 1361,1365 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1380,1384 **** + "\" already declared for Script " "node", ! this->uri, id->getLine(), id->getColumn()); --- 1401,1405 ---- + "\" already declared for Script " "node", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1438,1442 **** throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->uri, nodeTypeId->getLine(), nodeTypeId->getColumn()); --- 1459,1463 ---- throw SemanticException("unknown node type \"" + nodeTypeId->getText() + "\"", ! this->getFilename(), nodeTypeId->getLine(), nodeTypeId->getColumn()); *************** *** 1486,1490 **** throw SemanticException("node has no interface \"" + interface_id->getText() + "\"", ! this->uri, interface_id->getLine(), interface_id->getColumn()); --- 1507,1511 ---- throw SemanticException("node has no interface \"" + interface_id->getText() + "\"", ! this->getFilename(), interface_id->getLine(), interface_id->getColumn()); *************** *** 1548,1552 **** + "\" conflicts with previous " "declaration", ! this->uri, id->getLine(), id->getColumn()); --- 1569,1573 ---- + "\" conflicts with previous " "declaration", ! this->getFilename(), id->getLine(), id->getColumn()); *************** *** 1591,1595 **** + "\" already declared for Script " "node", ! this->uri, id->getLine(), id->getColumn()); --- 1612,1616 ---- + "\" already declared for Script " "node", ! this->getFilename(), id->getLine(), id->getColumn()); |
From: Braden M. <br...@us...> - 2006-11-17 06:47:08
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2405 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Write parser error and warning messages using openvrml::browser::err rather than use the libantlr default (which writes directly to std::cerr). Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.53 retrieving revision 1.1310.2.54 diff -C2 -d -r1.1310.2.53 -r1.1310.2.54 *** ChangeLog 17 Nov 2006 02:29:49 -0000 1.1310.2.53 --- ChangeLog 17 Nov 2006 06:47:06 -0000 1.1310.2.54 *************** *** 1,2 **** --- 1,66 ---- + 2006-11-17 Braden McDaniel <br...@en...> + + Write parser error and warning messages using + openvrml::browser::err rather than use the libantlr default (which + writes directly to std::cerr). + + * src/libopenvrml/openvrml/Vrml97Parser.g + (Vrml97Parser::Vrml97Parser(openvrml::browser &, + antlr::TokenStream &, const std::string &)): Construct with an + openvrml::browser; call antlr::Parser::setFilename instead of + adding a member variable for the uri. + (Vrml97Parser::reportError(const antlr::RecognitionException &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (Vrml97Parser::reportError(const std::string &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (Vrml97Parser::reportWarning(const std::string &)): + Overridden from antlr::Parser; send the warning message to + openvrml::browser::err. + (Vrml97Parser::browser_): Added a pointer to the browser. + (vrmlScene): Use getFilename. + (nodeStatement): Use getFilename. + (proto): Use getFilename. + (protoInterfaceDeclaration): Use getFilename. + (protoNodeStatement): Use getFilename. + (externproto): Use getFilename. + (externInterfaceDeclaration): Use getFilename. + (routeStatement): Use getFilename. + (protoRouteStatement): Use getFilename. + (node): Use getFilename. + (nodeBodyElement): Use getFilename. + (scriptInterfaceDeclaration): Use getFilename. + (scriptFieldInterfaceDeclaration): Use getFilename. + (protoNode): Use getFilename. + (protoNodeBodyElement): Use getFilename. + (protoScriptInterfaceDeclaration): Use getFilename. + (protoScriptFieldInterfaceDeclaration): Use getFilename. + * src/libopenvrml/openvrml/X3DVrmlParser.g + (X3DVrmlParser::X3DVrmlParser(openvrml::browser &, + antlr::TokenStream &, const std::string &)): Construct with an + openvrml::browser; call antlr::Parser::setFilename instead of + adding a member variable for the uri. + (X3DVrmlParser::reportError(const antlr::RecognitionException &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (X3DVrmlParser::reportError(const std::string &)): + Overridden from antlr::Parser; send the error message to + openvrml::browser::err. + (X3DVrmlParser::reportWarning(const std::string &)): + Overridden from antlr::Parser; send the warning message to + openvrml::browser::err. + (X3DVrmlParser::browser_): Added a pointer to the browser. + (vrmlScene): Use getFilename. + (componentStatement): Use getFilename. + * src/libopenvrml/openvrml/browser.cpp + (parse_vrml(std::istream &, const std::string &, const + std::string&, const openvrml::scene &, + std::vector<boost::intrusive_ptr<openvrml::node> > &, + std::map<std::string, std::string> &)): Pass the browser to the + parser constructor. + (openvrml::browser::root_scene_loader::operator()() const): Catch + openvrml::invalid_vrml and print an error message. + 2006-11-16 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-11-17 02:34:24
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1090 Modified Files: configure-gcc-dbg configure-gcc-opt Log Message: Quote so that arguments can be passed properly. Index: configure-gcc-dbg =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure-gcc-dbg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configure-gcc-dbg 28 Oct 2006 02:41:56 -0000 1.4 --- configure-gcc-dbg 17 Nov 2006 02:34:22 -0000 1.5 *************** *** 1,3 **** #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --enable-gtk-doc CXXFLAGS='-g -O0 -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -Wno-attributes' $* --- 1,3 ---- #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --enable-gtk-doc CXXFLAGS='-g -O0 -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -Wno-attributes' "$*" Index: configure-gcc-opt =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure-gcc-opt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure-gcc-opt 1 Oct 2006 05:46:54 -0000 1.2 --- configure-gcc-opt 17 Nov 2006 02:34:22 -0000 1.3 *************** *** 1,3 **** #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --disable-exception-specs --enable-gtk-doc CXXFLAGS='-Os -Wall -Wextra -Wno-missing-braces -fvisibility=hidden' $* --- 1,3 ---- #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --disable-exception-specs --enable-gtk-doc CXXFLAGS='-Os -Wall -Wextra -Wno-missing-braces -fvisibility=hidden -fvisibility-inlines-hidden' "$*" |
From: Braden M. <br...@us...> - 2006-11-17 02:34:11
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1058 Modified Files: Tag: OpenVRML-0_16-BRANCH configure-gcc-dbg configure-gcc-opt Log Message: Quote so that arguments can be passed properly. Index: configure-gcc-dbg =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure-gcc-dbg,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** configure-gcc-dbg 28 Oct 2006 02:41:11 -0000 1.1.2.3 --- configure-gcc-dbg 17 Nov 2006 02:34:09 -0000 1.1.2.4 *************** *** 1,3 **** #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --enable-gtk-doc CXXFLAGS='-g -O0 -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -Wno-attributes' $* --- 1,3 ---- #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --enable-gtk-doc CXXFLAGS='-g -O0 -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -Wno-attributes' "$*" Index: configure-gcc-opt =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure-gcc-opt,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** configure-gcc-opt 1 Oct 2006 05:48:14 -0000 1.1.2.1 --- configure-gcc-opt 17 Nov 2006 02:34:09 -0000 1.1.2.2 *************** *** 1,3 **** #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --disable-exception-specs --enable-gtk-doc CXXFLAGS='-Os -Wall -Wextra -Wno-missing-braces -fvisibility=hidden' $* --- 1,3 ---- #!/bin/bash ! ./$(dirname $0)/configure -C --disable-static --disable-exception-specs --enable-gtk-doc CXXFLAGS='-Os -Wall -Wextra -Wno-missing-braces -fvisibility=hidden -fvisibility-inlines-hidden' "$*" |