1 ### FuncOpViewer and CodeModelFormatter
 2 [Back to Index ../](../index.md)
 3 
 4 We have a few 'tools' in which might be useful to others
 5 
 6 Two in particular
 7 
 8 #### FuncOpViewer
 9 This is a swing app which takes a text file containing text form of a CodeModel (as dumped by the OopWriter)
10 
11 We can generate text for kernels using
12 ```bash
13 HAT=SHOW_KERNEL_MODEL java @.ffi-opencl-example mandel.Main
14 ```
15 
16 From the standard out copy the text starting with `func @loc....1` to the closing `}` and paste it into a file (say mandel.cr)
17 Then
18 ```
19 java -cp build/hat-optkl-1.0.jar:build/hat-tools-1.0.jar hat.tools.textmodel.ui.FuncOpViewer mandle.cr
20 ```
21 
22 ### CodeModelFormatter
23 
24 Is a terminal based tool (useful if you are accessing a machine via ssh - and can't launch ui)
25 
26 With it you can dump to the terminal a colorized version of the code model, slightly prettied up with java source for each line inserted as a comment.
27 
28 ```
29 java -cp build/hat-optkl-1.0.jar:build/hat-tools-1.0.jar  hat.tools.textmodel.terminal.CodeModelFormatter mandle.cr
30 ```
31