Package Martel :: Module optimize
[show private | hide private]
[frames | no frames]

Module Martel.optimize

Optimize an expression tree

- remove Group nodes with no name
- merge successive Str, single character positive Any nodes and positive
      Literals

Function Summary
  get_merge_text(exp)
  is_mergeable(exp)
  merge_strings(exp)
merge successive strings and string-like terms into a single Str
  optimize(exp)
expression tree -> optimized expression tree
  optimize_unnamed_groups(exp)
return an equivalent expression tree but without unnamed groups
  optimize_unnamed_groups_recursive(exp)
  skip_empty_group(exp)

Function Details

merge_strings(exp)

merge successive strings and string-like terms into a single Str

WARNING: has side-effects

optimize(exp)

expression tree -> optimized expression tree

Apply various optimizations to the expression tree.

optimize_unnamed_groups(exp)

return an equivalent expression tree but without unnamed groups

WARNING: has side-effect

Generated by Epydoc 2.1 on Thu Aug 10 20:01:06 2006 http://epydoc.sf.net