view release on metacpan or search on metacpan
os2/Opcode.pm view on Meta::CPAN
use XSLoader ();
BEGIN {
@ISA = qw(Exporter);
@EXPORT_OK = qw(
opset ops_to_opset
opset_to_ops opset_to_hex invert_opset
empty_opset full_opset
opdesc opcodes opmask define_optag
opmask_add verify_opset opdump
);
}
sub opset (;@);
sub opset_to_hex ($);
sub opdump (;$);
use subs @EXPORT_OK;
XSLoader::load 'Opcode', $XS_VERSION;
_init_optags();
sub ops_to_opset { opset @_ } # alias for old name
sub opset_to_hex ($) {
return "(invalid opset)" unless verify_opset($_[0]);
unpack("h*",$_[0]);
}
sub opdump (;$) {
my $pat = shift;
# handy utility: perl -MOpcode=opdump -e 'opdump File'
foreach(opset_to_ops(full_opset)) {
my $op = sprintf " %12s %s\n", $_, opdesc($_);
next if defined $pat and $op !~ m/$pat/i;
print $op;
}
}
sub _init_optags {
my(%all, %seen);
@all{opset_to_ops(full_opset)} = (); # keys only
local($_);
local($/) = "\n=cut"; # skip to optags definition section
<DATA>;
$/ = "\n="; # now read in 'pod section' chunks
os2/Opcode.pm view on Meta::CPAN
foreach(@ops) {
warn "$tag - $_ already tagged in $seen{$_}\n" if $seen{$_};
$seen{$_} = $tag;
delete $all{$_};
}
# opset will croak on invalid names
define_optag($tag, opset(@ops));
}
close(DATA);
warn "Untagged opnames: ".join(' ',keys %all)."\n" if %all;
}
os2/Opcode.pm view on Meta::CPAN
An opname or optag can be prefixed with an exclamation mark, e.g., !mkdir.
Negating an opname or optag means remove the corresponding ops from the
accumulated set of ops at that point.
=item an operator set (opset)
An I<opset> as a binary string of approximately 44 bytes which holds a
set or zero or more operators.
The opset and opset_to_ops functions can be used to convert from
a list of operators to an opset and I<vice versa>.
Wherever a list of operators can be given you can use one or more opsets.
See also Manipulating Opsets below.
=back
os2/Opcode.pm view on Meta::CPAN
In a scalar context opcodes returns the number of opcodes in this
version of perl (around 350 for perl-5.7.0).
In a list context it returns a list of all the operator names.
(Not yet implemented, use @names = opset_to_ops(full_opset).)
=item opset (OP, ...)
Returns an opset containing the listed operators.
=item opset_to_ops (OPSET)
Returns a list of operator names corresponding to those operators in
the set.
=item opset_to_hex (OPSET)
Returns a string representation of an opset. Can be handy for debugging.
=item full_opset
Returns an opset which includes all operators.
=item empty_opset
Returns an opset which contains no operators.
=item invert_opset (OPSET)
Returns an opset which is the inverse set of the one supplied.
=item verify_opset (OPSET, ...)
Returns true if the supplied opset looks like a valid opset (is the
right length etc) otherwise it returns false. If an optional second
parameter is true then verify_opset will croak on an invalid opset
instead of returning false.
Most of the other Opcode functions call verify_opset automatically
and will croak if given an invalid opset.
=item define_optag (OPTAG, OPSET)
Define OPTAG as a symbolic name for OPSET. Optag names always start
with a colon C<:>.
os2/Opcode.pm view on Meta::CPAN
you should prefix your tags names with the name of your module to
ensure uniqueness and thus avoid clashes with other modules.
=item opmask_add (OPSET)
Adds the supplied opset to the current opmask. Note that there is
currently I<no> mechanism for unmasking ops once they have been masked.
This is intentional.
=item opmask
Returns an opset corresponding to the current opmask.
=item opdesc (OP, ...)
This takes a list of operator names and returns the corresponding list
of operator descriptions.
os2/Opcode.pm view on Meta::CPAN
Opsets may be manipulated using the perl bit vector operators & (and), | (or),
^ (xor) and ~ (negate/invert).
However you should never rely on the numerical position of any opcode
within the opset. In other words both sides of a bit vector operator
should be opsets returned from Opcode functions.
Also, since the number of opcodes in your current version of perl might
not be an exact multiple of eight, there may be unused bits in the last
byte of an upset. This should not cause any problems (Opcode functions
ignore those extra bits) but it does mean that using the ~ operator
will typically not produce the same 'physical' opset 'string' as the
invert_opset function.
=head1 TO DO (maybe)
$bool = opset_eq($opset1, $opset2) true if opsets are logically eqiv
$yes = opset_can($opset, @ops) true if $opset has all @ops set
@diff = opset_diff($opset1, $opset2) => ('foo', '!bar', ...)
=cut
# the =cut above is used by _init_optags() to get here quickly
view all matches for this distribution
view release on metacpan or search on metacpan
/* Selected functions borrowed from perl's ext/Opcode/Opcode.xs */
/* PL_maxo shouldn't differ from MAXO but leave room anyway (see BOOT:) */
#define OP_MASK_BUF_SIZE (MAXO + 100)
#define opset_len ((PL_maxo + 7) / 8)
static void
opmask_add(pTHX_ char *bitmask, STRLEN len)
{
int i,j;
int myopcode = 0;
if (len != opset_len)
croak("Invalid opset: wrong size");
if (!PL_op_mask) /* caller must ensure PL_op_mask exists */
croak("Can't add to uninitialised PL_op_mask");
/* OPCODES ALREADY MASKED ARE NEVER UNMASKED. See opmask_addlocal() */
for (i=0; i < opset_len; i++) {
U16 bits = bitmask[i];
if (!bits) { /* optimise for sparse masks */
myopcode += 8;
continue;
}
view all matches for this distribution
view release on metacpan or search on metacpan
PL_bufptr||5.003007|ponu
PL_CCC_non0_non230|5.029008||Viu
PL_check|5.009003|5.006000|
PL_checkav|5.006000||Viu
PL_checkav_save|5.008001||Viu
PL_chopset|5.005000||Viu
PL_clocktick|5.008001||Viu
PL_collation_ix|5.005000||Viu
PL_collation_name|5.005000||Viu
PL_collation_standard|5.005000||Viu
PL_collxfrm_base|5.005000||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
onig/HISTORY view on Meta::CPAN
--
<create tag>
svn copy file:///home/kosako/svnreps/svnrep_onig/trunk file:///home/kosako/svnreps/svnrep_onig/tags/5.0.0 -m "ADD TAG: 5.0.0"
<set ignore files by .cvsignore>
svn propset svn:ignore -F .cvsignore .
svn commit -m "..."
<CVS: show all tags>
cvs history -T
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Text/Highlight/PHP.pm view on Meta::CPAN
'posix_getrlimit' => 1,
'mcrypt_get_key_size' => 1,
'gmp_gcdext' => 1,
'ftp_quit' => 1,
'sql_regcase' => 1,
'com_propset' => 1,
'mcal_event_add_attribute' => 1,
'fileinode' => 1,
'ingres_commit' => 1,
'dbmexists' => 1,
'filepro_fieldcount' => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
PL_bufptr||5.003007|ponu
PL_CCC_non0_non230|5.029008||Viu
PL_check|5.009003|5.006000|
PL_checkav|5.006000||Viu
PL_checkav_save|5.008001||Viu
PL_chopset|5.005000||Viu
PL_clocktick|5.008001||Viu
PL_collation_ix|5.005000||Viu
PL_collation_name|5.005000||Viu
PL_collation_standard|5.005000||Viu
PL_collxfrm_base|5.005000||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
PL_bufptr||5.003007|ponu
PL_CCC_non0_non230|5.029008||Viu
PL_check|5.009003|5.006000|
PL_checkav|5.006000||Viu
PL_checkav_save|5.008001||Viu
PL_chopset|5.005000||Viu
PL_clocktick|5.008001||Viu
PL_collation_ix|5.005000||Viu
PL_collation_name|5.005000||Viu
PL_collation_standard|5.005000||Viu
PL_collxfrm_base|5.005000||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
vutil/ppport.h view on Meta::CPAN
PL_bufptr||5.003007|ponu
PL_CCC_non0_non230|5.029008||Viu
PL_check|5.009003|5.006000|
PL_checkav|5.006000||Viu
PL_checkav_save|5.008001||Viu
PL_chopset|5.005000||Viu
PL_clocktick|5.008001||Viu
PL_collation_ix|5.005000||Viu
PL_collation_name|5.005000||Viu
PL_collation_standard|5.005000||Viu
PL_collxfrm_base|5.005000||Viu
view all matches for this distribution