Setup a skeleton for the scanner.

This commit is contained in:
2022-02-09 19:53:57 +00:00
parent 68882d05a3
commit d6a3935588
3 changed files with 88 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
#ifndef SCANNER_H
#define SCANNER_H
typedef enum {
//Single-character tokens
LParen, RParen,
LBrace, RBrace,
Comma,
Dot,
Minus, Plus,
Semicolon,
Slash, Star,
//One or two character tokens
Bang, Bang_Equal,
Equal, Equal_Equal,
Greater, Greater_Equal,
Less, Less_Equal,
//Literals
Identifier,
String,
Number,
//Keywords
AND, CLASS, ELSE, FALSE, FUN,
FOR, IF, NIL, OR, PRINT, RETURN,
SUPER, THIS, TRUE, VAR, WHILE,
EndOF
} TokenType;
void ScanTokens(const char*);
#endif