diff options
| author | ov-4 <hausemasterstream@gmail.com> | 2026-01-29 14:24:05 +0000 |
|---|---|---|
| committer | ov-4 <hausemasterstream@gmail.com> | 2026-01-29 14:24:05 +0000 |
| commit | 943ed04b775949e8bc4948bcb8d762a32ab14f76 (patch) | |
| tree | 5c8d09bcd702558e1fba25e176712a1697a6c7e7 /include/cps/Lexer.h | |
| parent | 4573880fcc32bd76a72a4ae713190cd997194583 (diff) | |
Added array
Diffstat (limited to 'include/cps/Lexer.h')
| -rw-r--r-- | include/cps/Lexer.h | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/include/cps/Lexer.h b/include/cps/Lexer.h index a03c3f6..a7a6218 100644 --- a/include/cps/Lexer.h +++ b/include/cps/Lexer.h @@ -1,39 +1,46 @@ #pragma once #include <string> -#include <iostream> namespace cps { enum Token { tok_eof = -1, + tok_declare = -2, - tok_integer_kw = -3, // INTEGER + tok_integer_kw = -3, tok_input = -4, tok_output = -5, - tok_identifier = -6, - tok_number = -7, - tok_assign = -8, // <- - tok_colon = -9, // : - - tok_if = -10, - tok_then = -11, - tok_else = -12, - tok_endif = -13, - tok_while = -14, - tok_do = -15, - tok_endwhile = -16, - tok_repeat = -17, - tok_until = -18, - tok_for = -19, - tok_to = -24, - tok_step = -25, - tok_next = -26, + tok_if = -6, + tok_then = -7, + tok_else = -8, + tok_endif = -9, + + tok_while = -10, + tok_do = -11, + tok_endwhile = -12, + + tok_repeat = -13, + tok_until = -14, + + tok_for = -15, + tok_to = -16, + tok_step = -17, + tok_next = -18, + + tok_array = -19, + tok_of = -20, - tok_eq = -20, // = - tok_ne = -21, // <> - tok_le = -22, // <= - tok_ge = -23 // >= + tok_identifier = -100, + tok_number = -101, + + tok_assign = -200, // <- + tok_eq = -201, // = + tok_ne = -202, // <> + tok_le = -203, // <= + tok_ge = -204, // >= + + tok_colon = -300 // : }; class Lexer { @@ -44,4 +51,4 @@ public: int gettok(); }; -} // namespace cps +} |
