From da973be545d6da3b2d42023f96bcfd79f751eba9 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 22 Jan 2026 13:09:29 +0100 Subject: Add CUDA grammar --- queries/cuda.h | 37 +++++++++++++++++++++++++++++++++++++ queries/cuda.scm | 20 ++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 queries/cuda.h create mode 100644 queries/cuda.scm (limited to 'queries') diff --git a/queries/cuda.h b/queries/cuda.h new file mode 100644 index 0000000..770a142 --- /dev/null +++ b/queries/cuda.h @@ -0,0 +1,37 @@ +unsigned char query_cuda[] = { + 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x74, + 0x79, 0x70, 0x65, 0x3a, 0x20, 0x28, 0x5f, 0x29, 0x20, 0x40, 0x66, 0x74, + 0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x20, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x28, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x20, 0x40, + 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x20, 0x28, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x29, 0x20, 0x40, 0x66, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x29, + 0x29, 0x0a, 0x0a, 0x28, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x73, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x22, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, + 0x0a, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x74, 0x79, + 0x70, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x0a, + 0x28, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x22, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, 0x0a, + 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x74, 0x79, 0x70, + 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x0a, 0x28, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x22, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x20, 0x40, + 0x66, 0x74, 0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, + 0x3a, 0x20, 0x28, 0x5f, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, + 0x29, 0x0a +}; +unsigned int query_cuda_len = 398; diff --git a/queries/cuda.scm b/queries/cuda.scm new file mode 100644 index 0000000..d2865be --- /dev/null +++ b/queries/cuda.scm @@ -0,0 +1,20 @@ +(function_definition + type: (_) @ftype + declarator: (function_declarator + declarator: [ + (identifier) + (field_identifier) + ] @fname + parameters: (parameter_list) @fparams)) + +(class_specifier + "class" @ftype + name: (type_identifier) @fname) + +(struct_specifier + "struct" @ftype + name: (type_identifier) @fname) + +(namespace_definition + "namespace" @ftype + name: (_) @fname) -- cgit v1.2.3