# iamzhz/abandon architecture

> Architecture diagram of the GitHub repository iamzhz/abandon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iamzhz/abandon
- Repository: https://github.com/iamzhz/abandon

## Overview

##### Project type and purpose
- This is a compiler front-end (and partial back-end) for a toy language named “Abandon.”
- README tells us it lexes, parses, builds an AST/IR, performs semantic checks, and emits or interprets code.

##### File structure
- Top-level “src/” contains all components, each in its own subfolder:
- CmdLineParser – command-line argument parsing
- FileManager – file I/O and buffering
- Lexer – tokenizes source text
- Parser – produces AST from tokens
- IR – intermediate representation structures
- Tree – AST node definitions and helpers
- SymbolTable – manages scopes and symbol lookups
- PointerManager – handles pointer/reference semantics
- SayError – error-reporting routines
- debug – debug logging and trace utilities
- .h, main.cc – central includes and program entry point
- A makefile at the root shows the single-binary build.
- “doc/” contains markdown documentation for each subsystem.

##### README for additional insights
- Confirms the pipeline: source → lexer → parser → semantic (symbol/pointer) → IR → output.
- No external services—purely in-process modules.

## Diagram (Mermaid)

```mermaid
graph TB
    CLI["CLI Interface"]:::io
    File["File Manager"]:::io
    Lexer["Lexer"]:::transform
    Tokens["Token Stream"]:::transform
    Parser["Parser"]:::transform
    AST["AST (Tree)"]:::transform
    subgraph "Semantic Analyzer"
        Symbol["SymbolTable"]:::support
        Pointer["PointerManager"]:::support
    end
    IR["IR Generator"]:::transform
    Error["Error Reporter (SayError)"]:::support
    Debug["Debug Utilities"]:::support
    Make["Makefile & Build"]:::support

    CLI --> File
    File --> Lexer
    Lexer --> Tokens
    Tokens --> Parser
    Parser --> AST
    AST --> Symbol
    AST --> Pointer
    Symbol --> IR
    Pointer --> IR

    File -.->|errors| Error
    Lexer -.->|errors| Error
    Parser -.->|errors| Error
    Symbol -.->|errors| Error
    Pointer -.->|errors| Error
    IR -.->|errors| Error

    File -.->|debug| Debug
    Lexer -.->|debug| Debug
    Parser -.->|debug| Debug
    Symbol -.->|debug| Debug
    Pointer -.->|debug| Debug
    IR -.->|debug| Debug

    click CLI "https://github.com/iamzhz/abandon/blob/main/src/CmdLineParser/CmdLineParser.cc"
    click File "https://github.com/iamzhz/abandon/blob/main/src/FileManager/FileManager.cc"
    click Lexer "https://github.com/iamzhz/abandon/blob/main/src/Lexer/Lexer.cc"
    click Tokens "https://github.com/iamzhz/abandon/blob/main/src/Token/Token.cc"
    click Parser "https://github.com/iamzhz/abandon/blob/main/src/Parser/Parser.cc"
    click AST "https://github.com/iamzhz/abandon/blob/main/src/Tree/Tree.cc"
    click Symbol "https://github.com/iamzhz/abandon/blob/main/src/SymbolTable/SymbolTable.cc"
    click Pointer "https://github.com/iamzhz/abandon/blob/main/src/PointerManager/PointerManager.cc"
    click IR "https://github.com/iamzhz/abandon/blob/main/src/IR/IR.cc"
    click Error "https://github.com/iamzhz/abandon/blob/main/src/SayError/SayError.cc"
    click Debug "https://github.com/iamzhz/abandon/blob/main/src/debug/debug.cc"
    click Make "https://github.com/iamzhz/abandon/tree/main/Makefile"

    classDef io fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef transform fill:#90EE90,stroke:#000,stroke-width:1px
    classDef support fill:#FFFFE0,stroke:#000,stroke-width:1px
```
