class Parser

Takes an input stream and divides it into tokens. More...

Definition#include <graph/parser.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Members

Private Members


Detailed Description

Takes an input stream and divides it into tokens. This code was mostly inspired by the calculator example by Bjarne Stroustrup, "The C++ Programming Language", 3rd., pp. 108ff (1997)

enum Tokens {STRING, NUMBER, END, BAD, NEWLINE, DIRECTIVE, COLON = ':', OTAG = '<', CTAG ='>', DEFTAG = '!' }

Possible token values used by the Parser.

double numberValue

This variable contains the numerical value of the last token if appropriate.

Tokens currentToken

Holds the type of the last token read.

string stringValue

This variable contains the string value of the last token if appropriate.

Tokens  nextToken ()

Returns the next token in the stream. The value is stored in the public variables stringValue and numberValue if appropriate.

Tag  getTag ()

Tries to construct a tag of the form < element.name attribute1 attribute2 ... >. The elementName will be stored in tagAttribute[0] and all following attributes in tagAttribute[1..n].

istream* is

[private]

Data input stream to be tokenized