Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/Doc/manual.tex
ViewVC logotype

Diff of /sml/trunk/src/cm/Doc/manual.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 632, Sat Apr 29 15:50:42 2000 UTC revision 634, Mon May 1 10:03:50 2000 UTC
# Line 1222  Line 1222 
1222                   -f bar-pp.mk)                   -f bar-pp.mk)
1223  \end{verbatim}  \end{verbatim}
1224    
1225    \subsubsection*{Noweb}
1226    
1227    The {\tt noweb} class handles sources written for Ramsey's {\it noweb}
1228    literate programming facility~\cite{ramsey:simplified}.  Files ending
1229    with suffix {\tt .nw} are automatically recognized as belonging to
1230    this class.
1231    
1232    The noweb tool takes a list of targets.  Each target individually can
1233    have a variety of options.  A target is specified by a separate
1234    tool option labelled {\tt target}.  The tool option usually has the
1235    form of a sub-option list.  Recognized sub-options are:
1236    
1237    \begin{description}
1238    \item[name] the name of the target
1239    \item[root] the (optional) root tag for the target (given to the {\tt
1240    -R} command line switch for the {\tt notangle} command); if {\tt root}
1241    is missing, {\tt name} is used instead
1242    \item[class] the (optional) class of the target
1243    \item[options] (optional) options for the tool that handles the
1244    target's class
1245    \item[lineformat] a string that will be passed to the {\tt -L} command
1246    line option of {\tt notangle}
1247    \item[cpif] an optional boolean value (the word {\tt true} or {\tt
1248    false}); if set to {\tt true} then the target will not be overwritten
1249    if its contents would be unchanged\footnote{The tradeoff is between
1250    running {\tt notangle} too often or recompiling the result too
1251    often.}; default: {\tt true}
1252    \end{description}
1253    
1254    Example:
1255    
1256    \begin{verbatim}
1257       project.nw (target:(name:main.sml options:(private) cpif:false)
1258                   target:(name:grammar class:mlyacc)
1259                   target:(name:parse.sml))
1260    \end{verbatim}
1261    
1262    In place of the sub-option list there can be a single string option
1263    which will be used for {\tt name} or even an unnamed parameter (i.e.,
1264    without the {\tt target} label).  If no targets are specified, the
1265    tool will assume two default targets by stripping the {\tt .nw}
1266    suffix (if present) from the source name and adding {\tt .sig} as well
1267    as {\tt .sml}.
1268    
1269    The following four examples are all equivalent:
1270    
1271    \begin{verbatim}
1272       foo.nw (target:(name:foo.sig) target:(name:foo.sml))
1273       foo.nw (target:foo.sig target:foo.sml)
1274       foo.nw (foo.sig foo.sml)
1275       foo.nw
1276    \end{verbatim}
1277    
1278    If {\tt lineformat} is missing, then a default based on the target
1279    class is used.  Currently only the {\tt sml} and {\tt cm} classes are
1280    known to CM; other classes can be added or removed by using the {\tt
1281    NowebTool.lineNumbering} controller function exported from library
1282    {\tt noweb-tool.cm}:
1283    
1284    \begin{verbatim}
1285      val lineNumbering: string -> { get: unit -> string option,
1286                                     set: string option -> unit }
1287    \end{verbatim}
1288    
1289  \section{Conditional compilation}  \section{Conditional compilation}
1290  \label{sec:preproc}  \label{sec:preproc}
1291    

Legend:
Removed from v.632  
changed lines
  Added in v.634

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0