Yes it looks possible to recreate the hardware for this from the code. I'm assuming you don't have a diagram or an example for the hardware just the code and that's why you are asking? This appears to want some (3 in this example) 74hc595 shift registers to drive the leds some push buttons (5 here) one to a pin to toggle the position of the switches (I assume a trunout is another name for a switch in modelrailroadese) and some servos (5 here one for each switch) . All the parts exist in Fritzing so it is fairly trivial to create this. The only thing unclear to me is why 3 shift registers, and why 4 values (I think because there are 2 leds one for each direction of the switch to act as signals) which would mean 10 leds in total.
TURNOUT_DATA turnouts[NUMBER_OF_TURNOUTS] = {
{{A0, 2, 93, 117, 0, 1, 2, 3}},
I think the end 4 numbers (0 to 3) are led positions in the shift register, presumably red green green red 2 for each position of the switch. Based on that this sketch implements (or is at least close to) the hardware this is expecting. I only did schematic not breadboard although I could do breadboard if you can't figure it out as well. The 220 ohm led resistor values may need to change up or down depending on what leds you are using (if you proceed feel free to post what leds you are using an I can calculate appropriate values for you. The polarity may be wrong as well if he assumed common cathode, changing the sketch would be the easy fix to that. Enjoy
switch.fzz (39.9 KB)