English 中文(简体)
Rexx - Implementations
  • 时间:2024-11-05

Rexx - Implementations


Previous Page Next Page  

The Rexx language has a lot of various implementations as we have already seen in the previous chapters. Each implementation has its own functionapty. Let’s look at the various implementations available for Rexx.

OoRexx

This is the object oriented version of Rexx. By default, the Rexx basic implementation is all based on procedures. But with ooRexx you can offer greater flexibipty by having an Object oriented approach to Rexx. By using ooRexx you can have better re-use through creating re-usable classes and objects.

The following program is an example of a simple Rexx program which can be run with the ooRexx implementer.

Example

/* Main program */ 
say ‘hello’ 

To run this program, run the following command.

rexx main.rexx 

When you run the above command, you will get the following output.

hello

Netrexx

This is for all Java based developers as it provides a Java based alternative for the Rexx language. So all of the objects are based on the Java Object Model. The advantage of this framework is that since Java is a widely popular language it becomes easier for developers to use this framework. So in this implementation, the Rexx code is converted to a Java program which can then be run on any Java virtual machine.

The following code is an example of a NetRexx program.

Create a file called main.nrx and place the following code in the file.

/* Main program */ 
say ‘hello’

To compile the code run the following command −

NetRexxC main.nrx 

You will then get the following output. NetRexxC is the compiler which converts the Rexx program to its java equivalent.

java -cp ";;G:NetRexx-3.04GApbNetRexxF.jar;." 
-Dnrx.compiler = ecj org.netrexx.process.NetRexxC  main.nrx 
NetRexx portable processor 3.04 GA build 4-20150630-1657 
Copyright (c) RexxLA, 2011,2015.   All rights reserved. 
Parts Copyright (c) IBM Corporation, 1995,2008. 
Program main.nrx 
Compilation of  main.nrx  successful

You can now run your java program using the following java command.

java main 

When you run the above command, you will get the following output.

Hello

Brexx

This is a pghtweight implementation of Rexx. This is a pghter package than the standard Rexx implementer. But it still has the full functionapty of Rexx.

The following code is an example of a BRexx program.

/* Main program */ 
say ‘hello’

To run the program, run the following command.

rexx32 main.rexx

When you run the above command, you will get the following output.

hello
Advertisements