source: project/wiki/peep @ 4398

Last change on this file since 4398 was 4398, checked in by felix winkelmann, 13 years ago

peep update, wiki

File size: 3.7 KB
Line 
1[[toc:]]
2[[tags: egg internals]]
3
4== Introduction
5
6The {{peep}} extension can be loaded into the {{chicken}} compiler
7to interactively explore the internal database during compilation
8of a program.
9
10== Requirements
11
12[[http://www.call-with-current-continuation.org/eggs/dissector.html|dissector]].
13
14chicken 2.621 or higher is required to use this extension.
15
16If the [[http://www.call-with-current-continuation.org/eggs/readline.html|readline]]
17extension is installed, the interactive prompt supports line-editing.
18
19== Usage
20
21Pass {{peep}} to the {{-extend}} option while compiling a file. This
22sets the {{user-post-analysis-hook}} and will start a read-eval-print
23loop after all optimizations have been performed. You can enter
24a number of commands (described below) to inspect the analysis
25database and node tree.
26
27See [[chicken-compilation-process]] and [[chicken-internal-structure]] for
28more information about the database and the way {{chicken}} compiles Scheme
29to C code.
30
31Before the compilation starts, a file named {{.peeprc}} will be loaded,
32if it exists, either from the current directory, or from the user's
33home directory.
34
35== Commands
36
37When the REPL is started, you can enter arbitrary Scheme expressions,
38including any of the following commands:
39
40  (.pp [X])            [.p]     pretty-print node or other value (defaults to program graph)
41  (.dump)              [.d]     dump database
42  (.find NAME)         [.f]     find symbol in database
43  (.show SYMBOL)       [.s]     show properties of symbol
44  (.get SYMBOL PROP)   [.g]     get symbol property
45  (.set SYMBOL PROP X)          set symbol property
46  (.select PROP ...)   [.sel]   return list of symbols that have given properties
47  (.inspect [X])       [.i]     inspect value (defaults to program graph)
48  (.props)                      list valid symbol properties
49  (.quit)              [.q]     continue compilation until finished
50  (.continue [PASS])   [.c]     continue until PASS is reached or to next analysis
51  (.help)              [.h]     show this message
52
53The special expression {{#}} holds the result of the last entered expression.
54
55
56== Authors
57
58[[felix winkelmann]]
59
60== License
61
62 Copyright (c) 2007, Felix L. Winkelmann
63 All rights reserved.
64
65 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
66 conditions are met:
67
68   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
69     disclaimer.
70   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
71     disclaimer in the documentation and/or other materials provided with the distribution.
72   Neither the name of the author nor the names of its contributors may be used to endorse or promote
73     products derived from this software without specific prior written permission.
74
75 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
76 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
77 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
78 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
79 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
80 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
81 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
82 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
83 POSSIBILITY OF SUCH DAMAGE.
84
85== Version History
86
87; 0.2 : .peeprc, adapted to CHICKEN 2.621, new commands, dropped readline requirement
88; 0.1 : initial release
Note: See TracBrowser for help on using the repository browser.