| ★ wanayoo — archive 1999 http://www.python.org/doc/current/lib/Creating_ASTs.html | Nouvelle recherche | Portail wanayoo |
AST objects may be created from source code or from a parse tree. When creating an AST object from source, different functions are used to create the 'eval' and 'exec' forms.
Sequences representing terminal tokens may be represented as either two-element lists of the form (1, 'name') or as three-element lists of the form (1, 'name', 56). If the third element is present, it is assumed to be a valid line number. The line number may be specified for any subset of the terminal symbols in the input tree.