# akene-uzezi/bwh architecture

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

- Interactive diagram: https://gitdiagram.com/akene-uzezi/bwh
- Repository: https://github.com/akene-uzezi/bwh

## Overview

BWH is a small Badwhipp language front end with an interactive token-printing REPL. A user enters a line; the executable starts the REPL, which creates a lexer and prints tokens until end of input. Separately, the parser consumes lexer tokens and builds the currently supported statement AST; expression parsing is incomplete, and the REPL does not invoke the parser or evaluate code. The graph reflects the sampled source and README; documented capabilities without a shown runtime connection are not linked.

Main entry points: [`repl/repl.go`](https://github.com/akene-uzezi/bwh/blob/main/repl/repl.go) (Line REPL), [`token/token.go`](https://github.com/akene-uzezi/bwh/blob/main/token/token.go) (Token types), [`parser/parser.go`](https://github.com/akene-uzezi/bwh/blob/main/parser/parser.go) (Parser), [`lexer/lexer.go`](https://github.com/akene-uzezi/bwh/blob/main/lexer/lexer.go) (Lexer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Interactive shell"]
  node_main["Executable entry<br/>[main.go]"]
  node_repl["Line REPL<br/>[repl.go]"]
end

subgraph group_lexing["Lexical analysis"]
  node_lexer["Lexer<br/>[lexer.go]"]
  node_tokens["Token types<br/>[token.go]"]
end

subgraph group_parsing["Parsing and syntax"]
  node_parser["Parser<br/>[parser.go]"]
  node_ast["AST nodes<br/>[ast.go]"]
end

node_user(("User"))

node_user -->|"enters lines"| node_repl
node_main -->|"starts"| node_repl
node_repl -->|"creates lexer"| node_lexer
node_repl -->|"checks EOF"| node_tokens
node_lexer -->|"emits tokens"| node_tokens
node_parser -->|"reads tokens"| node_lexer
node_parser -->|"classifies tokens"| node_tokens
node_parser -->|"builds nodes"| node_ast
node_ast -->|"stores token"| node_tokens

click node_main "https://github.com/akene-uzezi/bwh/blob/main/main.go"
click node_repl "https://github.com/akene-uzezi/bwh/blob/main/repl/repl.go"
click node_lexer "https://github.com/akene-uzezi/bwh/blob/main/lexer/lexer.go"
click node_tokens "https://github.com/akene-uzezi/bwh/blob/main/token/token.go"
click node_parser "https://github.com/akene-uzezi/bwh/blob/main/parser/parser.go"
click node_ast "https://github.com/akene-uzezi/bwh/blob/main/ast/ast.go"

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_main,node_repl,node_user toneBlue
class node_lexer,node_tokens toneAmber
class node_parser,node_ast toneMint
```

## Components

### Interactive shell

- [Executable entry](https://github.com/akene-uzezi/bwh/blob/main/main.go): `main.go`
- [Line REPL](https://github.com/akene-uzezi/bwh/blob/main/repl/repl.go): `repl/repl.go`

### Lexical analysis

- [Lexer](https://github.com/akene-uzezi/bwh/blob/main/lexer/lexer.go): `lexer/lexer.go`
- [Token types](https://github.com/akene-uzezi/bwh/blob/main/token/token.go): `token/token.go`

### Parsing and syntax

- [Parser](https://github.com/akene-uzezi/bwh/blob/main/parser/parser.go): `parser/parser.go`
- [AST nodes](https://github.com/akene-uzezi/bwh/blob/main/ast/ast.go): `ast/ast.go`

### Other components

- **User**

## Connections

- User → Line REPL: enters lines (evidence: `README.md`)
- Executable entry → Line REPL: starts (evidence: `main.go`)
- Line REPL → Lexer: creates lexer (evidence: `repl/repl.go`)
- Line REPL → Token types: checks EOF (evidence: `repl/repl.go`)
- Lexer → Token types: emits tokens (evidence: `lexer/lexer.go`)
- Parser → Lexer: reads tokens (evidence: `parser/parser.go`)
- Parser → Token types: classifies tokens (evidence: `parser/parser.go`)
- Parser → AST nodes: builds nodes (evidence: `parser/parser.go`)
- AST nodes → Token types: stores token (evidence: `ast/ast.go`)
