ConfigScanner Class Reference

#include <ConfigScanner.h>

List of all members.


Detailed Description

Class ConfigScanner is used by class ConfigParser to obtain the contents of a Rulbus configuration file one token at a time.

Class ConfigScanner analyzes the text from the Rulbus configuration file specified as stream with the constructor and breaks it into tokens.

The scanner ignores whitespace (spaces, tabs and newlines) and it recognizes the following Tokens:

             words :  keywords, e.g. rack, address, bipolar, rb8510_dac12
           numbers : octal, decimal, hexadecimal, floating point
           strings : '...' and "..."
           special : {}=;
  end-of-file : end of file indicator
             error : unrecognized token


Public Member Functions

virtual ~ConfigScanner ()
 destructor.

 ConfigScanner (std::istream &stream, String aFilename="")
 constructor.

ConfigTokenget ()
 return next token; may throw RulbusScanError.

String filename () const
 return the filename.

Int linenumber () const
 return curernt linenumber.


Protected Member Functions

void skipWhitespace ()
 skip whitespace, keep track of linenumber.

bool seechar (char &chr)
 look ahead one character.


Protected Attributes

ConfigWordToken wordToken
 the keyword scanner

ConfigNumberToken numberToken
 the number scanner

ConfigStringToken stringToken
 the string scanner

ConfigSpecialToken specialToken
 the special token scanner

ConfigEofToken eofToken
 the end-of-file token

ConfigErrorToken errorToken
 the unrecognized token scanner


Private Attributes

std::istream * is
 the stream

String theFilename
 the filename

Int theLinenumber
 the current linenumber


The documentation for this class was generated from the following files:
Generated on Tue Oct 12 14:12:03 2004 for Rulbus Device Class Library for Microsoft Windows by doxygen 1.3.4