# divpreeet/scurvyscript architecture

> Architecture diagram of the GitHub repository divpreeet/scurvyscript, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/divpreeet/scurvyscript
- Repository: https://github.com/divpreeet/scurvyscript

## Overview

##### Main Components

The system can be divided into three major layers:
- Web Interface Layer
- Language Processing Layer
- Runtime Layer

##### Detailed Component Breakdown

A. Web Interface Components (Frontend):
- HTML template (templates/index.html)
- Static assets (CSS and JavaScript)
- Flask web server (app.py)

B. Language Processing Pipeline:
1. Lexer (lexer.py) - Tokenization
2. Parser (parse.py) - Syntax Analysis
3. Interpreter (interpreter.py) - Execution

C. Supporting Components:
- Token Definitions (tokens.py)
- Data Structures (data.py)
- Interactive Shell (shell.py)

##### Component Relationships

**User Input -> Web Interface -> Language Processing Pipeline -> Output**

##### Specific Elements

- Web Interface     |

- Flask (app.py) |  |

- Templates    |  |
- Static Files |  |

- ↓

- Language Processing   |

- Lexer      |  |

- Parser     |  |

- Interpreter   |  |

- ↓

- Supporting Systems    |

- Tokens     |  |

- Data      |  |

- Shell      |  |

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Web Interface Layer"
        WebServer["Flask Server"]
        Template["HTML Template"]
        CSS["Static CSS"]
        JS["Static JS"]
        WebServer --> Template
        WebServer --> CSS
        WebServer --> JS
    end

    subgraph "Language Processing Layer"
        Lexer["Lexer"]
        Parser["Parser"]
        Interpreter["Interpreter"]
        Lexer --> Parser
        Parser --> Interpreter
    end

    subgraph "Supporting Components"
        Tokens["Token Definitions"]
        Data["Data Structures"]
        Shell["Interactive Shell"]
        Tokens --> Lexer
        Tokens --> Parser
        Data --> Interpreter
        Shell --> Lexer
    end

    WebServer --> Lexer
    Interpreter --> WebServer

    classDef web fill:#3498db,stroke:#2980b9,color:white
    classDef lang fill:#2ecc71,stroke:#27ae60,color:white
    classDef support fill:#f1c40f,stroke:#f39c12,color:white

    class WebServer,Template,CSS,JS web
    class Lexer,Parser,Interpreter lang
    class Tokens,Data,Shell support

    click WebServer "https://github.com/divpreeet/ScurvyScript/blob/main/app.py"
    click Template "https://github.com/divpreeet/ScurvyScript/blob/main/templates/index.html"
    click CSS "https://github.com/divpreeet/ScurvyScript/blob/main/static/css/style.css"
    click JS "https://github.com/divpreeet/ScurvyScript/blob/main/static/js/script.js"
    click Lexer "https://github.com/divpreeet/ScurvyScript/blob/main/lexer.py"
    click Parser "https://github.com/divpreeet/ScurvyScript/blob/main/parse.py"
    click Interpreter "https://github.com/divpreeet/ScurvyScript/blob/main/interpreter.py"
    click Tokens "https://github.com/divpreeet/ScurvyScript/blob/main/tokens.py"
    click Data "https://github.com/divpreeet/ScurvyScript/blob/main/data.py"
    click Shell "https://github.com/divpreeet/ScurvyScript/blob/main/shell.py"

    %% Legend
    subgraph Legend
        WebComponent["Web Interface"]:::web
        LangComponent["Language Processing"]:::lang
        SupportComponent["Supporting Components"]:::support
    end
```
