# jvmryatch/jordanvega-proyecto2 architecture

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

- Interactive diagram: https://gitdiagram.com/jvmryatch/jordanvega-proyecto2
- Repository: https://github.com/jvmryatch/jordanvega-proyecto2

## Overview

1. **Project purpose**
   - This repository is a small **Java-based compiler for a basic Visual Basic dialect**. The README is minimal, but the source layout clearly shows a compiler-style pipeline rather than an application UI.

2. **Primary runtime boundary**
   - The code lives under `src/jordanvega/proyecto2`, with the main logic in a single package.
   - The compiled deliverable is a **JAR** (`dist/JordanVega-Proyecto2.jar` / `JordanVega-Proyecto2.jar`), so the runtime boundary is a standalone Java command-line or desktop-style tool rather than a service.

3. **Build and packaging**
   - The project uses **NetBeans + Ant** (`build.xml`, `nbproject/`), which means the architecture is organized around a conventional Java compile/package flow.
   - The repository also contains generated build output in `build/` and `dist/`, indicating the checked-in artifacts are the packaged compiler, not just source.

4. **Likely entry point**
   - `MainComp.java` is the main entry class and probably orchestrates the compilation process.
   - This class is the top-level controller that would invoke analysis, collect diagnostics, and produce output.

5. **Core analysis engine**
   - `Analizer.java` is the central processing component. Based on the name and adjacent support classes, it is likely responsible for scanning/parsing the source and coordinating semantic checks.
   - In an architecture diagram, this is the core engine between source input and the internal compiler state.

6. **Compiler state: symbols**
   - `SymbolsTable.java` represents the **symbol table** subsystem.
   - This is the persistent semantic state for identifiers, declarations, and scope-related information used during compilation.

7. **Compiler state: expressions**
   - `ExpressionsTable.java` appears to track **expressions and/or type-checking metadata**.
   - It likely supports validation of assignments, operations, and expression compatibility during analysis.

8. **Diagnostics subsystem**
   - `Errors.java` is the error-reporting and error-collection component.
   - `Log.java` is a separate logging/output mechanism, likely used to record compiler progress, warnings, or generated reports.
   - These form the diagnostics boundary: analysis produces findings, and these classes format or store them for output.

9. **Data flow through the system**
   - The expected flow is: **source program input → `MainComp` → `Analizer` → symbol/expression state updates → `Errors`/`Log` output**.
   - This is a classic compiler pipeline with a single orchestration point and several internal state holders.

10. **Output artifacts**
   - `Informe.txt` suggests the compiler produces a **report file** as part of its execution.
   - That makes the output boundary important: the tool likely emits human-readable compilation results rather than generating executable machine code.

11. **Repo shape and scope**
   - There are no obvious modules for optimization, code generation, or runtime execution, so this is a **basic front-end compiler** focused on analysis and reporting.
   - The architecture is intentionally compact: one package, one main analyzer, a few supporting tables, and diagnostic classes.

12. **Diagramming takeaway**
   - A good architecture diagram should show four main areas:
     - **Input/driver**: `MainComp`
     - **Analysis core**: `Analizer`
     - **Semantic state**: `SymbolsTable`, `ExpressionsTable`
     - **Diagnostics/output**: `Errors`, `Log`, and the generated `Informe.txt`
   - The build system and JAR packaging are supporting infrastructure, not part of the compiler logic itself.

Main entry points: [`src/jordanvega/proyecto2/Analizer.java`](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Analizer.java) (Analizer), [`src/jordanvega/proyecto2/MainComp.java`](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/MainComp.java) (MainComp), [`src/jordanvega/proyecto2/Errors.java`](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Errors.java) (Errors), [`src/jordanvega/proyecto2/Log.java`](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Log.java) (Log)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Compiler Core"]
  node_n1["MainComp<br/>entry point<br/>[MainComp.java]"]
  node_n2["Analizer<br/>analysis engine<br/>[Analizer.java]"]
end

subgraph group_g2["Semantic State"]
  node_n3[("Symbols Table<br/>symbol state<br/>[SymbolsTable.java]")]
  node_n4[("Expressions Table<br/>expression state")]
end

subgraph group_g3["Diagnostics & Output"]
  node_n5["Errors<br/>diagnostics<br/>[Errors.java]"]
  node_n6["Log<br/>[Log.java]"]
  node_n7["Informe.txt<br/>report artifact<br/>[Informe.txt]"]
  node_n8["JAR package<br/>build artifact"]
end

node_n1 -->|"invokes"| node_n2
node_n2 -->|"updates"| node_n3
node_n2 -->|"checks"| node_n4
node_n2 -->|"reports"| node_n5
node_n2 -->|"logs"| node_n6
node_n6 -->|"emits"| node_n7
node_n5 -->|"summarizes"| node_n7
node_n1 -.->|"packages"| node_n8

click node_n1 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/MainComp.java"
click node_n2 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Analizer.java"
click node_n3 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/SymbolsTable.java"
click node_n4 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/ExpressionsTable.java"
click node_n5 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Errors.java"
click node_n6 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Log.java"
click node_n7 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/Informe.txt"
click node_n8 "https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/dist/JordanVega-Proyecto2.jar"

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_n1,node_n2 toneBlue
class node_n3,node_n4 toneAmber
class node_n5,node_n6,node_n7,node_n8 toneMint
```

## Components

### Compiler Core

Main compilation flow and semantic analysis.

- [MainComp](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/MainComp.java): entry point · Starts compilation and coordinates the run. · `src/jordanvega/proyecto2/MainComp.java`
- [Analizer](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Analizer.java): analysis engine · Central compiler logic for scanning, parsing, and checks. · `src/jordanvega/proyecto2/Analizer.java`

### Semantic State

Tables maintained during analysis.

- [Symbols Table](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/SymbolsTable.java): symbol state · Tracks identifiers, declarations, and scope data. · `src/jordanvega/proyecto2/SymbolsTable.java`
- [Expressions Table](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/ExpressionsTable.java): expression state · Holds expression and type-checking metadata. · `src/jordanvega/proyecto2/ExpressionsTable.java`

### Diagnostics & Output

Error handling, logging, and generated report output.

- [Errors](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Errors.java): diagnostics · Collects and formats compilation errors. · `src/jordanvega/proyecto2/Errors.java`
- [Log](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/src/jordanvega/proyecto2/Log.java): output log · Writes compiler progress or report output. · `src/jordanvega/proyecto2/Log.java`
- [Informe.txt](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/Informe.txt): report artifact · Generated human-readable compilation report. · `Informe.txt`
- [JAR package](https://github.com/jvmryatch/jordanvega-proyecto2/blob/main/dist/JordanVega-Proyecto2.jar): build artifact · Packaged executable distribution of the compiler. · `dist/JordanVega-Proyecto2.jar`

## Connections

- MainComp → Analizer: invokes · Main entry hands control to the analyzer.
- Analizer → Symbols Table: updates · Analysis records identifiers and scopes.
- Analizer → Expressions Table: checks · Analysis consults expression metadata during validation.
- Analizer → Errors: reports · Errors are collected from analysis failures.
- Analizer → Log: logs · Progress and results are written to the log.
- Log → Informe.txt: emits · Logging/reporting produces the text report.
- Errors → Informe.txt: summarizes · Error findings contribute to the final report.
- MainComp → JAR package: packages · The project build assembles the distributable JAR.
