| 1 |
|
| 2 |
<HTML> |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
<HEAD> |
| 29 |
<TITLE>6.3 Multiple Language Systems</TITLE> |
| 30 |
<STYLE TYPE="text/css"> <!-- A {text-decoration: none} // --> </STYLE> |
| 31 |
</HEAD> |
| 32 |
<BODY BACKGROUND="binary/background.gif" |
| 33 |
BGCOLOR="#FFFFFF" |
| 34 |
TEXT="#000000" |
| 35 |
VLINK="#660000" |
| 36 |
LINK="#FF0000" |
| 37 |
ALINK="#CC0000"> |
| 38 |
|
| 39 |
<TABLE WIDTH="490"> |
| 40 |
<TR> |
| 41 |
<TD WIDTH="130" VALIGN="top"> |
| 42 |
<IMG SRC="binary/d_clear.gif" ALT="" WIDTH="130" HEIGHT="1"><BR> |
| 43 |
|
| 44 |
<FONT SIZE="2"> |
| 45 |
<BR> |
| 46 |
|
| 47 |
<A HREF="http://www.ross.net/" |
| 48 |
TARGET="rosshome" |
| 49 |
onClick="window.open('','rosshome','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 50 |
> |
| 51 |
<IMG SRC="binary/rossnet_logo.gif" |
| 52 |
WIDTH="64" HEIGHT="32" |
| 53 |
BORDER="0" ALT="RossNet" |
| 54 |
HSPACE="0" VSPACE="1"></A><BR> |
| 55 |
<BR> |
| 56 |
|
| 57 |
<A HREF="../index.shtml" |
| 58 |
TARGET="funnelweb" |
| 59 |
onClick="window.open('','funnelweb','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 60 |
> |
| 61 |
<IMG SRC="binary/linklogo.gif" |
| 62 |
WIDTH="64" HEIGHT="32" |
| 63 |
BORDER="0" ALT="FunnelWeb" |
| 64 |
HSPACE="0" VSPACE="1"></A><BR> |
| 65 |
<BR> |
| 66 |
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD BGCOLOR="#000000"> |
| 67 |
<A HREF="../reference/index.html" |
| 68 |
TARGET="funnelwebreference" |
| 69 |
onClick="window.open('','funnelwebreference','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 70 |
><FONT COLOR="#FFFFFF"><B>Reference</B></FONT></A><BR> |
| 71 |
<BR> |
| 72 |
<A HREF="../developer/index.html" |
| 73 |
TARGET="funnelwebdeveloper" |
| 74 |
onClick="window.open('','funnelwebdeveloper','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 75 |
><FONT COLOR="#FFFFFF"><B>Developer</B></FONT></A><BR> |
| 76 |
<BR> |
| 77 |
<A HREF="index.html"><FONT COLOR="#FFFFFF"><B>Tutorial</B></FONT></A><BR> |
| 78 |
<A HREF="intro.html"><FONT COLOR="#FFFFFF">1 Introduction</FONT></A><BR> |
| 79 |
<A HREF="macro.html"><FONT COLOR="#FFFFFF">2 Macros</FONT></A><BR> |
| 80 |
<A HREF="type.html"><FONT COLOR="#FFFFFF">3 Typesetting</FONT></A><BR> |
| 81 |
<A HREF="example.html"><FONT COLOR="#FFFFFF">4 Example</FONT></A><BR> |
| 82 |
<A HREF="hints.html"><FONT COLOR="#FFFFFF">5 Hints</FONT></A><BR> |
| 83 |
<A HREF="examples.html"><FONT COLOR="#FFFFFF">6 Examples</FONT></A><BR> |
| 84 |
<A HREF="web.html"><FONT COLOR="#FFFFFF">7 Webmaking</FONT></A><BR> |
| 85 |
|
| 86 |
<BR> |
| 87 |
<A HREF="search.html"><FONT COLOR="#FFFFFF"><B>SEARCH</B></FONT></A><BR> |
| 88 |
</FONT> |
| 89 |
</TD></TR></TABLE> |
| 90 |
|
| 91 |
|
| 92 |
</TD> |
| 93 |
<TD WIDTH="360" VALIGN="top"> |
| 94 |
<FONT SIZE="3"> |
| 95 |
|
| 96 |
|
| 97 |
<A HREF="../reference/index.html"><IMG SRC="binary/title.gif" |
| 98 |
WIDTH="302" HEIGHT="24" |
| 99 |
BORDER="0" ALT="FunnelWeb Tutorial Manual" |
| 100 |
HSPACE="0" VSPACE="0"></A> |
| 101 |
<P><FONT SIZE="5">6.3 Multiple Language Systems</FONT><BR> |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
<P>With the prevalence of open systems and multi-vendor computing, it is often necessary |
| 106 |
to construct systems consisting of programs written in a |
| 107 |
number of different programming languages for a number of |
| 108 |
different systems. For example, a particular functionality |
| 109 |
might be implemented by a shellscript (invoked by the user) |
| 110 |
that calls a C program that makes a network connection to a |
| 111 |
Pascal program that queries a database. Quite often all |
| 112 |
these programs must conspire closely to execute their |
| 113 |
function. In the normal case, they must be written |
| 114 |
separately. FunnelWeb allows them to be written as a whole. |
| 115 |
|
| 116 |
<P>By creating a single FunnelWeb file that creates many |
| 117 |
product files in different languages, the programmer can |
| 118 |
describe the interaction between the different programs in |
| 119 |
any manner desired. Furthermore, because the different |
| 120 |
product files are all created in the same "text |
| 121 |
space" (i.e. in a single FunnelWeb file), it is easy for |
| 122 |
them to share information. |
| 123 |
|
| 124 |
<P>For example, in one real application FunnelWeb was used |
| 125 |
to create a system for printing |
| 126 |
files on a laser |
| 127 |
printer connected to a remote Vax |
| 128 |
Unix machine from a local Vax VMS machine. The system |
| 129 |
consisted of two files: a VMS DCL command procedure to run |
| 130 |
on the local node, and a Unix shellscript to run on the |
| 131 |
remote node. The user, by giving the print command, invoked |
| 132 |
the local VMS command procedure, which in turn fired up the |
| 133 |
remote Unix shellscript. The two scripts then cooperated to |
| 134 |
transfer the files to be printed and print them. |
| 135 |
|
| 136 |
<P>In addition to its usual documentation powers, |
| 137 |
FunnelWeb assisted in the creation of this system in two |
| 138 |
special ways. First, it allowed pieces of code from the two |
| 139 |
different command procedures to be partially interwoven in a |
| 140 |
description of their interaction. This is just not possible |
| 141 |
with comments. Second, it facilitated the use of shared |
| 142 |
information. For example, under some conditions, each file |
| 143 |
to be printed would be renamed and copied to the remote |
| 144 |
system using a particular constant filename |
| 145 |
(e.g. "<TT>printfile.tmp</TT>"). FunnelWeb allowed this |
| 146 |
constant filename to be included in a single macro |
| 147 |
definition which was invoked in the definition of each of |
| 148 |
the scripts. This ensured that the two scripts used the same |
| 149 |
name. |
| 150 |
|
| 151 |
<P> |
| 152 |
<PRE> |
| 153 |
@A The following macro contains the temporary |
| 154 |
file name used to allow the two shellscripts to |
| 155 |
transfer each file to be printed. |
| 156 |
|
| 157 |
@$@<printfile@>@M==@{printme.txt@} |
| 158 |
|
| 159 |
@A Here are the scripts for the local VMS node |
| 160 |
and the remote UNIX node. |
| 161 |
|
| 162 |
@O@<vmscommandprocedure.com@>==@{@- |
| 163 |
DCL commands |
| 164 |
copy @<printfile@> unixnode:: |
| 165 |
DCL commands |
| 166 |
@} |
| 167 |
|
| 168 |
@O@<unixshellscript@>==@{@- |
| 169 |
unix commands |
| 170 |
print @<printfile@> |
| 171 |
unix commands |
| 172 |
@} |
| 173 |
</PRE> |
| 174 |
|
| 175 |
<P>In the case of the printing system, the entire system |
| 176 |
was described and defined in a single FunnelWeb |
| 177 |
<SAMP>.fw</SAMP> file. In larger systems containing many |
| 178 |
FunnelWeb <SAMP>.fw</SAMP> files for many different modules in |
| 179 |
many different languages, the same trick can be pulled by |
| 180 |
placing FunnelWeb macro definitions for shared values into |
| 181 |
FunnelWeb include files. For example, a suite of |
| 182 |
implementations of network nodes, with each implementation |
| 183 |
being in a different programming language for a different |
| 184 |
target machine, could all share a table of configuration |
| 185 |
constants defined in macros in a FunnelWeb include file. |
| 186 |
|
| 187 |
<P>In summary, FunnelWeb's macro and include file |
| 188 |
mechanisms provide a simple way for programs written in |
| 189 |
different languages to share information. This reduces |
| 190 |
redundancy between the systems and hence the chance of |
| 191 |
inconsistencies arising. |
| 192 |
|
| 193 |
|
| 194 |
<P> |
| 195 |
<TABLE WIDTH="100%"> |
| 196 |
<TR> |
| 197 |
<TD ALIGN="left" VALIGN="bottom"><A HREF="examples_adt.html"><IMG SRC="binary/fw_left.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Prev"></A></TD> |
| 198 |
<TD ALIGN="center" VALIGN="bottom"><A HREF="examples.html"><IMG SRC="binary/fw_up.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Up"></A></TD> |
| 199 |
<TD ALIGN="right" VALIGN="bottom"><A HREF="examples_function.html"><IMG SRC="binary/fw_right.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Next"></A></TD> |
| 200 |
</TR> |
| 201 |
</TABLE> |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
<HR> |
| 206 |
<FONT SIZE="2"> |
| 207 |
<A HREF="mailto:[email protected]">Webmaster</A> |
| 208 |
<A HREF="copyright.html">Copyright © Ross N. Williams 1992,1999. All rights reserved.</A><BR> |
| 209 |
</FONT> |
| 210 |
|
| 211 |
</FONT> |
| 212 |
</TD> |
| 213 |
</TR> |
| 214 |
</TABLE> |
| 215 |
|
| 216 |
|
| 217 |
</BODY> |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
</HTML> |