63 lines
1.5 KiB
C
63 lines
1.5 KiB
C
#ifndef ARC_STD_PARSER_H_
|
|
#define ARC_STD_PARSER_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "arc/std/string.h"
|
|
|
|
/**
|
|
* @brief a parser type
|
|
*/
|
|
typedef struct ARC_Parser ARC_Parser;
|
|
|
|
/**
|
|
* @brief a parser node
|
|
*/
|
|
typedef struct ARC_ParserNode ARC_ParserNode;
|
|
|
|
/**
|
|
* @brief creates an ARC_Parser type
|
|
*
|
|
* @param[out] parser
|
|
* @param[in] language ..., can be NULL
|
|
*/
|
|
void ARC_Parser_Create(ARC_Parser **parser, ARC_String *language);
|
|
|
|
/**
|
|
* @brief destroys an ARC_Parser type
|
|
*
|
|
* @param[in] parser ARC_Parser to free
|
|
*/
|
|
void ARC_Parser_Destroy(ARC_Parser *parser);
|
|
|
|
/**
|
|
* @brief sets the definition of the parser, the language itself is parsed and will throw an error if invalid
|
|
*
|
|
* @param[in] parser ARC_Parser to set the language to
|
|
* @param[in] language the language as a string the parser should use
|
|
*/
|
|
void ARC_Parser_SetLanguage(ARC_Parser *parser, ARC_String *language);
|
|
|
|
/**
|
|
* @brief sets the definition of the parser, the language itself is parsed and will throw an error if invalid
|
|
*
|
|
* @param[in] parser ARC_Parser to set the language to
|
|
* @param[in] language the language as a string the parser should use
|
|
*/
|
|
void ARC_Parser_Parse(ARC_Parser *parser, ARC_String *data);
|
|
|
|
/**
|
|
* @brief sets the definition of the parser, the language itself is parsed and will throw an error if invalid
|
|
*
|
|
* @param[in] parser ARC_Parser to set the language to
|
|
* @param[in] language the language as a string the parser should use
|
|
*/
|
|
void ARC_Parser_ParseFile(ARC_Parser *parser, ARC_String *path);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // !ARC_STD_LEXER_H_
|