package core:c/frontend/preprocessor

Types

Cond_Incl ¶

Cond_Incl :: struct {
	next:     ^Cond_Incl,
	tok:      ^c_frontend_tokenizer.Token,
	state:    Cond_Incl_State,
	included: bool,
}

Cond_Incl_State ¶

Cond_Incl_State :: enum u8 {
	In_Then, 
	In_Elif, 
	In_Else, 
}

Error_Handler ¶

Error_Handler :: c_frontend_tokenizer.Error_Handler

Macro ¶

Macro :: struct {
	name:         string,
	kind:         Macro_Kind,
	params:       ^Macro_Param,
	va_args_name: string,
	body:         ^c_frontend_tokenizer.Token,
	handler:      Macro_Handler,
}

Macro_Arg ¶

Macro_Arg :: struct {
	next:       ^Macro_Arg,
	name:       string,
	tok:        ^c_frontend_tokenizer.Token,
	is_va_args: bool,
}

Macro_Handler ¶

Macro_Handler :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token

Macro_Kind ¶

Macro_Kind :: enum u8 {
	Function_Like, 
	Value_Like, 
}

Macro_Param ¶

Macro_Param :: struct {
	next: ^Macro_Param,
	name: string,
}

Pragma_Handler ¶

Pragma_Handler :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token)

Preprocessor ¶

Preprocessor :: struct {
	// Lookup tables
	macros:             map[string]^Macro,
	pragma_once:        map[string]bool,
	include_guards:     map[string]string,
	filepath_cache:     map[string]string,
	// Include path data
	include_paths:      []string,
	// Counter for __COUNTER__ macro
	counter:            i64,
	// Include information
	cond_incl:          ^Cond_Incl,
	include_level:      int,
	include_next_index: int,
	wide_char_size:     int,
	// Mutable data
	err:                c_frontend_tokenizer.Error_Handler,
	warn:               c_frontend_tokenizer.Error_Handler,
	pragma_handler:     Pragma_Handler,
	error_count:        int,
	warning_count:      int,
}

Constants

MAX_INCLUDE_LEVEL ¶

MAX_INCLUDE_LEVEL :: 1024

Variables

This section is empty.

Procedures

add_builtin ¶

add_builtin :: proc "odin" (cpp: ^Preprocessor, name: string, handler: Macro_Handler) -> ^Macro {…}

add_macro ¶

add_macro :: proc "odin" (cpp: ^Preprocessor, name: string, kind: Macro_Kind, body: ^c_frontend_tokenizer.Token) -> ^Macro {…}

append_token ¶

append_token :: proc "odin" (a, b: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

check_for_include_guard ¶

check_for_include_guard :: proc "odin" (tok: ^c_frontend_tokenizer.Token) -> (guard: string, ok: bool) {…}

const_expr ¶

const_expr :: proc "odin" (rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) -> i64 {…}

consume ¶

consume :: proc "odin" (rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token, lit: string) -> bool {…}

convert_pp_char ¶

convert_pp_char :: proc "odin" (tok: ^c_frontend_tokenizer.Token) {…}

convert_pp_number ¶

convert_pp_number :: proc "odin" (tok: ^c_frontend_tokenizer.Token) {…}

convert_pp_string ¶

convert_pp_string :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) {…}

convert_pp_token ¶

convert_pp_token :: proc "odin" (cpp: ^Preprocessor, t: ^c_frontend_tokenizer.Token, is_keyword: c_frontend_tokenizer.Is_Keyword_Proc) {…}

convert_pp_tokens ¶

convert_pp_tokens :: proc "odin" (cpp: ^Preprocessor, t: ^c_frontend_tokenizer.Token, is_keyword: c_frontend_tokenizer.Is_Keyword_Proc) {…}

copy_line ¶

copy_line :: proc "odin" (rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

counter_macro ¶

counter_macro :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

define_macro ¶

define_macro :: proc "odin" (cpp: ^Preprocessor, name, def: string) {…}

error ¶

error :: proc "odin" (cpp: ^Preprocessor, tok: ^c_frontend_tokenizer.Token, msg: string, args: ..any) {…}

eval_const_expr ¶

eval_const_expr :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) -> (val: i64) {…}

expand_macro ¶

expand_macro :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) -> bool {…}

file_macro ¶

file_macro :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

find_arg ¶

find_arg :: proc "odin" (args: ^Macro_Arg, tok: ^c_frontend_tokenizer.Token) -> ^Macro_Arg {…}

find_macro ¶

find_macro :: proc "odin" (cpp: ^Preprocessor, tok: ^c_frontend_tokenizer.Token) -> ^Macro {…}

from_hex ¶

