# blazkull/compilator_coste-ol architecture

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

- Interactive diagram: https://gitdiagram.com/blazkull/compilator_coste-ol
- Repository: https://github.com/blazkull/compilator_coste-ol

## Overview

Costeñol is an educational language with a Tkinter IDE, compiler front end, interpreter, and .pqek project files. Users edit programs, analyze them through tokenization and parsing with semantic checks, or execute the resulting AST; execution reports output and requests input through the IDE terminal. The README also documents syntax highlighting and package management. The GUI, parser, and interpreter excerpts support the main calls; some GUI wiring is omitted, so the graph avoids inferring unshown details.

Main entry points: [`src/gui/app.py`](https://github.com/blazkull/compilator_coste-ol/blob/main/src/gui/app.py) (IDE and editor), [`src/interpreter/interpreter.py`](https://github.com/blazkull/compilator_coste-ol/blob/main/src/interpreter/interpreter.py) (AST interpreter), [`src/parser/parser.py`](https://github.com/blazkull/compilator_coste-ol/blob/main/src/parser/parser.py) (Parser and AST), [`src/lexer/scanner.py`](https://github.com/blazkull/compilator_coste-ol/blob/main/src/lexer/scanner.py) (Tokenizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ide["IDE"]
  node_gui["IDE and editor<br/>[app.py]"]
  node_terminal["Interactive terminal<br/>[app.py]"]
  node_file_ui["Package browser<br/>[app.py]"]
end

subgraph group_compile["Compilation"]
  node_scanner["Tokenizer<br/>[scanner.py]"]
  node_token_rules["Token definitions<br/>[tokens.py]"]
  node_parser["Parser and AST<br/>[parser.py]"]
  node_symbols["Symbol table<br/>[symbol_table.py]"]
end

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

subgraph group_files["Project Files"]
  node_packages[(".pqek files")]
end

node_user(("User"))

node_user -->|"edits code"| node_gui
node_gui -->|"tokenizes code"| node_scanner
node_scanner -->|"uses patterns"| node_token_rules
node_gui -->|"parses tokens"| node_parser
node_parser -->|"checks symbols"| node_symbols
node_gui -->|"starts execution"| node_interpreter
node_interpreter -->|"uses AST types"| node_parser
node_interpreter -->|"sends output"| node_terminal
node_terminal -->|"provides input"| node_interpreter
node_gui -->|"saves files"| node_packages
node_file_ui -->|"lists files"| node_packages
node_file_ui -->|"opens file"| node_gui
node_gui -->|"shows results"| node_user

click node_gui "https://github.com/blazkull/compilator_coste-ol/blob/main/src/gui/app.py"
click node_terminal "https://github.com/blazkull/compilator_coste-ol/blob/main/src/gui/app.py"
click node_file_ui "https://github.com/blazkull/compilator_coste-ol/blob/main/src/gui/app.py"
click node_scanner "https://github.com/blazkull/compilator_coste-ol/blob/main/src/lexer/scanner.py"
click node_token_rules "https://github.com/blazkull/compilator_coste-ol/blob/main/src/lexer/tokens.py"
click node_parser "https://github.com/blazkull/compilator_coste-ol/blob/main/src/parser/parser.py"
click node_symbols "https://github.com/blazkull/compilator_coste-ol/blob/main/src/semantic/symbol_table.py"
click node_interpreter "https://github.com/blazkull/compilator_coste-ol/blob/main/src/interpreter/interpreter.py"
click node_packages "https://github.com/blazkull/compilator_coste-ol/tree/main/packages"

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_gui,node_terminal,node_file_ui,node_user toneBlue
class node_scanner,node_token_rules,node_parser,node_symbols toneAmber
class node_interpreter toneMint
class node_packages toneRose
```

## Components

### IDE

- [IDE and editor](https://github.com/blazkull/compilator_coste-ol/blob/main/src/gui/app.py): `src/gui/app.py`
- [Interactive terminal](https://github.com/blazkull/compilator_coste-ol/blob/main/src/gui/app.py): `src/gui/app.py`
- [Package browser](https://github.com/blazkull/compilator_coste-ol/blob/main/src/gui/app.py): `src/gui/app.py`

### Compilation

- [Tokenizer](https://github.com/blazkull/compilator_coste-ol/blob/main/src/lexer/scanner.py): `src/lexer/scanner.py`
- [Token definitions](https://github.com/blazkull/compilator_coste-ol/blob/main/src/lexer/tokens.py): `src/lexer/tokens.py`
- [Parser and AST](https://github.com/blazkull/compilator_coste-ol/blob/main/src/parser/parser.py): `src/parser/parser.py`
- [Symbol table](https://github.com/blazkull/compilator_coste-ol/blob/main/src/semantic/symbol_table.py): `src/semantic/symbol_table.py`

### Execution

- [AST interpreter](https://github.com/blazkull/compilator_coste-ol/blob/main/src/interpreter/interpreter.py): `src/interpreter/interpreter.py`

### Project Files

- [.pqek files](https://github.com/blazkull/compilator_coste-ol/tree/main/packages): `packages`

### Other components

- **User**

## Connections

- User → IDE and editor: edits code (evidence: `README.md`)
- IDE and editor → Tokenizer: tokenizes code (evidence: `src/gui/app.py`)
- Tokenizer → Token definitions: uses patterns (evidence: `src/lexer/scanner.py`)
- IDE and editor → Parser and AST: parses tokens (evidence: `src/gui/app.py`)
- Parser and AST → Symbol table: checks symbols (evidence: `src/parser/parser.py`)
- IDE and editor → AST interpreter: starts execution (evidence: `src/gui/app.py`)
- AST interpreter → Parser and AST: uses AST types (evidence: `src/interpreter/interpreter.py`)
- AST interpreter → Interactive terminal: sends output (evidence: `src/gui/app.py`)
- Interactive terminal → AST interpreter: provides input (evidence: `src/gui/app.py`)
- IDE and editor → .pqek files: saves files (evidence: `src/gui/app.py`)
- Package browser → .pqek files: lists files (evidence: `src/gui/app.py`)
- Package browser → IDE and editor: opens file (evidence: `src/gui/app.py`)
- IDE and editor → User: shows results (evidence: `README.md`)
