Languages / CUDA · Edit queries/tags.scm

Tier 2 · Declarative tags.scm

CUDA

Declarative tree-sitter query plugin powered by QueryLanguagePlugin (rgctl-lang-runtime) and crates/rgctl-lang-cuda/queries/tags.scm. Compiles once at startup, validates captures against the Tier-2 vocabulary gate, and extracts symbols, container hierarchy (Container::member), imports, and call edges.

Grammar Crate
tree-sitter-cuda
Plugin
QueryLanguagePlugin (rgctl-lang-cuda)
Extensions
.cu, .cuh
Discover
rgctl discover . -l cuda
Function Kinds
function_definition
Class / Container Kinds
struct_specifier, class_specifier

Capture summary

CapturePatternsGraph mapping
@definition.class2Emits SymbolType::Class (acts as enclosing container).
@definition.function1Emits SymbolType::Function (acts as caller scope & container).
@import.path1Emits SymbolType::Import with normalized import_path metadata.
@name4Symbol identifier or target callee/type name.
@reference.call1Emits RelationType::Calls from innermost enclosing function to @name.

Query source (crates/rgctl-lang-cuda/queries/tags.scm)

; Tier-2 CUDA tags for rgctl.

(function_definition
  declarator: (function_declarator
    declarator: (identifier) @name)) @definition.function

(struct_specifier
  name: (type_identifier) @name) @definition.class

(class_specifier
  name: (type_identifier) @name) @definition.class

(preproc_include
  path: (_) @import.path)

(call_expression
  function: (identifier) @name) @reference.call

Related: Tier 2 language support · Tier 1 language support · Discovering and indexing