diff --git a/4coder_API/types.h b/4coder_API/types.h index 0c62aa23..64f658b4 100644 --- a/4coder_API/types.h +++ b/4coder_API/types.h @@ -413,9 +413,13 @@ UNION Range{ }; }; +/* DOC(Parser_String_And_Type contains a string and type integer used to specify information about keywords to the parser.) */ STRUCT Parser_String_And_Type{ + /* DOC(The string specified by the pair, it need not be null terminated.) */ char *str; + /* DOC(The number of bytes in the string str.) */ uint32_t length; + /* DOC(The type integer.) */ uint32_t type; }; diff --git a/4cpp/4cpp_lexer.h b/4cpp/4cpp_lexer.h index 5a348146..88c8f9b0 100644 --- a/4cpp/4cpp_lexer.h +++ b/4cpp/4cpp_lexer.h @@ -63,7 +63,7 @@ typedef int32_t b32_4tech; //////////////// -FCPP_LINK umem_4tech +API_EXPORT FCPP_LINK umem_4tech cpp_get_table_memory_size_null_terminated(char **str_array, u32_4tech str_count){ umem_4tech memsize = 0; for (u32_4tech i = 0; i < str_count; ++i){ @@ -77,7 +77,7 @@ cpp_get_table_memory_size_null_terminated(char **str_array, u32_4tech str_count) return(memsize); } -FCPP_LINK umem_4tech +API_EXPORT FCPP_LINK umem_4tech cpp_get_table_memory_size_string_lengths(u32_4tech *str_len, u32_4tech byte_stride, u32_4tech str_count){ umem_4tech memsize = 0; u8_4tech *length_data = (u8_4tech*)str_len; @@ -166,7 +166,7 @@ cpp__fill_table(Cpp_Keyword_Table *table, char *str, u32_4tech str_count){ } } -FCPP_LINK Cpp_Keyword_Table +API_EXPORT FCPP_LINK Cpp_Keyword_Table cpp_make_table(char **str_array, u32_4tech str_stride, u32_4tech *len_array, u32_4tech len_stride, u32_4tech *type_array, u32_4tech type_stride, u32_4tech str_count, void *memory, umem_4tech memsize){ Cpp_Keyword_Table table = {0}; table.mem = memory; @@ -278,7 +278,7 @@ cpp__table_match(Cpp_Keyword_Table *table, char *s, u32_4tech s_len, u32_4tech * return(result); } -FCPP_LINK umem_4tech +API_EXPORT FCPP_LINK umem_4tech cpp_get_table_memory_size_default(Cpp_Word_Table_Type type){ u32_4tech *ptr = 0; u32_4tech count = 0; @@ -302,7 +302,7 @@ cpp_get_table_memory_size_default(Cpp_Word_Table_Type type){ return(size); } -FCPP_LINK Cpp_Keyword_Table +API_EXPORT FCPP_LINK Cpp_Keyword_Table cpp_make_table_default(Cpp_Word_Table_Type type, void *mem, umem_4tech memsize){ char **str_ptr = 0; u32_4tech *len_ptr = 0; diff --git a/4cpp/4cpp_lexer_types.h b/4cpp/4cpp_lexer_types.h index 57f3e4dc..4a559598 100644 --- a/4cpp/4cpp_lexer_types.h +++ b/4cpp/4cpp_lexer_types.h @@ -16,8 +16,11 @@ #define STRUCT struct #endif +/* DOC(A Cpp_Word_Table_Type names one of the keyword table slots in a parse context.) */ ENUM(uint32_t, Cpp_Word_Table_Type){ + /* DOC(The Cpp_Keyword_Table used to list the typical keywords.) */ CPP_TABLE_KEYWORDS, + /* DOC(The Cpp_Keyword_Table used to list preprocessor directives.) */ CPP_TABLE_PREPROCESSOR_DIRECTIVES, }; @@ -311,6 +314,9 @@ struct Cpp_Lex_FSM{ }; static Cpp_Lex_FSM null_lex_fsm = {0}; +/* DOC(A Cpp_Keyword_Table contains a list of keywords and a hashed lookup table for the keywords. They are used to setup a parse context.) +DOC_SEE(cpp_make_token_array) +HIDE_MEMBERS() */ STRUCT Cpp_Keyword_Table{ void *mem; umem_4tech memsize; diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 6533c713..b4c261ed 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -447,7 +447,13 @@ DOC_SEE(The_4coder_Clipboard) API_EXPORT Parse_Context_ID Create_Parse_Context(Application_Links *app, Parser_String_And_Type *kw, uint32_t kw_count, Parser_String_And_Type *pp, uint32_t pp_count) -{ +/* +DOC_PARAM(kw, The list of keywords and type of each.) +DOC_PARAM(kw_count, The number of keywords in the list.) +DOC_PARAM(pp, The list of preprocessor directives and the type of each.) +DOC_PARAM(pp_count, The number of preprocessor directives in the list.) +DOC_RETURN(On success returns an id for the new parse context. If id == 0, then the maximum number of parse contexts has been reached.) +*/{ Command_Data *cmd = (Command_Data*)app->cmd_context; Models *models = cmd->models; diff --git a/4ed_site.ctm b/4ed_site.ctm index 201ff961..9364899d 100644 Binary files a/4ed_site.ctm and b/4ed_site.ctm differ