⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 b.pm

📁 UNIX下perl实现代码
💻 PM
📖 第 1 页 / 共 2 页
字号:
=item TARGLEN=item TYPE=item TARG=back=head2 B::BM METHODS=over 4=item USEFUL=item PREVIOUS=item RARE=item TABLE=back=head2 B::GV METHODS=over 4=item is_emptyThis method returns TRUE if the GP field of the GV is NULL.=item NAME=item SAFENAMEThis method returns the name of the glob, but if the firstcharacter of the name is a control character, then it convertsit to ^X first, so that *^G would return "^G" rather than "\cG".It's useful if you want to print out the name of a variable.If you restrict yourself to globs which exist at compile-timethen the result ought to be unambiguous, because code likeC<${"^G"} = 1> is compiled as two ops - a constant string anda dereference (rv2gv) - so that the glob is created at runtime.If you're working with globs at runtime, and need to disambiguate*^G from *{"^G"}, then you should use the raw NAME method.=item STASH=item SV=item IO=item FORM=item AV=item HV=item EGV=item CV=item CVGEN=item LINE=item FILE=item FILEGV=item GvREFCNT=item FLAGS=back=head2 B::IO METHODS=over 4=item LINES=item PAGE=item PAGE_LEN=item LINES_LEFT=item TOP_NAME=item TOP_GV=item FMT_NAME=item FMT_GV=item BOTTOM_NAME=item BOTTOM_GV=item SUBPROCESS=item IoTYPE=item IoFLAGS=back=head2 B::AV METHODS=over 4=item FILL=item MAX=item OFF=item ARRAY=item AvFLAGS=back=head2 B::CV METHODS=over 4=item STASH=item START=item ROOT=item GV=item FILE=item DEPTH=item PADLIST=item OUTSIDE=item XSUB=item XSUBANY=item CvFLAGS=back=head2 B::HV METHODS=over 4=item FILL=item MAX=item KEYS=item RITER=item NAME=item PMROOT=item ARRAY=back=head2 OP-RELATED CLASSESB::OP, B::UNOP, B::BINOP, B::LOGOP, B::LISTOP, B::PMOP,B::SVOP, B::PADOP, B::PVOP, B::CVOP, B::LOOP, B::COP.These classes correspond inthe obvious way to the underlying C structures of similar names. Theinheritance hierarchy mimics the underlying C "inheritance". Accessmethods correspond to the underlying C structre field names, with theleading "class indication" prefix removed (op_).=head2 B::OP METHODS=over 4=item next=item sibling=item nameThis returns the op name as a string (e.g. "add", "rv2av").=item ppaddrThis returns the function name as a string (e.g. "PL_ppaddr[OP_ADD]","PL_ppaddr[OP_RV2AV]").=item descThis returns the op description from the global C PL_op_desc array(e.g. "addition" "array deref").=item targ=item type=item seq=item flags=item private=back=head2 B::UNOP METHOD=over 4=item first=back=head2 B::BINOP METHOD=over 4=item last=back=head2 B::LOGOP METHOD=over 4=item other=back=head2 B::LISTOP METHOD=over 4=item children=back=head2 B::PMOP METHODS=over 4=item pmreplroot=item pmreplstart=item pmnext=item pmregexp=item pmflags=item pmpermflags=item precomp=back=head2 B::SVOP METHOD=over 4=item sv=item gv=back=head2 B::PADOP METHOD=over 4=item padix=back=head2 B::PVOP METHOD=over 4=item pv=back=head2 B::LOOP METHODS=over 4=item redoop=item nextop=item lastop=back=head2 B::COP METHODS=over 4=item label=item stash=item file=item cop_seq=item arybase=item line=back=head1 FUNCTIONS EXPORTED BY C<B>The C<B> module exports a variety of functions: some are simpleutility functions, others provide a Perl program with a way toget an initial "handle" on an internal object.=over 4=item main_cvReturn the (faked) CV corresponding to the main part of the Perlprogram.=item init_avReturns the AV object (i.e. in class B::AV) representing INIT blocks.=item main_rootReturns the root op (i.e. an object in the appropriate B::OP-derivedclass) of the main part of the Perl program.=item main_startReturns the starting op of the main part of the Perl program.=item comppadlistReturns the AV object (i.e. in class B::AV) of the global comppadlist.=item sv_undefReturns the SV object corresponding to the C variable C<sv_undef>.=item sv_yesReturns the SV object corresponding to the C variable C<sv_yes>.=item sv_noReturns the SV object corresponding to the C variable C<sv_no>.=item amagic_generationReturns the SV object corresponding to the C variable C<amagic_generation>.=item walkoptree(OP, METHOD)Does a tree-walk of the syntax tree based at OP and calls METHOD oneach op it visits. Each node is visited before its children. IfC<walkoptree_debug> (q.v.) has been called to turn debugging on thenthe method C<walkoptree_debug> is called on each op before METHOD iscalled.=item walkoptree_debug(DEBUG)Returns the current debugging flag for C<walkoptree>. If the optionalDEBUG argument is non-zero, it sets the debugging flag to that. Seethe description of C<walkoptree> above for what the debugging flagdoes.=item walksymtable(SYMREF, METHOD, RECURSE)Walk the symbol table starting at SYMREF and call METHOD on eachsymbol visited. When the walk reached package symbols "Foo::" itinvokes RECURSE and only recurses into the package if that subreturns true.=item svref_2object(SV)Takes any Perl variable and turns it into an object in theappropriate B::OP-derived or B::SV-derived class. Apart from functionssuch as C<main_root>, this is the primary way to get an initial"handle" on a internal perl data structure which can then be followedwith the other access methods.=item ppname(OPNUM)Return the PP function name (e.g. "pp_add") of op number OPNUM.=item hash(STR)Returns a string in the form "0x..." representing the value of theinternal hash function used by perl on string STR.=item cast_I32(I)Casts I to the internal I32 type used by that perl.=item minus_cDoes the equivalent of the C<-c> command-line option. Obviously, thisis only useful in a BEGIN block or else the flag is set too late.=item cstring(STR)Returns a double-quote-surrounded escaped version of STR which canbe used as a string in C source code.=item class(OBJ)Returns the class of an object without the part of the classnamepreceding the first "::". This is used to turn "B::UNOP" into"UNOP" for example.=item threadsv_namesIn a perl compiled for threads, this returns a list of the specialper-thread threadsv variables.=back=head1 AUTHORMalcolm Beattie, C<mbeattie@sable.ox.ac.uk>=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -