Herb C Reference
Loading...
Searching...
No Matches
herb.h
Go to the documentation of this file.
1#ifndef HERB_H
2#define HERB_H
3
4#include "ast/ast_node.h"
5#include "diff/herb_diff.h"
6#include "extract.h"
7#include "lib/hb_allocator.h"
8#include "lib/hb_array.h"
9#include "lib/hb_buffer.h"
10#include "macros.h"
11#include "parser/parser.h"
12
13#include <prism.h>
14#include <stdbool.h>
15#include <stdint.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21HERB_EXPORTED_FUNCTION hb_array_T* herb_lex(const char* source, hb_allocator_T* allocator);
22
23HERB_EXPORTED_FUNCTION AST_DOCUMENT_NODE_T* herb_parse(
24 const char* source,
25 const parser_options_T* options,
26 hb_allocator_T* allocator
27);
28
29HERB_EXPORTED_FUNCTION const char* herb_version(void);
31
32typedef struct {
33 pm_parser_t parser;
34 pm_node_t* root;
35 pm_options_t options;
37
38HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T* herb_parse_ruby(const char* source, size_t length);
40HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T** tokens, hb_allocator_T* allocator);
41
42#ifdef __cplusplus
43}
44#endif
45
46#endif
HERB_EXPORTED_FUNCTION void herb_free_ruby_parse_result(herb_ruby_parse_result_T *result)
Definition herb.c:111
HERB_EXPORTED_FUNCTION const char * herb_prism_version(void)
Definition herb.c:94
HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T * herb_parse_ruby(const char *source, size_t length)
Definition herb.c:98
HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T **tokens, hb_allocator_T *allocator)
Definition herb.c:79
HERB_EXPORTED_FUNCTION AST_DOCUMENT_NODE_T * herb_parse(const char *source, const parser_options_T *options, hb_allocator_T *allocator)
Definition herb.c:33
HERB_EXPORTED_FUNCTION hb_array_T * herb_lex(const char *source, hb_allocator_T *allocator)
Definition herb.c:15
HERB_EXPORTED_FUNCTION const char * herb_version(void)
Definition herb.c:90
#define HERB_EXPORTED_FUNCTION
Definition macros.h:8
Definition herb.h:32
pm_node_t * root
Definition herb.h:34
pm_options_t options
Definition herb.h:35
pm_parser_t parser
Definition herb.h:33