# pranavi-gupta07/parse-wise architecture

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

- Interactive diagram: https://gitdiagram.com/pranavi-gupta07/parse-wise
- Repository: https://github.com/pranavi-gupta07/parse-wise

## Overview

Parse-Wise is an interactive teaching tool for operator-precedence parsing. A learner enters or selects a grammar, the app validates it, computes Leading/Trailing sets and precedence relations (including conflicts), then simulates shift-reduce parsing and can inspect a derivation tree. The graph separates the React workflow, algorithm engine, and step-specific visualizations. README documents these capabilities; some component implementations were not sampled, so their internal behavior and unshown connections are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/App.tsx) (Workflow coordinator), [`src/utils/compilerEngine.ts`](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/utils/compilerEngine.ts) (Compiler engine), [`src/components/Step4ParseTrace.tsx`](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step4ParseTrace.tsx) (Parse trace), [`src/components/Step1Grammar.tsx`](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step1Grammar.tsx) (Grammar editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Application workflow"]
  node_app["Workflow coordinator<br/>[App.tsx]"]
  node_mount["React entry point<br/>[main.tsx]"]
end

subgraph group_engine["Parsing engine"]
  node_engine["Compiler engine<br/>[compilerEngine.ts]"]
end

subgraph group_visuals["Learning interface"]
  node_grammar["Grammar editor<br/>[Step1Grammar.tsx]"]
  node_sets["Boundary sets"]
  node_matrix["Precedence table"]
  node_trace["Parse trace"]
  node_tree["Derivation tree"]
  node_navigation["Step navigation<br/>[StepperNav.tsx]"]
  node_breadcrumbs["Status breadcrumbs<br/>[Breadcrumbs.tsx]"]
  node_header["App header<br/>[Header.tsx]"]
  node_footer["App footer<br/>[Footer.tsx]"]
  node_help["Help dialog<br/>[HelpModal.tsx]"]
  node_shortcuts["Shortcuts dialog<br/>[ShortcutsModal.tsx]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_mount -->|"renders"| node_app
node_app -->|"validates grammar"| node_engine
node_app -->|"computes sets"| node_engine
node_app -->|"builds matrix"| node_engine
node_app -->|"renders"| node_grammar
node_app -->|"renders"| node_sets
node_app -->|"renders"| node_matrix
node_app -->|"renders"| node_trace
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_breadcrumbs
node_app -->|"renders"| node_header
node_app -->|"renders"| node_footer
node_app -->|"renders"| node_help
node_app -->|"renders"| node_shortcuts
node_grammar -->|"loads presets"| node_engine
node_trace -->|"simulates parse"| node_engine
node_trace -->|"opens tree"| node_tree
node_tree -->|"builds tree"| node_engine

click node_app "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/App.tsx"
click node_mount "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/main.tsx"
click node_engine "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/utils/compilerEngine.ts"
click node_grammar "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step1Grammar.tsx"
click node_sets "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step2LeadingTrailing.tsx"
click node_matrix "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step3PrecedenceTable.tsx"
click node_trace "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step4ParseTrace.tsx"
click node_tree "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/DerivationTreeModal.tsx"
click node_navigation "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/StepperNav.tsx"
click node_breadcrumbs "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Breadcrumbs.tsx"
click node_header "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Header.tsx"
click node_footer "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Footer.tsx"
click node_help "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/HelpModal.tsx"
click node_shortcuts "https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/ShortcutsModal.tsx"

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_app,node_mount toneBlue
class node_engine toneAmber
class node_grammar,node_sets,node_matrix,node_trace,node_tree,node_navigation,node_breadcrumbs,node_header,node_footer,node_help,node_shortcuts toneMint
class node_learner toneIndigo
```

## Components

### Application workflow

- [Workflow coordinator](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/App.tsx): `src/App.tsx`
- [React entry point](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/main.tsx): `src/main.tsx`

### Parsing engine

- [Compiler engine](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/utils/compilerEngine.ts): `src/utils/compilerEngine.ts`

### Learning interface

- [Grammar editor](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step1Grammar.tsx): `src/components/Step1Grammar.tsx`
- [Boundary sets](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step2LeadingTrailing.tsx): `src/components/Step2LeadingTrailing.tsx`
- [Precedence table](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step3PrecedenceTable.tsx): `src/components/Step3PrecedenceTable.tsx`
- [Parse trace](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Step4ParseTrace.tsx): `src/components/Step4ParseTrace.tsx`
- [Derivation tree](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/DerivationTreeModal.tsx): `src/components/DerivationTreeModal.tsx`
- [Step navigation](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/StepperNav.tsx): `src/components/StepperNav.tsx`
- [Status breadcrumbs](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Breadcrumbs.tsx): `src/components/Breadcrumbs.tsx`
- [App header](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [App footer](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Help dialog](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/HelpModal.tsx): `src/components/HelpModal.tsx`
- [Shortcuts dialog](https://github.com/pranavi-gupta07/parse-wise/blob/main/src/components/ShortcutsModal.tsx): `src/components/ShortcutsModal.tsx`

### Other components

- **Learner**

## Connections

- Learner → Workflow coordinator: uses (evidence: `README.md`)
- React entry point → Workflow coordinator: renders (evidence: `src/main.tsx`)
- Workflow coordinator → Compiler engine: validates grammar (evidence: `src/App.tsx`)
- Workflow coordinator → Compiler engine: computes sets (evidence: `src/App.tsx`)
- Workflow coordinator → Compiler engine: builds matrix (evidence: `src/App.tsx`)
- Workflow coordinator → Grammar editor: renders (evidence: `src/App.tsx`)
- Workflow coordinator → Boundary sets: renders (evidence: `src/App.tsx`)
- Workflow coordinator → Precedence table: renders (evidence: `src/App.tsx`)
- Workflow coordinator → Parse trace: renders (evidence: `src/App.tsx`)
- Workflow coordinator → Step navigation: renders (evidence: `src/App.tsx`)
- Workflow coordinator → Status breadcrumbs: renders (evidence: `src/App.tsx`)
- Workflow coordinator → App header: renders (evidence: `src/App.tsx`)
- Workflow coordinator → App footer: renders (evidence: `src/App.tsx`)
- Workflow coordinator → Help dialog: renders (evidence: `src/App.tsx`)
- Workflow coordinator → Shortcuts dialog: renders (evidence: `src/App.tsx`)
- Grammar editor → Compiler engine: loads presets (evidence: `src/components/Step1Grammar.tsx`)
- Parse trace → Compiler engine: simulates parse (evidence: `src/components/Step4ParseTrace.tsx`)
- Parse trace → Derivation tree: opens tree (evidence: `src/components/Step4ParseTrace.tsx`)
- Derivation tree → Compiler engine: builds tree (evidence: `src/components/DerivationTreeModal.tsx`)
