Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Functions | |
uint32_t | ts_language_symbol_count (const TSLanguage *self) |
uint32_t | ts_language_version (const TSLanguage *self) |
uint32_t | ts_language_field_count (const TSLanguage *self) |
void | ts_language_table_entry (const TSLanguage *self, TSStateId state, TSSymbol symbol, TableEntry *result) |
TSSymbolMetadata | ts_language_symbol_metadata (const TSLanguage *self, TSSymbol symbol) |
TSSymbol | ts_language_public_symbol (const TSLanguage *self, TSSymbol symbol) |
const char * | ts_language_symbol_name (const TSLanguage *self, TSSymbol symbol) |
TSSymbol | ts_language_symbol_for_name (const TSLanguage *self, const char *string, uint32_t length, bool is_named) |
TSSymbolType | ts_language_symbol_type (const TSLanguage *self, TSSymbol symbol) |
const char * | ts_language_field_name_for_id (const TSLanguage *self, TSFieldId id) |
TSFieldId | ts_language_field_id_for_name (const TSLanguage *self, const char *name, uint32_t name_length) |
uint32_t ts_language_field_count | ( | const TSLanguage * | self | ) |
Get the number of distinct field names in the language.
Definition at line 14 of file language.c.
Referenced by ts_language_field_id_for_name(), and ts_language_field_name_for_id().
TSFieldId ts_language_field_id_for_name | ( | const TSLanguage * | self, |
const char * | name, | ||
uint32_t | name_length | ||
) |
Get the numerical id for the given field name string.
Definition at line 119 of file language.c.
References count, i, and ts_language_field_count().
Referenced by ts_node_child_by_field_name(), and ts_query__parse_pattern().
const char* ts_language_field_name_for_id | ( | const TSLanguage * | self, |
TSFieldId | id | ||
) |
Get the field name string for the given numerical id.
Definition at line 107 of file language.c.
References count, id, NULL, and ts_language_field_count().
Referenced by ts_query__analyze_patterns(), and ts_query_cursor__advance().
TSSymbol ts_language_public_symbol | ( | const TSLanguage * | self, |
TSSymbol | symbol | ||
) |
Definition at line 51 of file language.c.
References ts_builtin_sym_error.
Referenced by ts_node_symbol().
uint32_t ts_language_symbol_count | ( | const TSLanguage * | self | ) |
Get the number of distinct node types in the language.
Definition at line 6 of file language.c.
Referenced by ts_language_symbol_for_name(), and ts_language_symbol_name().
TSSymbol ts_language_symbol_for_name | ( | const TSLanguage * | self, |
const char * | string, | ||
uint32_t | length, | ||
bool | is_named | ||
) |
Get the numerical id for the given node type string.
Definition at line 74 of file language.c.
References count, i, length, TSSymbolMetadata::named, TSSymbolMetadata::supertype, ts_builtin_sym_error, ts_language_symbol_count(), ts_language_symbol_metadata(), and TSSymbolMetadata::visible.
Referenced by rz_core_cmd_new(), and ts_query__parse_pattern().
TSSymbolMetadata ts_language_symbol_metadata | ( | const TSLanguage * | self, |
TSSymbol | symbol | ||
) |
Definition at line 38 of file language.c.
References ts_builtin_sym_error, ts_builtin_sym_error_repeat, and TSSymbolMetadata::visible.
Referenced by parser__halt_parse(), parser__lex(), parser__recover(), parser__reduce(), parser__repair_error(), parser__shift(), ts_language_symbol_for_name(), ts_language_symbol_type(), ts_node__is_relevant(), ts_node_is_named(), ts_query__analyze_patterns(), ts_query__parse_pattern(), ts_subtree__write_to_string(), ts_subtree_new_leaf(), ts_subtree_new_node(), ts_subtree_set_symbol(), ts_subtree_summarize_children(), and ts_tree_cursor_current_status().
const char* ts_language_symbol_name | ( | const TSLanguage * | self, |
TSSymbol | symbol | ||
) |
Get a node type string for the given numerical id.
Definition at line 59 of file language.c.
References NULL, ts_builtin_sym_error, ts_builtin_sym_error_repeat, and ts_language_symbol_count().
Referenced by ts_node_type(), ts_query__analyze_patterns(), ts_stack_print_dot_graph(), ts_subtree__print_dot_graph(), and ts_subtree__write_to_string().
TSSymbolType ts_language_symbol_type | ( | const TSLanguage * | self, |
TSSymbol | symbol | ||
) |
Check whether the given node type id belongs to named nodes, anonymous nodes, or a hidden nodes.
See also ts_node_is_named
. Hidden nodes are never returned from the API.
Definition at line 93 of file language.c.
References TSSymbolMetadata::named, ts_language_symbol_metadata(), TSSymbolTypeAnonymous, TSSymbolTypeAuxiliary, TSSymbolTypeRegular, and TSSymbolMetadata::visible.
Referenced by ts_language_type_is_named_wasm(), and ts_language_type_is_visible_wasm().
void ts_language_table_entry | ( | const TSLanguage * | self, |
TSStateId | state, | ||
TSSymbol | symbol, | ||
TableEntry * | result | ||
) |
Definition at line 18 of file language.c.
References TableEntry::action_count, TableEntry::actions, assert(), TableEntry::is_reusable, NULL, ts_builtin_sym_error, ts_builtin_sym_error_repeat, and ts_language_lookup().
Referenced by parser__advance(), parser__do_potential_reductions(), ts_language_actions(), ts_language_has_reduce_action(), ts_parser__advance(), ts_parser__do_all_potential_reductions(), ts_parser__get_cached_token(), and ts_parser__reuse_node().
uint32_t ts_language_version | ( | const TSLanguage * | self | ) |
Get the ABI version number for this language. This version number is used to ensure that languages were generated by a compatible version of Tree-sitter.
See also ts_parser_set_language
.
Definition at line 10 of file language.c.