How dark-codex/horizon works
Main Components
a) Lexical Analysis Layer
• Lexer component (src/lexer)
• Token handling (src/token and src/token_type)
b) Parsing Layer
• Parser component (src/parser)
• AST (Abstract Syntax Tree) representation (src/parser/ast)
• Reference the grammar file (src/parser/grammar.gr)
c) Error Handling System
• Error management component (src/errors)
d) Core Infrastructure
• Entry point system (src/entry)
• System (src/defines)
• Colorization support (src/colorize)
e) Utility Layer
• File handling (src/misc/file)
• Memory management
• Support utilities
Component Relationships
Input Source (.hr files)
• ↓
[Lexical Analysis]
• Token Generation
• Token Classification
• ↓
[Parsing]
• AST Construction
• Grammar Rules
• ↓
[Semantic Analysis]
• Type Checking
• ↓
[Code Generation/Execution]
Important Architectural Elements to Highlight
• The dependency management system (deps/ directory)
• Custom implementations of core data structures (pair, sptr, string, vector)
• The error handling system's integration points
• The colorization system for output formatting
• File handling and management system
Technical Details
• Build system integration (CMake)
• Development tools configuration (.clang-format, .clang-tidy)
• CI/CD pipeline (.github/workflows)