How sindrip/analysis-tool works
Main Components
a) Frontend Layer:
• Blazor Web Application (WebApplication project)
• Component-based UI structure
• JavaScript interop capabilities
b) Analysis Core:
• Parser Component (Parser project)
• Abstract Syntax Tree (AST) Component
• Control Flow Graph (CFG) Component
• Analysis Implementations:
• Available Expressions
• Detection of Signs
• Faint Variables
• Interval Analysis
• Live Variables
• Reaching Definitions
c) Infrastructure:
• Docker containerization
• GitHub Actions CI/CD pipeline
• Heroku deployment
[Web Interface Layer]
• ↓ ↑
[Analysis Service Layer]
• ↓ ↑
[Core Analysis Layer]
• ↓ ↑
[Parser Layer]
Component Relationships to Highlight
a) Data Flow:
• Source code input → Parser → AST → CFG → Analysis Engines
• Analysis Results → Analysis Service → Web Interface
• User Interface → Analysis Service → Analysis Engines
b) Key Interactions:
• Parser to AST transformation
• AST to CFG conversion
• Analysis implementations utilizing the Worklist algorithm
• Web components communicating with Analysis Service
Detailed Component Breakdown
a) Parser Section:
[MicroC Grammar (.g4)] → [Generated Parser] → [Parse Visitor]
• ↓
• [Symbol Table Handler]
b) Analysis Core:
[AST Components] → [CFG Generator] → [Analysis Framework]
• ↓
• [Individual Analysis Implementations]
c) Web Interface:
[Blazor Components] ↔ [Analysis Service] ↔ [State Management]
Implementation Details
• Different analysis types as parallel components
• Worklist algorithm implementation
• Lattice-based analysis structure
• Relationship between different expression types (AExpr, BExpr)