📄 b::concise.3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. \*(C+ will.\" give a nicer C++. Capital omega is used to do unbreakable dashes and.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "B::Concise 3".TH B::Concise 3 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"B::Concise \- Walk Perl syntax tree, printing concise info about ops.SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 1\& perl \-MO=Concise[,OPTIONS] foo.pl\&\& use B::Concise qw(set_style add_callback);.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"This compiler backend prints the internal OPs of a Perl program's syntaxtree in one of several space-efficient text formats suitable for debuggingthe inner workings of perl or other compiler backends. It can print OPs inthe order they appear in the \s-1OP\s0 tree, in the order they will execute, orin a text approximation to their tree structure, and the format of theinformation displayed is customizable. Its function is similar to that ofperl's \fB\-Dx\fR debugging flag or the \fBB::Terse\fR module, but it is moresophisticated and flexible..SH "EXAMPLE".IX Header "EXAMPLE"Here's two outputs (or 'renderings'), using the \-exec and \-basic(i.e. default) formatting conventions on the same code snippet..PP.Vb 9\& % perl \-MO=Concise,\-exec \-e \*(Aq$a = $b + 42\*(Aq\& 1 <0> enter\& 2 <;> nextstate(main 1 \-e:1) v\& 3 <#> gvsv[*b] s\& 4 <$> const[IV 42] s\& * 5 <2> add[t3] sK/2\& 6 <#> gvsv[*a] s\& 7 <2> sassign vKS/2\& 8 <@> leave[1 ref] vKP/REFC.Ve.PPIn this \-exec rendering, each opcode is executed in the order shown.The add opcode, marked with '*', is discussed in more detail..PPThe 1st column is the op's sequence number, starting at 1, and isdisplayed in base 36 by default. Here they're purely linear; thesequences are very helpful when looking at code with loops andbranches..PPThe symbol between angle brackets indicates the op's type, forexample; <2> is a \s-1BINOP\s0, <@> a \s-1LISTOP\s0, and <#> is a \s-1PADOP\s0, which isused in threaded perls. (see \*(L"\s-1OP\s0 class abbreviations\*(R")..PPThe opname, as in \fB'add[t1]'\fR, may be followed by op-specificinformation in parentheses or brackets (ex \fB'[t1]'\fR)..PPThe op-flags (ex \fB'sK/2'\fR) are described in (\*(L"\s-1OP\s0 flagsabbreviations\*(R")..PP.Vb 11\& % perl \-MO=Concise \-e \*(Aq$a = $b + 42\*(Aq\& 8 <@> leave[1 ref] vKP/REFC \->(end)\& 1 <0> enter \->2\& 2 <;> nextstate(main 1 \-e:1) v \->3\& 7 <2> sassign vKS/2 \->8\& * 5 <2> add[t1] sK/2 \->6\& \- <1> ex\-rv2sv sK/1 \->4\& 3 <$> gvsv(*b) s \->4\& 4 <$> const(IV 42) s \->5\& \- <1> ex\-rv2sv sKRM*/1 \->7\& 6 <$> gvsv(*a) s \->7.Ve.PPThe default rendering is top-down, so they're not in execution order.This form reflects the way the stack is used to parse and evaluateexpressions; the add operates on the two terms below it in the tree..PPNullops appear as \f(CW\*(C`ex\-opname\*(C'\fR, where \fIopname\fR is an op that has beenoptimized away by perl. They're displayed with a sequence-number of\&'\-', because they are not executed (they don't appear in previousexample), they're printed here because they reflect the parse..PPThe arrow points to the sequence number of the next op; they're notdisplayed in \-exec mode, for obvious reasons..PPNote that because this rendering was done on a non-threaded perl, thePADOPs in the previous examples are now SVOPs, and some (but not all)of the square brackets have been replaced by round ones. This is asubtle feature to provide some visual distinction between renderingson threaded and un-threaded perls..SH "OPTIONS".IX Header "OPTIONS"Arguments that don't start with a hyphen are taken to be the names ofsubroutines to render; if no such functions are specified, the mainbody of the program (outside any subroutines, and not including use'dor require'd files) is rendered. Passing \f(CW\*(C`BEGIN\*(C'\fR, \f(CW\*(C`UNITCHECK\*(C'\fR,\&\f(CW\*(C`CHECK\*(C'\fR, \f(CW\*(C`INIT\*(C'\fR, or \f(CW\*(C`END\*(C'\fR will cause all of the correspondingspecial blocks to be printed. Arguments must follow options..PPOptions affect how things are rendered (ie printed). They're presentedhere by their visual effect, 1st being strongest. They're groupedaccording to how they interrelate; within each group the options aremutually exclusive (unless otherwise stated)..Sh "Options for Opcode Ordering".IX Subsection "Options for Opcode Ordering"These options control the 'vertical display' of opcodes. The display\&'order' is also called 'mode' elsewhere in this document..IP "\fB\-basic\fR" 4.IX Item "-basic"Print OPs in the order they appear in the \s-1OP\s0 tree (a preordertraversal, starting at the root). The indentation of each \s-1OP\s0 shows itslevel in the tree, and the '\->' at the end of the line indicates thenext opcode in execution order. This mode is the default, so the flagis included simply for completeness..IP "\fB\-exec\fR" 4.IX Item "-exec"Print OPs in the order they would normally execute (for the majorityof constructs this is a postorder traversal of the tree, ending at theroot). In most cases the \s-1OP\s0 that usually follows a given \s-1OP\s0 willappear directly below it; alternate paths are shown by indentation. Incases like loops when control jumps out of a linear path, a 'goto'line is generated..IP "\fB\-tree\fR" 4.IX Item "-tree"Print OPs in a text approximation of a tree, with the root of the treeat the left and 'left\-to\-right' order of children transformed into\&'top\-to\-bottom'. Because this mode grows both to the right and down,it isn't suitable for large programs (unless you have a very wideterminal)..Sh "Options for Line-Style".IX Subsection "Options for Line-Style"These options select the line-style (or just style) used to rendereach opcode, and dictates what info is actually printed into each line..IP "\fB\-concise\fR" 4.IX Item "-concise"Use the author's favorite set of formatting conventions. This is thedefault, of course..IP "\fB\-terse\fR" 4.IX Item "-terse"Use formatting conventions that emulate the output of \fBB::Terse\fR. Thebasic mode is almost indistinguishable from the real \fBB::Terse\fR, and theexec mode looks very similar, but is in a more logical order and lackscurly brackets. \fBB::Terse\fR doesn't have a tree mode, so the tree modeis only vaguely reminiscent of \fBB::Terse\fR.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -