Source languages
TypeScript is a superset of JavaScript, so mehen analyzes
.js / .mjs / .cjs through the Oxc
TypeScript front-end and .jsx through Oxc’s TSX front-end.Why these parsers
- Ruff parses Python with full support for current syntax (3.13/3.14 features, f-strings,
match/case, exception groups, async constructs) and exposes a typed AST plus a semantic model. - Oxc is a JavaScript/TypeScript toolchain in Rust and one of the fastest TS parsers in
production. It handles decorators, class fields, parameter properties, JSX,
satisfies,using, and dynamic import natively. - Mago is a PHP toolchain in Rust. It understands attributes, promoted properties, enums, traits,
anonymous classes, readonly members, null-safe calls, and
matchexpressions out of the box. - Prism is the official Ruby parser maintained by the Ruby core team. It covers blocks, lambdas, numbered parameters, modifier conditionals, rescue modifiers, endless methods, pattern matching, and safe navigation.
ra_ap_syntaxis the syntax tree library used by rust-analyzer; it gives mehen exactly the syntactic granularity rust-analyzer uses for its own analyses.- ANTLR parses Kotlin, Java, and C#, generated to Rust by
ophi-dev/antlr-rust-runtime. Kotlin uses the official Kotlin specification grammar, which models Kotlin constructs (whenentries, the elvis?:and safe-call?.operators,catchblocks, labeled jumps, property accessors) as first-class, semantically-named rules. Java uses the community grammars-v4 Java grammar, which covers modern Java (records, sealed types, switch expressions, text blocks, pattern matching, modules). C# uses Roslyn’s own generated grammar, which the C# compiler generates from the sameSyntax.xmlmodel that produces its syntax node classes — so it tracks C# as implemented: records,is not,and/orand relational patterns, list patterns, collection expressions, raw strings, primary constructors,requiredmembers, and the C# 14 additions (field, extension blocks). It replaced the community grammars-v4 C# grammar, which stops at C# 7 and parsed 93 of 322System.Text.Jsonfiles against 317 for the derived Roslyn grammar; seecrates/mehen-csharp-parser/grammar/PROVENANCE.mdfor the pinned revision and what the derivation repairs. All three are richer than a tree-sitter CST. - Tree-sitter is mehen’s pick for Go, C, and PowerShell, where its grammar quality and ecosystem maturity make it the best fit.
Documentation
Markdown gets a dedicated documentation metric suite — code-style metrics like cyclomatic complexity
and NOM/NPA/NPM/WMC do not apply because Markdown has no functions or classes. See
Markdown metrics for the full set.
SQL
A dedicated SQL analyzer (
mehen-sql) ships its own metric family — query-block structure, CTE
graphs, join graphs, predicate complexity, object-touch risk, dialect portability, and an
SQL-flavored Halstead. Code-style metrics like cyclomatic complexity and NOM/NPA/NPM/WMC do not
apply to declarative SQL. The dialect is inferred from syntax hints (postgres, T-SQL, snowflake,
bigquery, mysql, sqlite, oracle, clickhouse, redshift, sparksql, hive, athena, db2) with a reported
confidence, defaulting to ANSI. See SQL metrics overview for the full set.