.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .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" '' . ds C` . ds C' '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 >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "B::Hooks::Parser 3pm" .TH B::Hooks::Parser 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" 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::Hooks::Parser \- Interface to perl's parser variables .SH "VERSION" .IX Header "VERSION" version 0.21 .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides an \s-1API\s0 for parts of the perl parser. It can be used to modify code while it's being parsed. .SH "Perl API" .IX Header "Perl API" .ie n .SS """setup()""" .el .SS "\f(CWsetup()\fP" .IX Subsection "setup()" Does some initialization work. This must be called before any other functions of this module if you intend to use \f(CW\*(C`set_linestr\*(C'\fR. Returns an id that can be used to disable the magic using \f(CW\*(C`teardown\*(C'\fR. .ie n .SS """teardown($id)""" .el .SS "\f(CWteardown($id)\fP" .IX Subsection "teardown($id)" Disables magic registered using \f(CW\*(C`setup\*(C'\fR. .ie n .SS """get_linestr()""" .el .SS "\f(CWget_linestr()\fP" .IX Subsection "get_linestr()" Returns the line the parser is currently working on, or undef if perl isn't parsing anything right now. .ie n .SS """get_linestr_offset()""" .el .SS "\f(CWget_linestr_offset()\fP" .IX Subsection "get_linestr_offset()" Returns the position within the current line to which perl has already parsed the input, or \-1 if nothing is being parsed currently. .ie n .SS """set_linestr($string)""" .el .SS "\f(CWset_linestr($string)\fP" .IX Subsection "set_linestr($string)" Sets the line the perl parser is currently working on to \f(CW$string\fR. .PP Note that perl won't notice any changes in the line string after the position returned by \f(CW\*(C`get_linestr_offset\*(C'\fR. .PP Throws an exception when nothing is being compiled. .ie n .SS """inject($string)""" .el .SS "\f(CWinject($string)\fP" .IX Subsection "inject($string)" Convenience function to insert a piece of perl code into the current line string (as returned by \f(CW\*(C`get_linestr\*(C'\fR) at the current offset (as returned by \&\f(CW\*(C`get_linestr_offset\*(C'\fR). .ie n .SS """get_lex_stuff()""" .el .SS "\f(CWget_lex_stuff()\fP" .IX Subsection "get_lex_stuff()" Returns the string of additional stuff resulting from recent lexing that is being held onto by the lexer. For example, the content of a quoted string goes here. Returns \f(CW\*(C`undef\*(C'\fR if there is no such stuff. .ie n .SS """clear_lex_stuff()""" .el .SS "\f(CWclear_lex_stuff()\fP" .IX Subsection "clear_lex_stuff()" Discard the string of additional stuff resulting from recent lexing that is being held onto by the lexer. .SH "C API" .IX Header "C API" The following functions work just like their equivalent in the Perl \s-1API,\s0 except that they can't handle embedded \f(CW\*(C`NUL\*(C'\fR bytes in strings. .ie n .SS """hook_op_check_id hook_parser_setup (void)""" .el .SS "\f(CWhook_op_check_id hook_parser_setup (void)\fP" .IX Subsection "hook_op_check_id hook_parser_setup (void)" Note: may be implemented as a macro. .ie n .SS """void hook_parser_teardown (hook_op_check_id id)""" .el .SS "\f(CWvoid hook_parser_teardown (hook_op_check_id id)\fP" .IX Subsection "void hook_parser_teardown (hook_op_check_id id)" .ie n .SS """const char *hook_parser_get_linestr (pTHX)""" .el .SS "\f(CWconst char *hook_parser_get_linestr (pTHX)\fP" .IX Subsection "const char *hook_parser_get_linestr (pTHX)" .ie n .SS """IV hook_parser_get_linestr_offset (pTHX)""" .el .SS "\f(CWIV hook_parser_get_linestr_offset (pTHX)\fP" .IX Subsection "IV hook_parser_get_linestr_offset (pTHX)" .ie n .SS """void hook_parser_set_linestr (pTHX_ const char *new_value)""" .el .SS "\f(CWvoid hook_parser_set_linestr (pTHX_ const char *new_value)\fP" .IX Subsection "void hook_parser_set_linestr (pTHX_ const char *new_value)" .ie n .SS """char *hook_parser_get_lex_stuff (pTHX)""" .el .SS "\f(CWchar *hook_parser_get_lex_stuff (pTHX)\fP" .IX Subsection "char *hook_parser_get_lex_stuff (pTHX)" .ie n .SS """void hook_parser_clear_lex_stuff (pTHX)""" .el .SS "\f(CWvoid hook_parser_clear_lex_stuff (pTHX)\fP" .IX Subsection "void hook_parser_clear_lex_stuff (pTHX)" .SH "SUPPORT" .IX Header "SUPPORT" Bugs may be submitted through the \s-1RT\s0 bug tracker (or bug\-B\-Hooks\-Parser@rt.cpan.org ). .SH "AUTHOR" .IX Header "AUTHOR" Florian Ragwitz .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .IP "\(bu" 4 Karen Etheridge .IP "\(bu" 4 Zefram .IP "\(bu" 4 Vincent Pit .IP "\(bu" 4 Alexandr Ciornii .IP "\(bu" 4 Karl Williamson .IP "\(bu" 4 Liu Kang-min .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2008 by Florian Ragwitz. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.