KCC - Kayte C Compiler
1.10.0
A C compiler implementation with preprocessor, lexer, parser, and code generator
Loading...
Searching...
No Matches
include
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
16
Lexer
*lexer_create(
const
char
*input,
const
char
*filename);
17
void
lexer_destroy(
Lexer
*lexer);
18
Token
lexer_next_token(
Lexer
*lexer);
19
Token
lexer_peek_token(
Lexer
*lexer);
20
const
char
*token_type_to_string(
TokenType
type);
21
bool
is_keyword(
const
char
*str,
TokenType
*type);
22
void
print_token(
const
Token
*token);
23
24
// Helper functions for token management
25
void
token_destroy(
Token
*token);
26
Token
token_copy(
const
Token
*token);
27
28
// Objective-C specific helper functions
29
bool
is_objc_at_keyword(
const
char
*str,
TokenType
*type);
30
bool
is_objc_keyword(
const
char
*str,
TokenType
*type);
31
bool
is_objc_type(
const
char
*str,
TokenType
*type);
32
33
#endif
// LEXER_H
Lexer
Lexer structure.
Definition
types.h:499
Token
Token structure.
Definition
types.h:304
types.h
Type definitions for KCC compiler with Objective-C support.
TokenType
TokenType
Token types for lexical analysis.
Definition
types.h:24
Generated by
1.14.0