Changeset e80ebe5 for doc/user


Ignore:
Timestamp:
Aug 2, 2016, 8:50:27 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
8688ce1, aea7168
Parents:
7416e041
Message:

document new -no-include-std flag and implicit standard headers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    r7416e041 re80ebe5  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon Aug  1 09:11:24 2016
    14 %% Update Count     : 1271
     13%% Last Modified On : Tue Aug  2 17:39:02 2016
     14%% Update Count     : 1286
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    226226
    227227\section{Interoperability}
     228\label{s:Interoperability}
    228229
    229230\CFA is designed to integrate well with existing C programs and libraries.
     
    314315The \CFA compilation message is printed at the beginning of a compilation.
    315316\textbf{This option is the default.}
     317
     318\item
     319\Indexc{-no-include-std}\index{compilation option!-no-include-std@©-no-include-std©}
     320Do not supply ©extern "C"© wrappers for \Celeven standard include files (see~\VRef{s:StandardHeaders}).
     321\textbf{This option is \emph{not} the default.}
    316322\end{description}
    317323
     
    43634369
    43644370
    4365 \section{New Keywowrds}
    4366 
    4367 ©catch©, ©catchResume©, ©choose©, \quad ©disable©, ©dtype©, \quad ©enable©, \quad ©fallthrough©, ©fallthru©, ©finally©, ©forall©, ©ftype©, \quad ©lvalue©, \quad ©otype©, \quad ©throw©, ©throwResume©, ©trait©, ©try©
     4371\section{New Keywords}
     4372\label{s:NewKeywords}
     4373
     4374\begin{quote2}
     4375\begin{tabular}{ll}
     4376©catch©                 & ©lvalue©              \\
     4377©catchResume©   &                               \\
     4378©choose©                & ©otype©               \\
     4379                                &                               \\
     4380©disable©               & ©throw©               \\
     4381©dtype©                 & ©throwResume© \\
     4382                                & ©trait©               \\
     4383©enable©                & ©try©                 \\
     4384                                &                               \\
     4385©fallthrough©                                   \\
     4386©fallthru©                                              \\
     4387©finally©                                               \\
     4388©forall©                                                \\
     4389©ftype©                                                 \\
     4390\end{tabular}
     4391\end{quote2}
     4392
     4393
     4394\section{Standard Headers}
     4395\label{s:StandardHeaders}
     4396
     4397C prescribes the following standard header-files:
     4398\begin{quote2}
     4399\begin{minipage}{\linewidth}
     4400\begin{tabular}{lll}
     4401assert.h        & math.h                & stdlib.h              \\
     4402complex.h       & setjmp.h              & stdnoreturn.h \\
     4403ctype.h         & signal.h              & string.h              \\
     4404errno.h         & stdalign.h    & tgmath.h              \\
     4405fenv.h          & stdarg.h              & threads.h             \\
     4406float.h         & stdatomic.h   & time.h                \\
     4407inttypes.h      & stdbool.h             & uchar.h               \\
     4408iso646.h        & stddef.h              & wchar.h               \\
     4409limits.h        & stdint.h              & wctype.h              \\
     4410locale.h        & stdio.h               & unistd.h\footnote{\CFA extension}
     4411\end{tabular}
     4412\end{minipage}
     4413\end{quote2}
     4414For the prescribed head-files, \CFA implicit wraps their includes in an ©extern "C"©;
     4415hence, names in these include files are not mangled\index{mangling!name} (see~\VRef{s:Interoperability}).
     4416All other C header files must be explicitly wrapped in ©extern "C"© to prevent name mangling.
    43684417
    43694418
     
    43754424\item
    43764425\begin{description}
    4377 \item[Change:] add new keywords \\
     4426\item[Change:] add new keywords (see~\VRef{s:NewKeywords}) \\
    43784427New keywords are added to \CFA.
    43794428\item[Rationale:] keywords added to implement new semantics of \CFA.
     
    44734522\begin{description}
    44744523\item[Change:] have ©struct© introduce a scope for nested types
    4475 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing 
     4524In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing
    44764525Example:
    44774526\begin{lstlisting}
     
    45964645%$
    45974646\begin{lstlisting}[mathescape=off]
    4598 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7 | "x ¿" | 8 | "x «" | 9 | endl;
     4647sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7
     4648         | "x ¿" | 8 | "x «" | 9 | endl;
    45994649\end{lstlisting}
    46004650%$
     
    46064656A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: ©,.:;!?)]}%¢»©
    46074657\begin{lstlisting}[belowskip=0pt]
    4608 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | ") x" | 8 | "] x" | 9 | "} x"
    4609          | 10 | "% x" | 11 | "¢ x" | 12 | "» x" | endl;
     4658sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7
     4659         | ") x" | 8 | "] x" | 9 | "} x" | 10 | "% x" | 11 | "¢ x" | 12 | "» x" | endl;
    46104660\end{lstlisting}
    46114661\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    46234673The following \CC-style \Index{manipulator}s allow further control over implicit seperation.
    46244674\begin{lstlisting}[mathescape=off,belowskip=0pt]
    4625 sout | sepOn | 1 | 2 | 3 | sepOn | endl;        // separator at start of line
     4675sout | sepOn | 1 | 2 | 3 | sepOn | endl;        §\C{// separator at start of line}§
    46264676\end{lstlisting}
    46274677\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    46294679\end{lstlisting}
    46304680\begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt]
    4631 sout | 1 | sepOff | 2 | 3 | endl;                       // turn off implicit separator temporarily
     4681sout | 1 | sepOff | 2 | 3 | endl;                       §\C{// turn off implicit separator temporarily}§
    46324682\end{lstlisting}
    46334683\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    46354685\end{lstlisting}
    46364686\begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt]
    4637 sout | sepDisable | 1 | 2 | 3 | endl;           // turn off implicit separation, affects all subsequent prints
     4687sout | sepDisable | 1 | 2 | 3 | endl;           §\C{// turn off implicit separation, affects all subsequent prints}§
    46384688\end{lstlisting}
    46394689\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    46414691\end{lstlisting}
    46424692\begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt]
    4643 sout | 1 | sepOn | 2 | 3 | endl;                        // turn on implicit separator temporarily
     4693sout | 1 | sepOn | 2 | 3 | endl;                        §\C{// turn on implicit separator temporarily}§
    46444694\end{lstlisting}
    46454695\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    46474697\end{lstlisting}
    46484698\begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt]
    4649 sout | sepEnable | 1 | 2 | 3 | endl;            // turn on implicit separation, affects all subsequent prints
     4699sout | sepEnable | 1 | 2 | 3 | endl;            §\C{// turn on implicit separation, affects all subsequent prints}§
    46504700\end{lstlisting}
    46514701\begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    46534703\end{lstlisting}
    46544704\begin{lstlisting}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
    4655 sepSet( sout, ", $" );                                          // change separator from " " to ", $"
     4705sepSet( sout, ", $" );                                          §\C{// change separator from " " to ", \$"}§
    46564706sout | 1 | 2 | 3 | endl;
    46574707\end{lstlisting}
Note: See TracChangeset for help on using the changeset viewer.