1.1 --- a/simplified.py Tue Oct 24 23:04:27 2006 +0200
1.2 +++ b/simplified.py Tue Oct 24 23:05:02 2006 +0200
1.3 @@ -1,7 +1,9 @@
1.4 #!/usr/bin/env python
1.5
1.6 """
1.7 -Simplified AST nodes for easier type propagation and analysis.
1.8 +Simplified program nodes for easier type propagation and analysis. This module
1.9 +contains nodes representing program instructions or operations, program
1.10 +structure or organisation, and abstract program data.
1.11
1.12 Copyright (C) 2006 Paul Boddie <paul@boddie.org.uk>
1.13
1.14 @@ -276,6 +278,8 @@
1.15 self._pprint(indent + 2, "| ", "when %s: %s" % (ref, attribute), stream=stream)
1.16 self._pprint(indent, "", "--------", stream=stream)
1.17
1.18 +# These are the supported "operations" described by simplified program nodes.
1.19 +
1.20 class Pass(Node): "A placeholder node corresponding to pass."
1.21 class Return(Node): "Return an evaluated expression."
1.22 class Assign(Node): "A grouping node for assignment-related operations."
1.23 @@ -296,11 +300,10 @@
1.24 class Raise(Node): "An exception raising node."
1.25 class Not(Node): "A negation of an expression."
1.26 class Choice(Node): "A special node which indicates a choice of expressions."
1.27 +class Invoke(Node): "An invocation."
1.28
1.29 # Invocations involve some more work to process calculated attributes.
1.30
1.31 -class Invoke(Node): "An invocation."
1.32 -
1.33 class InvokeFunction(Invoke):
1.34
1.35 "A function or method invocation."
1.36 @@ -343,6 +346,8 @@
1.37 def full_name(self):
1.38 return self._full_name
1.39
1.40 +# Program structure nodes.
1.41 +
1.42 class Module(Node):
1.43
1.44 "A Python module."