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_node.h"
5#include "extract.h"
6#include "macros.h"
7#include "parser.h"
8#include "util/hb_allocator.h"
9#include "util/hb_array.h"
10#include "util/hb_buffer.h"
11
12#include <prism.h>
13#include <stdbool.h>
14#include <stdint.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20HERB_EXPORTED_FUNCTION hb_array_T* herb_lex(const char* source, hb_allocator_T* allocator);
21
23 const char* source,
24 const parser_options_T* options,
25 hb_allocator_T* allocator
26);
27
28HERB_EXPORTED_FUNCTION const char* herb_version(void);
30
31typedef struct {
32 pm_parser_t parser;
33 pm_node_t* root;
34 pm_options_t options;
36
37HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T* herb_parse_ruby(const char* source, size_t length);
39HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T** tokens, hb_allocator_T* allocator);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
HERB_EXPORTED_FUNCTION void herb_free_ruby_parse_result(herb_ruby_parse_result_T *result)
Definition herb.c:101
HERB_EXPORTED_FUNCTION const char * herb_prism_version(void)
Definition herb.c:84
HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T * herb_parse_ruby(const char *source, size_t length)
Definition herb.c:88
HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T **tokens, hb_allocator_T *allocator)
Definition herb.c:69
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:80
#define HERB_EXPORTED_FUNCTION
Definition macros.h:8
Definition ast_nodes.h:72
Definition parser.h:19
Definition herb.h:31
pm_node_t * root
Definition herb.h:33
pm_options_t options
Definition herb.h:34
pm_parser_t parser
Definition herb.h:32