[Subversion] / BytecodeAssembler / peak / util / assembler.txt |
No default branch
Bookmark a link to HEAD:
(view)
(download)
Major update: lots of docs, block support, loops, break, continue, exception handling, pseudo-"switch" statement demo, .label() renamed to .here(), constant folding, const_value() API, NotAConstant exception.
Major doc upgrade and new features: Return() nodes, code() accepts multiple args, and forward references can be used as code generation targets. Booleans are now treated as constants. Local() vars can now be references to cell/free variables, and free/cell index lookup is fixed. ``curry()`` is now ``ast_curry()``, and handles ``None`` arguments by replacing them with special ``nil`` objects, correcting the problem of naively using ``None`` for AST child nodes. And the documentation now covers virtually all of the package's current functionality.
Mark tests that fail under Python 2.3, and explain why.
Refactor the high-level API: it's now .return_() instead of .Return(), Local() has to be used to load local variables, and virtually any immutable type (including strings and None) can now be used for direct value generation. The high-level APIs now curry themselves so that ASTs can be used as dictionary keys (useful for identifying common subexpressions, as PEAK-Rules will need to do). Also, added lots of documentation (although there's still quite a lot left to write), and fixed a couple of bugs.
Code generation, function cloning, code flags support, some work on closures.
Spin off RuleDispatch's bytecode assembler into a separate project.
Added jumps, labels, and backpatching forward references, all of which turned out to be easier to do than I expected, as long as we assume the total code size is <64K. At this point, the assembler probably has everything it will need for doing generic function stuff, so I probably won't bother with any special support for loops or try: blocks, or for that matter nested scopes. At some point, the <64K limit for jump handling may need to be fixed, though, if we ever generate big enough generic functions. (Which assumes I ever manage to generate something useful with this module in the first place, which is not a given at this point.)
Preliminary draft of an "assembler" for Python bytecode, to be used in later code generation of generic functions. The only features missing at this point are jumps, block management, and nested scope support. Docs are also sketchy as yet, but I wanted to get a snapshot into source control before I stop work on it for now. See assembler.txt for examples of what's implemented so far.
cvs-admin@eby-sarna.com Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |