To compile, you need OCaml, findlib, and extlib.
$ make
This create a binary called brainscan. Then you can give BrainF*ck
program as the argument.
$ ./brainscan '+[]!'
$
BrainScan checks the following condition and prints the command trace
if such conditions could arise.
1. Underflow of the pointer
2. Overflow (> 255) and Underflow (<0) of a buffer-cell value. (Only
with -R or --range option.)
3. Reach the positions marked by !
In the case above, the program infinitely loops between [ and ].
Hence it never reaches !. BrainScan understands this, and terminates
without error messages. On the other hand,
$ ./brainscan ',[]!'
! reached.
0: ,
1: [
3: !
this program may reach ! depending on the input at the ",".
Enjoy!
--
Yamagata Yoriyuki
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
I forgot the URL. You can obtain BrainScan from
http://www15.ocn.ne.jp/~rodinia/brainscan.tar.gz