# reddysridharkb/nfa-dfa-converting architecture

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

- Interactive diagram: https://gitdiagram.com/reddysridharkb/nfa-dfa-converting
- Repository: https://github.com/reddysridharkb/nfa-dfa-converting

## Overview

This is a browser-based NFA-to-DFA converter. A user supplies an NFA, the app parses its transitions, accounts for epsilon transitions, and constructs a DFA; it then presents graphs, transition tables, and step-by-step DFA traversal. The excerpts show the conversion and rendering calls, but not the HTML structure or unsampled implementation details.

Main entry points: [`script.js`](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js) (Page interactions), [`index.html`](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/index.html) (Converter page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Browser interface"]
  node_page["Converter page<br/>[index.html]"]
  node_styles["Page styles<br/>[style.css]"]
  node_events["Page interactions<br/>[script.js]"]
end

subgraph group_conversion["Automata conversion"]
  node_parser["Transition parser<br/>[script.js]"]
  node_closure["Epsilon closure<br/>[script.js]"]
  node_converter["Subset construction<br/>[script.js]"]
end

subgraph group_presentation["Results and navigation"]
  node_nfa_view["NFA graph<br/>[script.js]"]
  node_complete_view["Complete DFA graph<br/>[script.js]"]
  node_step_view["Stepwise DFA graph<br/>[script.js]"]
  node_tables["Transition tables<br/>[script.js]"]
  node_step_controls["Step navigation<br/>[script.js]"]
end

node_user(("User"))

node_user -.->|"uses"| node_page
node_page -.->|"loads"| node_events
node_events -->|"parses input"| node_parser
node_events -->|"computes closures"| node_closure
node_events -->|"builds DFA"| node_converter
node_converter -->|"renders NFA"| node_nfa_view
node_converter -->|"renders DFA"| node_complete_view
node_converter -->|"prepares steps"| node_step_view
node_converter -->|"displays tables"| node_tables
node_events -->|"registers controls"| node_step_controls

click node_page "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/index.html"
click node_styles "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/style.css"
click node_events "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_parser "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_closure "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_converter "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_nfa_view "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_complete_view "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_step_view "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_tables "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"
click node_step_controls "https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js"

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_page,node_styles,node_events,node_user toneBlue
class node_parser,node_closure,node_converter toneAmber
class node_nfa_view,node_complete_view,node_step_view,node_tables,node_step_controls toneMint
```

## Components

### Browser interface

- [Converter page](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/index.html): `index.html`
- [Page styles](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/style.css): `style.css`
- [Page interactions](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`

### Automata conversion

- [Transition parser](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`
- [Epsilon closure](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`
- [Subset construction](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`

### Results and navigation

- [NFA graph](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`
- [Complete DFA graph](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`
- [Stepwise DFA graph](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`
- [Transition tables](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`
- [Step navigation](https://github.com/reddysridharkb/nfa-dfa-converting/blob/main/script.js): `script.js`

### Other components

- **User**

## Connections

- User → Converter page: uses
- Converter page → Page interactions: loads
- Page interactions → Transition parser: parses input (evidence: `script.js`)
- Page interactions → Epsilon closure: computes closures (evidence: `script.js`)
- Page interactions → Subset construction: builds DFA (evidence: `script.js`)
- Subset construction → NFA graph: renders NFA (evidence: `script.js`)
- Subset construction → Complete DFA graph: renders DFA (evidence: `script.js`)
- Subset construction → Stepwise DFA graph: prepares steps (evidence: `script.js`)
- Subset construction → Transition tables: displays tables (evidence: `script.js`)
- Page interactions → Step navigation: registers controls (evidence: `script.js`)
