# mayoorr24/logicgaurd architecture

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

- Interactive diagram: https://gitdiagram.com/mayoorr24/logicgaurd
- Repository: https://github.com/mayoorr24/logicgaurd

## Overview

This is a small C source analyzer. Its entry point reads the hardcoded input file `test.c`, then runs variable-declaration extraction, unreachable-code checks, and loop analysis, which print findings to standard output. The parser also provides brace matching used by loop analysis; variable extraction records declarations in a hash table. The supplied excerpts show these calls, but provide no README or implementation for the empty overflow and report modules.

Main entry points: [`parser.c`](https://github.com/mayoorr24/logicgaurd/blob/main/parser.c) (Input and parsing), [`main.c`](https://github.com/mayoorr24/logicgaurd/blob/main/main.c) (Analyzer entry), [`loop_analyzer.c`](https://github.com/mayoorr24/logicgaurd/blob/main/loop_analyzer.c) (Loop analysis), [`unreachable.c`](https://github.com/mayoorr24/logicgaurd/blob/main/unreachable.c) (Unreachable check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and input"]
  node_main["Analyzer entry<br/>[main.c]"]
  node_parser["Input and parsing<br/>[parser.c]"]
end

subgraph group_analysis["Source analysis"]
  node_unreachable["Unreachable check<br/>[unreachable.c]"]
  node_loops["Loop analysis<br/>[loop_analyzer.c]"]
end

subgraph group_state["Variable state"]
  node_variables[("Variable table<br/>[hashtable.c]")]
end

node_source["C source file"]
node_stdout["Standard output"]

node_main -->|"loads and extracts"| node_parser
node_main -->|"checks reachability"| node_unreachable
node_main -->|"analyzes loops"| node_loops
node_parser -->|"reads input"| node_source
node_parser -->|"inserts declarations"| node_variables
node_loops -->|"matches braces"| node_parser
node_parser -->|"prints detections"| node_stdout
node_unreachable -->|"prints warnings"| node_stdout
node_loops -->|"prints verdicts"| node_stdout
node_main -->|"prints run headings"| node_stdout

click node_main "https://github.com/mayoorr24/logicgaurd/blob/main/main.c"
click node_parser "https://github.com/mayoorr24/logicgaurd/blob/main/parser.c"
click node_unreachable "https://github.com/mayoorr24/logicgaurd/blob/main/unreachable.c"
click node_loops "https://github.com/mayoorr24/logicgaurd/blob/main/loop_analyzer.c"
click node_variables "https://github.com/mayoorr24/logicgaurd/blob/main/hashtable.c"

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_main,node_parser toneBlue
class node_unreachable,node_loops toneAmber
class node_variables toneMint
class node_source,node_stdout toneIndigo
```

## Components

### Entry and input

- [Analyzer entry](https://github.com/mayoorr24/logicgaurd/blob/main/main.c): `main.c`
- [Input and parsing](https://github.com/mayoorr24/logicgaurd/blob/main/parser.c): `parser.c`

### Source analysis

- [Unreachable check](https://github.com/mayoorr24/logicgaurd/blob/main/unreachable.c): `unreachable.c`
- [Loop analysis](https://github.com/mayoorr24/logicgaurd/blob/main/loop_analyzer.c): `loop_analyzer.c`

### Variable state

- [Variable table](https://github.com/mayoorr24/logicgaurd/blob/main/hashtable.c): `hashtable.c`

### Other components

- **C source file**
- **Standard output**

## Connections

- Analyzer entry → Input and parsing: loads and extracts (evidence: `main.c`)
- Analyzer entry → Unreachable check: checks reachability (evidence: `main.c`)
- Analyzer entry → Loop analysis: analyzes loops (evidence: `main.c`)
- Input and parsing → C source file: reads input (evidence: `parser.c`)
- Input and parsing → Variable table: inserts declarations (evidence: `parser.c`)
- Loop analysis → Input and parsing: matches braces (evidence: `loop_analyzer.c`)
- Input and parsing → Standard output: prints detections (evidence: `parser.c`)
- Unreachable check → Standard output: prints warnings (evidence: `unreachable.c`)
- Loop analysis → Standard output: prints verdicts (evidence: `loop_analyzer.c`)
- Analyzer entry → Standard output: prints run headings (evidence: `main.c`)
