Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | StackSlice |
struct | StackSummaryEntry |
Macros | |
#define | STACK_VERSION_NONE ((StackVersion)-1) |
Typedefs | |
typedef struct Stack | Stack |
typedef unsigned | StackVersion |
typedef void(* | StackIterateCallback) (void *, TSStateId, uint32_t) |
#define STACK_VERSION_NONE ((StackVersion)-1) |
typedef unsigned StackVersion |
typedef Array | ( | StackSlice | ) |
typedef Array | ( | StackSummaryEntry | ) |
bool ts_stack_can_merge | ( | Stack * | self, |
StackVersion | version1, | ||
StackVersion | version2 | ||
) |
Definition at line 693 of file stack.c.
References Length::bytes, StackNode::error_cost, StackHead::last_external_token, StackHead::node, StackNode::position, StackNode::state, StackHead::status, and ts_subtree_external_scanner_state_eq().
Referenced by ts_parser__better_version_exists(), and ts_stack_merge().
void ts_stack_clear | ( | Stack * | self | ) |
Definition at line 737 of file stack.c.
References array_clear, array_push, i, stack_head_delete(), and stack_node_retain().
Referenced by parser__start(), parser_parse(), ts_parser_reset(), and ts_stack_new().
StackVersion ts_stack_copy_version | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 669 of file stack.c.
References array_back, array_push, assert(), test-lz4-versions::head, NULL, stack_node_retain(), and ts_subtree_retain().
Referenced by parser__recover(), parser__reduce(), and ts_parser__handle_error().
void ts_stack_delete | ( | Stack * | self | ) |
Definition at line 424 of file stack.c.
References array_clear, array_delete, i, stack_head_delete(), stack_node_release(), and ts_free.
Referenced by parser_destroy(), and ts_parser_delete().
int ts_stack_dynamic_precedence | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 615 of file stack.c.
References array_get.
Referenced by ts_parser__better_version_exists(), and ts_parser__version_status().
unsigned ts_stack_error_cost | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 466 of file stack.c.
References array_get, ERROR_COST_PER_RECOVERY, ERROR_STATE, and test-lz4-versions::head.
Referenced by ts_parser__condense_stack(), ts_parser__recover(), ts_parser__version_status(), and ts_stack_print_dot_graph().
StackSummary* ts_stack_get_summary | ( | Stack * | self, |
StackVersion | version | ||
) |
void ts_stack_halt | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 705 of file stack.c.
References array_get.
Referenced by parser__accept(), parser__better_version_exists(), parser__handle_error(), parser__repair_error(), ts_parser__accept(), ts_parser__recover(), and ts_parser__recover_to_state().
bool ts_stack_has_advanced_since_error | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 619 of file stack.c.
References array_get, StackNode::error_cost, test-lz4-versions::head, StackNode::link_count, StackNode::links, StackLink::node, StackNode::node_count, Subtree::ptr, StackLink::subtree, ts_subtree_error_cost(), and ts_subtree_total_bytes().
Referenced by ts_parser__lex().
bool ts_stack_is_active | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 716 of file stack.c.
References array_get.
Referenced by ts_parser__better_version_exists(), ts_parser__recover(), and ts_parser_parse().
bool ts_stack_is_halted | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 720 of file stack.c.
References array_get.
Referenced by parser__advance(), parser__better_version_exists(), parser__condense_stack(), parser_parse(), and ts_parser__condense_stack().
bool ts_stack_is_paused | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 724 of file stack.c.
References array_get.
Referenced by ts_parser__condense_stack(), and ts_parser__version_status().
Subtree ts_stack_last_external_token | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 455 of file stack.c.
References array_get.
Referenced by ts_parser__advance(), and ts_parser__lex().
bool ts_stack_merge | ( | Stack * | self, |
StackVersion | version1, | ||
StackVersion | version2 | ||
) |
Definition at line 679 of file stack.c.
References ERROR_STATE, i, StackNode::link_count, StackNode::links, StackHead::node, StackNode::node_count, StackHead::node_count_at_last_error, stack_node_add_link(), StackNode::state, ts_stack_can_merge(), and ts_stack_remove_version().
Referenced by parser__condense_stack(), parser__handle_error(), parser__reduce(), ts_parser__condense_stack(), ts_parser__do_all_potential_reductions(), ts_parser__handle_error(), and ts_parser__reduce().
Stack* ts_stack_new | ( | SubtreePool * | subtree_pool | ) |
Definition at line 405 of file stack.c.
References array_init, array_reserve, MAX_NODE_POOL_SIZE, NULL, NULL_SUBTREE, stack_node_new(), ts_calloc, and ts_stack_clear().
Referenced by parser_init(), and ts_parser_new().
unsigned ts_stack_node_count_since_error | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 477 of file stack.c.
References array_get, and test-lz4-versions::head.
Referenced by ts_parser__better_version_exists(), ts_parser__recover(), ts_parser__version_status(), ts_parser_has_outstanding_parse(), and ts_stack_print_dot_graph().
void ts_stack_pause | ( | Stack * | self, |
StackVersion | version, | ||
Subtree | lookahead | ||
) |
Definition at line 709 of file stack.c.
References array_get, and test-lz4-versions::head.
Referenced by ts_parser__advance().
StackSliceArray ts_stack_pop_all | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 569 of file stack.c.
References NULL, pop_all_callback(), and stack__iter().
Referenced by parser__accept(), and ts_parser__accept().
StackSliceArray ts_stack_pop_count | ( | Stack * | self, |
StackVersion | version, | ||
uint32_t | count | ||
) |
Definition at line 507 of file stack.c.
References count, pop_count_callback(), and stack__iter().
Referenced by parser__reduce(), ts_parser__recover(), ts_parser__recover_to_state(), and ts_parser__reduce().
SubtreeArray ts_stack_pop_error | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 547 of file stack.c.
References array_get, assert(), i, StackNode::link_count, StackNode::links, pop_error_callback(), Subtree::ptr, stack__iter(), StackLink::subtree, ts_stack_renumber_version(), and ts_subtree_is_error().
Referenced by ts_parser__recover_to_state().
StackSliceArray ts_stack_pop_pending | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 524 of file stack.c.
References NULL, pop_pending_callback(), stack__iter(), ts_stack_renumber_version(), and version.
Referenced by parser__breakdown_top_of_stack(), and ts_parser__breakdown_top_of_stack().
Length ts_stack_position | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 451 of file stack.c.
References array_get.
Referenced by ts_parser__advance(), ts_parser__better_version_exists(), ts_parser__handle_error(), ts_parser__lex(), ts_parser__recover(), and ts_parser_parse().
bool ts_stack_print_dot_graph | ( | Stack * | self, |
const TSLanguage * | language, | ||
FILE * | f | ||
) |
Definition at line 751 of file stack.c.
References Array(), array_back, array_clear, array_delete, array_new, array_push, array_reserve, c, TSPoint::column, StackNode::dynamic_precedence, StackNode::error_cost, ERROR_STATE, Length::extent, f, test-lz4-versions::head, i, link, StackNode::link_count, StackNode::links, StackIterator::node, StackNode::node_count, NULL, StackNode::position, Subtree::ptr, TSPoint::row, StackNode::state, StackLink::subtree, ts_external_scanner_state_data(), ts_language_symbol_name(), ts_stack_error_cost(), ts_stack_node_count_since_error(), ts_subtree_dynamic_precedence(), ts_subtree_error_cost(), ts_subtree_extra(), ts_subtree_named(), ts_subtree_symbol(), and ts_subtree_visible().
void ts_stack_push | ( | Stack * | self, |
StackVersion | version, | ||
Subtree | subtree, | ||
bool | pending, | ||
TSStateId | state | ||
) |
Definition at line 485 of file stack.c.
References array_get, test-lz4-versions::head, StackNode::node_count, Subtree::ptr, and stack_node_new().
Referenced by parser__accept(), parser__breakdown_top_of_stack(), parser__handle_error(), parser__push(), parser__reduce(), parser__shift(), ts_parser__accept(), ts_parser__breakdown_top_of_stack(), ts_parser__handle_error(), ts_parser__recover(), ts_parser__recover_to_state(), ts_parser__reduce(), and ts_parser__shift().
void ts_stack_record_summary | ( | Stack * | self, |
StackVersion | version, | ||
unsigned | max_depth | ||
) |
Definition at line 596 of file stack.c.
References array_delete, array_init, test-lz4-versions::head, stack__iter(), summarize_stack_callback(), SummarizeStackSession::summary, ts_free, ts_malloc, and version.
Referenced by ts_parser__handle_error().
void ts_stack_remove_version | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 643 of file stack.c.
References array_erase, array_get, and stack_head_delete().
Referenced by parser__accept(), parser__condense_stack(), parser__do_potential_reductions(), parser__recover(), parser__reduce(), parser__repair_error(), ts_parser__accept(), ts_parser__condense_stack(), ts_parser__do_all_potential_reductions(), ts_parser__recover(), ts_parser__reduce(), and ts_stack_merge().
void ts_stack_renumber_version | ( | Stack * | self, |
StackVersion | v1, | ||
StackVersion | v2 | ||
) |
Definition at line 648 of file stack.c.
References array_erase, assert(), NULL, stack_head_delete(), StackHead::summary, and v1.
Referenced by parser__advance(), parser__do_potential_reductions(), parser__repair_error(), ts_parser__advance(), ts_parser__do_all_potential_reductions(), ts_parser__recover(), ts_stack_pop_error(), and ts_stack_pop_pending().
Subtree ts_stack_resume | ( | Stack * | self, |
StackVersion | version | ||
) |
Definition at line 728 of file stack.c.
References array_get, assert(), test-lz4-versions::head, and NULL_SUBTREE.
Referenced by ts_parser__condense_stack().
void ts_stack_set_last_external_token | ( | Stack * | self, |
StackVersion | version, | ||
Subtree | token | ||
) |
Definition at line 459 of file stack.c.
References array_get, test-lz4-versions::head, Subtree::ptr, ts_subtree_release(), and ts_subtree_retain().
Referenced by ts_parser__recover(), and ts_parser__shift().
TSStateId ts_stack_state | ( | const Stack * | self, |
StackVersion | version | ||
) |
Definition at line 447 of file stack.c.
References array_get.
Referenced by ts_parser__advance(), ts_parser__breakdown_top_of_stack(), ts_parser__do_all_potential_reductions(), ts_parser__handle_error(), ts_parser__recover(), ts_parser__recover_to_state(), ts_parser__reduce(), ts_parser__reuse_node(), ts_parser__version_status(), ts_parser_has_outstanding_parse(), and ts_parser_parse().
void ts_stack_swap_versions | ( | Stack * | self, |
StackVersion | v1, | ||
StackVersion | v2 | ||
) |
Definition at line 443 of file stack.c.
Referenced by parser__better_version_exists(), parser__condense_stack(), parser__do_potential_reductions(), parser__handle_error(), parser__reduce(), parser__shift(), parser_parse(), ts_parser__better_version_exists(), ts_parser__condense_stack(), ts_parser__do_all_potential_reductions(), ts_parser__handle_error(), ts_parser__recover(), ts_parser__reduce(), and ts_parser_parse().