slr

S Lang Runtime
git clone https://codeberg.org/night0721/slr
Log | Files | Refs | README | LICENSE

lexer.h (417B)


      1 #ifndef LEXER_H_
      2 #define LEXER_H_
      3 
      4 typedef enum {
      5   INT,
      6   KEYWORD,
      7   SEPARATOR,
      8   END_OF_TOKENS,
      9 } TokenType;
     10 
     11 typedef struct {
     12   TokenType type;
     13   char *value;
     14 } Token;
     15 
     16 Token *lexer(char *buf);
     17 void print_token(Token token);
     18 Token *generate_separator(char *current, int *current_index);
     19 Token *generate_number(char *current, int *current_index);
     20 Token *generate_keyword(char *current, int *current_index);
     21 
     22 #endif