Interface to a parsing subsystem. More...
#include <iparser.h>
Public Member Functions | |
| virtual void | cleanup () const =0 |
| Cleanup function after parsing or if an exception is thrown. | |
| virtual const char * | getMode () const =0 |
| Gets the opening mode of the input file. | |
| virtual ProjectInterface * | parse (Factory *const factory, ProjectInterface *const lib) const =0 throw (HGL::Exception::ParserException, HGL::Exception::IOException) |
| virtual ProjectInterface * | parse (const Common::URI &infile, Factory *const factory, ProjectInterface *const lib=0) const =0 throw (HGL::Exception::ParserException, HGL::Exception::IOException) |
| Parses an input source and returns a type tree. | |
Interface to a parsing subsystem.
This interface provides methods needed for HGL::Common::createProject Concrete subclasses should implement a parser, which returns the ProjectInterface as root of the type tree and use Factory to create the types.
| ProjectInterface | the type of root type | |
| Factory | type of the factory to create types |
| virtual const char* HGL::Common::IParser< ProjectInterface, Factory >::getMode | ( | ) | const [pure virtual] |
Gets the opening mode of the input file.
"rb" for binary input or "r" for text input
| virtual ProjectInterface* HGL::Common::IParser< ProjectInterface, Factory >::parse | ( | Factory *const | factory, | |
| ProjectInterface *const | lib | |||
| ) | const throw (HGL::Exception::ParserException, HGL::Exception::IOException) [pure virtual] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| virtual ProjectInterface* HGL::Common::IParser< ProjectInterface, Factory >::parse | ( | const Common::URI & | infile, | |
| Factory *const | factory, | |||
| ProjectInterface *const | lib = 0 | |||
| ) | const throw (HGL::Exception::ParserException, HGL::Exception::IOException) [pure virtual] |
Parses an input source and returns a type tree.
| HGL::Exception::ParserException | if there has been a parsing error | |
| HGL::Exception::IOException | if there has been an I/O error |
| infile | the input file | |
| factory | factory to use to create types | |
| lib | root node of the standard library |
1.6.1