1234567891011121314151617181920212223242526272829303132 |
- #ifndef LEXER_H
- #define LEXER_H
- #include <cctype>
- #include <cstdio>
- #include <map>
- #include <string>
- #include <vector>
- #include "Ast.h"
- namespace lexer{
- // The lexer returns tokens [0-255] if it is an unknown character, otherwise one
- // of these for known things.
- enum Token {
- tok_eof = -1,
- // commands
- tok_def = -2,
- tok_extern = -3,
- // primary
- tok_identifier = -4,
- tok_number = -5
- };
- static std::string IdentifierStr; // Filled in if tok_identifier
- static double NumVal;
- int gettok();
- }
- #endif
|