Running Jacl2Jython conversion assistant

The IBM® Jacl to Jython Conversion Assistant (Jacl2Jython) is a program that assists in converting WebSphere® administrative (wsadmin) scripts written in Jacl into Jython syntax. It is designed to complete most of the preliminary conversion. However, you are responsible for manually verifying all of the preliminary conversion and manually convert or modify the code to make the script function as originally intended. Even if the preliminary conversion might appear correct, you are require to complete the line-by-line manual review and verification of the preliminary converted Jython script.

The Jacl2Jython program performs two main actions when it receives a Jacl script file as input. The first action is scan the input file and group characters into Jacl language parser tokens such as keywords, strings, braces, operators, and others. The second action is convert each of the parser tokens into the corresponding Jython syntax which is output into the Jython script file.

The Jacl2Jython program does a single pass through the input Jacl script each time it runs and does not perform any look-ahead actions during the parsing and converting operations. As the Jacl2Jython program encounters new method definitions, it saves and adds these method names into a file called Jacl2Jython_UserMethods.txt to cache all previously encountered user method definitions. If the parser encounters a method call and has not yet seen its method definition, the Jacl2Jython program flags the command as an unknown. The key is to run the Jacl2Jython program at least two times for each Jacl script that is being converted into a Jython script. Otherwise, the converted Jython script might contain unnecessary warnings such as:
#?PROBLEM? (jacl line 123) COMMAND_UNKNOWN?  myMethod

To run the Jacl2Jython program to facilitate the conversion of wsadmin scripts written in Jacl to Jython syntax:

  1. From the command prompt, change to the x:/bin directory, where x is the installation directory of the workbench.
  2. The command syntax for running the Jacl2Jython program is:
    Jacl2Jython input_Jacl_script_filename
    where input_Jacl_script_name is the fully qualified name of the Jacl script that you want to convert into a Jython script. For example, at the command prompt, type:
    Jacl2Jython c:\MyPath\MyFile.jacl
  3. If the Jacl2Jython program stops, there is a parse error encountered in the input Jacl script. As a result, a matching Jython script cannot be created. You need to resolve all the parse errors in the input Jacl script file. Then run the Jacl2Jython program again to continue with the conversion. See Resolving any Jacl2Jython input parser problems topic on how to resolve parse errors.
  4. If the Jacl2Jython program successfully parses the input Jacl script, then a matching Jython script file with a file extension .py is produced in the same file directory as your input Jacl script. For example, c:\MyPath\MyFile.py
  5. Repeat the above steps again to run the Jacl2Jython program again to ensure that all user method definition have been processed and recorded in Jacl2Jython_UserMethods.txt file. This step helps resolve any unnecessary unknown command warnings and ensures the converted Jython script is as clean as possible.
  6. In a Jython editor or a text editor, open the Jython file that is produced by the Jacl2Jython program.
  7. Find and fix the lines of script marked with a #?PROBLEM? comment flag. The Jacl2Jython program adds a #?PROBLEM? comment flag to the output of the Jython script when it detects a problem in the conversion. The intention is to mark areas in the script where you need to manual verify or alter the script to ensure the intended runtime results are maintained.
  8. Complete the line-by-line manual review and verification of the preliminary conversion. Manually convert or modify the script to function as originally intended. Refer to Considerations when manually verifying the Jacl2Jython converted scripts for details on known manual alterations that might be required on the preliminary converted Jython scripts.

Feedback