Unknown commands, methods or arguments

Jacl scripts might call user methods in another or later in the same user scripts, where the method definition has not yet been processed. This produces unknown command warnings in the converted Jython scripts because the Jacl2Jython does not know the command exists yet.

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, for example:

?PROBLEM? (jacl 123) COMMAND_UNKNOWN? someUserMethod(someParam)
The key is to run every set of related Jacl script files through the Jacl2Jython program once to ensure that all user method definitions have been processed and recorded. Then run each Jacl script through a second time to ensure there are no unnecessary warnings and the converted code is as clean as possible. Continuing the above example, after running the Jacl2Jython program a second time, the method definition no longer has unnecessary warnings:
someUserMethod(someParam)
There are Jacl scripts which call methods in the Jacl runtime which might not have an equivalent Jython syntax in the Jython runtime (or which Jacl2Jython program is unaware or cannot handle). The Jacl2Jython program proceeds to convert the invocation of the command or method, but flags it as being an unknown command. You need to modify the preliminary converted Jython script to call a valid Jython runtime command or method. The following are examples of Jacl methods that cannot be handled by the Jacl2Jython program:
?PROBLEM? (jacl 123) COMMAND_UNKNOWN?  setTA(attrib )
?PROBLEM? (jacl 123) COMMAND_UNKNOWN?  cd(dir )
?PROBLEM? (jacl 123) COMMAND_UNKNOWN?  pwd( )
?PROBLEM? (jacl 123) COMMAND_UNKNOWN?  socket(server, port )
The Jacl2Jython program recognizes most of the Jacl commands and can convert them into Jython syntax. During the conversion a warning is produced if a command option is used which the Jacl2Jython program does not understand. For example, most of the Jacl string subcommands are converted, but the less common string subcommand, such as trimleft, cannot be handled:
#?PROBLEM? (jacl 123) STRING_CMD_UNKNOWN? string "trimleft", myStr
Another situation where a conversion warning is produced by the Jacl2Jython program is if there are extra or missing parameters than expected. For example, a Jacl regexp command that contains two parameters converts nicely into Jython syntax. However, the Jacl regexp command accepts extra parameters, whereas, the Jython regexp command does not. When the Jacl regexp command contains more than two parameters, the Jacl2Jython program tags the Jython conversion as problematic:
JACL:   regexp $exp $aJmsServer junk junk2 nodeName
==>
JYTHON: junk = regexp(exp, aJmsServer) #?PROBLEM? (jacl 123) 
               _ REGEXP_NUMBER_ARGS "junk2" "nodeName"

Feedback