REXXTACY USER MANUAL Copyright 1991 Ruddock and Associates, Inc. 1. Introduction 1.1 REXXTACY - The REXX to C translator REXXTACY is a package which will allow you to convert a REXX program into an OS/2 executable. It does this by first translating the REXX source into C code , invoking the Microsoft C compiler, and linking the resulting object file with the REXXTACY runtime library. The process of converting the REXX program to C code consists of invoking two programs - REXXCSYM and REXXCGEN. REXXCSYM is a symbol semantics analyzer. By examining how REXX variables are used in a program, it is possible to emit highly optimized C code. The compiled C code may run hundreds of times faster than the original REXX program. REXXCSYM writes a temporary file to disk with it's analysis. It may also generate reports for the more advanced user to examine. Once this has been done, REXXCGEN may be invoked. REXXCGEN reads REXXCSYM's analysis and generates C source using the original REXX source and REXXCSYM's analysis. This C source is ready to compile with the Microsoft C compiler. 1.2 Using this manual The organization of this manual has been loosly based on IBM's OS/2 REXX reference manual. Most sections of that manual have corresponding sections in this document. This will make it easier for the user who wishes to find any implementation differences between particular commands or control structures. Since there are only a small number of differences or omissions from REXX in REXXTACY, the manual will seem rather sparse at points. Please be aware that this manual is not intended to be a REXX reference manual - but rather a description of the REXXTACY implementation. 1.3 Using REXXTACY Both REXXCSYM and REXXCGEN have a number of options. Run "REXXCYSM -?" and "REXXCGEN -?" for online help. REXXCSYM's other options include: -o file Write a report of REXXCSYM's findings to the specified file. -v Verbose analysis -p Debug parser (this may only be useful to the developer s of REXXTACY) REXXCGEN's other options include: -c Compile to C only. Do not invoke the C compiler. -p Debug parser -P Use protected mode library names (ending in "P") -o Compile C code with maximum optimization -d Compile C code with CodeView debugging information If you have the TEMP or TMP environment variables set, then REXXCSYM and REXXCGEN will use that directory to write and read the temporary symbol file (which ends in ".tmp"). A batch file is provided (REXXTACY.CMD) which will, when invoked with the name of a REXX program, translate and compile in one step. Many errors in a REXX program will be caught at compile time by REXXTACY. However, REXXTACY provides extensive runtime error checks. A compiled REXX program processing faulty data will emit descriptive error messages - with lin e numbers that refer back to the original REXX code. 2 General Concepts 2.1 Structure and General Syntax REXXTACY input can be structured exactly like REXX input. It supports implicit and explicit end of statement markers, statement continuation markers and C style comments. However, hexadecimal and binary strings are not supported at this time. 2.2 Expressions and Operators All of REXX's logical, arithmentic and comparison expressions and operators ar e supported by REXXTACY - including string abuttals and operator precedence orders. 2.3 Clauses and Instructions REXXTACY supports all five REXX clause types: 1. NULL Clauses 2. Labels 3. Assignments 4. Keyword Instructions 5. Commands 2.4 Assignments and Symbols Constant symbols, simple symbols, compound symbols and stems are all supported by REXXTACY. Assignments to these symbol types operate exactly as they do in REXX. 2.5 Commands to External Environments The only command processing environment that REXXTACY currently supports is CMD. Commands to this environment may be issued exactly as they are in REXX. 3. Keyword Instructions 3.1 ADDRESS Not implemented. All commands are routed to the OS/2 command shell, CMD. 3.2 ARG Implementation identical to that of REXX. 3.3 CALL Implementation identical to that of REXX, with the omission of: - CALL ON - CALL OFF 3.4 DO Implementation identical to that of REXX. 3.5 DROP Not implemented. 3.6 EXIT Implementation identical to that of REXX. 3.7 IF Implementation identical to that of REXX. 3.8 INTERPRET Not implemented. 3.9 ITERATE Not implemented. 3.10 LEAVE Not implemented. 3.11 NOP Implementation identical to that of REXX. 3.12 NUMERIC Not implemented. 3.13 OPTIONS Not implemented. 3.14 PARSE Implementation identical to that of REXX with the exception of the following omissions: - PARSE SOURCE - PARSE VERSION 3.15 PROCEDURE Implementation identical to that of REXX. 3.16 PULL Implementation identical to that of REXX. 3.17 PUSH Not implemented. 3.18 QUEUE Not implemented. 3.19 RETURN Implementation identical to that of REXX. 3.20 SAY Implementation identical to that of REXX. 3.21 SELECT Implementation identical to that of REXX. 3.22 SIGNAL Not implemented. 3.23 TRACE Not implemented. 4. Functions Function calls in REXXTACY operate exactly as they do in REXX. Built in functions that are supported in REXXTACY include: - LENGTH - LINEIN (No support for device names, line or count parameters) - LINES (No support for device names) - RxFuncAdd - RxFuncDrop