2014-03-09 22:05:17 -07:00
|
|
|
#ifndef TREE_SITTER_COMPILER_H_
|
|
|
|
|
#define TREE_SITTER_COMPILER_H_
|
2014-02-16 22:13:08 -08:00
|
|
|
|
2016-01-10 20:04:41 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
TSCompileErrorTypeNone,
|
|
|
|
|
TSCompileErrorTypeInvalidGrammar,
|
|
|
|
|
TSCompileErrorTypeInvalidRegex,
|
|
|
|
|
TSCompileErrorTypeUndefinedSymbol,
|
2017-01-31 11:36:51 -08:00
|
|
|
TSCompileErrorTypeInvalidExtraToken,
|
|
|
|
|
TSCompileErrorTypeInvalidExternalToken,
|
2016-01-10 20:04:41 -08:00
|
|
|
TSCompileErrorTypeLexConflict,
|
|
|
|
|
TSCompileErrorTypeParseConflict,
|
2016-11-30 22:47:25 -08:00
|
|
|
TSCompileErrorTypeEpsilonRule,
|
2017-03-17 12:52:01 -07:00
|
|
|
TSCompileErrorTypeInvalidTokenContents,
|
2016-01-10 20:04:41 -08:00
|
|
|
} TSCompileErrorType;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2016-02-05 12:23:54 -08:00
|
|
|
char *code;
|
|
|
|
|
char *error_message;
|
2016-01-10 20:04:41 -08:00
|
|
|
TSCompileErrorType error_type;
|
|
|
|
|
} TSCompileResult;
|
2016-01-10 13:44:22 -08:00
|
|
|
|
2016-01-10 20:04:41 -08:00
|
|
|
TSCompileResult ts_compile_grammar(const char *input);
|
2014-07-22 07:52:12 -07:00
|
|
|
|
2016-01-10 20:04:41 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2014-02-16 22:13:08 -08:00
|
|
|
|
2014-03-09 22:05:17 -07:00
|
|
|
#endif // TREE_SITTER_COMPILER_H_
|