UnivesalDisassembler(2003)
|
Scans input for tokens. More...
#include <instrset.h>
Classes | |
class | Token |
Token type returned by Scanner. More... | |
Public Member Functions | |
int | line () |
Returns actual row in the input stream. | |
Scanner (const char *filename) | |
Creates scanner. | |
Token | Scan () |
Reads next token. tk_none type is returned when no token is in input stream. | |
Protected Member Functions | |
int | getc () |
void | ungetc (int c) |
Protected Attributes | |
const char * | _filename |
ifstream | input |
Scans input for tokens.
Definition at line 131 of file instrset.h.
Scanner::Scanner | ( | const char * | filename | ) |
Creates scanner.
Definition at line 155 of file instrset.cc.
int Scanner::getc | ( | ) | [protected] |
Definition at line 132 of file instrset.cc.
Referenced by Scan().
int Scanner::line | ( | ) | [inline] |
Returns actual row in the input stream.
Definition at line 154 of file instrset.h.
Referenced by Symbols::Load(), and Scan().
Scanner::Token Scanner::Scan | ( | ) |
Reads next token. tk_none type is returned when no token is in input stream.
Definition at line 161 of file instrset.cc.
References getc(), Scanner::Token::int_value, line(), lower, Scanner::Token::str_value, tk_comma, tk_equal, tk_ident, tk_number, tk_parcl, tk_parop, tk_plus, tk_semicol, tk_text, Scanner::Token::type, uint2str(), and ungetc().
Referenced by Symbols::Load(), and Parser::Parse().
void Scanner::ungetc | ( | int | c | ) | [protected] |
Definition at line 148 of file instrset.cc.
Referenced by Scan().
const char* Scanner::_filename [protected] |
Definition at line 136 of file instrset.h.
ifstream Scanner::input [protected] |
Definition at line 137 of file instrset.h.