Skip to content

Commit

Permalink
import illguts-0.13.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Dec 15, 2009
1 parent f70184d commit 63fbe5f
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 75 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ eps:
%.png: %.epsx
./epsx2eps $< >$@.eps
./eps2png $@.eps >$@
test -s $@ || rm $@
rm $@.eps

clean:
Expand All @@ -67,7 +68,7 @@ dist: all VERSION

# deps
av.png: av.epsx common.ps sv.ps rect.ps ptr.ps box.ps mws.ps break.ps
cv.png: cv.epsx common.ps sv.ps rect.ps ptr.ps box.ps mws.ps magic.ps
cv.png: cv.epsx common.ps sv.ps rect.ps ptr.ps box.ps mws.ps magic.ps pad.ps
flags.png: flags.epsx common.ps mws.ps rect.ps
gv.png: gv.epsx common.ps sv.ps rect.ps ptr.ps box.ps mws.ps gp.ps chararray.ps
hv.png: hv.epsx common.ps sv.ps rect.ps ptr.ps box.ps mws.ps he.ps chararray.ps break.ps
Expand All @@ -76,7 +77,7 @@ ook.png: ook.epsx common.ps sv.ps rect.ps ptr.ps box.ps break.ps
op1.png: op1.epsx common.ps box.ps rect.ps mws.ps op.ps
op2.png: op2.epsx common.ps box.ps rect.ps mws.ps op.ps
optypes.png: optypes.epsx common.ps arrow.ps
pad.png: pad.epsx common.ps sv.ps rect.ps ptr.ps box.ps mws.ps break.ps
pad.png: pad.epsx common.ps sv.ps rect.ps ptr.ps box.ps mws.ps break.ps pad.ps
scope.png: scope.epsx common.ps rect.ps ptr.ps break.ps dist.ps sv.ps
stack.png: stack.epsx common.ps rect.ps ptr.ps break.ps dist.ps sv.ps box.ps mws.ps
stash.png: stash.epsx common.ps stash.ps rect.ps ptr.ps box.ps glob.ps mws.ps sv.ps
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12
0.13
18 changes: 15 additions & 3 deletions cv.epsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: -5 70 110 310
%%Creator: Gisle Aas (Copyright 1998)
%%BoundingBox: -5 70 300 310
%%Creator: Gisle Aas (Copyright 1998), Reini Urban 2009

%require "common.ps"
%require "sv.ps"
Expand All @@ -22,9 +22,21 @@
/Helvetica 11 SF
60 303 15 sub M

