#include <FireflyBoardParser.h>
Public Member Functions | |
| MVFirefly * | getFirefly () |
| MVBoard * | getBoard () |
| void | parse (std::string filename) |
| Start parsing. Parses row by row. | |
Static Public Member Functions | |
| static FireflyBoardParser * | getInstance () |
Private Member Functions | |
| FireflyBoardParser () | |
| Standard Constructor. | |
| char | readChar () |
| Read the next character from the input file and check for EOF. | |
| Token | readToken () |
| Read the next token, consuming the next character(s). | |
| std::string | tokenToString (Token tok) |
| A convenience function which translates Tokens to textual representation. | |
| void | parseRow_walkToNextLinebreak () |
| Helping function for parseRow(). | |
| void | parseRow_silentErrorRecover (std::string message) |
| Helping function for parseRow(). | |
| bool | parseRow_readRequiredToken (Token requiredToken) |
| Helping function for parseRow(). | |
| bool | parseRow_readRequiredNumberToken (int &value) |
| Helping function for parseRow(). | |
| bool | parseRow_readTwoRequiredCommaSeparatedNumberTokens (int &value1, int &value2) |
| Helping function for parseRow(). | |
| void | parseRow () |
| Parses a single row. Reads in the first token and figures out which keyword it is. Then, read the appropriate parameters and prepare the result. | |
Private Attributes | |
| std::ifstream * | file |
| input file stream | |
| char | next |
| current character | |
| Token | token |
| current token's symbol class | |
| int | valNumber |
| current token's int-value (NUMBER) | |
| std::string | valWord |
| current token's string-value (WORD) | |
| MVBoard | board |
| MVFirefly | firefly |
Static Private Attributes | |
| static FireflyBoardParser * | instance = 0 |
| The singleton instance. | |
| FireflyBoardParser::FireflyBoardParser | ( | ) | [private] |
Standard Constructor.
| char FireflyBoardParser::readChar | ( | ) | [private] |
Read the next character from the input file and check for EOF.
Read the next character from the input file and check for EOF.
| Token FireflyBoardParser::readToken | ( | ) | [private] |
Read the next token, consuming the next character(s).
Read the next token, consuming the next character(s).
| std::string FireflyBoardParser::tokenToString | ( | Token | tok | ) | [private] |
A convenience function which translates Tokens to textual representation.
A convenience function which translates Tokens to textual representation.
| void FireflyBoardParser::parseRow_walkToNextLinebreak | ( | ) | [private] |
Helping function for parseRow().
| void FireflyBoardParser::parseRow_silentErrorRecover | ( | std::string | message | ) | [private] |
Helping function for parseRow().
| bool FireflyBoardParser::parseRow_readRequiredToken | ( | Token | requiredToken | ) | [private] |
Helping function for parseRow().
| bool FireflyBoardParser::parseRow_readRequiredNumberToken | ( | int & | value | ) | [private] |
Helping function for parseRow().
| bool FireflyBoardParser::parseRow_readTwoRequiredCommaSeparatedNumberTokens | ( | int & | value1, | |
| int & | value2 | |||
| ) | [private] |
Helping function for parseRow().
| void FireflyBoardParser::parseRow | ( | ) | [private] |
Parses a single row. Reads in the first token and figures out which keyword it is. Then, read the appropriate parameters and prepare the result.
Parses a single row. Reads in the first token and figures out which keyword it is. Then, read the appropriate parameters and prepare the result.
| FireflyBoardParser * FireflyBoardParser::getInstance | ( | ) | [static] |
The only way to access the manager
| MVFirefly * FireflyBoardParser::getFirefly | ( | ) |
| MVBoard * FireflyBoardParser::getBoard | ( | ) |
| void FireflyBoardParser::parse | ( | std::string | filename | ) |
Start parsing. Parses row by row.
Start parsing. Parses row by row. Please notice:
FireflyBoardParser * FireflyBoardParser::instance = 0 [static, private] |
The singleton instance.
std::ifstream* FireflyBoardParser::file [private] |
input file stream
char FireflyBoardParser::next [private] |
current character
Token FireflyBoardParser::token [private] |
current token's symbol class
int FireflyBoardParser::valNumber [private] |
current token's int-value (NUMBER)
std::string FireflyBoardParser::valWord [private] |
current token's string-value (WORD)
MVBoard FireflyBoardParser::board [private] |
MVFirefly FireflyBoardParser::firefly [private] |
1.5.6