# cjtarre/cmsc-124-ps1-starter architecture

> Architecture diagram of the GitHub repository cjtarre/cmsc-124-ps1-starter, 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/cjtarre/cmsc-124-ps1-starter
- Repository: https://github.com/cjtarre/cmsc-124-ps1-starter

## Overview

This is a C17 case-file interpreter for exercising ten Unit 5 data types. A user supplies a case file; the program scans its lines, validates commands and names, executes operations against values and containers, and prints results or errors. The README documents the scan/parse/execute workflow and the ten implementation modules. The driver and several data modules are only partially excerpted, so links to datatype implementations rely on the README’s product map; specific printer-to-container calls are shown in the printer excerpt.

Main entry points: [`src/driver.c`](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/driver.c) (Execute Commands), [`src/print.c`](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/print.c) (Value Printer), [`src/main.c`](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/main.c) (Program Entry), [`src/dt_array.c`](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_array.c) (Indexed Arrays)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Interpreter Front End"]
  node_main["Program Entry<br/>[main.c]"]
  node_scan["Scan Lines<br/>[driver.c]"]
  node_parse["Validate Commands<br/>[driver.c]"]
  node_execute["Execute Commands<br/>[driver.c]"]
end

subgraph group_values["Scalar Values"]
  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_containers["Containers"]
  node_arrays["Indexed Arrays<br/>[dt_array.c]"]
  node_maps["Associative Maps<br/>[dt_map.c]"]
  node_records["Named Records<br/>[dt_record.c]"]
  node_tuples["Fixed Tuples<br/>[dt_tuple.c]"]
  node_lists["Linked Lists<br/>[dt_list.c]"]
end

subgraph group_ownership["References and Output"]
  node_refs["Owned References<br/>[dt_ref.c]"]
  node_printer["Value Printer<br/>[print.c]"]
end

node_user(("Case File User"))

node_user -->|"provides case"| node_main
node_main -->|"runs driver"| node_scan
node_scan -->|"tokenizes lines"| node_parse
node_parse -->|"validates commands"| node_execute
node_execute -->|"uses values"| node_value
node_execute -->|"dispatches operations"| node_integers
node_execute -->|"dispatches operations"| node_strings
node_execute -->|"dispatches operations"| node_enums
node_execute -->|"dispatches operations"| node_arrays
node_execute -->|"calls map operations"| node_maps
node_execute -->|"dispatches operations"| node_records
node_execute -->|"dispatches operations"| node_tuples
node_execute -->|"dispatches operations"| node_lists
node_execute -->|"dispatches operations"| node_refs
node_printer -->|"reads elements"| node_arrays
node_printer -->|"reads entries"| node_maps
node_printer -->|"reads fields"| node_records
node_printer -->|"borrows values"| node_refs

click node_main "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/main.c"
click node_scan "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/driver.c"
click node_parse "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/driver.c"
click node_execute "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/driver.c"
click node_value "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_value.c"
click node_integers "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_int.c"
click node_strings "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_str.c"
click node_enums "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_enum.c"
click node_arrays "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_array.c"
click node_maps "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_map.c"
click node_records "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_record.c"
click node_tuples "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_tuple.c"
click node_lists "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_list.c"
click node_refs "https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_ref.c"
click node_printer "https://github.com/cjtarre/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_scan,node_parse,node_execute,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_refs,node_printer toneRose
```

## Components

### Interpreter Front End

- [Program Entry](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/main.c): `src/main.c`
- [Scan Lines](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/driver.c): `src/driver.c`
- [Validate Commands](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/driver.c): `src/driver.c`
- [Execute Commands](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/driver.c): `src/driver.c`

### Scalar Values

- [Tagged Values](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_value.c): `src/dt_value.c`
- [Checked Integers](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_int.c): `src/dt_int.c`
- [Length-Carrying Strings](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_str.c): `src/dt_str.c`
- [Enumerations](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_enum.c): `src/dt_enum.c`

### Containers

- [Indexed Arrays](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_array.c): `src/dt_array.c`
- [Associative Maps](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_map.c): `src/dt_map.c`
- [Named Records](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_record.c): `src/dt_record.c`
- [Fixed Tuples](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_tuple.c): `src/dt_tuple.c`
- [Linked Lists](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_list.c): `src/dt_list.c`

### References and Output

- [Owned References](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/dt_ref.c): `src/dt_ref.c`
- [Value Printer](https://github.com/cjtarre/cmsc-124-ps1-starter/blob/main/src/print.c): `src/print.c`

### Other components

- **Case File User**

## Connections

- Case File User → Program Entry: provides case (evidence: `src/main.c`)
- Program Entry → Scan Lines: runs driver (evidence: `src/main.c`)
- Scan Lines → Validate Commands: tokenizes lines (evidence: `src/driver.c`)
- Validate Commands → Execute Commands: validates commands (evidence: `src/driver.c`)
- Execute Commands → Tagged Values: uses values (evidence: `README.md`)
- Execute Commands → Checked Integers: dispatches operations (evidence: `README.md`)
- Execute Commands → Length-Carrying Strings: dispatches operations (evidence: `README.md`)
- Execute Commands → Enumerations: dispatches operations (evidence: `README.md`)
- Execute Commands → Indexed Arrays: dispatches operations (evidence: `README.md`)
- Execute Commands → Associative Maps: calls map operations (evidence: `src/driver.c`)
- Execute Commands → Named Records: dispatches operations (evidence: `README.md`)
- Execute Commands → Fixed Tuples: dispatches operations (evidence: `README.md`)
- Execute Commands → Linked Lists: dispatches operations (evidence: `README.md`)
- Execute Commands → Owned References: dispatches operations (evidence: `README.md`)
- Value Printer → Indexed Arrays: reads elements (evidence: `src/print.c`)
- Value Printer → Associative Maps: reads entries (evidence: `src/print.c`)
- Value Printer → Named Records: reads fields (evidence: `src/print.c`)
- Value Printer → Owned References: borrows values (evidence: `src/print.c`)
