Model Railroad System 2.2.2
|
Virtual base class for file-based parsers. More...
#include <ParseFile.h>
Public Member Functions | |
const char * | SourceFile () const |
Return the name of the source file. More... | |
ParseFile (const char *filename) | |
Constructor. More... | |
virtual | ~ParseFile () |
Destructor. More... | |
int | ProcessFile (ostream &err) |
open file and parse it. More... | |
Protected Member Functions | |
virtual int | Parse ()=0 |
The parser itself, supplied by derived classes. More... | |
virtual void | ParseError (const char *)=0 |
The parser's error handler, supplied by derived classes. More... | |
Protected Attributes | |
char * | lp |
Input line buffer pointer. More... | |
FILE * | fp |
Input file pointer. More... | |
int | source_line |
Source line number. More... | |
char | line_buffer [buffersize] |
Input line buffer. More... | |
ostream * | errorstream |
Stream for error reporting. More... | |
char * | source_file |
Name of the source file. More... | |
Static Protected Attributes | |
static const int | buffersize = 1024 |
Size of line buffer. More... | |
Virtual base class for file-based parsers.
Contains all of the base level input and error output support members.
|
inline |
Constructor.
Make a local copy of the source file name, Other members are initialized.
References fp, lp, source_file, and source_line.
|
inlinevirtual |
|
protectedpure virtual |
The parser itself, supplied by derived classes.
Implemented in Parsers::LayoutFile.
|
protectedpure virtual |
The parser's error handler, supplied by derived classes.
Implemented in Parsers::LayoutFile.
int Parsers::ParseFile::ProcessFile | ( | ostream & | err | ) |
open file and parse it.
err | Output string to write error messages to. |
|
inline |
Return the name of the source file.
References source_file.
|
staticprotected |
Size of line buffer.
|
protected |
Stream for error reporting.
|
protected |
Input file pointer.
Referenced by ParseFile().
|
protected |
Input line buffer.
|
protected |
Input line buffer pointer.
Referenced by ParseFile().
|
protected |
Name of the source file.
Referenced by ParseFile(), SourceFile(), and ~ParseFile().
|
protected |