[Compiler-sig] progress on new AST

Jeremy Hylton jeremy@zope.com
Thu, 11 Apr 2002 16:15:51 -0400


>>>>> "FB" == Finn Bock <bckfnn@worldonline.dk> writes:

  FB> [Jerymy]
  >> I've been working on a new AST defined in ASDL ...

  FB> Another question: Whats with the Lvalue constructor? It strikes
  FB> me as a somewhat strange way of describing a 'expr'. Is it just
  FB> a consequence of some asdl limitation? Are there a reason for
  FB> having a Lvalue node in the AST?

The Lvalue node captures the notion that a limited subset of
expressions can occur in two contexts -- as an expression or as the
target of an assignment.  A single constructor can appear only once;
otherwise its type would be ambiguous.  Example: Name() can be an
expression and the target of an assignment.  A ListComp() is an
expression, but can not be assigned to.  The extra Lvalue()
constructor captures the distinction.

Jeremy