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

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

Serving Software Downloads in 956 Categories, Downloaded 50.242.023 Times

B::Generate 1.06

  Date Added: January 18, 2010  |  Visits: 1.505

B::Generate

Report Broken Link
Printer Friendly Version


Product Homepage
Download (98 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
USER REVIEWS
More Reviews or Write Review


B::GENERATE RELATED
Simulation Games  -  Create Your Own Adventure 0.4 Beta
Create Your Own Adventure project is an interactive adventure in which the users themselves write the adventure. When the user reaches the end of the adventure, the user will be given the option to continue writing the next part of the adventure....
14.34 KB  
Business  -  Create Your Own Image Menus with ABCMenuMan Java Menu 9.0
With ABCMenuMan you are able to create your own image menus and really turn your website into a sleek and professional looking platform for your business. You can do so many things with this Java application and after investing in the image menu...
2.93 MB  
Libraries  -  libpal 0.1.4a
libpal allows you to create your own forged IP, TCP, and ICMP packets. libpal project is straightforward to use and is a powerful tool for building artificial TCP/IP packets. At the time of this writing the only supported platform is LiNUX/i386,...
88.06 KB  
Network & Internet  -  MkGallery 1.1
MkGallery allows you to create your own gallery for the Internet with HTML 4.0 and CSS support. MkGallery generates an image gallery with thumbnails for the Internet. All pages are HTML 4.0 and CSS compatible. How it works: Enter in a folder...
61.44 KB  
Simulation Games  -  Pizza Business 1.0-beta9
Pizza Business project is a game in which you can create your own pizza business. Pizza Business is a platform-independent restaurant simulation game written in object-oriented C++. It utilizes the WxWindows library. Whats New in This Release:...
1.6 MB  
Libraries  -  GNU Classpath 0.95
GNU Classpath (essential libraries for Java) is a project to create free core class libraries for use with virtual machines and compilers for the Java programming language. GNU Classpath project includes all native methods and core classes...
6.5 MB  
Network & Internet  -  Avaguide 1.0
AvaGuide is the first web-based interactive video characters base for business sites. It enables you to easily create your own video avatars or virtual employees. You can use own video recordings or choose from multiple professionally recorded...
3.67 MB  
Development Tools  -  Flag Lists 6.x-1.1
Flag lists allows regular users to create unlimited private flags called lists. Flag lists extends Flag. In Flag, a site administrator creates the flags that any authorized users may use. In Flag lists, users create their own lists, and they may...
20.48 KB  
Web Searching Tools  -  SearchPlaces 1.4.2
SearchPlaces is a Firefox extension that allows you to create your own complex Places queries (i.e. bookmark and history searches), or edit the ones that come as standard with Firefox, or created using the Bookmarks Organiser. Queries...
51.2 KB  
Sound Card Tools  -  Quack 4.2
Create your own original sound effects with QUACK Sound Effects Studio. Simply use the visual editor to plug together standard components, such as oscillators, modulators and filters. Create an unlimited variety of new sounds for games,...
924 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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 4.0.0
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