# arcg-prog/olc2_fortranpeg_g13 architecture

> Architecture diagram of the GitHub repository arcg-prog/olc2_fortranpeg_g13, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arcg-prog/olc2_fortranpeg_g13
- Repository: https://github.com/arcg-prog/olc2_fortranpeg_g13

## Overview

##### Main Components Identification

a) Frontend Layer:
- HTML interface (index.html)
- Frontend logic (index.js)
- Peggy-generated parser (grammar.js)

b) Backend Layer:
- TypeScript-based server (index.ts)
- Grammar definitions (grammar.pegjs, inicio.peggy)
- Test inputs (pruebas directory)

**[Web Interface]**
- ↓
**[Frontend Logic]**
- ↓
**[Parser Component]**
- ↓
**[Backend Server]**
- ↓
**[Grammar Processor]**

##### Specific Elements

a) User Interface Layer:
- JavaScript controller components
- Connection to the parser component

b) Parser Layer:
- Peggy parser generation flow
- How grammar files (.pegjs, .peggy) are compiled into the parser
- Relationship between frontend and backend parser components

c) Backend Processing:
- TypeScript server component
- Grammar processing pipeline
- Test input processing flow

##### Component Relationships

Use the following connection types:

##### Detailed Component Breakdown

Frontend Section:
**[index.html] → [index.js] → [grammar.js]**

Backend Section:
**[grammar.pegjs/inicio.peggy] → [TypeScript Server] → [Processed Output]**

##### Implementation Notes

- The separation between frontend and backend
- The parser generation process
- How grammar files are processed
- Test input handling
- Deployment workflow

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI[HTML Interface]
        FL[Frontend Logic]
        FP[Frontend Parser]
        
        UI --> FL
        FL --> FP
    end

    subgraph Backend
        TS[Backend Server]
        GD[Grammar Definitions]
        TI[Test Input Processing]
        
        GD --> TS
        TI --> TS
    end

    subgraph Build
        TC[TypeScript Config]
        DW[Deployment Workflow]
        
        TC --> TS
        DW --> |Deploys| Frontend
        DW --> |Deploys| Backend
    end

    FP <--> TS

    %% Component Styles
    classDef frontend fill:#a8d1ff,stroke:#333
    classDef backend fill:#98ff98,stroke:#333
    classDef build fill:#ffd700,stroke:#333

    class UI,FL,FP frontend
    class TS,GD,TI backend
    class TC,DW build

    %% Click Events
    click UI "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/blob/main/Frontend/index.html"
    click FL "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/blob/main/Frontend/src/index.js"
    click FP "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/blob/main/Frontend/peggy/grammar.js"
    click TS "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/blob/main/Backend/src/index.ts"
    click GD "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/tree/main/Backend/peggy"
    click TI "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/tree/main/Backend/pruebas"
    click DW "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/blob/main/.github/workflows/deploy.yml"
    click TC "https://github.com/ARCG-prog/OLC2_FortranPEG_G13/blob/main/tsconfig.json"

    %% Legend
    subgraph Legend
        F[Frontend Components]:::frontend
        B[Backend Components]:::backend
        BU[Build Components]:::build
    end
```
