# xwasoux/astars architecture

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

- Interactive diagram: https://gitdiagram.com/xwasoux/astars
- Repository: https://github.com/xwasoux/astars

## Overview

##### (minimal) file structure
- Top level only contains `.gitignore` and `README.md`.
- We infer that the real code lives under `src/` or `lib/` directories (even if not shown).
- Expect subfolders for language grammars, parser implementations, analysis rules, and the CLI entrypoint.

##### README for additional insights
- No detailed architecture is spelled out.
- Keywords “unified parser” and “analyse AST” imply two major subsystems: parsing and analysis.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% I/O Layer
    CLI["CLI / API Layer"]:::io
    Loader["Input Loader"]:::io

    %% Extension Points
    Plugin["Plugin/Grammar Registry"]:::ext
    Config["Configuration Manager"]:::ext

    %% Core Engine
    subgraph "Parser Engine"
        direction TB
        Tokenizer["Lexical Analyzer (Tokenizer)"]:::core
        Parser["Parser"]:::core
        ASTBuilder["AST Builder (Unified AST)"]:::core
    end

    Analysis["AST Analysis Module"]:::core

    %% Reporting
    subgraph "Output/Reporting"
        direction TB
        JSON["JSON Formatter"]:::io
        Text["Human-readable Text"]:::io
        HTML["HTML Report Generator"]:::io
    end

    %% Data Flow
    CLI -->|"source code, flags"| Loader
    Loader -->|"raw code"| Tokenizer
    Tokenizer -->|"tokens"| Parser
    Parser -->|"parse tree"| ASTBuilder
    ASTBuilder -->|"AST"| Analysis
    Analysis -->|"analysis results"| JSON
    Analysis -->|"analysis results"| Text
    Analysis -->|"analysis results"| HTML

    %% Plugin and Config integration
    Plugin -->|"language definitions"| Tokenizer
    Plugin -->|"grammar plugins"| Parser
    Config -->|"settings"| Parser
    Config -->|"settings"| Analysis

    %% Styles
    classDef core fill:#cce5ff,stroke:#004085,color:#004085
    classDef ext fill:#d4edda,stroke:#155724,color:#155724
    classDef io fill:#fff3cd,stroke:#856404,color:#856404
```
