Supported Languages
This is the list of programming languages big-code-analysis
parses. Each entry is a LANG variant (defined by the mk_langs!
invocation in big-code-analysis-ast/src/langs.rs) and is gated
behind the matching per-language Cargo feature documented in
Per-language Cargo features.
- Bash
- C
- C/C++
- C#
- Elixir
- Go
- Groovy
- Irules
- Java
- JavaScript
- Kotlin
- Lua
- Mozcpp
- Mozjs
- Objective-C
- Perl
- Php
- Python
- Ruby
- Rust
- Tcl
- Tsx
- Typescript
Every variant’s slug is its LANG::name, lowercase and
punctuation-free so it round-trips through FromStr (C# reports
csharp). Some entries are variants of a shared grammar pipeline:
JavaScript(the upstreamtree-sitter-javascriptgrammar) is the default for.js,.mjs,.cjs, and.jsxfiles.Mozjsis the Mozilla / SpiderMonkey fork, opt-in: it owns only the.jsm(Firefox module) extension and reports the slugmozjs. The two are metric-equivalent on ordinary JavaScript.TsxisTypescript(upstreamtree-sitter-typescript) with JSX syntax enabled and reports the distinct slugtsx.- Since #721 C has its own variant
C(slugc, upstreamtree-sitter-c), owning.cand thecemacs mode; theC/C++variant (slugcpp, upstreamtree-sitter-cppsince #720) keeps.cpp/.cc/.hand the rest..hdeliberately stays onCpp: a C++ header through the C grammar ERROR-cascades onclass/template, whereas a C header through the C++ grammar only trips on C++-keyword identifiers. - The Mozilla/Gecko C++ dialect is the opt-in
Mozcppvariant (slugmozcpp), which owns no file extensions and is selected only by name, exactly asMozjsrelates toJavaScript. - Since #724
Objective-C(slugobjc, upstreamtree-sitter-objc) owns.mand theobjc/objective-cemacs modes. Objective-C++ (.mm) stays onCpp. These files mix Objective-C and C++, buttree-sitter-objccannot parse C++ templates, namespaces, or::. The C++ grammar struggles only with the Objective-C portions, so it gives the better result, using the same trade-off as.h. Metrics for those Objective-C portions remain approximate.
K&R definitions with a wrapped return type
A pre-ANSI
(K&R)
function definition opens no function space under C
or Objective-C when its return type wraps the declarator; int *,
char **, struct S *, and a static pointer return all reproduce
it:
int *krptr(a, b) int a; int b; { if (a) { return 0; } return 1; }
tree-sitter-c 0.24.2 builds its old-style function definition from a
declarator nested inside the old-style declarator, so an outer
pointer_declarator is unreachable and the parser prefers a plain
declaration that swallows the first parameter declaration, orphaning
the body as a bare compound_statement. No ERROR node is produced:
the parse silently succeeds wrongly, and there is no dispatch arm
missing on our side.
The consequence is that the body’s decisions are charged to the file’s
unit space: the line above reports cyclomatic.sum 2 and
nom.functions 0, a file-level count no function-level row accounts
for. A K&R definition whose return type does not wrap the declarator
(int krplain(a, b) int a; int b; { … }) is unaffected, as is any ANSI
definition. C/C++ and Mozcpp open no space for either K&R form,
because tree-sitter-cpp has no rule for the syntax at all. This is an
upstream grammar limitation, tracked here as
#1209.
Internal helper variants
The following LANG variants are internal helpers, not user-facing
languages. They belong to the C-family analysis pipeline (they ride
every C-family Cargo feature: cpp, c, and mozcpp) and are not
selected directly when analysing source files:
Ccomment: C/C++ comments.Preproc: C/C++ preprocessor macros.
Note: Since #720 the Mozilla/Gecko C++ dialect is exposed as the
MozcppLANGvariant (backed by the vendoredbca-tree-sitter-mozcppcrate, pulled in by the opt-inmozcppfeature). It is a public, name-selectable language that owns no file extensions. Unlike theCcomment/Preprochelpers above, it is not internal.