# adrian-adrienne/cmsc-124-ps1-starter architecture

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

- Interactive diagram: https://gitdiagram.com/adrian-adrienne/cmsc-124-ps1-starter
- Repository: https://github.com/adrian-adrienne/cmsc-124-ps1-starter

## Overview

This repository is a C17 case-file interpreter and runtime for ten data types. A user supplies a case file; the program validates and executes its commands, then prints results and checks reference ownership. The graph separates the front end, scalar and aggregate runtime types, and output/ownership behavior. The README documents the driver-to-type interface; sampled driver code directly shows map operations and printing. Other per-type dispatch details are not fully excerpted, so those links rely on the README rather than claims of additional source inspection.

Main entry points: [`src/driver.c`](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/driver.c) (Scan, parse, execute), [`src/print.c`](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/print.c) (Value printer), [`src/dt_ref.c`](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_ref.c) (Owned references), [`src/main.c`](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/main.c) (Program entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Interpreter front end"]
  node_main["Program entry<br/>[main.c]"]
  node_driver["Scan, parse, execute<br/>[driver.c]"]
end

subgraph group_scalar["Scalar runtime types"]
  node_value["Tagged values<br/>[dt_value.c]"]
  node_integers["Checked integers<br/>[dt_int.c]"]
  node_strings["Length-carrying strings<br/>[dt_str.c]"]
  node_enums["Enumerations<br/>[dt_enum.c]"]
end

subgraph group_aggregate["Aggregate runtime types"]
  node_arrays["Arrays<br/>[dt_array.c]"]
  node_maps["Maps<br/>[dt_map.c]"]
  node_records["Records<br/>[dt_record.c]"]
  node_tuples["Tuples<br/>[dt_tuple.c]"]
  node_lists["Lists<br/>[dt_list.c]"]
end

subgraph group_lifecycle["Output and ownership"]
  node_references["Owned references<br/>[dt_ref.c]"]
  node_printer["Value printer<br/>[print.c]"]
end

node_user(("Case-file user"))
node_casefile["Case file"]

node_user -->|"provides"| node_casefile
node_casefile -->|"supplies path"| node_main
node_main -->|"runs"| node_driver
node_driver -->|"prints results"| node_printer
node_driver -->|"operates on"| node_maps
node_driver -->|"uses runtime types"| node_value
node_driver -->|"dispatches type operations"| node_integers
node_driver -->|"dispatches type operations"| node_strings
node_driver -->|"dispatches type operations"| node_enums
node_driver -->|"dispatches type operations"| node_arrays
node_driver -->|"dispatches type operations"| node_records
node_driver -->|"dispatches type operations"| node_tuples
node_driver -->|"dispatches type operations"| node_lists
node_driver -->|"checks ownership"| node_references
node_printer -->|"reads elements"| node_arrays
node_printer -->|"reads entries"| node_maps
node_printer -->|"reads fields"| node_records
node_printer -->|"borrows value"| node_references
node_printer -->|"reads bytes"| node_strings
node_driver -->|"reports unreleased cells"| node_references

click node_main "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/main.c"
click node_driver "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/driver.c"
click node_value "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_value.c"
click node_integers "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_int.c"
click node_strings "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_str.c"
click node_enums "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_enum.c"
click node_arrays "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_array.c"
click node_maps "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_map.c"
click node_records "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_record.c"
click node_tuples "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_tuple.c"
click node_lists "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_list.c"
click node_references "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_ref.c"
click node_printer "https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/print.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_driver,node_user toneBlue
class node_value,node_integers,node_strings,node_enums toneAmber
class node_arrays,node_maps,node_records,node_tuples,node_lists toneMint
class node_references,node_printer toneRose
class node_casefile toneIndigo
```

## Components

### Interpreter front end

- [Program entry](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/main.c): `src/main.c`
- [Scan, parse, execute](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/driver.c): `src/driver.c`

### Scalar runtime types

- [Tagged values](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_value.c): `src/dt_value.c`
- [Checked integers](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_int.c): `src/dt_int.c`
- [Length-carrying strings](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_str.c): `src/dt_str.c`
- [Enumerations](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_enum.c): `src/dt_enum.c`

### Aggregate runtime types

- [Arrays](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_array.c): `src/dt_array.c`
- [Maps](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_map.c): `src/dt_map.c`
- [Records](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_record.c): `src/dt_record.c`
- [Tuples](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_tuple.c): `src/dt_tuple.c`
- [Lists](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_list.c): `src/dt_list.c`

### Output and ownership

- [Owned references](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/dt_ref.c): `src/dt_ref.c`
- [Value printer](https://github.com/adrian-adrienne/cmsc-124-ps1-starter/blob/main/src/print.c): `src/print.c`

### Other components

- **Case-file user**
- **Case file**

## Connections

- Case-file user → Case file: provides (evidence: `README.md`)
- Case file → Program entry: supplies path (evidence: `src/main.c`)
- Program entry → Scan, parse, execute: runs (evidence: `src/main.c`)
- Scan, parse, execute → Value printer: prints results (evidence: `src/driver.c`)
- Scan, parse, execute → Maps: operates on (evidence: `src/driver.c`)
- Scan, parse, execute → Tagged values: uses runtime types (evidence: `README.md`)
- Scan, parse, execute → Checked integers: dispatches type operations (evidence: `README.md`)
- Scan, parse, execute → Length-carrying strings: dispatches type operations (evidence: `README.md`)
- Scan, parse, execute → Enumerations: dispatches type operations (evidence: `README.md`)
- Scan, parse, execute → Arrays: dispatches type operations (evidence: `README.md`)
- Scan, parse, execute → Records: dispatches type operations (evidence: `README.md`)
- Scan, parse, execute → Tuples: dispatches type operations (evidence: `README.md`)
- Scan, parse, execute → Lists: dispatches type operations (evidence: `README.md`)
- Scan, parse, execute → Owned references: checks ownership (evidence: `README.md`)
- Value printer → Arrays: reads elements (evidence: `src/print.c`)
- Value printer → Maps: reads entries (evidence: `src/print.c`)
- Value printer → Records: reads fields (evidence: `src/print.c`)
- Value printer → Owned references: borrows value (evidence: `src/print.c`)
- Value printer → Length-carrying strings: reads bytes (evidence: `src/print.c`)
- Scan, parse, execute → Owned references: reports unreleased cells (evidence: `src/driver.c`)
