TreeBase
Object Hierarchy:
Description:
public abstract class TreeBase : Object
Base class for tree-sitter AST parsing.
Provides common functionality for parsing source code files using tree-sitter, including language loading, element name/type extraction,
and file content management.
Content:
Properties:
Creation methods:
Methods:
- public string ast_path (Node node, string code_content)
Build AST path from a TreeSitter node by traversing up the AST tree.
- protected string? element_name (Node node, string code_content)
Get element name from AST node.
- protected string get_element_type (Node node, Language lang)
Determine element type from tree-sitter node type.
- protected async void init_parser () throws Error
Initialize tree-sitter parser with language for the file.
- protected bool is_unsupported_language (string lang_name)
Check if language is supported by tree-sitter (or should be skipped).
- public string lines_to_string (int start_line, int end_line, int max_lines = 0)
Extract string from lines array using Vala string range syntax.
- protected async string load_file_content () throws Error
Load file content and split into lines.
- protected Language? load_tree_sitter_language ()
Load tree-sitter language dynamically from shared library using
GModule.
- protected Tree? parse_content (string code_content)
Parse file content using tree-sitter.
- protected string? update_namespace_from_node (string node_type_lower, Node node, string code_content, string? current_namespace)
Update namespace string if node is a namespace declaration.
- protected string? update_parent_class_from_node (string node_type_lower, Node node, string code_content, string? parent_class_name)
Update parent class string if node is a class/struct/interface
declaration.
- protected string? update_parent_enum_from_node (string node_type_lower, Node node, string code_content, string? parent_enum_name)
Update parent enum string if node is an enum declaration.
Fields:
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref