I feel I got a little confused here distinguishing sub-expression from expression.
Compound expression – An expression involving more than one operator.
E.g. 1 + 1 * 1
Expression – An operator with one or more operands.
E.g 1 + 1 or + 1
is there a level below the expression which is called a sub-expression?
An expression may not have an operator. For example, in the following:
ais an expression. An expression is, to quote the C++ Standard, “a sequence of operators and operands that specifies a computation” (C++03 5/1). Here,ais an “operand” even though there is no operator.A subexpression is any expression that is a piece of a larger expression. So, in
a * bandc * dare subexpressions.The word “compound” is usually used with respect to statements, not expressions. A compound statement is a pair of braces that may contain a sequence of other statements. For example, a function body is almost always a compound statement, as are many loop bodies.
Usually, complex expressions are just referred to simply as “expressions” and their parts are referred to as subexpressions.