It's the most "alien" experience I've ever had.
Sounds like it was an abstract-declarative sort of narrative - header files are generally references that prospectively describe and model things.
I'm curious if the code was valid. (Hmm, and if the numbers were all fuzzy... people sometimes say they can't read clocks or digits.)
A bilingual friend once shared that they sometimes forgot which language they'd heard something in, their brain could subconsciously translate back and forth with so little effort. This sounds kind of like that.
Hmmmm... programming languages are unique in that they're generally never sounded-out to the same extent as wetware languages, eg in how commas and periods turn into pitch changes and pauses. Human(-to-human) language does have a visual/written component, but it's maybe... hm, 50/50 sounds potentially wrong, but it is sorta half-half; audio serialization is generally awkwardly bolted on to the side with programming, which is generally always visual, and has strong correlation (or even fundamental integration) to control and problem solving.
To integrate all that very young may have perhaps slightly remapped things around such that that language processing developed strong cohesive lock-step with visual/spatial reasoning, with sufficient cohesion that the integration retained structural integrity even when the logical/rational/etc parts of the brain shut down when asleep.
It was a bit like that: no audio! It was the structure and form of the API of a pair of associated classes shifting around fluidly. Very abstract, and not at all like human speech. But it was definitely my thoughts. As in, the code was my stream of consciousness, not a product of it.