#include <ConfigScanner.h>
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. | |
| ConfigToken * | get () |
| 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 | |