B::JVM::Emit - Package used by B::JVM to emit Java Bytecode
use B::JVM::Jasmin::Emit; my $emitter = new B::JVM::Emit(FILEHANDLE); # ... $emitter->DIRECTIVE_NAME([@ARGS]); # ... $emitter->OPCODE_NAME([@ARGS]); # ... $emitter->OPCODE_NAME([@ARGS]);
This class is used Java bytcodes on a file handle. Until someone actually creates a module that truely emits Java bytecodes, the interesting stuff is all happening in the subclass, B::JVM::Jasmin::Emit. The method names used here were built up from the jasmin syntax. There was no reason for this other than the implementor was most familar with that manner of thinking about Java bytecode. However, the set should cover every opcode available.
The user of this module must send opcodes in the order desired and is responsible for emitting a sensible JVM program. All this module provides is a consistent way to emit JVM opcodes from Perl, since there is no universal assembler syntax. Someone who wants to emit opcodes need only subclass this module and implement all the methods.
Bradley M. Kuhn, bkuhn@ebb.org, http://www.ebb.org/bkuhn
Copyright (C) 1999, Bradley M. Kuhn, All Rights Reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the LICENSE file that was shipped with this distribution.
perl(1), B::JVM::Jasmin(3), B::JVM::Jasmin::Emit(3)
Version number of B::JVM::Emit. For now, it should always match the version of B::JVM::Jasmin
Used for error reporting
usage: B::JVM::Emit::new(FILEHANDLE)
Creates a new object of the class. It assumes that FILEHANDLE is a lexically scoped file handle open for writing.
usage: $emitter->_clearMethod()
Clears the current method name.
usage: B::JVM::Emit::_setCurrentMethod(METHOD_NAME)
Sets the current name of the method being emitted.
usage: $emitter->inMethod()
Returns true (in particular, the current method name) if we are currently in method, and returns false otherwise.
usage: B::JVM::Emit::_setClassName(CLASS_NAME)
Sets the name of the class being emitted.
To install B::JVM::Jasmin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm B::JVM::Jasmin
CPAN shell
perl -MCPAN -e shell install B::JVM::Jasmin
For more information on module installation, please visit the detailed CPAN module installation guide.