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_arena_t* arena;
40 pm_parser_t* parser;
41 pm_node_t* root;
42 pm_options_t* options;
44
45HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T* herb_parse_ruby(const char* source, size_t length);
47HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T** tokens, hb_allocator_T* allocator);
48
49#ifdef __cplusplus
50}
51#endif
52
53#endif
HERB_EXPORTED_FUNCTION void herb_free_ruby_parse_result(herb_ruby_parse_result_T *result)
Definition herb.c:149
HERB_EXPORTED_FUNCTION const char * herb_prism_version(void)
Definition herb.c:130
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:18
HERB_EXPORTED_FUNCTION herb_ruby_parse_result_T * herb_parse_ruby(const char *source, size_t length)
Definition herb.c:134
HERB_EXPORTED_FUNCTION void herb_free_tokens(hb_array_T **tokens, hb_allocator_T *allocator)
Definition herb.c:115
HERB_EXPORTED_FUNCTION AST_DOCUMENT_NODE_T * herb_parse(const char *source, const parser_options_T *options, hb_allocator_T *allocator)
Definition herb.c:53
HERB_EXPORTED_FUNCTION hb_array_T * herb_lex(const char *source, hb_allocator_T *allocator)
Definition herb.c:41
HERB_EXPORTED_FUNCTION const char * herb_version(void)
Definition herb.c:126
#define HERB_EXPORTED_FUNCTION
Definition macros.h:8
Definition herb.h:38
pm_options_t * options
Definition herb.h:42
pm_arena_t * arena
Definition herb.h:39
pm_node_t * root
Definition herb.h:41
pm_parser_t * parser
Definition herb.h:40