#include <Driver.hpp>
Public Member Functions | |
bool | parseStream (std::istream &inStream, const std::string &inStreamName="stream input") |
bool | parseString (const std::string &inString, const std::string &inStreamName="string stream") |
bool | parseFile (const std::string &inFileName) |
void | error (const class location &inLocation, const std::string &inMessage) |
void | error (const std::string &inMessage) |
Scanner * | getLexer () const throw () |
std::string & | getStreamName () throw () |
EdifContextSharedPtr | getContext () const throw () |
Error | getParserError () const throw () |
bool | getIsParserErrorSet () const throw () |
void | setParserError (const Error &inSource) throw () |
Driver (const EdifContextSharedPtr &inEdifCntx) | |
construct a new parser driver context | |
Private Attributes | |
bool | mTraceScanning |
bool | mTraceParsing |
std::string | mStreamName |
Scanner * | mLexer |
EdifContextSharedPtr | mEdifCntx |
ErrorSharedPtr | mErrorObj |
Definition at line 48 of file Driver.hpp.
torc::generic::Driver::Driver | ( | const EdifContextSharedPtr & | inEdifCntx | ) |
bool torc::generic::Driver::parseStream | ( | std::istream & | inStream, | |
const std::string & | inStreamName = "stream input" | |||
) |
Invoke the scanner and parser for a stream.
inStream | input stream | |
inStreamName | stream name for error messages |
Definition at line 58 of file Driver.cpp.
bool torc::generic::Driver::parseString | ( | const std::string & | inString, | |
const std::string & | inStreamName = "string stream" | |||
) |
Invoke the scanner and parser on an input string.
inString | input string | |
inStreamName | stream name for error messages |
Definition at line 82 of file Driver.cpp.
bool torc::generic::Driver::parseFile | ( | const std::string & | inFileName | ) |
Invoke the scanner and parser on a file. Use parseStream with a std::ifstream if detection of file reading errors is required.
inFileName | input file name |
Definition at line 72 of file Driver.cpp.
void torc::generic::Driver::error | ( | const class location & | inLocation, | |
const std::string & | inMessage | |||
) |
Error handling with associated line number. This can be modified to output the error e.g. to a dialog box.
void torc::generic::Driver::error | ( | const std::string & | inMessage | ) |
General error handling. This can be modified to output the error e.g. to a dialog box.
Definition at line 95 of file Driver.cpp.
Scanner* torc::generic::Driver::mLexer [private] |
Pointer to the current lexer instance, this is used to connect the parser to the scanner. It is used in the yylex macro.
Definition at line 121 of file Driver.hpp.
EdifContextSharedPtr torc::generic::Driver::mEdifCntx [private] |
Reference to the Edif context filled during parsing of the Edif file.
Definition at line 125 of file Driver.hpp.
ErrorSharedPtr torc::generic::Driver::mErrorObj [private] |
Reference to the Error object
Definition at line 128 of file Driver.hpp.