older lexer stuff
This commit is contained in:
parent
7bd7cc4aa5
commit
380e74a0e6
3 changed files with 211 additions and 72 deletions
|
|
@ -0,0 +1,63 @@
|
|||
#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_
|
||||
Loading…
Add table
Add a link
Reference in a new issue