How cjtarre/cmsc-124-ps1-starter works
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: driver.c Execute Commands · print.c Value Printer · main.c Program Entry · dt_array.c Indexed Arrays
Components 16
Interpreter Front End
- Program Entry
src/main.c - Scan Lines
src/driver.c - Validate Commands
src/driver.c - Execute Commands
src/driver.c
Scalar Values
- Tagged Values
src/dt_value.c - Checked Integers
src/dt_int.c - Length-Carrying Strings
src/dt_str.c - Enumerations
src/dt_enum.c
Containers
- Indexed Arrays
src/dt_array.c - Associative Maps
src/dt_map.c - Named Records
src/dt_record.c - Fixed Tuples
src/dt_tuple.c - Linked Lists
src/dt_list.c
References and Output
- Owned References
src/dt_ref.c - Value Printer
src/print.c
Other components
- Case File User
Connections 18
- Case File User → Program Entry: provides case
src/main.c - Program Entry → Scan Lines: runs driver
src/main.c - Scan Lines → Validate Commands: tokenizes lines
src/driver.c - Validate Commands → Execute Commands: validates commands
src/driver.c - Execute Commands → Tagged Values: uses values
README.md - Execute Commands → Checked Integers: dispatches operations
README.md - Execute Commands → Length-Carrying Strings: dispatches operations
README.md - Execute Commands → Enumerations: dispatches operations
README.md - Execute Commands → Indexed Arrays: dispatches operations
README.md - Execute Commands → Associative Maps: calls map operations
src/driver.c - Execute Commands → Named Records: dispatches operations
README.md - Execute Commands → Fixed Tuples: dispatches operations
README.md - Execute Commands → Linked Lists: dispatches operations
README.md - Execute Commands → Owned References: dispatches operations
README.md - Value Printer → Indexed Arrays: reads elements
src/print.c - Value Printer → Associative Maps: reads entries
src/print.c - Value Printer → Named Records: reads fields
src/print.c - Value Printer → Owned References: borrows values
src/print.c