On Jan 7, 2019, at 7:51 PM, Kim EungKyun <
ek95...@gmail.com> wrote:
> In chapter 6.5.2.3, it states "any Expression starts with a Term and such a Term can be followed by a + or -."
>
> But, looking at the grammar rule, an expression does not start with a term. It starts with an expression.
>
> Expression:
> Term
> Expression '+' Term
> Expression '-' Term
Let's use the term "Addop" (additive operation) to mean + or -. The grammar says that an Expression is either a Term or has the form Expression Addop Term. Since a Term is a kind of Expression, the recursive part tells us that Term Addop Term is an Expression. Since Term Addop Term is an Expression, the recursive part now tells us that Term Addop Term Addop Term is an Expression. Continuing in this manner, we see that an Expression is a sequence of Terms, separated by Addops.
> would appreciate if someone could clear this up.
> My guess is that it is because "every Term is an Expression, but not every Expression is a Term" (chapter 6.5.2.2), but I don't quite understand why not every Expression is a Term.
For example: a+b is an Expression, but not a Term.
Art Werschulz
a...@comcast.net