/** * @nahisaho/musubix-codegraph - AST Parser * * Tree-sitter based AST parser for code entity extraction * Enhanced with ExtractorRegistry for 16-language support (v2.3.2) * * @see REQ-CG-AST-001 - Multi-language support * @see REQ-CG-AST-002 - Entity extraction * @see REQ-CG-AST-003 - Relation extraction * @see REQ-CG-MULTILANG-001 to REQ-CG-MULTILANG-013 (v2.3.2) * @see DES-CG-002 * @see TSK-CG-003, TSK-CG-010 */ import type { Language, ParseResult, ParserOptions } from '../types.js'; /** * AST Parser using Tree-sitter * Enhanced with ExtractorRegistry for multi-language support (v2.3.2) */ export declare class ASTParser { private options; private parser; private languages; private initialized; private useExtractors; constructor(options?: Partial); /** * Initialize tree-sitter and load language grammars * Now supports 16 languages via ExtractorRegistry */ private ensureInitialized; /** * Load grammar for a specific language */ private loadGrammar; /** * Load all available grammars */ private loadAvailableGrammars; /** * Parse a source file */ parseFile(filePath: string): Promise; /** * Parse source code content * Enhanced to use ExtractorRegistry for 16-language support */ parseContent(content: string, language: Language, filePath?: string): Promise; /** * Parse using ExtractorRegistry (v2.3.2) * Supports 16 languages with unified interface */ private parseWithExtractor; /** * Parse using tree-sitter */ private parseWithTreeSitter; /** * Extract entities from AST node recursively */ private extractFromNode; /** * Extract entity from a single AST node */ private extractEntity; /** * Create entity with required metadata */ private createEntity; /** * Create relation with required weight and metadata */ private createRelation; /** * Map AST node type to entity type */ private getEntityType; /** * Find the name node within an entity node */ private findNameNode; /** * Extract docstring from node */ private extractDocstring; /** * Extract relations from node */ private extractRelations; /** * Fallback regex-based parsing * Enhanced in v3.0.7 to support all 16 languages */ private parseWithRegex; /** * Extract TypeScript/JavaScript entities (v3.0.7) */ private extractTypeScriptEntities; /** * Extract Python entities (v3.0.7) */ private extractPythonEntities; /** * Extract C/C++ entities (v3.0.7) */ private extractCEntities; /** * Extract Rust entities (v3.0.7) */ private extractRustEntities; /** * Extract Go entities (v3.0.7) */ private extractGoEntities; /** * Extract Java entities (v3.0.7) */ private extractJavaEntities; /** * Extract C# entities (v3.0.7) */ private extractCSharpEntities; /** * Extract PHP entities (v3.0.7) */ private extractPhpEntities; /** * Extract Ruby entities (v3.0.7) */ private extractRubyEntities; /** * Extract Kotlin entities (v3.0.7) */ private extractKotlinEntities; /** * Extract Swift entities (v3.0.7) */ private extractSwiftEntities; /** * Extract Scala entities (v3.0.7) */ private extractScalaEntities; /** * Extract Lua entities (v3.0.7) */ private extractLuaEntities; /** * Extract HCL (Terraform) entities (v3.0.7) */ private extractHclEntities; /** * Get supported languages * Now returns all 16 supported languages (v2.3.2) */ getSupportedLanguages(): Language[]; /** * Check if a language is supported */ isLanguageSupported(language: Language): boolean; /** * Preload all extractors for faster parsing */ preloadExtractors(): Promise; } //# sourceMappingURL=ast-parser.d.ts.map