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
24 const char* source,
25 const parser_options_T* options,
26 hb_allocator_T* allocator
27);
28
29HERB_EXPORTED_FUNCTION AST_DOCUMENT_NODE_T* herb_parse(
30 const char* source,
31 const parser_options_T* options,
32 hb_allocator_T* allocator
33);
34
35HERB_EXPORTED_FUNCTION const char* herb_version(void);
37
38typedef struct {
39 pm_parser_t parser;
40 pm_node_t* root;
41 pm_options_t options;
43
44HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T* herb_parse_ruby(const char* source, size_t length);
46HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T** tokens, hb_allocator_T* allocator);
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif
HERB_EXPORTED_FUNCTION void herb_free_ruby_parse_result(herb_ruby_parse_result_T *result)
Definition herb.c:153
HERB_EXPORTED_FUNCTION const char * herb_prism_version(void)
Definition herb.c:136
HERB_EXPORTED_FUNCTION hb_array_T * herb_lex_with_options(const char *source, const parser_options_T *options, hb_allocator_T *allocator)
Definition herb.c:17
HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T * herb_parse_ruby(const char *source, size_t length)
Definition herb.c:140
HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T **tokens, hb_allocator_T *allocator)
Definition herb.c:121
HERB_EXPORTED_FUNCTION AST_DOCUMENT_NODE_T * herb_parse(const char *source, const parser_options_T *options, hb_allocator_T *allocator)
Definition herb.c:52
HERB_EXPORTED_FUNCTION hb_array_T * herb_lex(const char *source, hb_allocator_T *allocator)
Definition herb.c:40
HERB_EXPORTED_FUNCTION const char * herb_version(void)
Definition herb.c:132
#define HERB_EXPORTED_FUNCTION
Definition macros.h:8
Definition herb.h:38
pm_node_t * root
Definition herb.h:40
pm_options_t options
Definition herb.h:41
pm_parser_t parser
Definition herb.h:39