- Timestamp:
- Aug 2, 2016, 8:50:27 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 8688ce1, aea7168
- Parents:
- 7416e041
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/user.tex
r7416e041 re80ebe5 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Aug 1 09:11:24201614 %% Update Count : 12 7113 %% Last Modified On : Tue Aug 2 17:39:02 2016 14 %% Update Count : 1286 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 226 226 227 227 \section{Interoperability} 228 \label{s:Interoperability} 228 229 229 230 \CFA is designed to integrate well with existing C programs and libraries. … … 314 315 The \CFA compilation message is printed at the beginning of a compilation. 315 316 \textbf{This option is the default.} 317 318 \item 319 \Indexc{-no-include-std}\index{compilation option!-no-include-std@©-no-include-std©} 320 Do not supply ©extern "C"© wrappers for \Celeven standard include files (see~\VRef{s:StandardHeaders}). 321 \textbf{This option is \emph{not} the default.} 316 322 \end{description} 317 323 … … 4363 4369 4364 4370 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 4397 C prescribes the following standard header-files: 4398 \begin{quote2} 4399 \begin{minipage}{\linewidth} 4400 \begin{tabular}{lll} 4401 assert.h & math.h & stdlib.h \\ 4402 complex.h & setjmp.h & stdnoreturn.h \\ 4403 ctype.h & signal.h & string.h \\ 4404 errno.h & stdalign.h & tgmath.h \\ 4405 fenv.h & stdarg.h & threads.h \\ 4406 float.h & stdatomic.h & time.h \\ 4407 inttypes.h & stdbool.h & uchar.h \\ 4408 iso646.h & stddef.h & wchar.h \\ 4409 limits.h & stdint.h & wctype.h \\ 4410 locale.h & stdio.h & unistd.h\footnote{\CFA extension} 4411 \end{tabular} 4412 \end{minipage} 4413 \end{quote2} 4414 For the prescribed head-files, \CFA implicit wraps their includes in an ©extern "C"©; 4415 hence, names in these include files are not mangled\index{mangling!name} (see~\VRef{s:Interoperability}). 4416 All other C header files must be explicitly wrapped in ©extern "C"© to prevent name mangling. 4368 4417 4369 4418 … … 4375 4424 \item 4376 4425 \begin{description} 4377 \item[Change:] add new keywords \\4426 \item[Change:] add new keywords (see~\VRef{s:NewKeywords}) \\ 4378 4427 New keywords are added to \CFA. 4379 4428 \item[Rationale:] keywords added to implement new semantics of \CFA. … … 4473 4522 \begin{description} 4474 4523 \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 4524 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing 4476 4525 Example: 4477 4526 \begin{lstlisting} … … 4596 4645 %$ 4597 4646 \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; 4647 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7 4648 | "x ¿" | 8 | "x «" | 9 | endl; 4599 4649 \end{lstlisting} 4600 4650 %$ … … 4606 4656 A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: ©,.:;!?)]}%¢»© 4607 4657 \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;4658 sout | 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; 4610 4660 \end{lstlisting} 4611 4661 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4623 4673 The following \CC-style \Index{manipulator}s allow further control over implicit seperation. 4624 4674 \begin{lstlisting}[mathescape=off,belowskip=0pt] 4625 sout | sepOn | 1 | 2 | 3 | sepOn | endl; // separator at start of line4675 sout | sepOn | 1 | 2 | 3 | sepOn | endl; §\C{// separator at start of line}§ 4626 4676 \end{lstlisting} 4627 4677 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4629 4679 \end{lstlisting} 4630 4680 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4631 sout | 1 | sepOff | 2 | 3 | endl; // turn off implicit separator temporarily4681 sout | 1 | sepOff | 2 | 3 | endl; §\C{// turn off implicit separator temporarily}§ 4632 4682 \end{lstlisting} 4633 4683 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4635 4685 \end{lstlisting} 4636 4686 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4637 sout | sepDisable | 1 | 2 | 3 | endl; // turn off implicit separation, affects all subsequent prints4687 sout | sepDisable | 1 | 2 | 3 | endl; §\C{// turn off implicit separation, affects all subsequent prints}§ 4638 4688 \end{lstlisting} 4639 4689 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4641 4691 \end{lstlisting} 4642 4692 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4643 sout | 1 | sepOn | 2 | 3 | endl; // turn on implicit separator temporarily4693 sout | 1 | sepOn | 2 | 3 | endl; §\C{// turn on implicit separator temporarily}§ 4644 4694 \end{lstlisting} 4645 4695 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4647 4697 \end{lstlisting} 4648 4698 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4649 sout | sepEnable | 1 | 2 | 3 | endl; // turn on implicit separation, affects all subsequent prints4699 sout | sepEnable | 1 | 2 | 3 | endl; §\C{// turn on implicit separation, affects all subsequent prints}§ 4650 4700 \end{lstlisting} 4651 4701 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4653 4703 \end{lstlisting} 4654 4704 \begin{lstlisting}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt] 4655 sepSet( sout, ", $" ); // change separator from " " to ", $"4705 sepSet( sout, ", $" ); §\C{// change separator from " " to ", \$"}§ 4656 4706 sout | 1 | 2 | 3 | endl; 4657 4707 \end{lstlisting}
Note: See TracChangeset
for help on using the changeset viewer.