I mean, suppose I have this expression:
2 + 2
I want to get something like this:
as an output. I've tried FullForm, but this just evaluates 2+2 and returns 4. Is this even possible?
tree = Function[x, Defer @ FullForm @ x, HoldAll];
2 + 2 // tree
For some explanation of the mechanics of this code see: Why doesn't "Defer" work with "TableForm"?
See also my standard methods for analyzing parsing.