Herb C Reference
Loading...
Searching...
No Matches
parser.h
Go to the documentation of this file.
1#ifndef HERB_PARSER_H
2#define HERB_PARSER_H
3
4#include "ast_node.h"
5#include "lexer.h"
6#include "util/hb_allocator.h"
7#include "util/hb_array.h"
8
9typedef enum {
13 // FOREIGN_CONTENT_RUBY,
14 // FOREIGN_CONTENT_TEMPLATE
16
18
25
31
33
45
46size_t parser_sizeof(void);
47
48void herb_parser_init(parser_T* parser, lexer_T* lexer, parser_options_T options);
49
51
53 AST_DOCUMENT_NODE_T* document,
54 const parser_options_T* options,
55 hb_allocator_T* allocator
56);
57void herb_parser_deinit(parser_T* parser);
58
60 hb_array_T* nodes,
61 hb_array_T* errors,
62 const parser_options_T* options,
63 hb_allocator_T* allocator
64);
65bool match_tags_visitor(const AST_NODE_T* node, void* data);
66
67#endif
size_t parser_sizeof(void)
Definition parser.c:41
const parser_options_T HERB_DEFAULT_PARSER_OPTIONS
Definition parser.c:36
AST_DOCUMENT_NODE_T * herb_parser_parse(parser_T *parser)
Definition parser.c:1776
void match_tags_in_node_array(hb_array_T *nodes, hb_array_T *errors, const parser_options_T *options, hb_allocator_T *allocator)
Definition parser.c:1823
bool match_tags_visitor(const AST_NODE_T *node, void *data)
Definition parser_match_tags.c:9
struct MATCH_TAGS_CONTEXT_STRUCT match_tags_context_T
void herb_parser_match_html_tags_post_analyze(AST_DOCUMENT_NODE_T *document, const parser_options_T *options, hb_allocator_T *allocator)
Definition parser.c:1851
void herb_parser_init(parser_T *parser, lexer_T *lexer, parser_options_T options)
Definition parser.c:45
parser_state_T
Definition parser.h:17
@ PARSER_STATE_FOREIGN_CONTENT
Definition parser.h:17
@ PARSER_STATE_DATA
Definition parser.h:17
void herb_parser_deinit(parser_T *parser)
Definition parser.c:1808
struct PARSER_STRUCT parser_T
struct PARSER_OPTIONS_STRUCT parser_options_T
foreign_content_type_T
Definition parser.h:9
@ FOREIGN_CONTENT_STYLE
Definition parser.h:12
@ FOREIGN_CONTENT_UNKNOWN
Definition parser.h:10
@ FOREIGN_CONTENT_SCRIPT
Definition parser.h:11
Definition ast_nodes.h:69
Definition ast_nodes.h:61
Definition lexer_struct.h:17
Definition parser.h:26
hb_array_T * errors
Definition parser.h:27
const parser_options_T * options
Definition parser.h:28
hb_allocator_T * allocator
Definition parser.h:29
Definition parser.h:19
bool analyze
Definition parser.h:21
bool strict
Definition parser.h:22
bool track_whitespace
Definition parser.h:20
bool action_view_helpers
Definition parser.h:23
Definition parser.h:34
size_t consecutive_error_count
Definition parser.h:42
foreign_content_type_T foreign_content_type
Definition parser.h:40
parser_state_T state
Definition parser.h:39
parser_options_T options
Definition parser.h:41
lexer_T * lexer
Definition parser.h:36
hb_allocator_T * allocator
Definition parser.h:35
bool in_recovery_mode
Definition parser.h:43
hb_array_T * open_tags_stack
Definition parser.h:38
token_T * current_token
Definition parser.h:37
Definition token_struct.h:58