creation and destruction in parser, also added some stuff to gitingore

This commit is contained in:
herbglitch 2024-10-16 05:14:53 -06:00
parent 5842197142
commit 60acfd075a
6 changed files with 151 additions and 4 deletions

View file

@ -43,7 +43,6 @@ typedef ARC_Bool (* ARC_LexerTokenRule_AutomataFn)(ARC_String **string, ARC_Stri
*/
typedef void (* ARC_LexerTokenRule_DestroyAutomataDataFn)(void *automataData);
/**
* @brief a lexer token rule type
*/
@ -59,7 +58,7 @@ typedef struct ARC_LexerTokenRule {
/**
* @brief creates an ARC_Lexer type
*
* @param[out] lexer
* @param[out] lexer ARC_Lexer to create
*/
void ARC_Lexer_Create(ARC_Lexer **lexer);

View file

@ -0,0 +1,58 @@
#ifndef ARC_STD_PARSER_H_
#define ARC_STD_PARSER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "arc/std/array.h"
//#include "arc/std/bool.h"
//#include "arc/std/lexer.h"
#include <stdint.h>
/**
* @brief a lexer type
*/
typedef struct ARC_Parser ARC_Parser;
/**
* @brief a lexer type
*/
typedef struct ARC_ParserLanguageTag {
uint32_t tagId;
uint32_t **tokensOrTags;
uint32_t tokensOrTagsSize;
} ARC_ParserLanguageTag;
/**
* @brief creates an ARC_Parser type
*
* @TODO: probs want to move the note to another file
* @note array of tokens for langauge? like
* ARC_ParserTag tag = {
* VARIABLE_NAME, //tagId
* {
* { 2, CHAR_OR_NUM, VARIABLE_NAME },
* { 1, LAMBDA },
* }, //components
* 2 //componentsSize
* };
*
* @param[out] parser ARC_Parser to create
* @param[in] language an arry of ARC_ParserLanguageTags defining a langauge
*/
void ARC_Parser_Create(ARC_Parser **parser, ARC_Array *language);
/**
* @brief destroys an ARC_Parser type
*
* @param[in] parser ARC_Parser to free
*/
void ARC_Parser_Destroy(ARC_Parser *parser);
#ifdef __cplusplus
}
#endif
#endif // !ARC_STD_PARSER_H_