How maddenp/nml works
Main Components
a. Input Processing Layer:
• File Input Handler (stdin/file)
• Command-line Arguments Parser
• Input Validation Component
b. Core Processing Layer:
• Namelist Parser (using Instaparse)
• Query Engine (for --get operations)
• Modification Engine (for --set operations)
• Format Converter (for different output formats)
c. Output Processing Layer:
• File Output Handler (stdout/file)
• Format Handlers (namelist/JSON/bash/ksh)
Component Relationships
• Input → Parser → Core Processing → Output
• Parallel paths for different operations (get/set)
• Format conversion as a separate branch in the output stage
Specific Implementation Details
• Grammar Processing (src/grammar directory)
• Core Logic (src/nml/core.clj)
• Version Management (src/version)
• Test Framework (test directory)
Architectural Patterns to Highlight
• Pipeline Pattern: Show the linear flow of data transformation
• Strategy Pattern: For different output formats
• Command Pattern: For handling different operations (get/set)
Technical Stack Elements
• Clojure Runtime
• Instaparse Parser
• GraalVM Native Image (optional compilation path)
• File System Interface
[Input Sources] → [Command Parser] → [Input Validator]
• ↓
[Grammar Rules] → [Instaparse Parser] → [Core Engine] → [Format Converter] → [Output Handler]
• ↓
• [Operation Handlers]
• Query Engine
• Modification Engine
Clojure → GraalVM → Native Binary
This will help developers understand both the runtime behavior and the build/deployment options.