I'm starting to design the application to "read" programs to visually impaired users/authors (legally blind, macular degeneration, diabetic retinopathy, etc.). In general, it's a simple problem (given a formal grammar for the language).
The problem is deciding how much detail to convey, audibly. Remembering that the user/author needs to be able to determine how the compiler will treat (or *has* treated) his code.
E.g., the simplest approach is to read all identifiers (deciding on an algorithm to make those unpronounceable ones pronounceable!) and punctuation. This provides *all* of the information that the compiler will see (act on) so a practiced user can recognize incorrect/missing/absent syntax.
But, it's tedious -- esp when you want to read at rates above normal speaking rates (try reading a piece of code this way, REALLY fast!)
I can tweek the syntax (for my applets, but not for system code -- though the latter is much less likely to be reviewed by such folks) to reduce/eliminate extra punctuation as well as alter how certain punctuation is pronounced, based on context.
E.g., eliminate "==" for equality test in favor of "="; pronounce that as "is equal to" in that context and "gets" when used in assignment. Of course, this restricts the syntax of the language -- but, applets code tiny/trivial algorithms... akin to using a "BASIC" enhanced with support for multiple threads, concurrency, IPC, etc.
Similarly, eliminating commas in favor of whitespace (you don't "hear" commas so having to explicitly mention their presence -- so you can deduce their absence -- is extra work that a sighted author wouldn't encounter).
I can also slip into different voices based on context. E.g., quoted constants (so you don't have to pronounce the quotation marks).
As I suspect damn near everyone reading this is using their eyes and likely has *zero* experience with a screen reader, my question relies on *imagination*; imagine having someone read their code to you over the phone (a common metric for readability). What would make this easiest/most expeditious/least prone to error/misunderstanding?
Another option is to allow the user to selectively invoke a "spell that" mode (I use this elsewhere to address sequences of letters/symbols that aren't prnncbl)
Keep in mind that writing code is already tedious for such a user; reading what he's written shouldn't make this (much) worse!