Ipelib
|
#include <ipebase.h>
Public Member Functions | |
Lex (String str) | |
String | token () |
String | nextToken () |
int | getInt () |
int | getHexByte () |
Fixed | getFixed () |
unsigned long int | getHexNumber () |
double | getDouble () |
char | getChar () |
void | skipWhitespace () |
Lex & | operator>> (int &i) |
Lex & | operator>> (double &d) |
Lex & | operator>> (Fixed &d) |
void | mark () |
void | fromMark () |
bool | eos () const |
Lexical analyser. Seeded with a string.
|
explicit |
Construct lexical analyzer from a string.
String Lex::token | ( | ) |
Return NextToken, but without extracting it.
References nextToken().
Referenced by ipe::Shape::load().
String Lex::nextToken | ( | ) |
Extract next token.
Skips any whitespace before the token. Returns empty string if end of string is reached.
References eos(), mark(), skipWhitespace(), and ipe::String::substr().
Referenced by getDouble(), getFixed(), getHexNumber(), getInt(), ipe::Shape::load(), ipe::ImlParser::parsePage(), and token().
int Lex::getInt | ( | ) |
Extract integer token (skipping whitespace).
References nextToken(), and ipe::String::z().
Referenced by operator>>(), ipe::ImlParser::parseBitmap(), ipe::ImlParser::parseObject(), ipe::ImlParser::parseStyle(), and ipe::Platform::runPdfLatex().
int Lex::getHexByte | ( | ) |
Extract byte in hex (skipping whitespace).
References eos(), and skipWhitespace().
Referenced by ipe::Bitmap::Bitmap().
Fixed Lex::getFixed | ( | ) |
Extract Fixed token (skipping whitespace).
References ipe::Fixed::fromInternal(), nextToken(), ipe::String::size(), ipe::String::substr(), and ipe::String::z().
Referenced by operator>>().
unsigned long int Lex::getHexNumber | ( | ) |
Extract hexadecimal token (skipping whitespace).
References nextToken(), and ipe::String::z().
double Lex::getDouble | ( | ) |
Extract double token (skipping whitespace).
References nextToken(), and ipe::Platform::toDouble().
Referenced by ipe::PdfPainter::doDrawText(), operator>>(), ipe::ImlParser::parseStyle(), and ipe::Text::Text().
|
inline |
Extract next character (not skipping anything).
void Lex::skipWhitespace | ( | ) |
Skip over whitespace.
References eos().
Referenced by getHexByte(), ipe::Shape::load(), nextToken(), and ipe::ImlParser::parsePage().
|
inline |
Operator syntax for getDouble().
References getDouble().
Operator syntax for getFixed().
References getFixed().
|
inline |
Mark the current position.
Referenced by nextToken().
|
inline |
Reset reader to the marked position.
|
inline |
Return true if at end of string (not even whitespace left).
References ipe::String::size().
Referenced by ipe::Color::Color(), getHexByte(), ipe::Shape::load(), nextToken(), ipe::ImlParser::parsePage(), and skipWhitespace().