[(GvSTASH) (CUR) (LEN) (DEPTH) (MAGIC) (STASH) (CvSTASH) (START_u) (ROOT_u) (GV) (FILE) (PADLIST) (OUTSIDE) (OUTSIDE_SEQ) (FLAGS)] {
[(GvSTASH) (CUR) (LEN) (DEPTH) (MAGIC) (STASH) (CvSTASH) (START_u) (ROOT_u) (GV) (FILE) (PADLIST) (OUTSIDE) (OUTSIDE_SEQ) (CvFLAGS)] {
gsave
currentpoint 30 mws pop
grestore
0 -15 rmoveto
} forall

% PADLIST
105 127.5 135 202.5 ptrn
% DEPTH
/Courier 8 SF
/y 8 15 mul 127.5 add def
115 y 1 add M (depth=0) show
105 y 120 y 120 202.5 15 sub 135 202.5 15 sub ptrn

80 -40 translate
%include "pad.ps"

Binary file modified cv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions eps2png
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/sh

./eps2ppm $1 | pnmscale 0.4 | ppmquant 32 | pnmtopng -compression 9

./eps2ppm $1 > _err
if $(grep "Error:" _err >/dev/null); then
cat _err; rm _err
exit
fi
cat _err | (rm _err; pnmscale 0.4) | ppmquant 32 | pnmtopng -compression 9
3 changes: 0 additions & 3 deletions eps2ppm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ while (<FILE>) {
if (my($llx, $lly, $urx, $ury) =
/^%%BoundingBox:\s*(-?[0-9\.]+)\s+(-?[0-9\.]+)\s+(-?[0-9\.]+)\s+(-?[0-9\.]+)/)
{

warn "$file: BBox: $llx $lly $urx $ury\n";

my($w,$h) = map {$_ *= $scale} ($urx - $llx, $ury - $lly);
Expand All @@ -22,7 +21,6 @@ while (<FILE>) {

print GS "$scale dup scale $llx neg $lly neg translate %\n";


} elsif (/^%/ && !$gs) {
# ignore comments
} elsif (!$gs) {
Expand All @@ -33,5 +31,4 @@ while (<FILE>) {
}

print GS "\nshowpage\n";

close(GS);
135 changes: 71 additions & 64 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
topmargin=0>

<h1 align="center" name="top">
PerlGuts Illustrated<br><small>Version 0.12, for perl 5.11.2
PerlGuts Illustrated<br><small>Version 0.13, for perl 5.11.2
</small></h1>

<p>This document is meant to supplement the <i>perlguts(1)</i> manual
Expand Down Expand Up @@ -438,7 +438,7 @@ <h2><a name="sviv">SvIV</a> and <a name="svnv">SvNV</a></h2>

<a name="svpvmg"><h2>SvPVMG</h2></a>

<p>Blessed scalars ar othr magic attached. <i>SvPVMG</i> has two
<p>Blessed scalars or other magic attached. <i>SvPVMG</i> has two
additional fields; MAGIC and STASH. MAGIC is a pointer to additional
structures that contains callback functions and other data. If the
MAGIC pointer is non-NULL, then one or more of the MAGICAL flags will
Expand Down Expand Up @@ -499,7 +499,7 @@ <h2><a name="sviv">SvIV</a> and <a name="svnv">SvNV</a></h2>
is.
</ol>

The struct magic_state is stored on the global <a
The <code>struct magic_state</code> is stored on the global <a
href="#stacks">savestack</a>. <i>mgs_sv</i> points to our magical sv,
and <i>mgs_ss_ix</i> points on the savestack after the saved
destructor.
Expand Down Expand Up @@ -627,7 +627,7 @@ <h2><a name="sviv">SvIV</a> and <a name="svnv">SvNV</a></h2>
efficiently by just adjusting the ARRAY pointer (and FILL/MAX).
Similarly, the pop just involves decrementing the FILL count.

<p>The are only 2 array flags defined:
<p>There are only 2 array flags defined:

<blockquote><dl>

Expand Down Expand Up @@ -764,7 +764,14 @@ <h2><a name="sviv">SvIV</a> and <a name="svnv">SvNV</a></h2>
key and a pointer to this GV as value. See description of
<a href="#stash">stashes</a> below.

<p>GvFLAGS:
<p>A magic of type '*' is always attached to the GV (not shown in the
figure). The magic GET method is used to stringify the globs (as the fully
qualified name prefixed with '*'). The magic SET method is used to alias
an GLOB based on the name of another glob.

<p><center><img src="gv.png"></center>

<p><a name="GvFLAGS"><b>GvFLAGS</b></a>:
<blockquote><dl>

<dt>0x1) <b>INTRO</b>
Expand All @@ -784,13 +791,6 @@ <h2><a name="sviv">SvIV</a> and <a name="svnv">SvNV</a></h2>
<dt>0x80) <b>IMPORTED_CV</b>
</dl></blockquote>

<p>A magic of type '*' is always attached to the GV (not shown in the
figure). The magic GET method is used to stringify the globs (as the fully
qualified name prefixed with '*'). The magic SET method is used to alias
an GLOB based on the name of another glob.

<p><center><img src="gv.png"></center>

<h3><a name="gp">GP</a></h3>

<p>GPs can be shared between one or more GVs. The data type fields
Expand All @@ -801,14 +801,14 @@ <h3><a name="gp">GP</a></h3>
to an AV, etc.) The SV is always present (but might point to a
SvNULL object). All the others are initially NULL.

<p>The additional administrative fields in the GP are: REFCNT, EGV,
CVGEN, LASTEXPR, LINE, FILEGV.
<p>The additional administrative fields in the GP are: CVGEN, REFCNT, EGV,
LINE, FILE_HEK.

<p>REFCNT is a reference counter. It says how many GVs have a pointer
to this GP. It is incremented/decremented as new GVs reference/forget
this GP. When the counter reach 0 the GP is freed.

<p>EGV, the effective gv, if *glob, is a pointer to the GV that
<p>EGV, the "effective gv", if *glob, is a pointer to the GV that
originally created this GP (used to tell the real name of any aliased
symbol). If the original GV is freed, but GP should stay since
another GV reference it, then the EGV is NULLed.
Expand All @@ -818,11 +818,10 @@ <h3><a name="gp">GP</a></h3>
less than the global variable <tt>subgeneration</tt>, then the CV
contains a stale method cache entry. If CVGEN is equal to
<tt>subgeneration</tt> then the CV contains a valid method cache
entry.

(Every time some operation that might invalidate some of the
entry.<br>
Every time some operation that might invalidate some of the
method caches are performed, then the <tt>subgeneration</tt> variable
is incremented.)
is incremented.

<p>FILE_HEK is the name of the file where this symbol was first created.

Expand Down Expand Up @@ -876,7 +875,7 @@ <h3><a name="stash">Stashes</a></h3>

The <i>CV</i> ("code value") is like <i>SvPVMG</i> above, but has
some renamed and additional fields; CvSTASH, START, ROOT, GV, FILE,
DEPTH, PADLIST, OUTSIDE, OUTSIDE_SEQ, FLAGS.
DEPTH, PADLIST, OUTSIDE, OUTSIDE_SEQ, CvFLAGS.

<p><center><img src="cv.png"></center>

Expand All @@ -886,7 +885,7 @@ <h3><a name="stash">Stashes</a></h3>

DEPTH and <a href="#pad">PADLIST</a> are needed to access and check the current scratchpad.

Lexicals are access by looking up the name under GV, the glob in which
Lexicals are accessed by looking up the name under GV, the glob in which
the CV was defined. (really ?)

<p>See <a href="#pad">PAD</a>s and <a href="#op">OP</a>s below.
Expand Down Expand Up @@ -1001,47 +1000,56 @@ <h3><a name="stash">Stashes</a></h3>
</pre></td></tr></table>

We have two BINOPs, SASSIGN and ADD as &lt;2&gt;
and three SVOPs, GVSV and CONST as &lt;$&gt;.

<table><tr valign="top"><td><pre>
my %argnum = (
'S', 1, # scalar
'L', 2, # list
'A', 3, # array value
'H', 4, # hash value
'C', 5, # code value
'F', 6, # file value
'R', 7, # scalar reference
);
and three SVOPs, GVSV and CONST as &lt;$&gt;. <i>Note that for a threaded perl the GVSV OPs would have been PADOPs.</i><p>

<b>B::Concise Types</b>:<br>
<table cellpadding="3"><tr valign="top"><td><pre>
argnum:
S scalar
L list
A array value
H hash value
C code value
F file value
R scalar reference
</pre></td><td><pre>
my %opclass = (
'0', 0, # baseop
'1', 1, # unop
'2', 2, # binop
'|', 3, # logop
'@', 4, # listop
'/', 5, # pmop
'$', 6, # svop_or_padop
'#', 7, # padop
'"', 8, # pvop_or_svop
'{', 9, # loop
';', 10, # cop
'%', 11, # baseop_or_unop
'-', 12, # filestatop
'}', 13, # loopexop
);
opclass:
0 baseop
1 unop
2 binop
| logop
@ listop
/ pmop
$ svop_or_padop
# padop
" pvop_or_svop
{ loop
; cop
% baseop_or_unop
- filestatop
} loopexop
</pre></td><td><pre>
my %opflags = (
'm' => 1, # needs stack mark
'f' => 2, # fold constants
's' => 4, # always produces scalar
't' => 8, # needs target scalar
'T' => 8|256, # ... which may be lexical
'i' => 16, # always produces integer
'I' => 32, # has corresponding int op
'd' => 64, # danger, unknown side effects
'u' => 128, # defaults to $_
);
parsed op_flags:
v Want void
s Want scalar (single value)
l Want list of any length
K Kids
P Parens, or block needs explicit scope entry
R REF
M MOD. Will modify (lvalue)
S Stacked. Some arg is arriving on the stack
* Special. Do something weird for this op
</pre></td><td><pre>
static opcode.pl: %opflags
m needs stack mark
f fold constants
s always produces scalar
t needs target scalar
T ... which may be lexical
i always produces integer
I has corresponding int op
d danger, unknown side effects
u defaults to $_
</pre></td></tr></table>


Expand Down Expand Up @@ -1112,18 +1120,17 @@ <h2><a name="stacks">Stacks</a></h2>
<code>@_</code> is suppressed, and the routine will use the
<code>MARK</code> directly to find it's arguments.


<p>The <code>retstack</code> contains pointers to the operation to go
to after subroutines return. Each time a subroutine is called a new
OP* is pushed on this stack. When a subroutine returns, Perl pop the
top OP* from <code>retstack</code> and continue execution from this
OP* is pushed on this stack. When a subroutine returns, Perl pops the
top OP* from <code>retstack</code> and continues execution from this
place.

<p>The <code>cxstack</code> (context stack) contains records that
describe the current context. Each time a subroutine, an eval or a
loop is entered, then a new PERL_CONTEXT record is pushed on the
<code>cxstack</code>. When subroutine/eval/loop finished then the
record top record is poped and the corresponding values restored. The
record top record is pop'ed and the corresponding values restored. The
PERL_CONTEXT record will eventually be described below.

<p><center><img src="stack.png"></center>
Expand Down

0 comments on commit 63fbe5f

Please sign in to comment.