# justarobloxgamecreator/scripty architecture

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

- Interactive diagram: https://gitdiagram.com/justarobloxgamecreator/scripty
- Repository: https://github.com/justarobloxgamecreator/scripty

## Overview

Scripty is a beginner-oriented language that translates `.scy` programs into Python. Its main workflow is: a user runs a file, the CLI reads it, then tokenization, parsing, semantic checking, and Python generation precede execution; `build` instead prints the generated Python. The graph also shows the AST and runtime helpers for friendly output and list behavior. Edges follow the CLI pipeline and source references shown in the excerpts or SOURCE INDEX; unsampled details are omitted.

Main entry points: [`cli.py`](https://github.com/justarobloxgamecreator/scripty/blob/main/cli.py) (CLI and orchestration), [`generator.py`](https://github.com/justarobloxgamecreator/scripty/blob/main/generator.py) (Python generator), [`parser.py`](https://github.com/justarobloxgamecreator/scripty/blob/main/parser.py) (Parser), [`checker.py`](https://github.com/justarobloxgamecreator/scripty/blob/main/checker.py) (Semantic checker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command line"]
  node_launcher["Script launcher<br/>[scripty.py]"]
  node_cli["CLI and orchestration<br/>[cli.py]"]
end

subgraph group_frontend["Language frontend"]
  node_lexer["Tokenizer<br/>[lexer.py]"]
  node_parser["Parser<br/>[parser.py]"]
  node_checker["Semantic checker<br/>[checker.py]"]
end

subgraph group_translation["Translation and runtime"]
  node_generator["Python generator<br/>[generator.py]"]
  node_runner["Python execution<br/>[runner.py]"]
  node_runtime_helpers["Output and list helpers<br/>[runner.py]"]
end

subgraph group_shared["Shared model"]
  node_ast["Program AST<br/>[ast_nodes.py]"]
  node_errors["Friendly errors<br/>[errors.py]"]
end

node_user(("Program author"))
node_generated_output["Generated Python"]
node_program_file["&#96;.scy&#96; program"]

node_user -->|"runs command"| node_launcher
node_launcher -->|"delegates to"| node_cli
node_cli -->|"reads source"| node_program_file
node_cli -->|"tokenizes"| node_lexer
node_cli -->|"parses"| node_parser
node_cli -->|"checks meaning"| node_checker
node_cli -->|"generates Python"| node_generator
node_cli -->|"runs Python"| node_runner
node_cli -->|"prints on build"| node_generated_output
node_lexer -->|"raises errors"| node_errors
node_parser -->|"consumes tokens"| node_lexer
node_parser -->|"builds tree"| node_ast
node_checker -->|"checks tree"| node_ast
node_checker -->|"raises errors"| node_errors
node_generator -->|"translates tree"| node_ast
node_generator -->|"emits helper calls"| node_runtime_helpers
node_generator -->|"produces source"| node_generated_output
node_runner -->|"provides helpers"| node_runtime_helpers
node_runner -->|"reports errors"| node_errors

click node_launcher "https://github.com/justarobloxgamecreator/scripty/blob/main/scripty.py"
click node_cli "https://github.com/justarobloxgamecreator/scripty/blob/main/cli.py"
click node_lexer "https://github.com/justarobloxgamecreator/scripty/blob/main/lexer.py"
click node_parser "https://github.com/justarobloxgamecreator/scripty/blob/main/parser.py"
click node_checker "https://github.com/justarobloxgamecreator/scripty/blob/main/checker.py"
click node_ast "https://github.com/justarobloxgamecreator/scripty/blob/main/ast_nodes.py"
click node_errors "https://github.com/justarobloxgamecreator/scripty/blob/main/errors.py"
click node_generator "https://github.com/justarobloxgamecreator/scripty/blob/main/generator.py"
click node_runner "https://github.com/justarobloxgamecreator/scripty/blob/main/runner.py"
click node_runtime_helpers "https://github.com/justarobloxgamecreator/scripty/blob/main/runner.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_launcher,node_cli toneBlue
class node_lexer,node_parser,node_checker toneAmber
class node_generator,node_runner,node_runtime_helpers toneMint
class node_ast,node_errors toneRose
class node_user,node_generated_output,node_program_file toneIndigo
```

## Components

### Command line

- [Script launcher](https://github.com/justarobloxgamecreator/scripty/blob/main/scripty.py): `scripty.py`
- [CLI and orchestration](https://github.com/justarobloxgamecreator/scripty/blob/main/cli.py): `cli.py`

### Language frontend

- [Tokenizer](https://github.com/justarobloxgamecreator/scripty/blob/main/lexer.py): `lexer.py`
- [Parser](https://github.com/justarobloxgamecreator/scripty/blob/main/parser.py): `parser.py`
- [Semantic checker](https://github.com/justarobloxgamecreator/scripty/blob/main/checker.py): `checker.py`

### Translation and runtime

- [Python generator](https://github.com/justarobloxgamecreator/scripty/blob/main/generator.py): `generator.py`
- [Python execution](https://github.com/justarobloxgamecreator/scripty/blob/main/runner.py): `runner.py`
- [Output and list helpers](https://github.com/justarobloxgamecreator/scripty/blob/main/runner.py): `runner.py`

### Shared model

- [Program AST](https://github.com/justarobloxgamecreator/scripty/blob/main/ast_nodes.py): `ast_nodes.py`
- [Friendly errors](https://github.com/justarobloxgamecreator/scripty/blob/main/errors.py): `errors.py`

### Other components

- **Program author**
- **Generated Python**
- **`.scy` program**

## Connections

- Program author → Script launcher: runs command (evidence: `README.md`)
- Script launcher → CLI and orchestration: delegates to (evidence: `scripty.py`)
- CLI and orchestration → `.scy` program: reads source (evidence: `cli.py`)
- CLI and orchestration → Tokenizer: tokenizes (evidence: `cli.py`)
- CLI and orchestration → Parser: parses (evidence: `cli.py`)
- CLI and orchestration → Semantic checker: checks meaning (evidence: `cli.py`)
- CLI and orchestration → Python generator: generates Python (evidence: `cli.py`)
- CLI and orchestration → Python execution: runs Python (evidence: `cli.py`)
- CLI and orchestration → Generated Python: prints on build (evidence: `cli.py`)
- Tokenizer → Friendly errors: raises errors (evidence: `lexer.py`)
- Parser → Tokenizer: consumes tokens (evidence: `parser.py`)
- Parser → Program AST: builds tree (evidence: `parser.py`)
- Semantic checker → Program AST: checks tree (evidence: `checker.py`)
- Semantic checker → Friendly errors: raises errors (evidence: `checker.py`)
- Python generator → Program AST: translates tree (evidence: `generator.py`)
- Python generator → Output and list helpers: emits helper calls (evidence: `generator.py`)
- Python generator → Generated Python: produces source (evidence: `generator.py`)
- Python execution → Output and list helpers: provides helpers (evidence: `runner.py`)
- Python execution → Friendly errors: reports errors (evidence: `runner.py`)
