From 586ba52796e57709eb3df49e4a6938e8885daabd Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Wed, 12 Aug 2026 11:05:30 +0200 Subject: [PATCH 1/3] chore: add SPDX license headers to all hand-written source files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every .rs, .py, and .sh source file now opens with: // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) 2026 Konstantin Vyatkin Generated files (*/generated/*.rs, *.inc.rs) are left untouched — they already carry a @generated marker and are regenerated from grammars, so a license header would be overwritten on the next regen. --- benches/benches/char_stream.rs | 2 ++ benches/benches/grammar_frontend.rs | 2 ++ crates/antlr-rust-codegen/src/artifact.rs | 2 ++ crates/antlr-rust-codegen/src/bin/antlr4-rust-gen.rs | 2 ++ crates/antlr-rust-codegen/src/bin/antlr4-rust-testrig.rs | 2 ++ crates/antlr-rust-codegen/src/builder.rs | 2 ++ crates/antlr-rust-codegen/src/cli.rs | 2 ++ crates/antlr-rust-codegen/src/cli_report.rs | 2 ++ crates/antlr-rust-codegen/src/config.rs | 2 ++ crates/antlr-rust-codegen/src/driver.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/antlr4rust/aliases.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/antlr4rust/macros.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/antlr4rust/mod.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/antlr4rust/scopes.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/members.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/mod.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/model.rs | 2 ++ crates/antlr-rust-codegen/src/embedded/translate.rs | 2 ++ crates/antlr-rust-codegen/src/error.rs | 2 ++ crates/antlr-rust-codegen/src/generator/tests.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/action.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/analysis.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/build.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/general_bug_test.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/interp_test.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/lexer.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/mod.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/optimize.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/atn/parser.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/char_support.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/compiler.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/diagnostic.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/escape_sequence.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/integration.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/left_recursion.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/loader.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/mod.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/model.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/mutual_recursion.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/provenance.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/rule_reachability.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/semantics.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/semantics/attributes.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/semantics/bindings.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/source.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/syntax.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/transform/analysis.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/transform/artifact.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/transform/mod.rs | 2 ++ .../src/grammar/transform/passes/precedence_ladder.rs | 2 ++ .../src/grammar/transform/passes/prune_unreachable.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/transform/registry.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/unicode.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/unicode_escape.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/unicode_icu_tests.rs | 2 ++ crates/antlr-rust-codegen/src/grammar/validation.rs | 2 ++ crates/antlr-rust-codegen/src/json.rs | 2 ++ crates/antlr-rust-codegen/src/lexer/mod.rs | 2 ++ crates/antlr-rust-codegen/src/lexer/render.rs | 2 ++ crates/antlr-rust-codegen/src/lexer/render_model.rs | 2 ++ crates/antlr-rust-codegen/src/lib.rs | 2 ++ crates/antlr-rust-codegen/src/optimization/config.rs | 2 ++ crates/antlr-rust-codegen/src/optimization/descriptor.rs | 2 ++ crates/antlr-rust-codegen/src/optimization/metrics.rs | 2 ++ crates/antlr-rust-codegen/src/optimization/mod.rs | 2 ++ crates/antlr-rust-codegen/src/optimization/report.rs | 2 ++ crates/antlr-rust-codegen/src/parser/decision.rs | 2 ++ crates/antlr-rust-codegen/src/parser/ir/lower.rs | 2 ++ crates/antlr-rust-codegen/src/parser/ir/mod.rs | 2 ++ crates/antlr-rust-codegen/src/parser/ir/optimize.rs | 2 ++ crates/antlr-rust-codegen/src/parser/mod.rs | 2 ++ crates/antlr-rust-codegen/src/parser/render/decisions.rs | 2 ++ crates/antlr-rust-codegen/src/parser/render/fallback.rs | 2 ++ crates/antlr-rust-codegen/src/parser/render/loops.rs | 2 ++ crates/antlr-rust-codegen/src/parser/render/mod.rs | 2 ++ crates/antlr-rust-codegen/src/parser/render/rules.rs | 2 ++ crates/antlr-rust-codegen/src/parser/render_model.rs | 2 ++ crates/antlr-rust-codegen/src/parser/routing.rs | 2 ++ crates/antlr-rust-codegen/src/parser/surface/accessors.rs | 2 ++ crates/antlr-rust-codegen/src/parser/surface/contexts.rs | 2 ++ crates/antlr-rust-codegen/src/parser/surface/facade.rs | 2 ++ crates/antlr-rust-codegen/src/parser/surface/model.rs | 2 ++ crates/antlr-rust-codegen/src/parser/surface/names.rs | 2 ++ crates/antlr-rust-codegen/src/parser/surface/support_abi.rs | 2 ++ crates/antlr-rust-codegen/src/parser/surface/traversal.rs | 2 ++ crates/antlr-rust-codegen/src/pipeline.rs | 2 ++ crates/antlr-rust-codegen/src/rust_output.rs | 2 ++ crates/antlr-rust-codegen/src/rust_support/identity.rs | 2 ++ crates/antlr-rust-codegen/src/rust_support/mod.rs | 2 ++ crates/antlr-rust-codegen/src/rust_support/prompt.rs | 2 ++ crates/antlr-rust-codegen/src/rust_support/python.rs | 2 ++ crates/antlr-rust-codegen/src/rust_support/stage.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/hooks.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/inventory.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/manifest.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/mod.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/model.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/patterns.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/semir.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/stack_member.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/template_syntax.rs | 2 ++ crates/antlr-rust-codegen/src/semantics/templates.rs | 2 ++ crates/antlr-rust-codegen/src/structural/contexts.rs | 2 ++ crates/antlr-rust-codegen/src/structural/mod.rs | 2 ++ crates/antlr-rust-codegen/src/test_rig.rs | 2 ++ crates/antlr-rust-codegen/src/testrig_cli.rs | 2 ++ crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli.rs | 2 ++ crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/cli.rs | 2 ++ .../tests/antlr4_rust_gen_cli/compatibility.rs | 2 ++ .../antlr-rust-codegen/tests/antlr4_rust_gen_cli/diagnostics.rs | 2 ++ crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/lexer.rs | 2 ++ .../tests/antlr4_rust_gen_cli/multi_recognizer.rs | 2 ++ .../tests/antlr4_rust_gen_cli/optimizations.rs | 2 ++ crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/parser.rs | 2 ++ .../tests/antlr4_rust_gen_cli/rust_support.rs | 2 ++ .../antlr-rust-codegen/tests/antlr4_rust_gen_cli/semantics.rs | 2 ++ crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/support.rs | 2 ++ crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/testrig.rs | 2 ++ .../antlr-rust-codegen/tests/antlr4_rust_gen_cli/transforms.rs | 2 ++ .../antlr-rust-codegen/tests/antlr4_rust_gen_cli/typed_tree.rs | 2 ++ .../tests/fixtures/antlr4-rust-gen/midi-binary/make_fixture.py | 2 ++ .../antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs | 2 ++ .../antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py | 2 ++ .../antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py | 2 ++ crates/antlr-rust-g4-parser/src/frontend.rs | 2 ++ crates/antlr-rust-g4-parser/src/lexer_adaptor.rs | 2 ++ crates/antlr-rust-g4-parser/src/lib.rs | 2 ++ crates/antlr-rust-rs-parser/src/cfg_syntax.rs | 2 ++ crates/antlr-rust-rs-parser/src/lib.rs | 2 ++ crates/antlr-rust-runtime/src/atn/ascii_range.rs | 2 ++ crates/antlr-rust-runtime/src/atn/bypass.rs | 2 ++ crates/antlr-rust-runtime/src/atn/lexer.rs | 2 ++ crates/antlr-rust-runtime/src/atn/lexer_dfa.rs | 2 ++ crates/antlr-rust-runtime/src/atn/mod.rs | 2 ++ crates/antlr-rust-runtime/src/atn/parser.rs | 2 ++ crates/antlr-rust-runtime/src/atn/parser_atn.rs | 2 ++ crates/antlr-rust-runtime/src/atn/serialized.rs | 2 ++ crates/antlr-rust-runtime/src/byte_stream.rs | 2 ++ crates/antlr-rust-runtime/src/char_stream.rs | 2 ++ crates/antlr-rust-runtime/src/dfa.rs | 2 ++ crates/antlr-rust-runtime/src/errors.rs | 2 ++ crates/antlr-rust-runtime/src/generated.rs | 2 ++ crates/antlr-rust-runtime/src/int_stream.rs | 2 ++ crates/antlr-rust-runtime/src/lexer.rs | 2 ++ crates/antlr-rust-runtime/src/lib.rs | 2 ++ crates/antlr-rust-runtime/src/parser.rs | 2 ++ crates/antlr-rust-runtime/src/perf.rs | 2 ++ crates/antlr-rust-runtime/src/prediction.rs | 2 ++ crates/antlr-rust-runtime/src/recognizer.rs | 2 ++ crates/antlr-rust-runtime/src/semir.rs | 2 ++ crates/antlr-rust-runtime/src/token.rs | 2 ++ crates/antlr-rust-runtime/src/token_stream.rs | 2 ++ crates/antlr-rust-runtime/src/tree.rs | 2 ++ crates/antlr-rust-runtime/src/tree_pattern.rs | 2 ++ crates/antlr-rust-runtime/src/validated.rs | 2 ++ crates/antlr-rust-runtime/src/vocabulary.rs | 2 ++ crates/antlr-rust-runtime/src/xpath.rs | 2 ++ crates/antlr-rust-toml-parser/src/ast.rs | 2 ++ crates/antlr-rust-toml-parser/src/decode.rs | 2 ++ crates/antlr-rust-toml-parser/src/lib.rs | 2 ++ crates/antlr-rust-toml-parser/src/string.rs | 2 ++ tests/antlr-rust-runtime-testsuite/src/main.rs | 2 ++ tests/antlr-rust-runtime-testsuite/src/rust_names.rs | 2 ++ tests/javascript-parity/dump_python.py | 2 ++ tests/javascript-parity/dumper/src/javascript_lexer_base.rs | 2 ++ tests/javascript-parity/dumper/src/javascript_parser_base.rs | 2 ++ tests/javascript-parity/dumper/src/main.rs | 2 ++ tests/javascript-parity/run.sh | 2 ++ tests/kotlin-parity/dump_python.py | 2 ++ tests/kotlin-parity/dumper/src/main.rs | 2 ++ tests/kotlin-parity/run.sh | 2 ++ tests/typescript-parity/dumper/src/main.rs | 2 ++ tests/typescript-parity/dumper/src/typescript_lexer_base.rs | 2 ++ tests/typescript-parity/dumper/src/typescript_parser_base.rs | 2 ++ tests/typescript-parity/run.sh | 2 ++ tools/fixed-lookahead-bench/bench.py | 2 ++ tools/fixed-lookahead-bench/run.sh | 2 ++ tools/grammar-frontend/update-interp-fixtures.sh | 2 ++ tools/grammar-frontend/update-stage0.sh | 2 ++ tools/parse-bench/compare.py | 2 ++ tools/parse-bench/run.py | 2 ++ tools/parse-bench/rust-support/csharp_lexer_base.rs | 2 ++ tools/parse-bench/test_run.py | 2 ++ tools/release/check-workspace-version.sh | 2 ++ tools/release/preflight-package-archives.sh | 2 ++ tools/release/registry-smoke.sh | 2 ++ tools/release/verify-package-contents.sh | 2 ++ tools/rust-syntax/update-generated.sh | 2 ++ tools/toml-syntax/update-generated.sh | 2 ++ 189 files changed, 378 insertions(+) mode change 100755 => 100644 tests/javascript-parity/dump_python.py mode change 100755 => 100644 tests/javascript-parity/run.sh mode change 100755 => 100644 tests/kotlin-parity/run.sh mode change 100755 => 100644 tests/typescript-parity/run.sh mode change 100755 => 100644 tools/fixed-lookahead-bench/run.sh mode change 100755 => 100644 tools/grammar-frontend/update-interp-fixtures.sh mode change 100755 => 100644 tools/grammar-frontend/update-stage0.sh mode change 100755 => 100644 tools/parse-bench/compare.py mode change 100755 => 100644 tools/parse-bench/run.py mode change 100755 => 100644 tools/release/check-workspace-version.sh mode change 100755 => 100644 tools/release/preflight-package-archives.sh mode change 100755 => 100644 tools/release/registry-smoke.sh mode change 100755 => 100644 tools/release/verify-package-contents.sh mode change 100755 => 100644 tools/rust-syntax/update-generated.sh mode change 100755 => 100644 tools/toml-syntax/update-generated.sh diff --git a/benches/benches/char_stream.rs b/benches/benches/char_stream.rs index becb70986..8f2aaead6 100644 --- a/benches/benches/char_stream.rs +++ b/benches/benches/char_stream.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Character-stream benchmarks. //! //! Every generated lexer walks an [`InputStream`] one code point at a time, so diff --git a/benches/benches/grammar_frontend.rs b/benches/benches/grammar_frontend.rs index 2faac124e..f8d6ce5ad 100644 --- a/benches/benches/grammar_frontend.rs +++ b/benches/benches/grammar_frontend.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! End-to-end benchmarks for the `ANTLRv4` grammar frontend. //! //! Parsing a `.g4` source drives the whole runtime stack in one call: the diff --git a/crates/antlr-rust-codegen/src/artifact.rs b/crates/antlr-rust-codegen/src/artifact.rs index 5f68675ae..9fa0a8ab5 100644 --- a/crates/antlr-rust-codegen/src/artifact.rs +++ b/crates/antlr-rust-codegen/src/artifact.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet, btree_map::Entry}; use std::fs; use std::io; diff --git a/crates/antlr-rust-codegen/src/bin/antlr4-rust-gen.rs b/crates/antlr-rust-codegen/src/bin/antlr4-rust-gen.rs index eaf84e7c4..949c45c01 100644 --- a/crates/antlr-rust-codegen/src/bin/antlr4-rust-gen.rs +++ b/crates/antlr-rust-codegen/src/bin/antlr4-rust-gen.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin fn main() -> miette::Result<()> { antlr_rust_codegen::run_cli() } diff --git a/crates/antlr-rust-codegen/src/bin/antlr4-rust-testrig.rs b/crates/antlr-rust-codegen/src/bin/antlr4-rust-testrig.rs index 0df5a0272..f34e33210 100644 --- a/crates/antlr-rust-codegen/src/bin/antlr4-rust-testrig.rs +++ b/crates/antlr-rust-codegen/src/bin/antlr4-rust-testrig.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin fn main() -> miette::Result { antlr_rust_codegen::run_testrig_cli() } diff --git a/crates/antlr-rust-codegen/src/builder.rs b/crates/antlr-rust-codegen/src/builder.rs index 4c965b39b..e1e6c98a7 100644 --- a/crates/antlr-rust-codegen/src/builder.rs +++ b/crates/antlr-rust-codegen/src/builder.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use std::path::{Path, PathBuf}; diff --git a/crates/antlr-rust-codegen/src/cli.rs b/crates/antlr-rust-codegen/src/cli.rs index 9fe42ad7f..bedd84ea1 100644 --- a/crates/antlr-rust-codegen/src/cli.rs +++ b/crates/antlr-rust-codegen/src/cli.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::io::{self, IsTerminal as _, Write as _}; use std::path::PathBuf; use std::time::Duration; diff --git a/crates/antlr-rust-codegen/src/cli_report.rs b/crates/antlr-rust-codegen/src/cli_report.rs index 6459aae5b..415a9fbd9 100644 --- a/crates/antlr-rust-codegen/src/cli_report.rs +++ b/crates/antlr-rust-codegen/src/cli_report.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::error::Error as StdError; use std::fmt; use std::fs; diff --git a/crates/antlr-rust-codegen/src/config.rs b/crates/antlr-rust-codegen/src/config.rs index e84303add..c9293f875 100644 --- a/crates/antlr-rust-codegen/src/config.rs +++ b/crates/antlr-rust-codegen/src/config.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use std::path::PathBuf; diff --git a/crates/antlr-rust-codegen/src/driver.rs b/crates/antlr-rust-codegen/src/driver.rs index 417eb152e..6b1b0107e 100644 --- a/crates/antlr-rust-codegen/src/driver.rs +++ b/crates/antlr-rust-codegen/src/driver.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::config::CompilerConfig; use crate::generator::prelude::*; use crate::lexer::{LexerRenderModel, render_lexer_model}; diff --git a/crates/antlr-rust-codegen/src/embedded/antlr4rust/aliases.rs b/crates/antlr-rust-codegen/src/embedded/antlr4rust/aliases.rs index dbc825faf..9ce55ba87 100644 --- a/crates/antlr-rust-codegen/src/embedded/antlr4rust/aliases.rs +++ b/crates/antlr-rust-codegen/src/embedded/antlr4rust/aliases.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::{Range, RustDelimiterMap, RustLexeme, RustLexemeKind, RustReplacement, io}; pub(crate) fn recog_input_replacement( diff --git a/crates/antlr-rust-codegen/src/embedded/antlr4rust/macros.rs b/crates/antlr-rust-codegen/src/embedded/antlr4rust/macros.rs index 8afcede6a..010581c54 100644 --- a/crates/antlr-rust-codegen/src/embedded/antlr4rust/macros.rs +++ b/crates/antlr-rust-codegen/src/embedded/antlr4rust/macros.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::{ BTreeSet, Cow, FormatMacroCaptures, Range, RustDelimiterMap, RustLexeme, RustLexemeKind, RustReplacement, io, is_turbofish_open, is_unqualified_identifier, lex_rust_body, lexeme_text, diff --git a/crates/antlr-rust-codegen/src/embedded/antlr4rust/mod.rs b/crates/antlr-rust-codegen/src/embedded/antlr4rust/mod.rs index 6fd63ca6b..dc0b5b776 100644 --- a/crates/antlr-rust-codegen/src/embedded/antlr4rust/mod.rs +++ b/crates/antlr-rust-codegen/src/embedded/antlr4rust/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin mod aliases; mod macros; mod scopes; diff --git a/crates/antlr-rust-codegen/src/embedded/antlr4rust/scopes.rs b/crates/antlr-rust-codegen/src/embedded/antlr4rust/scopes.rs index b9d1e247a..22a1f88cb 100644 --- a/crates/antlr-rust-codegen/src/embedded/antlr4rust/scopes.rs +++ b/crates/antlr-rust-codegen/src/embedded/antlr4rust/scopes.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::*; impl AliasBindingScopes { diff --git a/crates/antlr-rust-codegen/src/embedded/members.rs b/crates/antlr-rust-codegen/src/embedded/members.rs index d7739fdfb..dfc1d11ae 100644 --- a/crates/antlr-rust-codegen/src/embedded/members.rs +++ b/crates/antlr-rust-codegen/src/embedded/members.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::{ ANTLR4RUST_INPUT_FACADE, Antlr4RustSourceKind, BTreeSet, MemberField, MemberItem, MembersModel, Range, RustDelimiterMap, RustLexeme, RustLexemeKind, SourceId, io, lex_rust_body, lexeme_text, diff --git a/crates/antlr-rust-codegen/src/embedded/mod.rs b/crates/antlr-rust-codegen/src/embedded/mod.rs index 5e84458fd..7d6bba6a3 100644 --- a/crates/antlr-rust-codegen/src/embedded/mod.rs +++ b/crates/antlr-rust-codegen/src/embedded/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Embedded-action grammar model and `$`-attribute translator. //! //! In embedded mode the generator receives a grammar whose actions and diff --git a/crates/antlr-rust-codegen/src/embedded/model.rs b/crates/antlr-rust-codegen/src/embedded/model.rs index 9392c26f6..4f8a1f572 100644 --- a/crates/antlr-rust-codegen/src/embedded/model.rs +++ b/crates/antlr-rust-codegen/src/embedded/model.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::*; /// One `name: type` attribute declared in a rule's `[...]` args clause or diff --git a/crates/antlr-rust-codegen/src/embedded/translate.rs b/crates/antlr-rust-codegen/src/embedded/translate.rs index 0cfd88d16..31ecb05c7 100644 --- a/crates/antlr-rust-codegen/src/embedded/translate.rs +++ b/crates/antlr-rust-codegen/src/embedded/translate.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::*; /// Context for translating one action/predicate body. diff --git a/crates/antlr-rust-codegen/src/error.rs b/crates/antlr-rust-codegen/src/error.rs index 5dc59ec6b..304ab74e4 100644 --- a/crates/antlr-rust-codegen/src/error.rs +++ b/crates/antlr-rust-codegen/src/error.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::fmt; use std::io; use std::ops::Range; diff --git a/crates/antlr-rust-codegen/src/generator/tests.rs b/crates/antlr-rust-codegen/src/generator/tests.rs index c940cfe03..9049cbbb2 100644 --- a/crates/antlr-rust-codegen/src/generator/tests.rs +++ b/crates/antlr-rust-codegen/src/generator/tests.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // `insta` assertion macros unwrap internal I/O. use super::*; use antlr4_runtime::atn::parser_atn::{ParserAtnBuilder, ParserTransitionSpec}; diff --git a/crates/antlr-rust-codegen/src/grammar/action.rs b/crates/antlr-rust-codegen/src/grammar/action.rs index 6b171a48a..756b793be 100644 --- a/crates/antlr-rust-codegen/src/grammar/action.rs +++ b/crates/antlr-rust-codegen/src/grammar/action.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub(crate) struct ActionReference<'a> { pub(crate) kind: ActionReferenceKind<'a>, diff --git a/crates/antlr-rust-codegen/src/grammar/atn/analysis.rs b/crates/antlr-rust-codegen/src/grammar/atn/analysis.rs index b49e61bf8..cbf8012eb 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/analysis.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/analysis.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use antlr4_runtime::atn::AtnStateKind; diff --git a/crates/antlr-rust-codegen/src/grammar/atn/build.rs b/crates/antlr-rust-codegen/src/grammar/atn/build.rs index 2f6181e54..7128842cb 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/build.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/build.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use antlr4_runtime::atn::AtnStateKind; diff --git a/crates/antlr-rust-codegen/src/grammar/atn/general_bug_test.rs b/crates/antlr-rust-codegen/src/grammar/atn/general_bug_test.rs index 8b9ae2c84..d2220a024 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/general_bug_test.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/general_bug_test.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet, VecDeque}; use std::fmt::Write as _; use std::path::{Path, PathBuf}; diff --git a/crates/antlr-rust-codegen/src/grammar/atn/interp_test.rs b/crates/antlr-rust-codegen/src/grammar/atn/interp_test.rs index f17a7b320..ed0329411 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/interp_test.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/interp_test.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use std::fmt::Write; diff --git a/crates/antlr-rust-codegen/src/grammar/atn/lexer.rs b/crates/antlr-rust-codegen/src/grammar/atn/lexer.rs index 80c398c5b..8c794c318 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/lexer.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/lexer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use antlr4_runtime::atn::lexer_dfa::CompiledLexerDfa; diff --git a/crates/antlr-rust-codegen/src/grammar/atn/mod.rs b/crates/antlr-rust-codegen/src/grammar/atn/mod.rs index 7fc32a28a..c26e6ce85 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/mod.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin mod analysis; mod build; #[cfg(test)] diff --git a/crates/antlr-rust-codegen/src/grammar/atn/optimize.rs b/crates/antlr-rust-codegen/src/grammar/atn/optimize.rs index 017db2dec..60d3b5407 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/optimize.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/optimize.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use antlr4_runtime::atn::AtnStateKind; diff --git a/crates/antlr-rust-codegen/src/grammar/atn/parser.rs b/crates/antlr-rust-codegen/src/grammar/atn/parser.rs index 4f186a5aa..5fe1e75bf 100644 --- a/crates/antlr-rust-codegen/src/grammar/atn/parser.rs +++ b/crates/antlr-rust-codegen/src/grammar/atn/parser.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use antlr4_runtime::atn::AtnStateKind; diff --git a/crates/antlr-rust-codegen/src/grammar/char_support.rs b/crates/antlr-rust-codegen/src/grammar/char_support.rs index 08099b1fc..dea208b0a 100644 --- a/crates/antlr-rust-codegen/src/grammar/char_support.rs +++ b/crates/antlr-rust-codegen/src/grammar/char_support.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr4_runtime::atn::IntervalSet; use super::unicode::simple_uppercase; diff --git a/crates/antlr-rust-codegen/src/grammar/compiler.rs b/crates/antlr-rust-codegen/src/grammar/compiler.rs index 127718026..8d703cbea 100644 --- a/crates/antlr-rust-codegen/src/grammar/compiler.rs +++ b/crates/antlr-rust-codegen/src/grammar/compiler.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use super::action::{ActionReferenceParser, action_references}; diff --git a/crates/antlr-rust-codegen/src/grammar/diagnostic.rs b/crates/antlr-rust-codegen/src/grammar/diagnostic.rs index 9509234dd..44f476dac 100644 --- a/crates/antlr-rust-codegen/src/grammar/diagnostic.rs +++ b/crates/antlr-rust-codegen/src/grammar/diagnostic.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::fmt; use std::path::PathBuf; diff --git a/crates/antlr-rust-codegen/src/grammar/escape_sequence.rs b/crates/antlr-rust-codegen/src/grammar/escape_sequence.rs index 2acc8bc17..fa39ee6ba 100644 --- a/crates/antlr-rust-codegen/src/grammar/escape_sequence.rs +++ b/crates/antlr-rust-codegen/src/grammar/escape_sequence.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr4_runtime::atn::IntervalSet; use super::unicode::property_ranges; diff --git a/crates/antlr-rust-codegen/src/grammar/integration.rs b/crates/antlr-rust-codegen/src/grammar/integration.rs index ba22736fd..a2f9403d2 100644 --- a/crates/antlr-rust-codegen/src/grammar/integration.rs +++ b/crates/antlr-rust-codegen/src/grammar/integration.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use super::char_support::get_char_value_from_grammar_char_literal; diff --git a/crates/antlr-rust-codegen/src/grammar/left_recursion.rs b/crates/antlr-rust-codegen/src/grammar/left_recursion.rs index 7384d4568..98b8e57d3 100644 --- a/crates/antlr-rust-codegen/src/grammar/left_recursion.rs +++ b/crates/antlr-rust-codegen/src/grammar/left_recursion.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use super::diagnostic::Diagnostic; diff --git a/crates/antlr-rust-codegen/src/grammar/loader.rs b/crates/antlr-rust-codegen/src/grammar/loader.rs index 4cacedd38..c8de83236 100644 --- a/crates/antlr-rust-codegen/src/grammar/loader.rs +++ b/crates/antlr-rust-codegen/src/grammar/loader.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use std::fs; use std::path::{Path, PathBuf}; diff --git a/crates/antlr-rust-codegen/src/grammar/mod.rs b/crates/antlr-rust-codegen/src/grammar/mod.rs index 3391a13a6..3f26a875e 100644 --- a/crates/antlr-rust-codegen/src/grammar/mod.rs +++ b/crates/antlr-rust-codegen/src/grammar/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) mod action; pub(crate) mod atn; mod char_support; diff --git a/crates/antlr-rust-codegen/src/grammar/model.rs b/crates/antlr-rust-codegen/src/grammar/model.rs index 0e5a63154..fb55dceaf 100644 --- a/crates/antlr-rust-codegen/src/grammar/model.rs +++ b/crates/antlr-rust-codegen/src/grammar/model.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use super::frontend::{SourceId, SourceSpan, SyntaxId}; diff --git a/crates/antlr-rust-codegen/src/grammar/mutual_recursion.rs b/crates/antlr-rust-codegen/src/grammar/mutual_recursion.rs index fc59c1eda..4d45670d0 100644 --- a/crates/antlr-rust-codegen/src/grammar/mutual_recursion.rs +++ b/crates/antlr-rust-codegen/src/grammar/mutual_recursion.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Mutual (indirect) left-recursion elimination — issue #151. //! //! ANTLR 4 rewrites *direct* left recursion (`e : e '+' e | INT`) into a diff --git a/crates/antlr-rust-codegen/src/grammar/provenance.rs b/crates/antlr-rust-codegen/src/grammar/provenance.rs index fbd09f840..937e2c242 100644 --- a/crates/antlr-rust-codegen/src/grammar/provenance.rs +++ b/crates/antlr-rust-codegen/src/grammar/provenance.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use super::frontend::{SourceSpan, SyntaxId}; diff --git a/crates/antlr-rust-codegen/src/grammar/rule_reachability.rs b/crates/antlr-rust-codegen/src/grammar/rule_reachability.rs index e845975bf..534dd2ece 100644 --- a/crates/antlr-rust-codegen/src/grammar/rule_reachability.rs +++ b/crates/antlr-rust-codegen/src/grammar/rule_reachability.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use petgraph::algo::tarjan_scc; diff --git a/crates/antlr-rust-codegen/src/grammar/semantics.rs b/crates/antlr-rust-codegen/src/grammar/semantics.rs index ada5675a6..6ca8d84b3 100644 --- a/crates/antlr-rust-codegen/src/grammar/semantics.rs +++ b/crates/antlr-rust-codegen/src/grammar/semantics.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use std::fs; diff --git a/crates/antlr-rust-codegen/src/grammar/semantics/attributes.rs b/crates/antlr-rust-codegen/src/grammar/semantics/attributes.rs index 603f48f2e..6aaa70a76 100644 --- a/crates/antlr-rust-codegen/src/grammar/semantics/attributes.rs +++ b/crates/antlr-rust-codegen/src/grammar/semantics/attributes.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use crate::grammar::diagnostic::Diagnostic; diff --git a/crates/antlr-rust-codegen/src/grammar/semantics/bindings.rs b/crates/antlr-rust-codegen/src/grammar/semantics/bindings.rs index 1525a6dbf..57d03c21e 100644 --- a/crates/antlr-rust-codegen/src/grammar/semantics/bindings.rs +++ b/crates/antlr-rust-codegen/src/grammar/semantics/bindings.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use crate::grammar::action::{ActionReference, ActionReferenceKind, ActionReferenceParser}; diff --git a/crates/antlr-rust-codegen/src/grammar/source.rs b/crates/antlr-rust-codegen/src/grammar/source.rs index 8aadc04de..37165eb9e 100644 --- a/crates/antlr-rust-codegen/src/grammar/source.rs +++ b/crates/antlr-rust-codegen/src/grammar/source.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeMap; use std::path::{Path, PathBuf}; use std::rc::Rc; diff --git a/crates/antlr-rust-codegen/src/grammar/syntax.rs b/crates/antlr-rust-codegen/src/grammar/syntax.rs index 6d2c92466..e1f2f9e45 100644 --- a/crates/antlr-rust-codegen/src/grammar/syntax.rs +++ b/crates/antlr-rust-codegen/src/grammar/syntax.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::char_support::get_string_from_grammar_string_literal; use super::frontend::{Cst, SourceFile, SourceSpan, SyntaxId, SyntaxNodeKind, SyntaxToken}; use super::generated::antlr_v4_parser as p; diff --git a/crates/antlr-rust-codegen/src/grammar/transform/analysis.rs b/crates/antlr-rust-codegen/src/grammar/transform/analysis.rs index db9069364..6f13bb7d7 100644 --- a/crates/antlr-rust-codegen/src/grammar/transform/analysis.rs +++ b/crates/antlr-rust-codegen/src/grammar/transform/analysis.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; use petgraph::algo::tarjan_scc; diff --git a/crates/antlr-rust-codegen/src/grammar/transform/artifact.rs b/crates/antlr-rust-codegen/src/grammar/transform/artifact.rs index 4742ac56d..c02d5ec0d 100644 --- a/crates/antlr-rust-codegen/src/grammar/transform/artifact.rs +++ b/crates/antlr-rust-codegen/src/grammar/transform/artifact.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::borrow::Cow; use std::collections::BTreeMap; diff --git a/crates/antlr-rust-codegen/src/grammar/transform/mod.rs b/crates/antlr-rust-codegen/src/grammar/transform/mod.rs index dc003b7cb..9fa5370b8 100644 --- a/crates/antlr-rust-codegen/src/grammar/transform/mod.rs +++ b/crates/antlr-rust-codegen/src/grammar/transform/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) mod analysis; pub(crate) mod artifact; mod registry; diff --git a/crates/antlr-rust-codegen/src/grammar/transform/passes/precedence_ladder.rs b/crates/antlr-rust-codegen/src/grammar/transform/passes/precedence_ladder.rs index 672eaffd1..ea9b7cf5b 100644 --- a/crates/antlr-rust-codegen/src/grammar/transform/passes/precedence_ladder.rs +++ b/crates/antlr-rust-codegen/src/grammar/transform/passes/precedence_ladder.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::{BTreeMap, BTreeSet}; #[cfg(test)] diff --git a/crates/antlr-rust-codegen/src/grammar/transform/passes/prune_unreachable.rs b/crates/antlr-rust-codegen/src/grammar/transform/passes/prune_unreachable.rs index 4b0b4bc81..3e4dfd6d2 100644 --- a/crates/antlr-rust-codegen/src/grammar/transform/passes/prune_unreachable.rs +++ b/crates/antlr-rust-codegen/src/grammar/transform/passes/prune_unreachable.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use crate::grammar::diagnostic::Diagnostic; diff --git a/crates/antlr-rust-codegen/src/grammar/transform/registry.rs b/crates/antlr-rust-codegen/src/grammar/transform/registry.rs index 7e6539f85..fe4e65b92 100644 --- a/crates/antlr-rust-codegen/src/grammar/transform/registry.rs +++ b/crates/antlr-rust-codegen/src/grammar/transform/registry.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::analysis::TransformAnalysis; use super::{ GrammarTransform, TransformContext, TransformGrammar, TransformReport, TransformReportEntry, diff --git a/crates/antlr-rust-codegen/src/grammar/unicode.rs b/crates/antlr-rust-codegen/src/grammar/unicode.rs index f3f15b1ff..61320976f 100644 --- a/crates/antlr-rust-codegen/src/grammar/unicode.rs +++ b/crates/antlr-rust-codegen/src/grammar/unicode.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::HashMap; use std::hash::{DefaultHasher, Hash, Hasher}; use std::sync::{Mutex, OnceLock, PoisonError}; diff --git a/crates/antlr-rust-codegen/src/grammar/unicode_escape.rs b/crates/antlr-rust-codegen/src/grammar/unicode_escape.rs index 223d7f7ae..24edc0faf 100644 --- a/crates/antlr-rust-codegen/src/grammar/unicode_escape.rs +++ b/crates/antlr-rust-codegen/src/grammar/unicode_escape.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub(super) enum UnicodeEscapeStyle { Utf16CodeUnits, diff --git a/crates/antlr-rust-codegen/src/grammar/unicode_icu_tests.rs b/crates/antlr-rust-codegen/src/grammar/unicode_icu_tests.rs index e5005d61a..bb7907ea9 100644 --- a/crates/antlr-rust-codegen/src/grammar/unicode_icu_tests.rs +++ b/crates/antlr-rust-codegen/src/grammar/unicode_icu_tests.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::{property_ranges, simple_lowercase, simple_uppercase}; use std::collections::BTreeMap; use std::fmt::Write; diff --git a/crates/antlr-rust-codegen/src/grammar/validation.rs b/crates/antlr-rust-codegen/src/grammar/validation.rs index 67a3cd73b..684cd46b4 100644 --- a/crates/antlr-rust-codegen/src/grammar/validation.rs +++ b/crates/antlr-rust-codegen/src/grammar/validation.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use super::diagnostic::Diagnostic; diff --git a/crates/antlr-rust-codegen/src/json.rs b/crates/antlr-rust-codegen/src/json.rs index d9f6b4891..a82366e5e 100644 --- a/crates/antlr-rust-codegen/src/json.rs +++ b/crates/antlr-rust-codegen/src/json.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use serde::Serialize; pub(crate) fn to_pretty_json(value: &T) -> String { diff --git a/crates/antlr-rust-codegen/src/lexer/mod.rs b/crates/antlr-rust-codegen/src/lexer/mod.rs index d73e3754b..a07a2c5bc 100644 --- a/crates/antlr-rust-codegen/src/lexer/mod.rs +++ b/crates/antlr-rust-codegen/src/lexer/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::generator::prelude::*; use crate::semantics::{ ActionTemplate, CoordinateDispose, PredicateTemplate, SemPatternFile, SemUnknownPolicy, diff --git a/crates/antlr-rust-codegen/src/lexer/render.rs b/crates/antlr-rust-codegen/src/lexer/render.rs index 056b04fde..d7354c5e7 100644 --- a/crates/antlr-rust-codegen/src/lexer/render.rs +++ b/crates/antlr-rust-codegen/src/lexer/render.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Renders a Rust lexer module that delegates token recognition to the shared /// ATN interpreter. /// diff --git a/crates/antlr-rust-codegen/src/lexer/render_model.rs b/crates/antlr-rust-codegen/src/lexer/render_model.rs index abe6ec18f..bbf7cc38d 100644 --- a/crates/antlr-rust-codegen/src/lexer/render_model.rs +++ b/crates/antlr-rust-codegen/src/lexer/render_model.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Complete, immutable input to lexer Rust emission. /// /// Constructing this value before calling the renderer keeps CLI/configuration diff --git a/crates/antlr-rust-codegen/src/lib.rs b/crates/antlr-rust-codegen/src/lib.rs index a8503daae..29f9bd915 100644 --- a/crates/antlr-rust-codegen/src/lib.rs +++ b/crates/antlr-rust-codegen/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! ANTLR v4 grammar compiler and Rust source generator. mod artifact; diff --git a/crates/antlr-rust-codegen/src/optimization/config.rs b/crates/antlr-rust-codegen/src/optimization/config.rs index c3ba955ee..9ee51911a 100644 --- a/crates/antlr-rust-codegen/src/optimization/config.rs +++ b/crates/antlr-rust-codegen/src/optimization/config.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use crate::config::CompilerConfig; diff --git a/crates/antlr-rust-codegen/src/optimization/descriptor.rs b/crates/antlr-rust-codegen/src/optimization/descriptor.rs index c93a0e19a..dbc16ba51 100644 --- a/crates/antlr-rust-codegen/src/optimization/descriptor.rs +++ b/crates/antlr-rust-codegen/src/optimization/descriptor.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::grammar::transform::SafetyClass; use crate::grammar::transform::passes::precedence_ladder::CollapsePrecedenceLadders; use crate::grammar::transform::passes::prune_unreachable::PruneUnreachableRules; diff --git a/crates/antlr-rust-codegen/src/optimization/metrics.rs b/crates/antlr-rust-codegen/src/optimization/metrics.rs index 8aab66841..811ef4c6b 100644 --- a/crates/antlr-rust-codegen/src/optimization/metrics.rs +++ b/crates/antlr-rust-codegen/src/optimization/metrics.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::grammar::model::{Block, ElementKind, GrammarUnit}; /// Deterministic structural counts captured around an optimization pass. diff --git a/crates/antlr-rust-codegen/src/optimization/mod.rs b/crates/antlr-rust-codegen/src/optimization/mod.rs index 53c6ec216..b8a3538b3 100644 --- a/crates/antlr-rust-codegen/src/optimization/mod.rs +++ b/crates/antlr-rust-codegen/src/optimization/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin mod config; mod descriptor; pub(crate) mod metrics; diff --git a/crates/antlr-rust-codegen/src/optimization/report.rs b/crates/antlr-rust-codegen/src/optimization/report.rs index 16d3295f4..ae12943f4 100644 --- a/crates/antlr-rust-codegen/src/optimization/report.rs +++ b/crates/antlr-rust-codegen/src/optimization/report.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use crate::grammar::compiler::Compilation; diff --git a/crates/antlr-rust-codegen/src/parser/decision.rs b/crates/antlr-rust-codegen/src/parser/decision.rs index 504a605d2..1b2ebfa97 100644 --- a/crates/antlr-rust-codegen/src/parser/decision.rs +++ b/crates/antlr-rust-codegen/src/parser/decision.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// LOOK(1) of one decision alternative, plus whether the walk crossed a /// predicate — Java nulls such alternatives, forcing the decision adaptive. #[derive(Debug, Default)] diff --git a/crates/antlr-rust-codegen/src/parser/ir/lower.rs b/crates/antlr-rust-codegen/src/parser/ir/lower.rs index 6f88f8178..8478e82d1 100644 --- a/crates/antlr-rust-codegen/src/parser/ir/lower.rs +++ b/crates/antlr-rust-codegen/src/parser/ir/lower.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) fn compile_generated_parser_rule( context: &GeneratedParserCompileContext<'_>, rule_index: usize, diff --git a/crates/antlr-rust-codegen/src/parser/ir/mod.rs b/crates/antlr-rust-codegen/src/parser/ir/mod.rs index 7738dedd3..2aa2f8522 100644 --- a/crates/antlr-rust-codegen/src/parser/ir/mod.rs +++ b/crates/antlr-rust-codegen/src/parser/ir/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Debug, Eq, PartialEq)] pub(crate) struct GeneratedParserRule { pub(crate) rule_index: usize, diff --git a/crates/antlr-rust-codegen/src/parser/ir/optimize.rs b/crates/antlr-rust-codegen/src/parser/ir/optimize.rs index af698c38e..4399fc0c9 100644 --- a/crates/antlr-rust-codegen/src/parser/ir/optimize.rs +++ b/crates/antlr-rust-codegen/src/parser/ir/optimize.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Validated parser IR after optional control-flow cleanup. #[derive(Clone, Debug, Eq, PartialEq)] pub(crate) struct OptimizedParserIr { diff --git a/crates/antlr-rust-codegen/src/parser/mod.rs b/crates/antlr-rust-codegen/src/parser/mod.rs index c158e9cbf..6d41b9e1a 100644 --- a/crates/antlr-rust-codegen/src/parser/mod.rs +++ b/crates/antlr-rust-codegen/src/parser/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::generator::prelude::*; use crate::semantics::{ RuleArgTemplate, SemPatternFile, SemUnknownPolicy, SemanticHelperCall, SemanticsKind, diff --git a/crates/antlr-rust-codegen/src/parser/render/decisions.rs b/crates/antlr-rust-codegen/src/parser/render/decisions.rs index 3aa0b6e47..4c0a63db3 100644 --- a/crates/antlr-rust-codegen/src/parser/render/decisions.rs +++ b/crates/antlr-rust-codegen/src/parser/render/decisions.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) fn render_generated_decision( out: &mut String, decision_info: DecisionRender<'_>, diff --git a/crates/antlr-rust-codegen/src/parser/render/fallback.rs b/crates/antlr-rust-codegen/src/parser/render/fallback.rs index 81eed5022..f98303adf 100644 --- a/crates/antlr-rust-codegen/src/parser/render/fallback.rs +++ b/crates/antlr-rust-codegen/src/parser/render/fallback.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Copy)] pub(crate) struct ParserFallbackRender<'a> { pub(crate) track_alt_numbers: bool, diff --git a/crates/antlr-rust-codegen/src/parser/render/loops.rs b/crates/antlr-rust-codegen/src/parser/render/loops.rs index 55afe9028..9f4b192ea 100644 --- a/crates/antlr-rust-codegen/src/parser/render/loops.rs +++ b/crates/antlr-rust-codegen/src/parser/render/loops.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) fn render_generated_star_loop( out: &mut String, loop_info: StarLoopRender<'_>, diff --git a/crates/antlr-rust-codegen/src/parser/render/mod.rs b/crates/antlr-rust-codegen/src/parser/render/mod.rs index 4905a61ae..2aab8d7e6 100644 --- a/crates/antlr-rust-codegen/src/parser/render/mod.rs +++ b/crates/antlr-rust-codegen/src/parser/render/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Test-facing wrapper over [`render_parser_with_decision_report`] for the /// many render assertions that never look at the manifest rows. #[cfg(test)] diff --git a/crates/antlr-rust-codegen/src/parser/render/rules.rs b/crates/antlr-rust-codegen/src/parser/render/rules.rs index 0f3c864c0..fd7c8562f 100644 --- a/crates/antlr-rust-codegen/src/parser/render/rules.rs +++ b/crates/antlr-rust-codegen/src/parser/render/rules.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) fn render_generated_rule_method( out: &mut String, rule: &GeneratedParserRule, diff --git a/crates/antlr-rust-codegen/src/parser/render_model.rs b/crates/antlr-rust-codegen/src/parser/render_model.rs index f7603219a..87f63ce7b 100644 --- a/crates/antlr-rust-codegen/src/parser/render_model.rs +++ b/crates/antlr-rust-codegen/src/parser/render_model.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Renders a Rust parser module with one public method per grammar rule. /// /// Parser methods use generated recursive-descent bodies for the ATN subset diff --git a/crates/antlr-rust-codegen/src/parser/routing.rs b/crates/antlr-rust-codegen/src/parser/routing.rs index ca660dc96..356c8e1e1 100644 --- a/crates/antlr-rust-codegen/src/parser/routing.rs +++ b/crates/antlr-rust-codegen/src/parser/routing.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[cfg(test)] pub(crate) fn render_generated_rule_dispatch( rules: &[Option], diff --git a/crates/antlr-rust-codegen/src/parser/surface/accessors.rs b/crates/antlr-rust-codegen/src/parser/surface/accessors.rs index 7afa5ec2c..ae4b7167f 100644 --- a/crates/antlr-rust-codegen/src/parser/surface/accessors.rs +++ b/crates/antlr-rust-codegen/src/parser/surface/accessors.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Debug, Eq, PartialEq)] struct ContextLabelAccessor { source_name: String, diff --git a/crates/antlr-rust-codegen/src/parser/surface/contexts.rs b/crates/antlr-rust-codegen/src/parser/surface/contexts.rs index 1b71a0d92..bb8b2288f 100644 --- a/crates/antlr-rust-codegen/src/parser/surface/contexts.rs +++ b/crates/antlr-rust-codegen/src/parser/surface/contexts.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Generates the typed context views, listener trait, and walker for the /// embedded `.test.stg` surface: /// diff --git a/crates/antlr-rust-codegen/src/parser/surface/facade.rs b/crates/antlr-rust-codegen/src/parser/surface/facade.rs index a552ef818..38ce09b45 100644 --- a/crates/antlr-rust-codegen/src/parser/surface/facade.rs +++ b/crates/antlr-rust-codegen/src/parser/surface/facade.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin fn render_antlr4rust_input_facade(input_facade: &str, token_view: &str) -> String { let mut out = String::with_capacity(ANTLR4RUST_INPUT_FACADE_TEMPLATE.len()); let mut rest = ANTLR4RUST_INPUT_FACADE_TEMPLATE; diff --git a/crates/antlr-rust-codegen/src/parser/surface/model.rs b/crates/antlr-rust-codegen/src/parser/surface/model.rs index 8c7a09d77..b2954b7cb 100644 --- a/crates/antlr-rust-codegen/src/parser/surface/model.rs +++ b/crates/antlr-rust-codegen/src/parser/surface/model.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Grammar-specific parser API and embedded-body bindings. /// /// This model is built from structural grammar metadata only. Decision and IR diff --git a/crates/antlr-rust-codegen/src/parser/surface/names.rs b/crates/antlr-rust-codegen/src/parser/surface/names.rs index 37e16c0da..4a4f3214c 100644 --- a/crates/antlr-rust-codegen/src/parser/surface/names.rs +++ b/crates/antlr-rust-codegen/src/parser/surface/names.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) fn build_structural_parser_surface( data: &RecognizerCodegenData<'_>, grammar_name: &str, diff --git a/crates/antlr-rust-codegen/src/parser/surface/support_abi.rs b/crates/antlr-rust-codegen/src/parser/surface/support_abi.rs index 761ee4a9d..76fad6ca8 100644 --- a/crates/antlr-rust-codegen/src/parser/surface/support_abi.rs +++ b/crates/antlr-rust-codegen/src/parser/surface/support_abi.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Runtime support surface selected for the generated-source API revision. /// /// Keeping this selection in the parser surface layer makes a future ABI diff --git a/crates/antlr-rust-codegen/src/parser/surface/traversal.rs b/crates/antlr-rust-codegen/src/parser/surface/traversal.rs index 5e0459d17..181eab175 100644 --- a/crates/antlr-rust-codegen/src/parser/surface/traversal.rs +++ b/crates/antlr-rust-codegen/src/parser/surface/traversal.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin fn render_validated_tree_support(surface_name: &str) -> String { let validated_tree = format!("{surface_name}ValidatedTree"); let validation_error = format!("{surface_name}ValidationError"); diff --git a/crates/antlr-rust-codegen/src/pipeline.rs b/crates/antlr-rust-codegen/src/pipeline.rs index dc6af717d..d89847160 100644 --- a/crates/antlr-rust-codegen/src/pipeline.rs +++ b/crates/antlr-rust-codegen/src/pipeline.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) mod prelude { pub(crate) use super::{ GENERATED_MODULE_FOOTER, LexerCodegenData, ParserCodegenData, RecognizerCodegenData, diff --git a/crates/antlr-rust-codegen/src/rust_output.rs b/crates/antlr-rust-codegen/src/rust_output.rs index e64f9a366..99bc45b08 100644 --- a/crates/antlr-rust-codegen/src/rust_output.rs +++ b/crates/antlr-rust-codegen/src/rust_output.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use icu_properties::{CodePointSetData, CodePointSetDataBorrowed, props}; /// Returns the byte end of a Rust identifier beginning at `start`. diff --git a/crates/antlr-rust-codegen/src/rust_support/identity.rs b/crates/antlr-rust-codegen/src/rust_support/identity.rs index 294e4c1a1..61763d2c7 100644 --- a/crates/antlr-rust-codegen/src/rust_support/identity.rs +++ b/crates/antlr-rust-codegen/src/rust_support/identity.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use std::ffi::OsStr; use std::fs::{self, OpenOptions}; diff --git a/crates/antlr-rust-codegen/src/rust_support/mod.rs b/crates/antlr-rust-codegen/src/rust_support/mod.rs index a78188642..b22ec3bb6 100644 --- a/crates/antlr-rust-codegen/src/rust_support/mod.rs +++ b/crates/antlr-rust-codegen/src/rust_support/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin mod identity; mod prompt; mod python; diff --git a/crates/antlr-rust-codegen/src/rust_support/prompt.rs b/crates/antlr-rust-codegen/src/rust_support/prompt.rs index 86a7d4d1b..a6408d94c 100644 --- a/crates/antlr-rust-codegen/src/rust_support/prompt.rs +++ b/crates/antlr-rust-codegen/src/rust_support/prompt.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::io::{self, Write as _}; use anstream::{AutoStream, ColorChoice}; diff --git a/crates/antlr-rust-codegen/src/rust_support/python.rs b/crates/antlr-rust-codegen/src/rust_support/python.rs index 0becc0e4b..cc4136e94 100644 --- a/crates/antlr-rust-codegen/src/rust_support/python.rs +++ b/crates/antlr-rust-codegen/src/rust_support/python.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::path::Path; use miette::{IntoDiagnostic as _, WrapErr as _}; diff --git a/crates/antlr-rust-codegen/src/rust_support/stage.rs b/crates/antlr-rust-codegen/src/rust_support/stage.rs index e04d24774..d32414d25 100644 --- a/crates/antlr-rust-codegen/src/rust_support/stage.rs +++ b/crates/antlr-rust-codegen/src/rust_support/stage.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::ffi::OsStr; use std::fs; use std::io; diff --git a/crates/antlr-rust-codegen/src/semantics/hooks.rs b/crates/antlr-rust-codegen/src/semantics/hooks.rs index 089f6d029..9a96d6ff2 100644 --- a/crates/antlr-rust-codegen/src/semantics/hooks.rs +++ b/crates/antlr-rust-codegen/src/semantics/hooks.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(crate) fn lexer_typed_hook_mappings( data: &RecognizerCodegenData<'_>, patterns: &SemPatternFile, diff --git a/crates/antlr-rust-codegen/src/semantics/inventory.rs b/crates/antlr-rust-codegen/src/semantics/inventory.rs index 879876dea..f0e72a411 100644 --- a/crates/antlr-rust-codegen/src/semantics/inventory.rs +++ b/crates/antlr-rust-codegen/src/semantics/inventory.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// One semantic predicate/action coordinate inventoried for the manifest. /// /// Optional fields reflect the coordinate kind or the absence of authored diff --git a/crates/antlr-rust-codegen/src/semantics/manifest.rs b/crates/antlr-rust-codegen/src/semantics/manifest.rs index f70328a18..0d6202cd0 100644 --- a/crates/antlr-rust-codegen/src/semantics/manifest.rs +++ b/crates/antlr-rust-codegen/src/semantics/manifest.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use serde::Serialize; use crate::json::to_pretty_json; diff --git a/crates/antlr-rust-codegen/src/semantics/mod.rs b/crates/antlr-rust-codegen/src/semantics/mod.rs index 0392c9219..95cc9aa5f 100644 --- a/crates/antlr-rust-codegen/src/semantics/mod.rs +++ b/crates/antlr-rust-codegen/src/semantics/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::generator::prelude::*; use crate::parser::{ DecisionReportRow, DecisionTierReport, LexerTypedHookKind, LexerTypedHookMapping, diff --git a/crates/antlr-rust-codegen/src/semantics/model.rs b/crates/antlr-rust-codegen/src/semantics/model.rs index 62dc02b24..198a823e9 100644 --- a/crates/antlr-rust-codegen/src/semantics/model.rs +++ b/crates/antlr-rust-codegen/src/semantics/model.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Disposition policy for semantic predicate/action coordinates that the /// generator cannot translate into runtime metadata. /// diff --git a/crates/antlr-rust-codegen/src/semantics/patterns.rs b/crates/antlr-rust-codegen/src/semantics/patterns.rs index 1329a4be5..949a1144c 100644 --- a/crates/antlr-rust-codegen/src/semantics/patterns.rs +++ b/crates/antlr-rust-codegen/src/semantics/patterns.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr_rust_toml_parser::{Item as TomlItem, Value as TomlValue}; impl SemPatternFile { diff --git a/crates/antlr-rust-codegen/src/semantics/semir.rs b/crates/antlr-rust-codegen/src/semantics/semir.rs index 06954c32a..ea1f74bef 100644 --- a/crates/antlr-rust-codegen/src/semantics/semir.rs +++ b/crates/antlr-rust-codegen/src/semantics/semir.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Renders parser predicate metadata shared by generated predicate checks. #[allow(dead_code)] fn render_parser_predicate_constant( diff --git a/crates/antlr-rust-codegen/src/semantics/stack_member.rs b/crates/antlr-rust-codegen/src/semantics/stack_member.rs index 838d057b5..ee11ea41c 100644 --- a/crates/antlr-rust-codegen/src/semantics/stack_member.rs +++ b/crates/antlr-rust-codegen/src/semantics/stack_member.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! `stack_member` lowering for the `--sem-patterns` DSL (issue #206). //! //! Several published grammars keep their lexer state inline in diff --git a/crates/antlr-rust-codegen/src/semantics/template_syntax.rs b/crates/antlr-rust-codegen/src/semantics/template_syntax.rs index d149750a5..0ac5e152e 100644 --- a/crates/antlr-rust-codegen/src/semantics/template_syntax.rs +++ b/crates/antlr-rust-codegen/src/semantics/template_syntax.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Splits a body made only of adjacent target-template expressions. pub(crate) fn template_sequence_bodies(body: &str) -> Option> { let mut templates = Vec::new(); diff --git a/crates/antlr-rust-codegen/src/semantics/templates.rs b/crates/antlr-rust-codegen/src/semantics/templates.rs index 96a62c3b7..7f8e5420f 100644 --- a/crates/antlr-rust-codegen/src/semantics/templates.rs +++ b/crates/antlr-rust-codegen/src/semantics/templates.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin /// Emits the generated lexer action dispatcher for structurally bound custom /// actions in the compiled lexer. pub(crate) fn render_lexer_action_method( diff --git a/crates/antlr-rust-codegen/src/structural/contexts.rs b/crates/antlr-rust-codegen/src/structural/contexts.rs index aa2269b2b..85ce1e8e3 100644 --- a/crates/antlr-rust-codegen/src/structural/contexts.rs +++ b/crates/antlr-rust-codegen/src/structural/contexts.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin fn structural_attr_decl(attribute: &AttributeSymbol) -> embedded::AttrDecl { embedded::AttrDecl { name: attribute.name.clone(), diff --git a/crates/antlr-rust-codegen/src/structural/mod.rs b/crates/antlr-rust-codegen/src/structural/mod.rs index 553ce7f6b..c72feb242 100644 --- a/crates/antlr-rust-codegen/src/structural/mod.rs +++ b/crates/antlr-rust-codegen/src/structural/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::generator::prelude::*; use crate::semantics::PredicateTemplate; diff --git a/crates/antlr-rust-codegen/src/test_rig.rs b/crates/antlr-rust-codegen/src/test_rig.rs index 58da616a3..b9bf0c0b3 100644 --- a/crates/antlr-rust-codegen/src/test_rig.rs +++ b/crates/antlr-rust-codegen/src/test_rig.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::io; use crate::parser::parser_public_rule_method_names; diff --git a/crates/antlr-rust-codegen/src/testrig_cli.rs b/crates/antlr-rust-codegen/src/testrig_cli.rs index 19d1396fc..bc4d720e8 100644 --- a/crates/antlr-rust-codegen/src/testrig_cli.rs +++ b/crates/antlr-rust-codegen/src/testrig_cli.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use std::ffi::OsString; use std::fs; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli.rs index 100524033..6ec5e416c 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[path = "antlr4_rust_gen_cli/cli.rs"] mod cli; #[path = "antlr4_rust_gen_cli/compatibility.rs"] diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/cli.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/cli.rs index d5dd65126..36ab63502 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/cli.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/cli.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/compatibility.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/compatibility.rs index 9be1fda97..7397f5094 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/compatibility.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/compatibility.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/diagnostics.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/diagnostics.rs index 0d8b92387..288b8ad4a 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/diagnostics.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/diagnostics.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/lexer.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/lexer.rs index abd2b930a..1bf1dd5b5 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/lexer.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/lexer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/multi_recognizer.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/multi_recognizer.rs index f22e22462..8ab19ddea 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/multi_recognizer.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/multi_recognizer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. use std::collections::BTreeMap; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/optimizations.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/optimizations.rs index a496bf6f2..d536186ed 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/optimizations.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/optimizations.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/parser.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/parser.rs index d308ca56b..477032838 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/parser.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/parser.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/rust_support.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/rust_support.rs index b0b499b82..1b3c059c6 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/rust_support.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/rust_support.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/semantics.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/semantics.rs index 73e19568d..4ca75b8ca 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/semantics.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/semantics.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/support.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/support.rs index fd0a70a5e..8b395cbcd 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/support.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/support.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub(super) use std::collections::BTreeSet; pub(super) use std::ffi::OsStr; pub(super) use std::fs; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/testrig.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/testrig.rs index 87e1da040..61e2e2ceb 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/testrig.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/testrig.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // `insta` assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/transforms.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/transforms.rs index cbe6411b7..80f094c57 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/transforms.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/transforms.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/typed_tree.rs b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/typed_tree.rs index 43673270b..f8bf50c39 100644 --- a/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/typed_tree.rs +++ b/crates/antlr-rust-codegen/tests/antlr4_rust_gen_cli/typed_tree.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] // insta assertion macros unwrap internal I/O. #[allow(clippy::wildcard_imports)] use super::support::*; diff --git a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/midi-binary/make_fixture.py b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/midi-binary/make_fixture.py index 2bda25909..45a539763 100644 --- a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/midi-binary/make_fixture.py +++ b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/midi-binary/make_fixture.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin """Regenerate twinkle.mid, the byte fixture for the MIDI binary-parsing test. The bytes are committed so the test needs no toolchain, but this script keeps diff --git a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs index b1b2e146f..e2352d51b 100644 --- a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs +++ b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(dead_code)] use std::cell::Cell; diff --git a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py index 47993f6e2..f53c9af04 100644 --- a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py +++ b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin """Pinned execution surface from grammars-v4 c/Rust/transformGrammar.py. Source commit: 42b1ea521705c126d84331186b221c9819db1058 diff --git a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py index 6a535924c..81e975f44 100644 --- a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py +++ b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin """Pinned execution surface from grammars-v4 java/java/Rust/transformGrammar.py. Source commit: 42b1ea521705c126d84331186b221c9819db1058 diff --git a/crates/antlr-rust-g4-parser/src/frontend.rs b/crates/antlr-rust-g4-parser/src/frontend.rs index 3ee944e4f..01c191191 100644 --- a/crates/antlr-rust-g4-parser/src/frontend.rs +++ b/crates/antlr-rust-g4-parser/src/frontend.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::fmt; use std::ops::Range; use std::path::{Path, PathBuf}; diff --git a/crates/antlr-rust-g4-parser/src/lexer_adaptor.rs b/crates/antlr-rust-g4-parser/src/lexer_adaptor.rs index 88532f39a..aa66d3f46 100644 --- a/crates/antlr-rust-g4-parser/src/lexer_adaptor.rs +++ b/crates/antlr-rust-g4-parser/src/lexer_adaptor.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr4_runtime::{ CharStream, INVALID_TOKEN_TYPE, LexerCustomAction, LexerLifecycleCtx, LexerSemCtx, SemanticHooks, TokenView, diff --git a/crates/antlr-rust-g4-parser/src/lib.rs b/crates/antlr-rust-g4-parser/src/lib.rs index 9cead3aec..6210ffa0b 100644 --- a/crates/antlr-rust-g4-parser/src/lib.rs +++ b/crates/antlr-rust-g4-parser/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Checked-in `ANTLRv4` recognizers and recovered source-syntax facade. //! //! This crate is a lockstep implementation dependency of diff --git a/crates/antlr-rust-rs-parser/src/cfg_syntax.rs b/crates/antlr-rust-rs-parser/src/cfg_syntax.rs index f5688d43a..42adb26b5 100644 --- a/crates/antlr-rust-rs-parser/src/cfg_syntax.rs +++ b/crates/antlr-rust-rs-parser/src/cfg_syntax.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::ops::Range; #[derive(Clone, Copy, Debug, Eq, PartialEq)] diff --git a/crates/antlr-rust-rs-parser/src/lib.rs b/crates/antlr-rust-rs-parser/src/lib.rs index 60037c37a..3be267086 100644 --- a/crates/antlr-rust-rs-parser/src/lib.rs +++ b/crates/antlr-rust-rs-parser/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Checked-in Rust recognizers and syntax analysis for embedded-action lowering. //! //! The recognizers are generated by `antlr-rust-codegen` itself. The analysis diff --git a/crates/antlr-rust-runtime/src/atn/ascii_range.rs b/crates/antlr-rust-runtime/src/atn/ascii_range.rs index 5e1d85285..12a13e4c0 100644 --- a/crates/antlr-rust-runtime/src/atn/ascii_range.rs +++ b/crates/antlr-rust-runtime/src/atn/ascii_range.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Exact ASCII range descriptors and range-prefix scanners. const ASCII_SYMBOLS: usize = 128; diff --git a/crates/antlr-rust-runtime/src/atn/bypass.rs b/crates/antlr-rust-runtime/src/atn/bypass.rs index 070d8cb77..0b76e513a 100644 --- a/crates/antlr-rust-runtime/src/atn/bypass.rs +++ b/crates/antlr-rust-runtime/src/atn/bypass.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Rule-bypass alternatives for parse-tree pattern matching. //! //! ANTLR's parse-tree pattern matcher needs to interpret a hybrid token stream diff --git a/crates/antlr-rust-runtime/src/atn/lexer.rs b/crates/antlr-rust-runtime/src/atn/lexer.rs index 07e093fa4..dd22141a8 100644 --- a/crates/antlr-rust-runtime/src/atn/lexer.rs +++ b/crates/antlr-rust-runtime/src/atn/lexer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::cell::RefCell; use std::collections::{HashMap, HashSet}; use std::hash::BuildHasherDefault; diff --git a/crates/antlr-rust-runtime/src/atn/lexer_dfa.rs b/crates/antlr-rust-runtime/src/atn/lexer_dfa.rs index e8131bac5..aeee091ba 100644 --- a/crates/antlr-rust-runtime/src/atn/lexer_dfa.rs +++ b/crates/antlr-rust-runtime/src/atn/lexer_dfa.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Ahead-of-time lexer DFA compilation. //! //! ANTLR runtimes normally discover the lexer DFA lazily: the ATN simulator diff --git a/crates/antlr-rust-runtime/src/atn/mod.rs b/crates/antlr-rust-runtime/src/atn/mod.rs index 1d385ddd5..64ac37b09 100644 --- a/crates/antlr-rust-runtime/src/atn/mod.rs +++ b/crates/antlr-rust-runtime/src/atn/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Abstract Transition Network structures used by generated lexers and //! parsers. //! diff --git a/crates/antlr-rust-runtime/src/atn/parser.rs b/crates/antlr-rust-runtime/src/atn/parser.rs index d474299d2..8c5db0ec0 100644 --- a/crates/antlr-rust-runtime/src/atn/parser.rs +++ b/crates/antlr-rust-runtime/src/atn/parser.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::atn::AtnStateKind; use crate::atn::parser_atn::{ ParserAtn as Atn, ParserAtnState as AtnState, ParserTransition, ParserTransitionKind, diff --git a/crates/antlr-rust-runtime/src/atn/parser_atn.rs b/crates/antlr-rust-runtime/src/atn/parser_atn.rs index 73954429b..d4b1a5c14 100644 --- a/crates/antlr-rust-runtime/src/atn/parser_atn.rs +++ b/crates/antlr-rust-runtime/src/atn/parser_atn.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Packed, index-addressed parser ATN storage. //! //! Parser ATNs are immutable after generation/deserialization. Keeping their diff --git a/crates/antlr-rust-runtime/src/atn/serialized.rs b/crates/antlr-rust-runtime/src/atn/serialized.rs index 7c764bb02..cf0b24ab2 100644 --- a/crates/antlr-rust-runtime/src/atn/serialized.rs +++ b/crates/antlr-rust-runtime/src/atn/serialized.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::borrow::Cow; use crate::atn::parser_atn::{ diff --git a/crates/antlr-rust-runtime/src/byte_stream.rs b/crates/antlr-rust-runtime/src/byte_stream.rs index 78bb8b316..dd5d6b825 100644 --- a/crates/antlr-rust-runtime/src/byte_stream.rs +++ b/crates/antlr-rust-runtime/src/byte_stream.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! A byte-oriented [`CharStream`] for parsing binary formats. //! //! ANTLR grammars normally consume Unicode text, but many real-world formats diff --git a/crates/antlr-rust-runtime/src/char_stream.rs b/crates/antlr-rust-runtime/src/char_stream.rs index ee9952193..4f0269a0b 100644 --- a/crates/antlr-rust-runtime/src/char_stream.rs +++ b/crates/antlr-rust-runtime/src/char_stream.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::int_stream::{EOF, IntStream, UNKNOWN_SOURCE_NAME}; use std::io; use std::rc::Rc; diff --git a/crates/antlr-rust-runtime/src/dfa.rs b/crates/antlr-rust-runtime/src/dfa.rs index cdcbb55c0..7a1d8f03a 100644 --- a/crates/antlr-rust-runtime/src/dfa.rs +++ b/crates/antlr-rust-runtime/src/dfa.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::prediction::{AtnConfigSet, ContextArena, ContextId, PredictionFxHasher}; use std::collections::HashMap; use std::hash::BuildHasherDefault; diff --git a/crates/antlr-rust-runtime/src/errors.rs b/crates/antlr-rust-runtime/src/errors.rs index 23f8720db..4a406e810 100644 --- a/crates/antlr-rust-runtime/src/errors.rs +++ b/crates/antlr-rust-runtime/src/errors.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::ops::Range; use crate::recognizer::Recognizer; diff --git a/crates/antlr-rust-runtime/src/generated.rs b/crates/antlr-rust-runtime/src/generated.rs index 2c20e07ac..726934194 100644 --- a/crates/antlr-rust-runtime/src/generated.rs +++ b/crates/antlr-rust-runtime/src/generated.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::any::Any; use std::fmt; use std::sync::{Arc, OnceLock}; diff --git a/crates/antlr-rust-runtime/src/int_stream.rs b/crates/antlr-rust-runtime/src/int_stream.rs index 4663bcc28..d528e9462 100644 --- a/crates/antlr-rust-runtime/src/int_stream.rs +++ b/crates/antlr-rust-runtime/src/int_stream.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin pub const EOF: i32 = -1; pub const UNKNOWN_SOURCE_NAME: &str = ""; diff --git a/crates/antlr-rust-runtime/src/lexer.rs b/crates/antlr-rust-runtime/src/lexer.rs index 7257c6a81..5aeb0eb95 100644 --- a/crates/antlr-rust-runtime/src/lexer.rs +++ b/crates/antlr-rust-runtime/src/lexer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::cell::{RefCell, RefMut}; use std::collections::{BTreeSet, HashMap, VecDeque}; use std::hash::BuildHasherDefault; diff --git a/crates/antlr-rust-runtime/src/lib.rs b/crates/antlr-rust-runtime/src/lib.rs index 2e4474a84..ddcaf1355 100644 --- a/crates/antlr-rust-runtime/src/lib.rs +++ b/crates/antlr-rust-runtime/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Clean-room ANTLR v4 runtime foundation for Rust. extern crate self as antlr4_runtime; diff --git a/crates/antlr-rust-runtime/src/parser.rs b/crates/antlr-rust-runtime/src/parser.rs index 8e0a562be..46c3b052a 100644 --- a/crates/antlr-rust-runtime/src/parser.rs +++ b/crates/antlr-rust-runtime/src/parser.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin // `HashMap`/`HashSet` here are used as parser-internal caches keyed on // stable ATN coordinates (state numbers, token indices). They're never // iterated externally, so the project's `disallowed_types` lint (which diff --git a/crates/antlr-rust-runtime/src/perf.rs b/crates/antlr-rust-runtime/src/perf.rs index df555aa4a..5d9961c51 100644 --- a/crates/antlr-rust-runtime/src/perf.rs +++ b/crates/antlr-rust-runtime/src/perf.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Lightweight counters for lexer and prediction performance investigations. #![allow(clippy::missing_const_for_thread_local)] diff --git a/crates/antlr-rust-runtime/src/prediction.rs b/crates/antlr-rust-runtime/src/prediction.rs index 410c98273..1b5af9337 100644 --- a/crates/antlr-rust-runtime/src/prediction.rs +++ b/crates/antlr-rust-runtime/src/prediction.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::cmp::Ordering; use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::hash::{BuildHasherDefault, Hash, Hasher}; diff --git a/crates/antlr-rust-runtime/src/recognizer.rs b/crates/antlr-rust-runtime/src/recognizer.rs index 4e9f95270..e70d9864e 100644 --- a/crates/antlr-rust-runtime/src/recognizer.rs +++ b/crates/antlr-rust-runtime/src/recognizer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::fmt; use std::sync::{Arc, Mutex}; diff --git a/crates/antlr-rust-runtime/src/semir.rs b/crates/antlr-rust-runtime/src/semir.rs index eea2550f2..c2ed788d7 100644 --- a/crates/antlr-rust-runtime/src/semir.rs +++ b/crates/antlr-rust-runtime/src/semir.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Semantic IR for grammar-embedded predicates and actions. //! //! ANTLR grammars embed target-language semantic predicates and actions that diff --git a/crates/antlr-rust-runtime/src/token.rs b/crates/antlr-rust-runtime/src/token.rs index ae5daf9d9..6e8751c93 100644 --- a/crates/antlr-rust-runtime/src/token.rs +++ b/crates/antlr-rust-runtime/src/token.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::char_stream::TextInterval; use std::fmt; use std::ops::Range; diff --git a/crates/antlr-rust-runtime/src/token_stream.rs b/crates/antlr-rust-runtime/src/token_stream.rs index cff177168..f7c687107 100644 --- a/crates/antlr-rust-runtime/src/token_stream.rs +++ b/crates/antlr-rust-runtime/src/token_stream.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::int_stream::{EOF, IntStream, UNKNOWN_SOURCE_NAME}; use std::cell::Cell; diff --git a/crates/antlr-rust-runtime/src/tree.rs b/crates/antlr-rust-runtime/src/tree.rs index fb74043bd..bdc2bf6f2 100644 --- a/crates/antlr-rust-runtime/src/tree.rs +++ b/crates/antlr-rust-runtime/src/tree.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use crate::errors::AntlrError; use crate::recognizer::Recognizer; use crate::token::{Token, TokenId, TokenStore, TokenView}; diff --git a/crates/antlr-rust-runtime/src/tree_pattern.rs b/crates/antlr-rust-runtime/src/tree_pattern.rs index 113eaac9e..81a08fbb7 100644 --- a/crates/antlr-rust-runtime/src/tree_pattern.rs +++ b/crates/antlr-rust-runtime/src/tree_pattern.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! ANTLR parse-tree pattern matching. //! //! A *tree pattern* is a string of ordinary grammar input with embedded diff --git a/crates/antlr-rust-runtime/src/validated.rs b/crates/antlr-rust-runtime/src/validated.rs index 29a045a70..caad11c26 100644 --- a/crates/antlr-rust-runtime/src/validated.rs +++ b/crates/antlr-rust-runtime/src/validated.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Shared validated-parse surface for generated recognizers. //! //! Every generated parser exposes a strict parsing mode that rejects syntax diff --git a/crates/antlr-rust-runtime/src/vocabulary.rs b/crates/antlr-rust-runtime/src/vocabulary.rs index 98486966a..d28287a58 100644 --- a/crates/antlr-rust-runtime/src/vocabulary.rs +++ b/crates/antlr-rust-runtime/src/vocabulary.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct Vocabulary { literal: Vec>, diff --git a/crates/antlr-rust-runtime/src/xpath.rs b/crates/antlr-rust-runtime/src/xpath.rs index ac741cf1f..8dbf9e634 100644 --- a/crates/antlr-rust-runtime/src/xpath.rs +++ b/crates/antlr-rust-runtime/src/xpath.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! ANTLR parse-tree `XPath` queries. //! //! This is ANTLR's small tree-path dialect, not W3C `XPath`. It supports child diff --git a/crates/antlr-rust-toml-parser/src/ast.rs b/crates/antlr-rust-toml-parser/src/ast.rs index fc7253680..8f0687a80 100644 --- a/crates/antlr-rust-toml-parser/src/ast.rs +++ b/crates/antlr-rust-toml-parser/src/ast.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct Document { items: Vec, diff --git a/crates/antlr-rust-toml-parser/src/decode.rs b/crates/antlr-rust-toml-parser/src/decode.rs index 0e89af10a..520fa438b 100644 --- a/crates/antlr-rust-toml-parser/src/decode.rs +++ b/crates/antlr-rust-toml-parser/src/decode.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::fmt; use std::sync::{Arc, Mutex}; diff --git a/crates/antlr-rust-toml-parser/src/lib.rs b/crates/antlr-rust-toml-parser/src/lib.rs index c6dee9b04..7cc56eebc 100644 --- a/crates/antlr-rust-toml-parser/src/lib.rs +++ b/crates/antlr-rust-toml-parser/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Checked-in TOML recognizers and a decoded syntax facade. //! //! This crate is a lockstep implementation dependency of diff --git a/crates/antlr-rust-toml-parser/src/string.rs b/crates/antlr-rust-toml-parser/src/string.rs index 06d4c17b4..656f874b0 100644 --- a/crates/antlr-rust-toml-parser/src/string.rs +++ b/crates/antlr-rust-toml-parser/src/string.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use super::Error; pub(crate) fn decode_basic(value: &str, multiline: bool) -> Result { diff --git a/tests/antlr-rust-runtime-testsuite/src/main.rs b/tests/antlr-rust-runtime-testsuite/src/main.rs index a9feb1427..633dc40ea 100644 --- a/tests/antlr-rust-runtime-testsuite/src/main.rs +++ b/tests/antlr-rust-runtime-testsuite/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::print_stderr, clippy::print_stdout)] use std::env; diff --git a/tests/antlr-rust-runtime-testsuite/src/rust_names.rs b/tests/antlr-rust-runtime-testsuite/src/rust_names.rs index 721655aad..7efc43ba2 100644 --- a/tests/antlr-rust-runtime-testsuite/src/rust_names.rs +++ b/tests/antlr-rust-runtime-testsuite/src/rust_names.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use icu_properties::{CodePointSetData, CodePointSetDataBorrowed, props}; /// Returns the byte end of a Rust identifier beginning at `start`. diff --git a/tests/javascript-parity/dump_python.py b/tests/javascript-parity/dump_python.py old mode 100755 new mode 100644 index 98b7e2e07..2c964a947 --- a/tests/javascript-parity/dump_python.py +++ b/tests/javascript-parity/dump_python.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin import argparse import importlib import json diff --git a/tests/javascript-parity/dumper/src/javascript_lexer_base.rs b/tests/javascript-parity/dumper/src/javascript_lexer_base.rs index f3075c3a0..c0dab0159 100644 --- a/tests/javascript-parity/dumper/src/javascript_lexer_base.rs +++ b/tests/javascript-parity/dumper/src/javascript_lexer_base.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr4_runtime::{CharStream, DEFAULT_CHANNEL, LexerSemCtx, Token, TokenView}; use crate::generated::java_script_lexer::{ diff --git a/tests/javascript-parity/dumper/src/javascript_parser_base.rs b/tests/javascript-parity/dumper/src/javascript_parser_base.rs index ccd12acec..5af814f04 100644 --- a/tests/javascript-parity/dumper/src/javascript_parser_base.rs +++ b/tests/javascript-parity/dumper/src/javascript_parser_base.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr4_runtime::{HIDDEN_CHANNEL, ParserSemCtx, Token, TokenSource}; use crate::generated::java_script_parser::{ diff --git a/tests/javascript-parity/dumper/src/main.rs b/tests/javascript-parity/dumper/src/main.rs index 6855b2d89..31c768668 100644 --- a/tests/javascript-parity/dumper/src/main.rs +++ b/tests/javascript-parity/dumper/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] use std::env; diff --git a/tests/javascript-parity/run.sh b/tests/javascript-parity/run.sh old mode 100755 new mode 100644 index 4c709aa13..dd04cb016 --- a/tests/javascript-parity/run.sh +++ b/tests/javascript-parity/run.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/tests/kotlin-parity/dump_python.py b/tests/kotlin-parity/dump_python.py index e422e20a9..89814579d 100644 --- a/tests/kotlin-parity/dump_python.py +++ b/tests/kotlin-parity/dump_python.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin """Parse a source file with an antlr4-python3-runtime parser and dump the parse tree in a stable, diff-friendly form. diff --git a/tests/kotlin-parity/dumper/src/main.rs b/tests/kotlin-parity/dumper/src/main.rs index 1f3e0ce45..9240ff3c7 100644 --- a/tests/kotlin-parity/dumper/src/main.rs +++ b/tests/kotlin-parity/dumper/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin //! Parses a Kotlin source file with the Rust runtime's generated parser and //! prints the parse tree in the same diff-friendly form as //! `tests/kotlin-parity/dump_python.py`. The smoke workflow compares the two diff --git a/tests/kotlin-parity/run.sh b/tests/kotlin-parity/run.sh old mode 100755 new mode 100644 index 306cfd5d2..bc6707a63 --- a/tests/kotlin-parity/run.sh +++ b/tests/kotlin-parity/run.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin # End-to-end Kotlin parse-tree parity smoke. Generates Python and Rust parsers # from the antlr/grammars-v4 Kotlin grammar, parses every snippet under # tests/kotlin-parity/snippets/*.kt and script-snippets/*.kts with both, and diff --git a/tests/typescript-parity/dumper/src/main.rs b/tests/typescript-parity/dumper/src/main.rs index fd72618e2..3df750912 100644 --- a/tests/typescript-parity/dumper/src/main.rs +++ b/tests/typescript-parity/dumper/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin #![allow(clippy::disallowed_methods)] use std::env; diff --git a/tests/typescript-parity/dumper/src/typescript_lexer_base.rs b/tests/typescript-parity/dumper/src/typescript_lexer_base.rs index 9fdbcd1e4..2d1701cb6 100644 --- a/tests/typescript-parity/dumper/src/typescript_lexer_base.rs +++ b/tests/typescript-parity/dumper/src/typescript_lexer_base.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr4_runtime::{CharStream, DEFAULT_CHANNEL, LexerSemCtx, Token, TokenView}; use crate::generated::type_script_lexer::{ diff --git a/tests/typescript-parity/dumper/src/typescript_parser_base.rs b/tests/typescript-parity/dumper/src/typescript_parser_base.rs index e19a02c7e..7ca24ffa8 100644 --- a/tests/typescript-parity/dumper/src/typescript_parser_base.rs +++ b/tests/typescript-parity/dumper/src/typescript_parser_base.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use antlr4_runtime::{HIDDEN_CHANNEL, ParserSemCtx, Token, TokenSource}; use crate::generated::type_script_parser::{ diff --git a/tests/typescript-parity/run.sh b/tests/typescript-parity/run.sh old mode 100755 new mode 100644 index 1bc0f5eca..d9716f84c --- a/tests/typescript-parity/run.sh +++ b/tests/typescript-parity/run.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/tools/fixed-lookahead-bench/bench.py b/tools/fixed-lookahead-bench/bench.py index e8bfee289..f1667982e 100644 --- a/tools/fixed-lookahead-bench/bench.py +++ b/tools/fixed-lookahead-bench/bench.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin """Same-machine interleaved A/B benchmark: baseline vs --fixed-lookahead. Driven by run.sh (env: GRAMMARS_DIR, DRIVER_BIN). For each corpus file the diff --git a/tools/fixed-lookahead-bench/run.sh b/tools/fixed-lookahead-bench/run.sh old mode 100755 new mode 100644 index a10275f08..a700f6be9 --- a/tools/fixed-lookahead-bench/run.sh +++ b/tools/fixed-lookahead-bench/run.sh @@ -1,4 +1,6 @@ #!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin # Differential validation + A/B benchmark for `--fixed-lookahead` (issue #150). # # For each target grammar (Thrift, EDN, Rego from antlr/grammars-v4) this diff --git a/tools/grammar-frontend/update-interp-fixtures.sh b/tools/grammar-frontend/update-interp-fixtures.sh old mode 100755 new mode 100644 index cfddcf584..12fe5825d --- a/tools/grammar-frontend/update-interp-fixtures.sh +++ b/tools/grammar-frontend/update-interp-fixtures.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" diff --git a/tools/grammar-frontend/update-stage0.sh b/tools/grammar-frontend/update-stage0.sh old mode 100755 new mode 100644 index 580f89154..17c509bf3 --- a/tools/grammar-frontend/update-stage0.sh +++ b/tools/grammar-frontend/update-stage0.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail usage() { diff --git a/tools/parse-bench/compare.py b/tools/parse-bench/compare.py old mode 100755 new mode 100644 index a44d97c92..1cd8c575a --- a/tools/parse-bench/compare.py +++ b/tools/parse-bench/compare.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin """Compare two parse-benchmark JSON reports and fail on Rust regressions.""" from __future__ import annotations diff --git a/tools/parse-bench/run.py b/tools/parse-bench/run.py old mode 100755 new mode 100644 index b74559e99..4afc979ba --- a/tools/parse-bench/run.py +++ b/tools/parse-bench/run.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin """Generate ANTLR parsers and benchmark parse throughput across runtimes.""" from __future__ import annotations diff --git a/tools/parse-bench/rust-support/csharp_lexer_base.rs b/tools/parse-bench/rust-support/csharp_lexer_base.rs index fded1d161..f158f322f 100644 --- a/tools/parse-bench/rust-support/csharp_lexer_base.rs +++ b/tools/parse-bench/rust-support/csharp_lexer_base.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026 Konstantin Vyatkin use std::collections::BTreeSet; use antlr4_runtime::{CharStream, EOF, HIDDEN_CHANNEL, LexerLifecycleCtx, LexerSemCtx}; diff --git a/tools/parse-bench/test_run.py b/tools/parse-bench/test_run.py index c0b416740..09841270a 100644 --- a/tools/parse-bench/test_run.py +++ b/tools/parse-bench/test_run.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin import contextlib import importlib.util import io diff --git a/tools/release/check-workspace-version.sh b/tools/release/check-workspace-version.sh old mode 100755 new mode 100644 index dd4e61044..b452d72d1 --- a/tools/release/check-workspace-version.sh +++ b/tools/release/check-workspace-version.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" diff --git a/tools/release/preflight-package-archives.sh b/tools/release/preflight-package-archives.sh old mode 100755 new mode 100644 index 6d7dd7f78..9e273a6bc --- a/tools/release/preflight-package-archives.sh +++ b/tools/release/preflight-package-archives.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail if [[ "$#" -ne 0 ]]; then diff --git a/tools/release/registry-smoke.sh b/tools/release/registry-smoke.sh old mode 100755 new mode 100644 index 5cc86d0e2..26eba4859 --- a/tools/release/registry-smoke.sh +++ b/tools/release/registry-smoke.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail if [[ "$#" -ne 1 ]]; then diff --git a/tools/release/verify-package-contents.sh b/tools/release/verify-package-contents.sh old mode 100755 new mode 100644 index e143e5cfb..f7d664bc5 --- a/tools/release/verify-package-contents.sh +++ b/tools/release/verify-package-contents.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail if [[ "$#" -ne 1 ]]; then diff --git a/tools/rust-syntax/update-generated.sh b/tools/rust-syntax/update-generated.sh old mode 100755 new mode 100644 index 8d262ac3d..a504029e5 --- a/tools/rust-syntax/update-generated.sh +++ b/tools/rust-syntax/update-generated.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail usage() { diff --git a/tools/toml-syntax/update-generated.sh b/tools/toml-syntax/update-generated.sh old mode 100755 new mode 100644 index 64d52c11c..da5171f0b --- a/tools/toml-syntax/update-generated.sh +++ b/tools/toml-syntax/update-generated.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Konstantin Vyatkin set -euo pipefail usage() { From c104b0f49bf8156e983f13b727e5a11a9c490e80 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Wed, 12 Aug 2026 11:06:38 +0200 Subject: [PATCH 2/3] chore: restore executable bits on scripts stripped by pre-commit hook --- tests/javascript-parity/dump_python.py | 0 tests/javascript-parity/run.sh | 0 tests/kotlin-parity/dump_python.py | 0 tests/kotlin-parity/run.sh | 0 tests/typescript-parity/run.sh | 0 tools/fixed-lookahead-bench/bench.py | 0 tools/fixed-lookahead-bench/run.sh | 0 tools/grammar-frontend/update-interp-fixtures.sh | 0 tools/grammar-frontend/update-stage0.sh | 0 tools/parse-bench/compare.py | 0 tools/parse-bench/run.py | 0 tools/parse-bench/test_run.py | 0 tools/release/check-workspace-version.sh | 0 tools/release/preflight-package-archives.sh | 0 tools/release/registry-smoke.sh | 0 tools/release/verify-package-contents.sh | 0 tools/rust-syntax/update-generated.sh | 0 tools/toml-syntax/update-generated.sh | 0 18 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/javascript-parity/dump_python.py mode change 100644 => 100755 tests/javascript-parity/run.sh mode change 100644 => 100755 tests/kotlin-parity/dump_python.py mode change 100644 => 100755 tests/kotlin-parity/run.sh mode change 100644 => 100755 tests/typescript-parity/run.sh mode change 100644 => 100755 tools/fixed-lookahead-bench/bench.py mode change 100644 => 100755 tools/fixed-lookahead-bench/run.sh mode change 100644 => 100755 tools/grammar-frontend/update-interp-fixtures.sh mode change 100644 => 100755 tools/grammar-frontend/update-stage0.sh mode change 100644 => 100755 tools/parse-bench/compare.py mode change 100644 => 100755 tools/parse-bench/run.py mode change 100644 => 100755 tools/parse-bench/test_run.py mode change 100644 => 100755 tools/release/check-workspace-version.sh mode change 100644 => 100755 tools/release/preflight-package-archives.sh mode change 100644 => 100755 tools/release/registry-smoke.sh mode change 100644 => 100755 tools/release/verify-package-contents.sh mode change 100644 => 100755 tools/rust-syntax/update-generated.sh mode change 100644 => 100755 tools/toml-syntax/update-generated.sh diff --git a/tests/javascript-parity/dump_python.py b/tests/javascript-parity/dump_python.py old mode 100644 new mode 100755 diff --git a/tests/javascript-parity/run.sh b/tests/javascript-parity/run.sh old mode 100644 new mode 100755 diff --git a/tests/kotlin-parity/dump_python.py b/tests/kotlin-parity/dump_python.py old mode 100644 new mode 100755 diff --git a/tests/kotlin-parity/run.sh b/tests/kotlin-parity/run.sh old mode 100644 new mode 100755 diff --git a/tests/typescript-parity/run.sh b/tests/typescript-parity/run.sh old mode 100644 new mode 100755 diff --git a/tools/fixed-lookahead-bench/bench.py b/tools/fixed-lookahead-bench/bench.py old mode 100644 new mode 100755 diff --git a/tools/fixed-lookahead-bench/run.sh b/tools/fixed-lookahead-bench/run.sh old mode 100644 new mode 100755 diff --git a/tools/grammar-frontend/update-interp-fixtures.sh b/tools/grammar-frontend/update-interp-fixtures.sh old mode 100644 new mode 100755 diff --git a/tools/grammar-frontend/update-stage0.sh b/tools/grammar-frontend/update-stage0.sh old mode 100644 new mode 100755 diff --git a/tools/parse-bench/compare.py b/tools/parse-bench/compare.py old mode 100644 new mode 100755 diff --git a/tools/parse-bench/run.py b/tools/parse-bench/run.py old mode 100644 new mode 100755 diff --git a/tools/parse-bench/test_run.py b/tools/parse-bench/test_run.py old mode 100644 new mode 100755 diff --git a/tools/release/check-workspace-version.sh b/tools/release/check-workspace-version.sh old mode 100644 new mode 100755 diff --git a/tools/release/preflight-package-archives.sh b/tools/release/preflight-package-archives.sh old mode 100644 new mode 100755 diff --git a/tools/release/registry-smoke.sh b/tools/release/registry-smoke.sh old mode 100644 new mode 100755 diff --git a/tools/release/verify-package-contents.sh b/tools/release/verify-package-contents.sh old mode 100644 new mode 100755 diff --git a/tools/rust-syntax/update-generated.sh b/tools/rust-syntax/update-generated.sh old mode 100644 new mode 100755 diff --git a/tools/toml-syntax/update-generated.sh b/tools/toml-syntax/update-generated.sh old mode 100644 new mode 100755 From ac76fafd0a514754eb6b5bc11e816c73c490d443 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Wed, 12 Aug 2026 13:05:45 +0200 Subject: [PATCH 3/3] chore: scope license headers to files this project actually owns Three corrections from review of the initial header sweep: - Drop headers from the rust-support fixture tree. Those files are pinned byte-level reproductions of grammars-v4 (each documents its upstream commit and blob), so a sole-copyright notice misstates their provenance. The bundle is sha256-fingerprinted precisely to catch content drift, and the headers broke noninteractive_bundle_requires_its_exact_fingerprint. - antlr-rust-toml-parser publishes as Apache-2.0 (its recognizers derive from the ASF-licensed grammars-v4 TOML grammar), so its sources carry an Apache-2.0 identifier. A BSD-3-Clause header there would contradict the crate's own metadata and packaged LICENSE/NOTICE. - Restore 100644 on dump_python.py, bench.py, and test_run.py. Re-adding the executable bit stripped by the pre-commit hook over-corrected these three, which were never executable; test_run.py in particular is an importable pytest module with no shebang. --- .../antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs | 2 -- .../antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py | 2 -- .../antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py | 2 -- crates/antlr-rust-toml-parser/src/ast.rs | 2 +- crates/antlr-rust-toml-parser/src/decode.rs | 2 +- crates/antlr-rust-toml-parser/src/lib.rs | 2 +- crates/antlr-rust-toml-parser/src/string.rs | 2 +- tests/kotlin-parity/dump_python.py | 0 tools/fixed-lookahead-bench/bench.py | 0 tools/parse-bench/test_run.py | 0 10 files changed, 4 insertions(+), 10 deletions(-) mode change 100755 => 100644 tests/kotlin-parity/dump_python.py mode change 100755 => 100644 tools/fixed-lookahead-bench/bench.py mode change 100755 => 100644 tools/parse-bench/test_run.py diff --git a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs index e2352d51b..b1b2e146f 100644 --- a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs +++ b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/c_parser_base.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright (c) 2026 Konstantin Vyatkin #![allow(dead_code)] use std::cell::Cell; diff --git a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py index f53c9af04..47993f6e2 100644 --- a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py +++ b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/c/Rust/transformGrammar.py @@ -1,5 +1,3 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright (c) 2026 Konstantin Vyatkin """Pinned execution surface from grammars-v4 c/Rust/transformGrammar.py. Source commit: 42b1ea521705c126d84331186b221c9819db1058 diff --git a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py index 81e975f44..6a535924c 100644 --- a/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py +++ b/crates/antlr-rust-codegen/tests/fixtures/antlr4-rust-gen/rust-support/java/Rust/transformGrammar.py @@ -1,5 +1,3 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright (c) 2026 Konstantin Vyatkin """Pinned execution surface from grammars-v4 java/java/Rust/transformGrammar.py. Source commit: 42b1ea521705c126d84331186b221c9819db1058 diff --git a/crates/antlr-rust-toml-parser/src/ast.rs b/crates/antlr-rust-toml-parser/src/ast.rs index 8f0687a80..b375a6002 100644 --- a/crates/antlr-rust-toml-parser/src/ast.rs +++ b/crates/antlr-rust-toml-parser/src/ast.rs @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: BSD-3-Clause +// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2026 Konstantin Vyatkin #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct Document { diff --git a/crates/antlr-rust-toml-parser/src/decode.rs b/crates/antlr-rust-toml-parser/src/decode.rs index 520fa438b..cf78148f8 100644 --- a/crates/antlr-rust-toml-parser/src/decode.rs +++ b/crates/antlr-rust-toml-parser/src/decode.rs @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: BSD-3-Clause +// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2026 Konstantin Vyatkin use std::fmt; use std::sync::{Arc, Mutex}; diff --git a/crates/antlr-rust-toml-parser/src/lib.rs b/crates/antlr-rust-toml-parser/src/lib.rs index 7cc56eebc..cc29bbd6a 100644 --- a/crates/antlr-rust-toml-parser/src/lib.rs +++ b/crates/antlr-rust-toml-parser/src/lib.rs @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: BSD-3-Clause +// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2026 Konstantin Vyatkin //! Checked-in TOML recognizers and a decoded syntax facade. //! diff --git a/crates/antlr-rust-toml-parser/src/string.rs b/crates/antlr-rust-toml-parser/src/string.rs index 656f874b0..8c57cb888 100644 --- a/crates/antlr-rust-toml-parser/src/string.rs +++ b/crates/antlr-rust-toml-parser/src/string.rs @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: BSD-3-Clause +// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2026 Konstantin Vyatkin use super::Error; diff --git a/tests/kotlin-parity/dump_python.py b/tests/kotlin-parity/dump_python.py old mode 100755 new mode 100644 diff --git a/tools/fixed-lookahead-bench/bench.py b/tools/fixed-lookahead-bench/bench.py old mode 100755 new mode 100644 diff --git a/tools/parse-bench/test_run.py b/tools/parse-bench/test_run.py old mode 100755 new mode 100644