HGL::Common::IParser< ProjectInterface, Factory > Interface Template Reference
[Utility classes]

Interface to a parsing subsystem. More...

#include <iparser.h>

List of all members.

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.

Detailed Description

template<class ProjectInterface = HGL::Type::IProject, class Factory = HGL::Type::IProjectFactory>
interface HGL::Common::IParser< ProjectInterface, Factory >

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.

See also:
HGL::Type::IProject
HGL::Type::IProjectFactory
HGL::Common::createProject
Template Parameters:
ProjectInterface the type of root type
Factory type of the factory to create types
Author:
Heiko Schäfer <heiko@hgl.rangun.de>

Member Function Documentation

template<class ProjectInterface = HGL::Type::IProject, class Factory = HGL::Type::IProjectFactory>
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

Returns:
the opening mode of the input file
template<class ProjectInterface = HGL::Type::IProject, class Factory = HGL::Type::IProjectFactory>
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.

template<class ProjectInterface = HGL::Type::IProject, class Factory = HGL::Type::IProjectFactory>
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.

Exceptions:
HGL::Exception::ParserException if there has been a parsing error
HGL::Exception::IOException if there has been an I/O error
Parameters:
infile the input file
factory factory to use to create types
lib root node of the standard library
Returns:
the root node of the type tree

Generated on 9 Apr 2014 for hgl 0.5.26~svn by  doxygen 1.6.1