Public Member Functions | List of all members
ipe::Lex Class Reference

#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 ()
Lexoperator>> (int &i)
Lexoperator>> (double &d)
Lexoperator>> (Fixed &d)
void mark ()
void fromMark ()
bool eos () const

Detailed Description

Lexical analyser. Seeded with a string.

Constructor & Destructor Documentation

◆ Lex()

Lex::Lex ( String  str)

Construct lexical analyzer from a string.

Member Function Documentation

◆ token()

String Lex::token ( )

Return NextToken, but without extracting it.

References nextToken().

Referenced by ipe::Shape::load().

◆ nextToken()

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().

◆ getInt()

int Lex::getInt ( )

◆ getHexByte()

int Lex::getHexByte ( )

Extract byte in hex (skipping whitespace).

References eos(), and skipWhitespace().

Referenced by ipe::Bitmap::Bitmap(), and ipe::PdfString::decode().

◆ getFixed()

Fixed Lex::getFixed ( )

◆ getHexNumber()

unsigned long int Lex::getHexNumber ( )

Extract hexadecimal token (skipping whitespace).

References nextToken(), and ipe::String::z().

◆ getDouble()

double Lex::getDouble ( )

Extract double token (skipping whitespace).

References nextToken(), and ipe::Platform::toDouble().

Referenced by ipe::Painter::dashStyle(), ipe::ImlParser::parseStyle(), and ipe::Text::Text().

◆ getChar()

char ipe::Lex::getChar ( )

Extract next character (not skipping anything).

◆ skipWhitespace()

void Lex::skipWhitespace ( )

◆ operator>>() [1/3]

Lex& ipe::Lex::operator>> ( int &  i)

Operator syntax for getInt().

◆ operator>>() [2/3]

Lex& ipe::Lex::operator>> ( double &  d)

Operator syntax for getDouble().

◆ operator>>() [3/3]

Lex& ipe::Lex::operator>> ( Fixed d)

Operator syntax for getFixed().

◆ mark()

void ipe::Lex::mark ( )

Mark the current position.

Referenced by nextToken().

◆ fromMark()

void ipe::Lex::fromMark ( )

Reset reader to the marked position.

◆ eos()

bool ipe::Lex::eos ( ) const

The documentation for this class was generated from the following files: