pub trait LanguageParser: Send + Sync {
// Required methods
fn extensions(&self) -> &[&str];
fn extract_symbols(
&self,
source: &[u8],
file_path: &Path,
) -> Result<Vec<Symbol>>;
fn extract_calls(
&self,
source: &[u8],
file_path: &Path,
) -> Result<Vec<RawCallEdge>>;
fn extract_types(
&self,
source: &[u8],
file_path: &Path,
) -> Result<Vec<TypeInfo>>;
fn extract_imports(
&self,
source: &[u8],
file_path: &Path,
) -> Result<Vec<Import>>;
// Provided method
fn parse_file(
&self,
source: &[u8],
file_path: &Path,
) -> Result<FileAnalysis> { ... }
}Expand description
Trait implemented by each language-specific parser.