How pascalh/astview works
Main Components
a) GUI Layer (src/gui/)
• Main window interface
• Menu system
• Source code editor
• Tree visualization component
b) Core Layer (src/core/)
• Language parsers
• AST data structures
• Source location handling
c) Language-Specific Components
• Haskell parser
• Python parser
• Extensible language support system
Key Architectural Elements
┌─────────────────────────────────────────┐
• GUI Layer │
• ┌─────────────┐ ┌──────────────────┐ │
• Editor │ │ Tree Viewer │ │
• ┘ └──────────────────┘ │
• ┤
• Core Layer │
• ┌─────────────┐ ┌──────────────────┐ │
• AST Manager │ │ Language Parsers │ │
• ┘ └──────────────────┘ │
• ┤
• Language-Specific Layer │
• ┌─────────────┐ ┌──────────────────┐ │
• Haskell │ │ Python │ │
• ┘ └──────────────────┘ │
• ┘
Component Interactions
• User input → Editor
• Editor → AST Manager (for parsing)
• AST Manager → Language Parsers
• Language Parsers → Tree Viewer
• Tree Viewer → Source Location Handler (for navigation)
Special Features to Highlight
• File extension detection system
• Source location navigation
• Flattening functionality
• Menu system
Technical Details
Annotations showing:
• GTK for GUI (evident from GtkActions.hs)
• Stack/Cabal build system
• Test framework integration
Design Patterns to Emphasize
Following architectural patterns:
• Layered architecture (GUI/Core/Language)
• Plugin system for language support
• Model-View separation (AST data vs. visualization)