|
Hmm. Mark, you're probably right about it being pretty complex. However, it might be a good exercise that can lead to other things...
In response to your points:
1. Handling switches would be difficult, but possible.
2. Various versions don't particularly present a problem. If I'm converting 100% to kix, then the resulting code should work exactly the same on different version, whether or not I have the same cmd, command, etc., so it comes down to my processing engine.
3. Piping and redirection -- I think in processing a script, you have to make multiple passes. As each line was processed, the script would have to determine what inputs and what outputs were contained in each line, keep track of that information, then see what other lines use the information and what information is discarded. Finally, the external inputs would be differentiated from inputs that are received from other lines in the script. When this is completed, a script could be formulated that discarded all unnecessary pieces. Definitely, this could be a bit difficult and take some time to figure out, but I don't think it's impossible.
4. Batch tricks would be handled by line by line processing. Because .bat files are handled line by line, it still is not difficult to figure out what the actual inputs and outputs should be for a given line. After all is said and done, the processing engine could ask the user if certain outputs (loose ends, like files used for processing) were needed before doing the actual code.
5. Many functions of popular DOS extensions could be incorporated. This would be the most difficult part. In the end, the kix conversion may be simply a shell to use the external program.
....
Brian
|