33 _tmpStringCapacity(16),
36 _bufferPos(_buffer.end()) {
63 got <<
"no more input";
90 err <<
a <<
" or " <<
b;
159 for (
size_t i = 1;
i < size; ++
i)
209 if (
sizeof(
size_t) ==
sizeof(
unsigned int)) {
212 errorMsg <<
"expected non-negative integer of size at most "
213 << numeric_limits<unsigned int>::max()
218 }
else if (
sizeof(
size_t) ==
sizeof(
unsigned long)) {
221 errorMsg <<
"expected non-negative integer of size at most "
222 << numeric_limits<unsigned long>::max()
230 "Frobby does not work on this machine due to an "
231 "unexpected technical issue.\n"
232 "Please contact the developers of Frobby about this.\n"
234 "Details that will be useful to the developers:\n"
235 " error location: Scanner::readSizeT\n"
236 " sizeof(size_t) = " <<
sizeof(size_t) <<
"\n"
237 " sizeof(unsigned int) = " <<
sizeof(
unsigned int) <<
"\n"
238 " sizeof(unsigned long) = " <<
sizeof(
unsigned long) <<
"\n";
280 errorMsg <<
"Unknown variable \"" <<
name <<
"\". Maybe you forgot a *.";
string getFormatNameIndicatingToGuessTheInputFormat()
Using the returned string in place of an (input) format name indicates to guess the format based on w...
string autoDetectFormat(Scanner &in)
Return the format of what in is reading based on the first non-whitespace character.
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
static const size_t BufferSize
A replacement for stringstream.
auto_ptr< IOHandler > createIOHandler() const
int peek()
Returns the next character or EOF.
size_t readIntegerString()
Returns the size of the string.
size_t _tmpStringCapacity
void parseInteger(mpz_class &integer, size_t size)
Scanner(const string &formatName, FILE *in)
Construct a Scanner object.
void reportErrorUnexpectedToken(const string &expected, int got)
void eatWhite()
Reads past any whitespace, where whitespace is defined by the standard function isspace().
vector< char >::iterator _bufferPos
void errorReadIdentifier()
void expectEOF()
Require that there is no more input.
void readIntegerAndNegativeAsZero(mpz_class &integer)
Read an integer and set it to zero if it is negative.
void expect(char expected)
Require the next character to be equal to expected.
const char * readIdentifier()
The returned string is only valid until the next method on this object gets called.
void errorExpectTwo(char a, char b, int got)
void readSizeT(size_t &size)
Reads a size_t, where the representable range of that type determines when the number is too big.
const string & getFormat() const
void readInteger(mpz_class &integer)
Read an arbitrary-precision integer.
void errorExpectOne(char expected, int got)
void setFormat(const string &format)
void errorReadVariable(const char *name)
size_t readIntegerStringNoSign()
Returns the size of the string.
void reportInternalError(const string &errorMsg)
void reportSyntaxError(const Scanner &scanner, const string &errorMsg)