# juansegnana/grupo-1-ssl-2022 architecture

> Architecture diagram of the GitHub repository juansegnana/grupo-1-ssl-2022, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juansegnana/grupo-1-ssl-2022
- Repository: https://github.com/juansegnana/grupo-1-ssl-2022

## Overview

Based on our analysis of the file tree and README, this project is an interpreter for an RSS-inspired language developed for an academic course on syntax and semantics. Its primary purpose is to tokenize and parse RSS language files using Python and the PLY library. The system is structured around core components for lexing and parsing, along with a user-interactive menu and auxiliary helper functions.

##### Main components
- Interpreter Core: Includes the Lexer (src/lexer.py) and Parser (src/parser.py). These components are the heart of the interpreter and are responsible for processing the input RSS files.
- Auxiliary Modules: Components like logicaMenu.py and helpers.py act as controllers or utility modules that manage the flow (for instance, a menu-driven interface) and provide common functions.
- External Utility – PLY Library: Note that the project contains its own copy (src/ply) of the PLY library. Represent it as an external module or dependency that supports lexing and parsing by providing definitions, token management (ctokens.py, lex.py), and parsing functions (yacc.py).
- Test and Example Artifacts: The pruebas directory holds sample RSS files for testing the interpreter, while the bin directory contains compiled executables for both lexer and parser on Linux and Windows platforms.

##### Relationships and interactions
- Data Flow: Begin with external input (RSS files) that are fed into the Lexer. The Lexer reads and tokenizes the input, then passes the tokens to the Parser.
- Utility & Control Layer: The logicaMenu module can be depicted as the interface controller that directs whether to invoke the lexer, parser, or additional helper functions (such as obtenerHtml.py) based on user input.
- Testing & Deployment: Show that test inputs (from the pruebas folder) and build outputs (in the bin folder generated via PyInstaller) validate and package the system.

##### Architectural patterns and design principles
- Layered Architecture: At the bottom, present the PLY library as the foundation. Then illustrate the core lexing and parsing components on top, with the control module (menu logic) and auxiliary functions interfaced with them.
- Portability Considerations: The existence of Windows and Linux executables indicates that platform-agnostic design was considered. Make a note that the system’s input processing and language interpretation do not depend on the underlying OS.

##### Relevant technologies
- Python 3 is the core language used.
- PyInstaller is used for generating standalone executables.
- PLY (Python Lex-Yacc) is embedded for lexing and parsing capabilities.
- Supporting libraries and scripts (helpers.py, obtenerHtml.py) will be mentioned as part of the utility layer.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Input
    INPUT["Input (RSS files)"]:::input

    %% Interpreter Core
    subgraph "Interpreter Core"
        LEX["Lexer (src/lexer.py)"]:::core
        PAR["Parser (src/parser.py)"]:::core
    end

    %% Auxiliary Modules
    subgraph "Auxiliary Modules"
        UI["Control/UI (logicaMenu.py)"]:::auxiliary
        HELP["Helpers (src/helpers.py)"]:::auxiliary
        HTML["Obtener HTML (src/obtenerHtml.py)"]:::auxiliary
    end

    %% External Dependency
    subgraph "External Dependency"
        PLY_LIB["PLY (src/ply)"]:::external
    end

    %% Testing & Deployment
    subgraph "Testing & Deployment"
        TEST["RSS Test Files (pruebas)"]:::test
        BIN["Compiled Executables (bin)"]:::test
    end

    %% Documentation
    subgraph "Documentation"
        DOC1["Documentation PDF (doc/documentación.pdf)"]:::doc
        DOC2["README (README.md)"]:::doc
    end

    %% Relationships
    TEST --> INPUT
    INPUT -->|"feeds"| LEX
    LEX -->|"tokenizes"| PAR
    PAR -->|"passes results to"| UI
    UI -->|"utilizes"| HELP
    UI -->|"calls"| HTML
    UI -->|"packaged as"| BIN

    LEX -.->|"uses routines from"| PLY_LIB
    PAR -.->|"uses routines from"| PLY_LIB

    %% Styles
    classDef input fill:#E0FFFF,stroke:#333,stroke-width:2px;
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef auxiliary fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef external fill:#F08080,stroke:#333,stroke-width:2px;
    classDef test fill:#FFFF99,stroke:#333,stroke-width:2px;
    classDef doc fill:#D3D3D3,stroke:#333,stroke-width:2px;

    %% Click Events
    click LEX "https://github.com/juansegnana/grupo-1-ssl-2022/blob/main/src/lexer.py"
    click PAR "https://github.com/juansegnana/grupo-1-ssl-2022/blob/main/src/parser.py"
    click UI "https://github.com/juansegnana/grupo-1-ssl-2022/blob/main/src/logicaMenu.py"
    click HELP "https://github.com/juansegnana/grupo-1-ssl-2022/blob/main/src/helpers.py"
    click HTML "https://github.com/juansegnana/grupo-1-ssl-2022/blob/main/src/obtenerHtml.py"
    click PLY_LIB "https://github.com/juansegnana/grupo-1-ssl-2022/tree/main/src/ply"
    click TEST "https://github.com/juansegnana/grupo-1-ssl-2022/tree/main/pruebas"
    click BIN "https://github.com/juansegnana/grupo-1-ssl-2022/tree/main/bin"
    click DOC1 "https://github.com/juansegnana/grupo-1-ssl-2022/blob/main/doc/documentación.pdf"
    click DOC2 "https://github.com/juansegnana/grupo-1-ssl-2022/blob/main/README.md"
```