from_hex :: proc "odin" (x: u8) -> i32 {…}

has_varargs ¶

has_varargs :: proc "odin" (args: ^Macro_Arg) -> bool {…}

include_file ¶

include_file :: proc "odin" (cpp: ^Preprocessor, tok: ^c_frontend_tokenizer.Token, path: string, filename_tok: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

init_default_macros ¶

init_default_macros :: proc "odin" (cpp: ^Preprocessor) {…}

init_defaults ¶

init_defaults :: proc "odin" (cpp: ^Preprocessor, allocator := context.allocator) {…}

init_lookup_tables ¶

init_lookup_tables :: proc "odin" (cpp: ^Preprocessor, allocator := context.allocator) {…}

is_hash ¶

is_hash :: proc "odin" (tok: ^c_frontend_tokenizer.Token) -> bool {…}

is_hex_digit ¶

is_hex_digit :: proc "odin" (x: u8) -> bool {…}

join_adjacent_string_literals ¶

join_adjacent_string_literals :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) {…}

join_tokens ¶

join_tokens :: proc "odin" (tok, end: ^c_frontend_tokenizer.Token) -> string {…}

line_macro ¶

line_macro :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

new_number_token ¶

new_number_token :: proc "odin" (cpp: ^Preprocessor, i: i64, tok: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

new_string_token ¶

new_string_token :: proc "odin" (cpp: ^Preprocessor, str: string, tok: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

paste ¶

paste :: proc "odin" (cpp: ^Preprocessor, hash, arg: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

preprocess ¶

preprocess :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

preprocess_internal ¶

preprocess_internal :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

push_cond_incl ¶

push_cond_incl :: proc "odin" (cpp: ^Preprocessor, tok: ^c_frontend_tokenizer.Token, included: bool) -> ^Cond_Incl {…}

quote_string ¶

quote_string :: proc "odin" (s: string) -> []u8 {…}

read_const_expr ¶

read_const_expr :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

read_include_filename ¶

read_include_filename :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) -> (filename: string, is_quote: bool) {…}

read_line_marker ¶

read_line_marker :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) {…}

read_macro_arg_one ¶

read_macro_arg_one :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token, read_rest: bool) -> ^Macro_Arg {…}

read_macro_args ¶

read_macro_args :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token, params: ^Macro_Param, va_args_name: string) -> ^Macro_Arg {…}

read_macro_definition ¶

read_macro_definition :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) {…}

read_macro_params ¶

read_macro_params :: proc "odin" (cpp: ^Preprocessor, rest: ^^c_frontend_tokenizer.Token, tok: ^c_frontend_tokenizer.Token) -> (param: ^Macro_Param, va_args_name: string) {…}

search_include_next ¶

search_include_next :: proc "odin" (cpp: ^Preprocessor, filename: string) -> (path: string, ok: bool) {…}

search_include_paths ¶

search_include_paths :: proc "odin" (cpp: ^Preprocessor, filename: string) -> (path: string, ok: bool) {…}

skip ¶

skip :: proc "odin" (cpp: ^Preprocessor, tok: ^c_frontend_tokenizer.Token, op: string) -> ^c_frontend_tokenizer.Token {…}

skip_cond_incl ¶

skip_cond_incl :: proc "odin" (tok: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

skip_line ¶

skip_line :: proc "odin" (_: ^Preprocessor, _: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

stringize ¶

stringize :: proc "odin" (cpp: ^Preprocessor, hash, arg: ^c_frontend_tokenizer.Token) -> ^c_frontend_tokenizer.Token {…}

substitute_token ¶

substitute_token :: proc "odin" (cpp: ^Preprocessor, tok: ^c_frontend_tokenizer.Token, args: ^Macro_Arg) -> ^c_frontend_tokenizer.Token {…}

undef_macro ¶

undef_macro :: proc "odin" (cpp: ^Preprocessor, name: string) {…}

unquote_char ¶

unquote_char :: proc "odin" (str: string, quote: u8) -> (r: rune, multiple_bytes: bool, tail_string: string, success: bool) {…}

unquote_string ¶

unquote_string :: proc "odin" (lit: string, allocator := context.allocator) -> (res: string, allocated, success: bool) {…}

warn ¶

warn :: proc "odin" (cpp: ^Preprocessor, tok: ^c_frontend_tokenizer.Token, msg: string, args: ..any) {…}

wide_char_size ¶

wide_char_size :: proc "odin" (cpp: ^Preprocessor) -> int {…}

Procedure Groups

This section is empty.

Source Files

Generation Information

Generated with odin version dev-2022-12 (vendor "odin") Windows_amd64 @ 2022-12-06 21:08:55.133105700 +0000 UTC