# HG changeset patch # User Sigurd Meldgaard # Date 1278495520 -7200 # Node ID 4ad646307bd79c50a4d3bff19a29165cce8a4965 # Parent ca43b16ec8e1f718c509ae3a3129c75d58a8d79b flow.py: pycheck corrections of style diff -r ca43b16ec8e1 -r 4ad646307bd7 pysmcl/flow.py --- a/pysmcl/flow.py Wed Jul 07 11:35:52 2010 +0200 +++ b/pysmcl/flow.py Wed Jul 07 11:38:40 2010 +0200 @@ -14,7 +14,7 @@ stored in each statement-node in_values and out_values, under the *key*. - function (FunctionDef) The function to analyze + function (FunctionDef) The function to analyze join (function) A function which takes a set of nodes to be joined @@ -24,11 +24,12 @@ key (String) A string used to index into the out_values dictionary init (Lattice point) The initial lattice point - + distribute (function): a function telling how information is passed on to children of a statement """ + def default_distribute(x): for child in x.children: child.in_values[key] = x.out_values[key] @@ -40,7 +41,7 @@ Flow().flow(function) - statements = [i for i in ast.walk(function) if isinstance(i,ast.stmt)] + statements = [i for i in ast.walk(function) if isinstance(i, ast.stmt)] statements.append(function) function.out_values[key]=copy(init) @@ -81,8 +82,8 @@ # in_values and out_values are used for storing # lattice-points in for static analyses using the monotone # framework. - child.in_values = {"secret" : set(), "range": None} - child.out_values = {"secret" : set(), "range": None} + child.in_values = {"secret": set(), "range": None} + child.out_values = {"secret": set(), "range": None} child.initialized = True # Todo - edges from function returns... @@ -162,6 +163,5 @@ graph.entry =processed[entry] return graph - def to_dot_string(self, entry): return self.to_graph(entry).to_dot_string()