I am going through the Go source code of ast.go at here,and there are 3 types of interfaces that are Expression,Statement and Declaration. But only with the source code I couldn't figure out the difference between them.What I could figure out is that expression results in a object that could be assigned or compared or used as parameter,while statements are some flow control like if-else or for loop. But I found some definitions like
// An IncDecStmt node represents an increment or decrement statement.
IncDecStmt struct {
X Expr
TokPos token.Pos // position of Tok
Tok token.Token // INC or DEC
}
shouldn't it be a expression?I feel confused how to distinguish expressions and statements,are there any rules?