#include <vuParser.h>
Inheritance diagram for vuParser:
Public Member Functions | |
vuParser () | |
default constructor, | |
virtual | ~vuParser () |
destructor | |
virtual void | Parse (const char *filename) throw (const char *) |
Parses the given gui script file, and generates the corresponding class. | |
Protected Member Functions | |
void | readBuffer (const char *filename) |
reads the input file into m_Buffer for processing. | |
void | FixBuffer () |
Fixes the input buffer by separating the defined tokens. | |
bool | readString (const char *s) |
Try to read a string from the buffer and eats it if it's there. | |
bool | readString (const char *prefix, char *s) |
Try to read a string prefixed by "prefix" from the buffer and eats it if it's there. | |
bool | readNumber (const char *prefix, float &t) |
Try to read a number prefixed by "prefix" from the buffer and eats it if it's there. | |
bool | readToken (char token, bool eat=true) |
Checks the buffer for the token, returning true and eating it up if it's there. | |
bool | finished () |
Returns true if the input stream is finished. | |
Protected Attributes | |
char * | m_Buffer |
A copy of the input file contents, with separated tokens. | |
dword | m_Len |
The total length of the buffer. | |
dword | m_Pos |
The reading position within the buffer. |
The functions of this class have been extracted from the original vuGuiParser to build a general parser base class. This can now be used to derive own parsers for arbitrary use.
Find some way to add the ios::nocreate flag or some equivalent to this code so that we have similar behaviour in IRIX as we do Linux or Windows.
Definition at line 36 of file vuParser.h.
|
default constructor, initializes everything to be 0 Definition at line 10 of file vuParser.cpp. |
|
destructor frees the memory used by the buffer Definition at line 21 of file vuParser.cpp. |
|
Returns true if the input stream is finished.
Definition at line 127 of file vuParser.cpp. References m_Pos. Referenced by vuGuiParser::ParseControls(), vuGuiParser::ParseList(), vuGuiParser::ParseMethod(), vuGuiParser::ParseSections(), and vuGuiParser::ParseStatement(). |
|
Fixes the input buffer by separating the defined tokens.
Definition at line 63 of file vuParser.cpp. References dword, m_Buffer, and m_Len. Referenced by vuTFDesign::Parse(). |
|
Parses the given gui script file, and generates the corresponding class. This function is virtual a reimplementation should start with readBuffer() and FixBuffer() and then continue evaluating the buffer using the provided functions. (which are not yet written <- todo) Reimplemented in vuTFDesign, vuTFDesign, and vuGuiParser. Definition at line 54 of file vuParser.h. |
|
reads the input file into m_Buffer for processing.
Definition at line 30 of file vuParser.cpp. References m_Buffer, and m_Pos. Referenced by vuTFDesign::Parse(). |
|
Try to read a number prefixed by "prefix" from the buffer and eats it if it's there.
Definition at line 176 of file vuParser.cpp. References m_Buffer, and m_Pos. Referenced by vuTFDesign::readColour(), vuTFDesignSpec::readLight(), vuTFDesign::readNComp(), and vuTFDesign::readOpacity(). |
|
Try to read a string prefixed by "prefix" from the buffer and eats it if it's there.
Definition at line 153 of file vuParser.cpp. References m_Buffer, m_Pos, and readString(). |
Here is the call graph for this function:
|
Try to read a string from the buffer and eats it if it's there.
Definition at line 135 of file vuParser.cpp. References m_Buffer, and m_Pos. Referenced by vuTFDesign::readColour(), vuTFDesignSpec::readLight(), vuTFDesign::readNComp(), vuTFDesign::readOpacity(), and readString(). |
|
Checks the buffer for the token, returning true and eating it up if it's there.
Definition at line 113 of file vuParser.cpp. References m_Buffer, and m_Pos. Referenced by vuGuiParser::ParseAPIs(), vuGuiParser::ParseControls(), vuGuiParser::ParseList(), vuGuiParser::ParseMethod(), vuGuiParser::ParseSections(), and vuGuiParser::ParseStatement(). |
|
A copy of the input file contents, with separated tokens.
Definition at line 79 of file vuParser.h. Referenced by FixBuffer(), readBuffer(), readNumber(), readString(), readToken(), and vuParser(). |
|
The total length of the buffer.
Definition at line 81 of file vuParser.h. Referenced by FixBuffer(), and vuParser(). |
|
The reading position within the buffer.
Definition at line 83 of file vuParser.h. Referenced by finished(), readBuffer(), readNumber(), readString(), readToken(), and vuParser(). |