# yaminmusleh/nexcore-project architecture

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

- Interactive diagram: https://gitdiagram.com/yaminmusleh/nexcore-project
- Repository: https://github.com/yaminmusleh/nexcore-project

## Overview

NexCore is a compiler for `.nex` programs, with a separate Qt desktop editor. The compiler workflow reads a source file, scans and parses it into AST nodes, generates assembly, then invokes NASM and the linker to produce an executable. Studio adds editing, file navigation, compiler diagnostics, and optional program execution. The graph includes the documented language capabilities; implementation details for generated parser/scanner internals and some Studio wiring were not sampled, so those relationships are shown only where the README or excerpts support them.

Main entry points: [`studio/src/MainWindow.cpp`](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/MainWindow.cpp) (Main Window), [`src/main.cpp`](https://github.com/yaminmusleh/nexcore-project/blob/main/src/main.cpp) (Compiler Entry), [`studio/src/BuildController.cpp`](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/BuildController.cpp) (Build Controller), [`src/generation.h`](https://github.com/yaminmusleh/nexcore-project/blob/main/src/generation.h) (Assembly Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_compiler["Compiler"]
  node_compiler_entry["Compiler Entry<br/>[main.cpp]"]
  node_generator["Assembly Generator<br/>[generation.h]"]
  node_assembly["Assembly Output"]
end

subgraph group_frontend["Language Front End"]
  node_scanner["Scanner<br/>[Scanner.cpp]"]
  node_parser["Parser<br/>[Parser.cpp]"]
  node_grammar["Grammar Actions<br/>[Nex.atg]"]
  node_parser_support["AST Builders<br/>[parser_support.cpp]"]
  node_ast["AST Nodes<br/>[ast.h]"]
  node_arena["Arena Allocator<br/>[arena.h]"]
end

subgraph group_studio["NexCore Studio"]
  node_studio_app["Studio Application<br/>[main.cpp]"]
  node_main_window["Main Window<br/>[MainWindow.cpp]"]
  node_editor["Code Editor<br/>[CodeEditor.cpp]"]
  node_highlighter["Syntax Highlighter<br/>[NexHighlighter.cpp]"]
  node_sidebar["File Sidebar<br/>[Sidebar.cpp]"]
  node_find_bar["Find Bar<br/>[FindBar.cpp]"]
  node_welcome["Welcome Page<br/>[WelcomePage.cpp]"]
  node_build_controller["Build Controller"]
  node_output_panel["Output Panel<br/>[OutputPanel.cpp]"]
end

subgraph group_integrations["Build Integrations"]
  node_nasm["NASM Assembler"]
  node_linker["System Linker"]
end

node_developer(("Programmer"))
node_source["Nex Source"]
node_executable["Program Executable"]

node_developer -->|"writes"| node_source
node_source -->|"opens"| node_compiler_entry
node_compiler_entry -->|"constructs"| node_scanner
node_compiler_entry -->|"parses with"| node_parser
node_parser -->|"builds via"| node_parser_support
node_parser -->|"constructs"| node_ast
node_parser_support -->|"allocates in"| node_arena
node_parser_support -->|"creates"| node_ast
node_compiler_entry -->|"generates with"| node_generator
node_generator -.->|"reads"| node_ast
node_generator -->|"produces"| node_assembly
node_compiler_entry -->|"invokes"| node_nasm
node_assembly -->|"assembles"| node_nasm
node_compiler_entry -->|"invokes"| node_linker
node_nasm -->|"provides object"| node_linker
node_linker -->|"links"| node_executable
node_developer -->|"opens"| node_studio_app
node_studio_app -->|"creates"| node_main_window
node_main_window -->|"hosts"| node_editor
node_main_window -->|"uses"| node_highlighter
node_main_window -->|"uses"| node_sidebar
node_main_window -->|"uses"| node_find_bar
node_main_window -->|"shows"| node_welcome
node_main_window -->|"starts builds"| node_build_controller
node_build_controller -->|"runs"| node_compiler_entry
node_build_controller -->|"runs after build"| node_executable
node_main_window -->|"displays results"| node_output_panel
node_build_controller -.->|"streams output"| node_output_panel
node_build_controller -.->|"reports diagnostics"| node_editor

click node_compiler_entry "https://github.com/yaminmusleh/nexcore-project/blob/main/src/main.cpp"
click node_scanner "https://github.com/yaminmusleh/nexcore-project/blob/main/generated/Scanner.cpp"
click node_parser "https://github.com/yaminmusleh/nexcore-project/blob/main/generated/Parser.cpp"
click node_grammar "https://github.com/yaminmusleh/nexcore-project/blob/main/docs/Nex.atg"
click node_parser_support "https://github.com/yaminmusleh/nexcore-project/blob/main/src/parser_support.cpp"
click node_ast "https://github.com/yaminmusleh/nexcore-project/blob/main/src/ast.h"
click node_arena "https://github.com/yaminmusleh/nexcore-project/blob/main/src/arena.h"
click node_generator "https://github.com/yaminmusleh/nexcore-project/blob/main/src/generation.h"
click node_studio_app "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/main.cpp"
click node_main_window "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/MainWindow.cpp"
click node_editor "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/CodeEditor.cpp"
click node_highlighter "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/NexHighlighter.cpp"
click node_sidebar "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/Sidebar.cpp"
click node_find_bar "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/FindBar.cpp"
click node_welcome "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/WelcomePage.cpp"
click node_build_controller "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/BuildController.cpp"
click node_output_panel "https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/OutputPanel.cpp"

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_compiler_entry,node_generator,node_assembly toneBlue
class node_scanner,node_parser,node_grammar,node_parser_support,node_ast,node_arena toneAmber
class node_studio_app,node_main_window,node_editor,node_highlighter,node_sidebar,node_find_bar,node_welcome,node_build_controller,node_output_panel toneMint
class node_nasm,node_linker toneRose
class node_developer,node_source,node_executable toneIndigo
```

## Components

### Compiler

- [Compiler Entry](https://github.com/yaminmusleh/nexcore-project/blob/main/src/main.cpp): `src/main.cpp`
- [Assembly Generator](https://github.com/yaminmusleh/nexcore-project/blob/main/src/generation.h): `src/generation.h`
- **Assembly Output**

### Language Front End

- [Scanner](https://github.com/yaminmusleh/nexcore-project/blob/main/generated/Scanner.cpp): `generated/Scanner.cpp`
- [Parser](https://github.com/yaminmusleh/nexcore-project/blob/main/generated/Parser.cpp): `generated/Parser.cpp`
- [Grammar Actions](https://github.com/yaminmusleh/nexcore-project/blob/main/docs/Nex.atg): `docs/Nex.atg`
- [AST Builders](https://github.com/yaminmusleh/nexcore-project/blob/main/src/parser_support.cpp): `src/parser_support.cpp`
- [AST Nodes](https://github.com/yaminmusleh/nexcore-project/blob/main/src/ast.h): `src/ast.h`
- [Arena Allocator](https://github.com/yaminmusleh/nexcore-project/blob/main/src/arena.h): `src/arena.h`

### NexCore Studio

- [Studio Application](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/main.cpp): `studio/src/main.cpp`
- [Main Window](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/MainWindow.cpp): `studio/src/MainWindow.cpp`
- [Code Editor](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/CodeEditor.cpp): `studio/src/CodeEditor.cpp`
- [Syntax Highlighter](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/NexHighlighter.cpp): `studio/src/NexHighlighter.cpp`
- [File Sidebar](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/Sidebar.cpp): `studio/src/Sidebar.cpp`
- [Find Bar](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/FindBar.cpp): `studio/src/FindBar.cpp`
- [Welcome Page](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/WelcomePage.cpp): `studio/src/WelcomePage.cpp`
- [Build Controller](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/BuildController.cpp): `studio/src/BuildController.cpp`
- [Output Panel](https://github.com/yaminmusleh/nexcore-project/blob/main/studio/src/OutputPanel.cpp): `studio/src/OutputPanel.cpp`

### Build Integrations

- **NASM Assembler**
- **System Linker**

### Other components

- **Programmer**
- **Nex Source**
- **Program Executable**

## Connections

- Programmer → Nex Source: writes (evidence: `README.md`)
- Nex Source → Compiler Entry: opens (evidence: `src/main.cpp`)
- Compiler Entry → Scanner: constructs (evidence: `src/main.cpp`)
- Compiler Entry → Parser: parses with (evidence: `src/main.cpp`)
- Parser → AST Builders: builds via (evidence: `README.md`)
- Parser → AST Nodes: constructs (evidence: `README.md`)
- AST Builders → Arena Allocator: allocates in
- AST Builders → AST Nodes: creates
- Compiler Entry → Assembly Generator: generates with (evidence: `src/main.cpp`)
- Assembly Generator → AST Nodes: reads
- Assembly Generator → Assembly Output: produces
- Compiler Entry → NASM Assembler: invokes (evidence: `src/main.cpp`)
- Assembly Output → NASM Assembler: assembles
- Compiler Entry → System Linker: invokes (evidence: `src/main.cpp`)
- NASM Assembler → System Linker: provides object
- System Linker → Program Executable: links
- Programmer → Studio Application: opens
- Studio Application → Main Window: creates (evidence: `studio/src/main.cpp`)
- Main Window → Code Editor: hosts (evidence: `studio/src/MainWindow.cpp`)
- Main Window → Syntax Highlighter: uses (evidence: `studio/src/MainWindow.cpp`)
- Main Window → File Sidebar: uses (evidence: `studio/src/MainWindow.cpp`)
- Main Window → Find Bar: uses (evidence: `studio/src/MainWindow.cpp`)
- Main Window → Welcome Page: shows (evidence: `studio/src/MainWindow.cpp`)
- Main Window → Build Controller: starts builds (evidence: `studio/src/MainWindow.cpp`)
- Build Controller → Compiler Entry: runs (evidence: `studio/src/BuildController.cpp`)
- Build Controller → Program Executable: runs after build (evidence: `studio/src/BuildController.cpp`)
- Main Window → Output Panel: displays results (evidence: `studio/src/MainWindow.cpp`)
- Build Controller → Output Panel: streams output
- Build Controller → Code Editor: reports diagnostics
