Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 32.389.327 Times

B::Generate 1.06

  Date Added: January 18, 2010  |  Visits: 1.146


Report Broken Link
Printer Friendly Version

Product Homepage
Download (75 downloads)

B::Generate is a Perl module which you can create your own op trees. SYNOPSIS use B::Generate; # Do nothing, slowly. CHECK { my $null = new B::OP("null",0); my $enter = new B::OP("enter",0); my $cop = new B::COP(0, "hiya", 0); my $leave = new B::LISTOP("leave", 0, $enter, $null); $leave->children(3); $enter->sibling($cop); $enter->next($cop); $cop->sibling($null); $null->next($leave); $cop->next($leave); # Tell Perl where to find our tree. B::main_root($leave); B::main_start($enter); } WARNING This module will create segmentation faults if you dont know how to use it properly. Further warning: sometimes I dont know how to use it properly. There are lots of other methods and utility functions, but they are not documented here. This is deliberate, rather than just through laziness. You are expected to have read the Perl and XS sources to this module before attempting to do anything with it. Patches welcome. Malcolm Beatties B module allows you to examine the Perl op tree at runtime, in Perl space; its the basis of the Perl compiler. But what it doesnt let you do is manipulate that op tree: it wont let you create new ops, or modify old ones. Now you can. Well, if youre intimately familiar with Perls internals, you can. B::Generate turns Bs accessor methods into get-set methods. Hence, instead of merely saying $op2 = $op->next; you can now say $op->next($op2); to set the next op in the chain. It also adds constructor methods to create new ops. This is where it gets really hairy. new B::OP ( type, flags ) new B::UNOP ( type, flags, first ) new B::BINOP ( type, flags, first, last ) new B::LOGOP ( type, flags, first, other ) new B::LISTOP ( type, flags, first, last ) new B::COP ( flags, name, first ) In all of the above constructors, type is either a numeric value representing the op type (62 is the addition operator, for instance) or the name of the op. ("add") (Incidentally, if you know about custom ops and have registed them properly with the interpreter, you can create custom ops by name: new B::OP("mycustomop",0), or whatever.) first, last and other are ops to be attached to the current op; these should be B::OP objects. If you havent created the ops yet, dont worry; give a false value, and fill them in later: $x = new B::UNOP("negate", 0, undef); # ... create some more ops ... $x->first($y); In addition, one may create a new nextstate operator with newstate B::op ( flags, label, op) in the same manner as B::COP::new - this will also, however, add the lineseq op. Finally, you can set the main root and the starting op by passing ops to the B::main_root and B::main_start functions. This module can obviously be used for all sorts of fun purposes. The best one will be in conjuction with source filters; have your source filter parse an input file in a foreign language, create an op tree for it and get Perl to execute it. Then email me and tell me how you did it. And why..

Requirements: No special requirements
Platforms: Linux
Keyword: Bgenerate Cop Create Create Your Own Flags Libraries Module New Ops Perl Perl Module Programming Your Own
Users rating: 0/10

License: Freeware Size: 12.29 KB
More Reviews or Write Review

Games  -  ABC Spell - Fun Way To Learn 1.1
ABC Spell - Fun Way To Learn Teach your kids the alphabet, some new words, or even add in your own words you want to teach them. All thru this fun, entertaining and highly addictive game Alpha Catcher! The game is fun for all ages young and old!...
17.2 MB  
Application Add-Ins  -  1 day Alexa Rank Boost
Improve your Alexa rank for brand new sites, This works even if your site has zero links on the web.
398 KB  
Health & Fitness  -  Runtastic Squats
Do you want to shape and strengthen your legs and glutes? With the Runtastic Squats app as your personal trainer, you can now improve your leg strength and reach new fitness goals. The app is your personal squat trainer that implements an...
17 MB  
Libraries  -  Module::Starter::PBP 0.0.3
Module::Starter::PBP is a Perl module to create a module as recommended in "Perl Best Practices". SYNOPSIS # In your ~/.module-starter/config file... author: email: plugins: Module::Starter::PBP...
8.19 KB  
Sports  -  ESPN Radio 4.6.0
The ESPN Radio App is a FREE App and will remain FREE Take your sports wherever your ears go! Introducing the new and improved ESPN Radio App for your iPhone or iPad, with a host of expanded features and functionality for sports fans....
9.1 MB  
Libraries  -  Module::Crypt 0.04
Module::Crypt is a Perl module to encrypt your Perl code and compile it into XS. SYNOPSIS use Module::Crypt; # for a single file: CryptModule( file =>, install_base => /path/to/my/lib ); # for multiple files: CryptModule(...
7.17 KB  
Multimedia & Graphics  -  Buddy Icon Constructor FREE 1.1
Buddy Icon Constructor Free allows to create own buddy icon for on-line messengers.You can use your pictures, pictures of your friends and family.You can use you pictures, images from Internet, your art-works. Take any image (BMP, JPEG, GIF, PNG,...
509 KB  
Multi-Purpose Audio Players  -  Crawler Radio & MP3 Player
Listen to internet radio streams and at the same time make recordings of your favorite songs & radio shows, listen to the music stored on your PC now even faster thanks to cool "drag & drop" function and create your own playlists while browsing...
3.95 KB  
Libraries  -  OpenPlugin::Application 0.11
OpenPlugin::Application is a subclass of CGI::Application, meant to help you create reusable web applications. SYNOPSIS # Example from OpenThoughts package Demo; use base "OpenPlugin::Application"; sub setup { my $self = shift;...
78.85 KB  
Word Games  -  Flip Word 2.1.3
Create your own words and phrases. New phrases always available. To beat this addictive puzzler, you'll need to exercise your mental muscles! Start with the first letter of a familiar phrase, then fill in the missing letters. Once you recognize...
4.42 MB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 3.15.3
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB