factor/basis/compiler/cfg/debugger/debugger.factor

29 lines
761 B
Factor
Raw Normal View History

2008-09-11 03:05:22 -04:00
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel words sequences quotations namespaces io
accessors prettyprint prettyprint.config
compiler.tree.builder compiler.tree.optimizer
compiler.cfg.builder compiler.cfg.linearization ;
IN: compiler.cfg.debugger
GENERIC: test-cfg ( quot -- cfgs )
M: callable test-cfg
2008-09-17 01:46:38 -04:00
build-tree optimize-tree gensym build-cfg ;
2008-09-11 03:05:22 -04:00
M: word test-cfg
2008-09-17 01:46:38 -04:00
[ build-tree-from-word nip optimize-tree ] keep build-cfg ;
2008-09-11 03:05:22 -04:00
: test-mr ( quot -- mrs ) test-cfg [ build-mr ] map ;
: mr. ( mrs -- )
[
boa-tuples? on
"=== word: " write
dup word>> pprint
", label: " write
dup label>> pprint nl nl
instructions>> .
nl
] each ;