- Perl API
- C API
- hook_op_check_id hook_parser_setup (void)
- void hook_parser_teardown (hook_op_check_id id)
- const char *hook_parser_get_linestr (pTHX)
- IV hook_parser_get_linestr_offset (pTHX)
- void hook_parser_set_linestr (pTHX_ const char *new_value)
- char *hook_parser_get_lex_stuff (pTHX)
- void hook_parser_clear_lex_stuff (pTHX)
- COPYRIGHT AND LICENSE
B::Hooks::Parser - Interface to perl's parser variables
This module provides an API for parts of the perl parser. It can be used to modify code while it's being parsed.
Does some initialization work. This must be called before any other functions of this module if you intend to use
set_linestr. Returns an id that can be used to disable the magic using
Disables magic registered using
Returns the line the parser is currently working on, or undef if perl isn't parsing anything right now.
Returns the position within the current line to which perl has already parsed the input, or -1 if nothing is being parsed currently.
Sets the line the perl parser is currently working on to
Note that perl won't notice any changes in the line string after the position returned by
Throws an exception when nothing is being compiled.
Convenience function to insert a piece of perl code into the current line string (as returned by
get_linestr) at the current offset (as returned by
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
undef if there is no such stuff.
Discard the string of additional stuff resulting from recent lexing that is being held onto by the lexer.
The following functions work just like their equivalent in the Perl API, except that they can't handle embedded
NUL bytes in strings.
hook_op_check_id hook_parser_setup (void)
Note: may be implemented as a macro.
void hook_parser_teardown (hook_op_check_id id)
const char *hook_parser_get_linestr (pTHX)
IV hook_parser_get_linestr_offset (pTHX)
void hook_parser_set_linestr (pTHX_ const char *new_value)
char *hook_parser_get_lex_stuff (pTHX)
void hook_parser_clear_lex_stuff (pTHX)
Florian Ragwitz <firstname.lastname@example.org>
Karen Etheridge <email@example.com>
Alexandr Ciornii <firstname.lastname@example.org>
Vincent Pit <email@example.com>
Liu Kang-min <firstname.lastname@example.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.