Getting Started with VB6Semantic
Add VB6Semantic to your analysis pipeline by including it as a dependency. It works with parsed VB6 project files from vb6parse to produce fully-resolved symbol tables, scopes, and type information.
Analyzing a Project
use vb6semantic::SemanticAnalyzer;
use vb6parse::io::SourceFile;
use vb6parse::files::ProjectFile;
let mut analyzer = SemanticAnalyzer::new();
let project_source =
SourceFile::from_file("MyProject.vbp").expect("Failed to read project file");
let (project_opt, failures) = ProjectFile::parse(&project_source).unpack();
if !failures.is_empty() {
eprintln!("Failed to parse project file: {:?}", failures);
return;
}
let project = project_opt.expect("Project file should have parsed successfully");
let analysis_result =
analyzer.analyze_project(&project).expect("Failed to analyze project");
println!(
"Analysis completed with {} errors and {} warnings",
analysis_result.errors.len(),
analysis_result.warnings.len()
);
Supported File Types
| File Type | Analyzer Entry Point |
|---|---|
.vbp Project files |
analyze_project |
.cls Class modules |
analyze_class |
.bas Code modules |
analyze_module |
.frm Forms |
analyze_form |