Generalized operators for programming languages After asking this question on stackoverflow, it has changed slightly.  Is there a way to represent a grammar as a basis for a vector space and represent a program as an object that lives in that vector space?

I'm interested in the parallels between mathematical operators (like the Hamiltonian, ladder operators, momentum operators, etc) and programming languages.  The operators that I'm talking about can be thought of as transformation matrices that act on (potentially) infinite vectors.  It seems like a good place to start might be a tree algebra?

An alternative would be to force the program into some sort of allowed bitwise representation, and then perform transforms on it.  Is such a thing possible?
You might be interested in the citations provided in the following post on CSTheory.StackExchange: https://cstheory.stackexchange.com/q/19091/5038  They get at something roughly similar to what you are asking for.

See also the algebraic theory of parsing, e.g., https://cstheory.stackexchange.com/q/9000/5038  It seems like it too might be in the space that you are interested in.