Swift Code Generators
AST-based code generation tools that parse Swift source files and emit test/view boilerplate
Overview
ViewGenerator and VIPTestsGenerator are command-line tools that parse Swift source files using the swift-ast library and generate boilerplate code. ViewGenerator creates UIView/UITableViewCell/UICollectionViewCell scaffolding with SnapKit constraints via an interactive terminal UI. VIPTestsGenerator reads VIP architecture scene files, parses protocol declarations from the AST, and auto-generates XCTest files with mock injectors for each VIP boundary.
Highlights
- Applied compiler theory to developer tooling: parse Swift source into ASTs and emit type-correct test boilerplate as a compiler phase problem
- Designed a protocol-oriented AST abstraction layer that adapts third-party parser output into a minimal domain-specific tree
- Implemented intelligent type synthesis for mock generation: Bool for void methods, direct types for single-param, synthesized tuples for multi-param
- Built an interactive terminal UI from scratch using raw termios mode, ANSI escape sequences, and a character-level state machine
Related Projects
ArgPar
Annotation-driven CLI argument parsing library for Java using reflection
Designed a declarative annotation-driven CLI parsing library (~548 lines) that eliminates all imperative parsing boilerplate
LintLokalization
Multi-threaded localization key validator for iOS/macOS/Android with IDE-native diagnostics
Multi-threaded CLI tool with manual thread pool, semaphore synchronization, and zero-contention work partitioning