5.5 KiB
5.5 KiB
SDL3 Parser - Project Structure
parser/
├── README.md # Project overview and quick start
├── build.zig # Build configuration
├── build.zig.zon # Dependencies
│
├── src/ # Source code (900 lines)
│ ├── parser.zig # Main entry point, CLI
│ ├── patterns.zig # Pattern matching & scanning
│ ├── types.zig # C to Zig type conversion
│ ├── naming.zig # Naming convention handling
│ ├── codegen.zig # Zig code generation
│ ├── mock_codegen.zig # C mock generation
│ └── dependency_resolver.zig # Dependency analysis (NEW)
│
├── test/ # Test files
│ ├── integration/ # Integration tests
│ │ ├── test_multifield_*.zig
│ │ ├── test_typedef_*.zig
│ │ └── test_flow_*.zig
│ └── (pattern test files)
│
├── docs/ # Documentation (5,500+ lines)
│ ├── INDEX.md # Documentation index
│ │
│ ├── GETTING_STARTED.md # Installation and first use
│ ├── QUICKSTART.md # Quick reference
│ ├── API_REFERENCE.md # Command-line options
│ │
│ ├── ARCHITECTURE.md # System design
│ ├── DEPENDENCY_RESOLUTION.md # How deps work
│ ├── KNOWN_ISSUES.md # Limitations
│ │
│ ├── DEVELOPMENT.md # Contributing guide
│ ├── ROADMAP.md # Future plans
│ │
│ ├── DEPENDENCY_FLOW.md # Technical deep dive
│ ├── VISUAL_FLOW.md # Flow diagrams
│ ├── MULTI_FIELD_IMPLEMENTATION.md
│ ├── TYPEDEF_IMPLEMENTATION.md
│ ├── MULTI_HEADER_TEST_RESULTS.md
│ │
│ └── archive/ # Historical documents
│ └── (planning and status docs)
│
└── zig-out/ # Build artifacts
└── bin/sdl-parser # Executable
Documentation Organization
User Documentation (Start Here)
- README.md - Project overview
- GETTING_STARTED.md - Tutorial
- QUICKSTART.md - Quick reference
- API_REFERENCE.md - Complete reference
Technical Documentation
- ARCHITECTURE.md - System design
- DEPENDENCY_RESOLUTION.md - Feature details
- DEPENDENCY_FLOW.md - Implementation walkthrough
- VISUAL_FLOW.md - Diagrams
Development Documentation
- DEVELOPMENT.md - Contributing guide
- KNOWN_ISSUES.md - Current limitations
- ROADMAP.md - Future plans
Implementation Documentation
- MULTI_FIELD_IMPLEMENTATION.md - Struct parsing
- TYPEDEF_IMPLEMENTATION.md - Typedef support
- MULTI_HEADER_TEST_RESULTS.md - Test results
Source Code Organization
Core Pipeline
parser.zig (main)
↓
patterns.zig (scan)
↓
dependency_resolver.zig (resolve)
↓
codegen.zig (generate)
↓
Output (Zig/C)
Supporting Modules
types.zig- Type conversion utilitiesnaming.zig- Naming convention utilitiesmock_codegen.zig- C mock generation
Build Outputs
Local Build
zig-out/
├── bin/
│ └── sdl-parser # Executable
└── (test outputs)
Integration with lib/sdl3
lib/sdl3/
├── v2/ # Generated bindings
│ ├── gpu.zig # SDL_gpu.h bindings
│ ├── video.zig # SDL_video.h (if working)
│ └── ...
└── zig-out/
├── gpu_test.zig # Test bindings
└── gpu_test_mock.c # Test mocks
Test Organization
Unit Tests (in source files)
Each src/*.zig file contains tests at the bottom:
- Pattern matching tests
- Type conversion tests
- Naming convention tests
Integration Tests (test/integration/)
test_multifield_*.zig- Multi-field struct parsingtest_typedef_*.zig- Typedef scanningtest_flow_*.zig- Dependency resolutiontest_*.c- Test input files
Running Tests
# All tests
zig build test
# Specific test file
zig test test/integration/test_typedef_simple.zig
Documentation Categories
For Users
- Getting started, quickstart, API reference
- Focus: How to use the tool
For Understanding
- Architecture, dependency resolution
- Focus: How it works internally
For Developers
- Development guide, implementation docs
- Focus: How to extend and contribute
For Reference
- Technical deep dives, flow diagrams
- Focus: Complete implementation details
File Size Reference
Source Code
- Total: ~900 lines production code
- Average: ~150 lines per module
- Largest: dependency_resolver.zig (454 lines)
Documentation
- Total: ~5,500 lines
- User guides: ~1,500 lines
- Technical docs: ~2,500 lines
- Implementation details: ~1,500 lines
Tests
- Unit tests: ~400 lines (in source files)
- Integration tests: ~500 lines (separate files)
- Total: ~900 lines
Quick Navigation
# Main documentation entry point
cat README.md
# Start tutorial
cat docs/GETTING_STARTED.md
# Command reference
cat docs/API_REFERENCE.md
# Understand internals
cat docs/ARCHITECTURE.md
# Fix issues
cat docs/KNOWN_ISSUES.md
# Contribute
cat docs/DEVELOPMENT.md
# All docs
ls docs/
Last Updated: 2026-01-22
Documentation Version: 2.1
Status: Clean and organized ✅