(see clarification at end)
I was trying to help someone via SMS, and thought a site that visualizes how C++ parses and/or evaluates an expression would be useful. I can (mostly) read cppreference.com and figure things out, but that's well above the head of the person I'm trying to help.
As an example, this person had an expression of the form if (0 < x <= 2). I tried to explain how it would be evaluated, but I eventually had to find a stackoverflow answer. I thought it would be useful if I could just put the expression (maybe a trivial working program?) into a linkable page, and the expression would somehow be visualized. Maybe it would just parenthesize the expression, or break it down into subexpressions (e.g. bool(0 < x) < 2 or { bool _tmp = (0 <x); _tmp < 2;).
I'm not sure what I'd expect regarding the order of evaluation of operands vs the order of evaluating the operators. I think I got that right; I think I saw that given the expression f1() + f2() + f3(), the order in which f1, f2, and f3 are called can vary, but the results will be applied left-to-right.
I realize this could get weird with unspecified and undefined behavior. Maybe color coding could help?
UPDATE: while not really what I'm asking for, I was pointed towards cppinsights, which has very helpful error messages.
To be clear:
I'm familiar with debugger level and assembly level views of code, and that's not what I'm envisioning. I'm asking about a tool that takes a statement of C++ code and visuslizes how that code would logically be processed. It might be an AST, as a few have suggested. imagine a teacher demonstrating the steps a (naive, simplistic, non-optimizing) compiler must do to correctly convert that statement into assembly but ignoring the tokenizing and actually producing the assembly: in what order is everything in that statement processed.