# spandan2106/aevy architecture

> Architecture diagram of the GitHub repository spandan2106/aevy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spandan2106/aevy
- Repository: https://github.com/spandan2106/aevy

## Overview

Aevy is an experimental Python-implemented programming language. Its principal workflow runs source through a command-line runner, lexer, parser, AST, and interpreter to produce program behavior. The interpreter also provides functions, classes, collections, built-ins, module imports, and text-file I/O. The README documents these capabilities; the sampled source confirms the frontend and runner wiring, but does not show every interpreter subsystem’s call paths.

Main entry points: [`src/aevy/interpreter.py`](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py) (Interpreter), [`src/aevy/__main__.py`](https://github.com/spandan2106/aevy/blob/main/src/aevy/__main__.py) (CLI Runner), [`src/aevy/parser.py`](https://github.com/spandan2106/aevy/blob/main/src/aevy/parser.py) (Parser), [`src/aevy/lexer.py`](https://github.com/spandan2106/aevy/blob/main/src/aevy/lexer.py) (Lexer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Language Frontend"]
  node_lexer["Lexer<br/>[lexer.py]"]
  node_tokens["Token Types<br/>[token.py]"]
  node_parser["Parser<br/>[parser.py]"]
  node_ast["AST Nodes<br/>[ast_nodes.py]"]
end

subgraph group_runtime["Execution Runtime"]
  node_interpreter["Interpreter<br/>[interpreter.py]"]
end

subgraph group_features["Language Features"]
  node_control["Control Flow<br/>[interpreter.py]"]
  node_functions["Functions and Classes<br/>[interpreter.py]"]
  node_collections["Lists and Dictionaries<br/>[interpreter.py]"]
  node_builtins["Standard Library<br/>[interpreter.py]"]
  node_modules["Module Imports<br/>[interpreter.py]"]
  node_fileio["Text File I/O<br/>[interpreter.py]"]
end

subgraph group_support["Run Support"]
  node_runner["CLI Runner<br/>[__main__.py]"]
  node_diagnostics["Error Formatting<br/>[diagnostics.py]"]
end

node_programmer(("Programmer"))
node_source["Aevy Source"]
node_output(("Program Output"))

node_programmer -->|"runs"| node_runner
node_source -->|"supplies source"| node_runner
node_runner -->|"tokenizes"| node_lexer
node_lexer -->|"creates tokens"| node_tokens
node_runner -->|"parses tokens"| node_parser
node_parser -->|"uses token types"| node_tokens
node_parser -->|"builds AST"| node_ast
node_runner -->|"executes program"| node_interpreter
node_interpreter -.->|"uses for imports"| node_lexer
node_interpreter -.->|"uses for imports"| node_parser
node_interpreter -->|"evaluates nodes"| node_ast
node_runner -->|"formats errors"| node_diagnostics
node_interpreter -->|"executes"| node_control
node_interpreter -->|"executes"| node_functions
node_interpreter -->|"supports"| node_collections
node_interpreter -->|"dispatches built-ins"| node_builtins
node_interpreter -->|"supports imports"| node_modules
node_interpreter -->|"provides file operations"| node_fileio
node_interpreter -->|"produces output"| node_output

click node_runner "https://github.com/spandan2106/aevy/blob/main/src/aevy/__main__.py"
click node_lexer "https://github.com/spandan2106/aevy/blob/main/src/aevy/lexer.py"
click node_tokens "https://github.com/spandan2106/aevy/blob/main/src/aevy/token.py"
click node_parser "https://github.com/spandan2106/aevy/blob/main/src/aevy/parser.py"
click node_ast "https://github.com/spandan2106/aevy/blob/main/src/aevy/ast_nodes.py"
click node_interpreter "https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py"
click node_diagnostics "https://github.com/spandan2106/aevy/blob/main/src/aevy/diagnostics.py"
click node_control "https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py"
click node_functions "https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py"
click node_collections "https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py"
click node_builtins "https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py"
click node_modules "https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py"
click node_fileio "https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lexer,node_tokens,node_parser,node_ast toneBlue
class node_interpreter toneAmber
class node_control,node_functions,node_collections,node_builtins,node_modules,node_fileio toneMint
class node_runner,node_diagnostics toneRose
class node_programmer,node_source,node_output toneIndigo
```

## Components

### Language Frontend

- [Lexer](https://github.com/spandan2106/aevy/blob/main/src/aevy/lexer.py): `src/aevy/lexer.py`
- [Token Types](https://github.com/spandan2106/aevy/blob/main/src/aevy/token.py): `src/aevy/token.py`
- [Parser](https://github.com/spandan2106/aevy/blob/main/src/aevy/parser.py): `src/aevy/parser.py`
- [AST Nodes](https://github.com/spandan2106/aevy/blob/main/src/aevy/ast_nodes.py): `src/aevy/ast_nodes.py`

### Execution Runtime

- [Interpreter](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py): `src/aevy/interpreter.py`

### Language Features

- [Control Flow](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py): `src/aevy/interpreter.py`
- [Functions and Classes](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py): `src/aevy/interpreter.py`
- [Lists and Dictionaries](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py): `src/aevy/interpreter.py`
- [Standard Library](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py): `src/aevy/interpreter.py`
- [Module Imports](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py): `src/aevy/interpreter.py`
- [Text File I/O](https://github.com/spandan2106/aevy/blob/main/src/aevy/interpreter.py): `src/aevy/interpreter.py`

### Run Support

- [CLI Runner](https://github.com/spandan2106/aevy/blob/main/src/aevy/__main__.py): `src/aevy/__main__.py`
- [Error Formatting](https://github.com/spandan2106/aevy/blob/main/src/aevy/diagnostics.py): `src/aevy/diagnostics.py`

### Other components

- **Programmer**
- **Aevy Source**
- **Program Output**

## Connections

- Programmer → CLI Runner: runs (evidence: `README.md`)
- Aevy Source → CLI Runner: supplies source (evidence: `src/aevy/__main__.py`)
- CLI Runner → Lexer: tokenizes (evidence: `src/aevy/__main__.py`)
- Lexer → Token Types: creates tokens (evidence: `src/aevy/lexer.py`)
- CLI Runner → Parser: parses tokens (evidence: `src/aevy/__main__.py`)
- Parser → Token Types: uses token types (evidence: `src/aevy/parser.py`)
- Parser → AST Nodes: builds AST (evidence: `src/aevy/parser.py`)
- CLI Runner → Interpreter: executes program (evidence: `src/aevy/__main__.py`)
- Interpreter → Lexer: uses for imports (evidence: `src/aevy/interpreter.py`)
- Interpreter → Parser: uses for imports (evidence: `src/aevy/interpreter.py`)
- Interpreter → AST Nodes: evaluates nodes (evidence: `src/aevy/interpreter.py`)
- CLI Runner → Error Formatting: formats errors (evidence: `src/aevy/__main__.py`)
- Interpreter → Control Flow: executes (evidence: `README.md`)
- Interpreter → Functions and Classes: executes (evidence: `README.md`)
- Interpreter → Lists and Dictionaries: supports (evidence: `README.md`)
- Interpreter → Standard Library: dispatches built-ins (evidence: `src/aevy/interpreter.py`)
- Interpreter → Module Imports: supports imports (evidence: `README.md`)
- Interpreter → Text File I/O: provides file operations (evidence: `README.md`)
- Interpreter → Program Output: produces output (evidence: `README.md`)
