normalization process.
"""
-import re, os, shutil, webbrowser
+import re, os, webbrowser
from collections import defaultdict
from utils import read_anf, path
from config import dynahome
return pretty, offset
-cssfile = dynahome / 'src' / 'Dyna' / 'Backend' / 'Python' / 'debug-pygments.css'
-jsfile = dynahome / 'external' / 'prototype-1.6.0.3.js'
-
class Edge(object):
def __init__(self, head, label, body):
self.head = head
dynafile = path(dynafile)
-# if not os.path.exists(cssfile) or not os.path.exists(jsfile):
-# print 'Debug must be run from the root of the Dyna source tree.'
-# return
-
d = dynafile + '.d'
d.mkdir_p()
- # XXX: this is sort of silly
- #shutil.copyfile(cssfile, d + '/debug-pygments.css')
- #shutil.copyfile(jsfile, d + '/prototype.js')
-
with file(d / 'index.html', 'wb') as html:
print >> html, HEADING
import re
-from utils import get_module
+from utils import get_module, true, false, null
available = 'trace', 'dump_solution', 'draw_circuit', 'graph', 'save', 'draw'
if cls == 'edge':
# split on arrow ->
u, v = x.split('->')
- print 'edge:', i, u, v
+# print 'edge:', i, u, v
else:
if x in E:
- print 'crux', i, x,
+# print 'crux', i, x,
rule = interp.rules[int(E[x].label)]
x = '%s %% rule %s' % (rule.src, rule.index)
- else:
- print 'node:', i, x
+# else:
+# print 'node:', i, x
return '<g id="%s" class="%s"><title>%s</title>%s</g>' % (i, cls, x, q)