diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /42sh/src/lexer/token.h | |
Diffstat (limited to '42sh/src/lexer/token.h')
| -rw-r--r-- | 42sh/src/lexer/token.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/42sh/src/lexer/token.h b/42sh/src/lexer/token.h new file mode 100644 index 0000000..89d772a --- /dev/null +++ b/42sh/src/lexer/token.h @@ -0,0 +1,54 @@ +#ifndef TOKEN_H +#define TOKEN_H + +#include <utils/libstring.h> + +enum token_type +{ + // STEP 1 + TOKEN_NEWLINE, + TOKEN_EOF, + TOKEN_ERROR, + TOKEN_WORD, + TOKEN_IF, + TOKEN_THEN, + TOKEN_ELIF, + TOKEN_ELSE, + TOKEN_SEMICOLON, + TOKEN_FI, + TOKEN_HASHTAG, + + // STEP 2 + TOKEN_REDIR, + TOKEN_PIPE, + TOKEN_NEG, + TOKEN_WHILE, + TOKEN_UNTIL, + TOKEN_DO, + TOKEN_FOR, + TOKEN_DONE, + TOKEN_AND, + TOKEN_OR, + TOKEN_ESCAPE, + TOKEN_ASS_WORD, + TOKEN_DOUBLEQUOTE, + TOKEN_DOLLAR, + TOKEN_IN, + TOKEN_IONUMBER, + + // STEP 3 + TOKEN_PAR_RIGHT, + TOKEN_PAR_LEFT, + TOKEN_CURLY_RIGHT, + TOKEN_CURLY_LEFT, + + // STEP 4 +}; + +struct token +{ + enum token_type type; + struct string *value; +}; + +#endif /* ! TOKEN_H */ |
