Related articles |
---|
Re: DOS to UNIX shell translator? Stephen.Darlington@durham.ac.uk (Stephen Darlington) (1994-08-05) |
Re: DOS to UNIX shell translator? dtrg@st-andrews.ac.uk (1994-08-07) |
Re: DOS to UNIX shell translator? ok@cs.rmit.oz.au (1994-08-18) |
Newsgroups: | comp.compilers |
From: | ok@cs.rmit.oz.au (Richard A. O'Keefe) |
Keywords: | translator |
Organization: | Comp Sci, RMIT, Melbourne, Australia |
References: | 94-08-060 94-08-065 |
Date: | Thu, 18 Aug 1994 10:24:43 GMT |
dtrg@st-andrews.ac.uk (David Thomas Richard Given) writes:
>I think you aren't going to be able to convert sh > .BAT, because sh
>scripts are a lot more powerful that .BAT files. For example, how are you
>going to convert multi-line ifs, switch statements, and back-quotes into
>.BAT files? However, .BAT > sh should be easy enough; the only slight
>difficulty may be due to GOTOs. Does sh support goto? (Never use it, so
>never wanted to find out :)
gotos are easy enough to simulate. Translate the whole file into a loop,
LABEL=1
while true ; do
case $LABEL in
1) ...
# goto L =>
LABEL=L
;;
...
esac
done
The real problem is simulating the commands whose return status controls
conditional gotos. For example, how should you translate a "TCC" command
to a "cc" command?
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.