x/debug: add an expression evaluator.

The evaluator parses the expression with go/parser, then walks through
the resulting syntax tree, evaluating the subexpression at each node.

The expression can include local and global variables.  The program
counter and stack pointer of the stopped program are used to determine
what variables are available, and their location in memory.

The returned result uses the same types as the program.Value function.

The math/big package is used to represent untyped numeric constants.

A go generate rule using the m4 preprocessor is used to produce eval.go.

Change-Id: I5b668308b3dd8361fc16974b3dfe9e1ab423c974
Reviewed-on: https://go-review.googlesource.com/15678
Reviewed-by: Dave Day <djd@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 files changed