KCC - Kayte C Compiler 1.10.0
A C compiler implementation with preprocessor, lexer, parser, and code generator
Loading...
Searching...
No Matches
lexer.h
1#ifndef LEXER_H
2#define LEXER_H
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7#include <stdbool.h>
8#include <ctype.h>
9#include "types.h"
10
11// Maximum lengths for lexer buffers
12#define MAX_IDENTIFIER_LENGTH 256
13#define MAX_STRING_LENGTH 1024
14
15// Lexer functions
16Lexer *lexer_create(const char *input, const char *filename);
17void lexer_destroy(Lexer *lexer);
18Token lexer_next_token(Lexer *lexer);
19Token lexer_peek_token(Lexer *lexer);
20const char *token_type_to_string(TokenType type);
21bool is_keyword(const char *str, TokenType *type);
22void print_token(const Token *token);
23
24// Helper functions for token management
25void token_destroy(Token *token);
26Token token_copy(const Token *token);
27
28// Objective-C specific helper functions
29bool is_objc_at_keyword(const char *str, TokenType *type);
30bool is_objc_keyword(const char *str, TokenType *type);
31bool is_objc_type(const char *str, TokenType *type);
32
33#endif // LEXER_H
Lexer structure.
Definition types.h:499
Token structure.
Definition types.h:304
Type definitions for KCC compiler with Objective-C support.
TokenType
Token types for lexical analysis.
Definition types.h:24