use std::path::Path;
use tree_sitter::Node;

use crate::analyzers::ast_analyzer::AstAnalyzer;
use crate::types::Vulnerability;

/// Trait for language-specific analysis logic
pub trait LanguageAnalyzer {
    /// Check a specific AST node for vulnerabilities
    fn check_node(
        &self,
        node: &Node,
        source: &str,
        file_path: &Path,
        analyzer: &AstAnalyzer,
    ) -> Option<Vulnerability>;
}

// Core languages with tree-sitter AST support
pub mod javascript;
pub mod python;
pub mod go;
pub mod java;
pub mod rust;
pub mod cpp;
pub mod csharp;
pub mod php;
pub mod ruby;
pub mod shell;
pub mod lua;

// Additional languages using regex-only detection
pub mod kotlin;
pub mod swift;
pub mod dart;
pub mod scala;
pub mod perl;
pub mod objective_c;
pub mod haskell;
pub mod elixir;
pub mod r;
pub mod groovy;
pub mod fsharp;
pub mod clojure;
pub mod solidity;

// Re-export analyzers for easier access
pub use kotlin::KotlinAnalyzer;
pub use swift::SwiftAnalyzer;
pub use dart::DartAnalyzer;
pub use scala::ScalaAnalyzer;
pub use perl::PerlAnalyzer;
pub use objective_c::ObjectiveCAnalyzer;
pub use haskell::HaskellAnalyzer;
pub use elixir::ElixirAnalyzer;
pub use r::RAnalyzer;
pub use groovy::GroovyAnalyzer;
pub use fsharp::FSharpAnalyzer;
pub use clojure::ClojureAnalyzer;
pub use solidity::SolidityAnalyzer;
