#include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> #define MAX_TOKEN_LENGTH 100 // Token types typedef enum { TOKEN_KEYWORD, TOKEN_IDENTIFIER, TOKEN_NUMBER, TOKEN_STRING_LITERAL, TOKEN_CHAR_LITERAL, TOKEN_OPERATOR, TOKEN_PUNCTUATION, TOKEN_UNKNOWN, TOKEN_END } TokenType; // Token structure typedef struct { TokenType type; char value[MAX_TOKEN_LENGTH]; } Token; // Keywords in C const char *keywords[] = { "auto", "break", "case", "char", "const", "continue", "default", "do", "double", "else", "enum", "extern", "float", "for", "goto", "if", "int", "long", "register", "return", "short", "signed", "sizeof", "static", "struct", "swi...
Comments
Post a Comment