Changeset 8cbe732 for doc


Ignore:
Timestamp:
Oct 13, 2023, 7:13:21 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
a97b9ed, bab2917
Parents:
85034ed (diff), 0bf0b978 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
doc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/common.sty

    r85034ed r8cbe732  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sun Jul 16 08:28:52 2023
    14 %% Update Count     : 586
     13%% Last Modified On : Fri Sep 29 16:48:59 2023
     14%% Update Count     : 587
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    272272\setlength{\gcolumnposn}{2.75in}
    273273\setlength{\columnposn}{\gcolumnposn}
     274\newcommand{\setgcolumn}[1]{\global\gcolumnposn=#1\global\columnposn=\gcolumnposn}
    274275\newcommand{\C}[2][\@empty]{\ifx#1\@empty\else\global\setlength{\columnposn}{#1}\global\columnposn=\columnposn\fi\hfill\makebox[\textwidth-\columnposn][l]{\lst@basicstyle{\LstCommentStyle{#2}}}}
    275276\newcommand{\CRT}{\global\columnposn=\gcolumnposn}
     
    302303literate=
    303304  {-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1
    304   {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
     305  {^}{\raisebox{0.6ex}{$\scriptstyle\land\,$}}1
    305306  {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1
    306307  {`}{\ttfamily\upshape\hspace*{-0.3ex}`}1
  • doc/LaTeXmacros/common.tex

    r85034ed r8cbe732  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Fri Jul 21 09:02:00 2023
    14 %% Update Count     : 576
     13%% Last Modified On : Fri Sep 29 16:49:02 2023
     14%% Update Count     : 590
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    275275\setlength{\gcolumnposn}{2.75in}
    276276\setlength{\columnposn}{\gcolumnposn}
     277\newcommand{\setgcolumn}[1]{\global\gcolumnposn=#1\global\columnposn=\gcolumnposn}
    277278\newcommand{\C}[2][\@empty]{\ifx#1\@empty\else\global\setlength{\columnposn}{#1}\global\columnposn=\columnposn\fi\hfill\makebox[\textwidth-\columnposn][l]{\lst@basicstyle{\LstCommentStyle{#2}}}}
    278279\newcommand{\CRT}{\global\columnposn=\gcolumnposn}
     
    301302showlines=true,                                                 % show blank lines at end of code
    302303aboveskip=4pt,                                                  % spacing above/below code block
    303 belowskip=0pt,
     304belowskip=2pt,
    304305numberstyle=\footnotesize\sf,                   % numbering style
    305306% replace/adjust listing characters that look bad in sanserif
    306307literate=
    307308  {-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1
    308   {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
     309  {^}{\raisebox{0.6ex}{$\scriptstyle\land\,$}}1
    309310  {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1
    310311  {`}{\ttfamily\upshape\hspace*{-0.3ex}`}1
  • doc/LaTeXmacros/lstlang.sty

    r85034ed r8cbe732  
    88%% Created On       : Sat May 13 16:34:42 2017
    99%% Last Modified By : Peter A. Buhr
    10 %% Last Modified On : Tue May  2 08:52:35 2023
    11 %% Update Count     : 30
     10%% Last Modified On : Thu Sep 21 08:40:05 2023
     11%% Update Count     : 31
    1212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1313
     
    134134        morekeywords={
    135135                _Accept, _AcceptReturn, _AcceptWait, _Actor, _At, _Catch, _CatchResume, _CorActor, _Cormonitor, _Coroutine,
    136                 _Disable, _Else, _Enable, _Event, _Finally, _Monitor, _Mutex, _Nomutex, _PeriodicTask, _RealTimeTask,
     136                _Disable, _Else, _Enable, _Event, _Exception, _Finally, _Monitor, _Mutex, _Nomutex, _PeriodicTask, _RealTimeTask,
    137137                _Resume, _ResumeTop, _Select, _SporadicTask, _Task, _Timeout, _When, _With, _Throw},
    138138}
  • doc/bibliography/pl.bib

    r85034ed r8cbe732  
    41134113    title       = {High-Performance Extended Actors},
    41144114    journal     = spe,
    4115     year        = 2022,
    4116     note        = {submitted July 2022},
     4115    year        = 2023,
     4116    month       = sep,
     4117    note        = {\url{https://onlinelibrary.wiley.com/doi/pdf/10.1002/spe.3262}}
    41174118}
    41184119
  • doc/user/user.tex

    r85034ed r8cbe732  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Thu Aug 10 21:24:07 2023
    14 %% Update Count     : 5570
     13%% Last Modified On : Sat Sep 30 22:46:19 2023
     14%% Update Count     : 5658
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    6565%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    6666
    67 \setlength{\gcolumnposn}{3in}
    6867\CFAStyle                                                                                               % use default CFA format-style
     68\setgcolumn{2.25in}
    6969%\lstset{language=CFA}                                                                  % CFA default lnaguage
    7070\lstnewenvironment{C++}[1][]                            % use C++ style
     
    224224\setlength{\tabcolsep}{10pt}
    225225\begin{tabular}{@{}rcccccccc@{}}
    226                 & 2021  & 2016  & 2011  & 2006  & 2001  & 1996  & 1991  & 1986  \\ \hline
    227 \RB{C}  & \RB{1}& \RB{2}& \RB{2}& \RB{1}& \RB{1}& \RB{1}& \RB{1}& \RB{1}\\
    228 Java    & 2             & 1             & 1             & 2             & 3             & 28    & -             & -             \\
    229 Python  & 3             & 5             & 6             & 7             & 23    & 13    & -             & -             \\
    230 \CC             & 4             & 3             & 3             & 3             & 2             & 2             & 2             & 8             \\
     226                & 2023  & 2018  & 2013  & 2008  & 2003  & 1998  & 1993  & 1988  \\ \hline
     227Python  & 1             & 4             & 8             & 7             & 12    & 25    & 18    & -             \\
     228\RB{C}  & \RB{2}& \RB{2}& \RB{1}& \RB{2}& \RB{2}& \RB{1}& \RB{1}& \RB{1}\\
     229C++             & 3             & 3             & 4             & 4             & 3             & 2             & 2             & 4             \\
     230Java    & 4             & 1             & 2             & 1             & 1             & 18    & -             & -             \\
    231231\end{tabular}
    232232\end{center}
     
    465465\Indexc{-h}\index{translator option!-h@{©-h©}}, \Indexc{--help}\index{translator option!--help@{©--help©}} \, print translator help message
    466466\item
     467\Indexc{-i}\index{translator option!-i@{©-i©}}, \Indexc{--invariant}\index{translator option!--invariant@{©--invariant©}} \, invariant checking during AST passes
     468\item
    467469\Indexc{-l}\index{translator option!-l@{©-l©}}, \Indexc{--libcfa}\index{translator option!--libcfa@{©--libcfa©}} \, generate ©libcfa.c©
    468470\item
     
    482484\begin{description}[topsep=0pt,itemsep=0pt,parsep=0pt]
    483485\item
    484 \Indexc{ascodegen}\index{translator option!-P@{©-P©}!©ascodegen©}\index{translator option!--print@{©-print©}!©ascodegen©} \, as codegen rather than AST
    485 \item
    486 \Indexc{asterr}\index{translator option!-P@{©-P©}!©asterr©}\index{translator option!--print@{©-print©}!©asterr©} \, AST on error
    487 \item
    488 \Indexc{declstats}\index{translator option!-P@{©-P©}!©declstats©}\index{translator option!--print@{©-print©}!©declstats©} \, code property statistics
    489 \item
    490 \Indexc{parse}\index{translator option!-P@{©-P©}!©parse©}\index{translator option!--print@{©-print©}!©parse©} \, yacc (parsing) debug information
     486\Indexc{ascodegen}\index{translator option!-P@{©-P©}!©ascodegen©}\index{translator option!--print@{©-print©}!©ascodegen©} \, print AST as codegen rather than AST
     487\item
     488\Indexc{asterr}\index{translator option!-P@{©-P©}!©asterr©}\index{translator option!--print@{©-print©}!©asterr©} \, print AST on error
     489\item
     490\Indexc{declstats}\index{translator option!-P@{©-P©}!©declstats©}\index{translator option!--print@{©-print©}!©declstats©} \, print code property statistics
     491\item
     492\Indexc{parse}\index{translator option!-P@{©-P©}!©parse©}\index{translator option!--print@{©-print©}!©parse©} \, print yacc (parsing) debug information
    491493\item
    492494\Indexc{pretty}\index{translator option!-P@{©-P©}!©pretty©}\index{translator option!--print@{©-print©}!©pretty©} \, prettyprint for ©ascodegen© flag
     
    494496\Indexc{rproto}\index{translator option!-P@{©-P©}!©rproto©}\index{translator option!--print@{©-print©}!©rproto©} \, resolver-proto instance
    495497\item
    496 \Indexc{rsteps}\index{translator option!-P@{©-P©}!©rsteps©}\index{translator option!--print@{©-print©}!©rsteps©} \, resolver steps
    497 \item
    498 \Indexc{tree}\index{translator option!-P@{©-P©}!©tree©}\index{translator option!--print@{©-print©}!©tree©} \, parse tree
    499 \item
    500 \Indexc{ast}\index{translator option!-P@{©-P©}!©ast©}\index{translator option!--print@{©-print©}!©ast©} \, AST after parsing
    501 \item
    502 \Indexc{symevt}\index{translator option!-P@{©-P©}!©symevt©}\index{translator option!--print@{©-print©}!©symevt©} \, symbol table events
    503 \item
    504 \Indexc{altexpr}\index{translator option!-P@{©-P©}!©altexpr©}\index{translator option!--print@{©-print©}!©altexpr©} \, alternatives for expressions
    505 \item
    506 \Indexc{astdecl}\index{translator option!-P@{©-P©}!©astdecl©}\index{translator option!--print@{©-print©}!©astdecl©} \, AST after declaration validation pass
    507 \item
    508 \Indexc{resolver}\index{translator option!-P@{©-P©}!©resolver©}\index{translator option!--print@{©-print©}!©resolver©} \, before resolver step
    509 \item
    510 \Indexc{astexpr}\index{translator option!-P@{©-P©}!©astexpr©}\index{translator option!--print@{©-print©}!©altexpr©} \, AST after expression analysis
    511 \item
    512 \Indexc{ctordtor}\index{translator option!-P@{©-P©}!©ctordtor©}\index{translator option!--print@{©-print©}!©ctordtor©} \, after ctor/dtor are replaced
    513 \item
    514 \Indexc{tuple}\index{translator option!-P@{©-P©}!©tuple©}\index{translator option!--print@{©-print©}!©tuple©} \, after tuple expansion
    515 \item
    516 \Indexc{astgen}\index{translator option!-P@{©-P©}!©astgen©}\index{translator option!--print@{©-print©}!©astgen©} \, AST after instantiate generics
    517 \item
    518 \Indexc{box}\index{translator option!-P@{©-P©}!©box©}\index{translator option!--print@{©-print©}!©box©} \, before box step
    519 \item
    520 \Indexc{codegen}\index{translator option!-P@{©-P©}!©codegen©}\index{translator option!--print@{©-print©}!©codegen©} \, before code generation
     498\Indexc{rsteps}\index{translator option!-P@{©-P©}!©rsteps©}\index{translator option!--print@{©-print©}!©rsteps©} \, print resolver steps
     499\item
     500\Indexc{ast}\index{translator option!-P@{©-P©}!©ast©}\index{translator option!--print@{©-print©}!©ast©} \, print AST after parsing
     501\item
     502\Indexc{excpdecl}\index{translator option!-P@{©-P©}!©excpdecl©}\index{translator option!--print@{©-print©}!©excpdecl©} \, print AST after translating exception decls
     503\item
     504\Indexc{symevt}\index{translator option!-P@{©-P©}!©symevt©}\index{translator option!--print@{©-print©}!©symevt©} \, print AST after symbol table events
     505\item
     506\Indexc{expralt}\index{translator option!-P@{©-P©}!©expralt©}\index{translator option!--print@{©-print©}!©expralt©} \, print AST after expressions alternatives
     507\item
     508\Indexc{valdecl}\index{translator option!-P@{©-P©}!©valdecl©}\index{translator option!--print@{©-print©}!©valdecl©} \, print AST after declaration validation pass
     509\item
     510\Indexc{bresolver}\index{translator option!-P@{©-P©}!©bresolver©}\index{translator option!--print@{©-print©}!©bresolver©} \, print AST before resolver step
     511\item
     512\Indexc{expranly}\index{translator option!-P@{©-P©}!©expranly©}\index{translator option!--print@{©-print©}!©expranly©} \, print AST after expression analysis
     513\item
     514\Indexc{ctordtor}\index{translator option!-P@{©-P©}!©ctordtor©}\index{translator option!--print@{©-print©}!©ctordtor©} \, print AST after ctor/dtor are replaced
     515\item
     516\Indexc{tuple}\index{translator option!-P@{©-P©}!©tuple©}\index{translator option!--print@{©-print©}!©tuple©} \, print AST after tuple expansion
     517\item
     518\Indexc{instgen}\index{translator option!-P@{©-P©}!©instgen©}\index{translator option!--print@{©-print©}!©instgen©} \, print AST after instantiate generics
     519\item
     520\Indexc{bbox}\index{translator option!-P@{©-P©}!©bbox©}\index{translator option!--print@{©-print©}!©bbox©} \, print AST before box pass
     521\item
     522\Indexc{bcodegen}\index{translator option!-P@{©-P©}!©bcodegen©}\index{translator option!--print@{©-print©}!©bcodegen©} \, print AST before code generation
    521523\end{description}
    522524\item
     
    535537Keyword clashes are accommodated by syntactic transformations using the \CFA backquote escape-mechanism:
    536538\begin{cfa}
    537 int ®``®coroutine = 3; $\C{// make keyword an identifier}$
     539int ®``®coroutine = 3;                                  $\C{// make keyword an identifier}$
    538540double ®``®forall = 3.5;
    539541\end{cfa}
     
    545547\begin{cfa}
    546548// include file uses the CFA keyword "with".
    547 #if ! defined( with )                                                   $\C{// nesting ?}$
    548 #define with ®``®with                                                   $\C{// make keyword an identifier}$
     549#if ! defined( with )                                   $\C{// nesting ?}$
     550#define with ®``®with                                   $\C{// make keyword an identifier}$
    549551#define __CFA_BFD_H__
    550552#endif
    551 $\R{\#include\_next} <bfdlink.h>$                               $\C{// must have internal check for multiple expansion}$
     553$\R{\#include\_next} <bfdlink.h>$               $\C{// must have internal check for multiple expansion}$
    552554#if defined( with ) && defined( __CFA_BFD_H__ ) $\C{// reset only if set}$
    553555#undef with
     
    564566Numeric constants are extended to allow \Index{underscore}s\index{constant!underscore} as a separator, \eg:
    565567\begin{cfa}
    566 2®_®147®_®483®_®648; $\C{// decimal constant}$
    567 56®_®ul; $\C{// decimal unsigned long constant}$
    568 0®_®377; $\C{// octal constant}$
    569 0x®_®ff®_®ff; $\C{// hexadecimal constant}$
    570 0x®_®ef3d®_®aa5c; $\C{// hexadecimal constant}$
    571 3.141®_®592®_®654; $\C{// floating constant}$
    572 10®_®e®_®+1®_®00; $\C{// floating constant}$
    573 0x®_®ff®_®ff®_®p®_®3; $\C{// hexadecimal floating}$
    574 0x®_®1.ffff®_®ffff®_®p®_®128®_®l; $\C{// hexadecimal floating long constant}$
     5682®_®147®_®483®_®648;                                    $\C{// decimal constant}$
     56956®_®ul;                                                                $\C{// decimal unsigned long constant}$
     5700®_®377;                                                                $\C{// octal constant}$
     5710x®_®ff®_®ff;                                                   $\C{// hexadecimal constant}$
     5720x®_®ef3d®_®aa5c;                                               $\C{// hexadecimal constant}$
     5733.141®_®592®_®654;                                              $\C{// floating constant}$
     57410®_®e®_®+1®_®00;                                               $\C{// floating constant}$
     5750x®_®ff®_®ff®_®p®_®3;                                   $\C{// hexadecimal floating}$
     5760x®_®1.ffff®_®ffff®_®p®_®128®_®l;               $\C{// hexadecimal floating long constant}$
    575577L®_®$"\texttt{\textbackslash{x}}$®_®$\texttt{ff}$®_®$\texttt{ee}"$; $\C{// wide character constant}$
    576578\end{cfa}
     
    602604
    603605There are exponentiation operators for integral and floating types, including the builtin \Index{complex} types.
    604 Integral exponentiation\index{exponentiation!unsigned integral} is performed with repeated multiplication\footnote{The multiplication computation is $O(\log y)$.} (or shifting if the exponent is 2).
     606Integral exponentiation\index{exponentiation!unsigned integral} is performed with repeated multiplication ($O(\log y)$ multiplies or shifting if the exponent is 2).
    605607Overflow for a large exponent or negative exponent returns zero.
    606608Floating exponentiation\index{exponentiation!floating} is performed using \Index{logarithm}s\index{exponentiation!logarithm}, so the exponent cannot be negative.
    607609\begin{cfa}
    608 sout | 1 ®\® 0 | 1 ®\® 1 | 2 ®\® 8 | -4 ®\® 3 | 5 ®\® 3 | 5 ®\® 32 | 5L ®\® 32 | 5L ®\® 64 | -4 ®\® -3 | -4.0 ®\® -3 | 4.0 ®\® 2.1
    609            | (1.0f+2.0fi) ®\® (3.0f+2.0fi);
     610sout | 1 ®\® 0 | 1 ®\® 1 | 2 ®\® 8 | -4 ®\® 3 | 5 ®\® 3 | 5 ®\® 32 | 5L ®\® 32 | 5L ®\® 64 | -4 ®\® -3 | -4.0 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi);
    6106111 1 256 -64 125 ®0® 3273344365508751233 ®0® ®0® -0.015625 18.3791736799526 0.264715-1.1922i
    611612\end{cfa}
     
    620621T ?®\®?( T ep, unsigned long int y );
    621622\end{cfa}
    622 The user type ©T© must define multiplication, one (©1©), and ©*©.
     623A user type ©T© must define multiplication, one (©1©), and ©*©.
    623624
    624625
     
    634635Declarations in the \Indexc{do}-©while© condition are not useful because they appear after the loop body.}
    635636\begin{cfa}
    636 if ( ®int x = f()® ) ... $\C{// x != 0}$
    637 if ( ®int x = f(), y = g()® ) ... $\C{// x != 0 \&\& y != 0}$
     637if ( ®int x = f()® ) ...                        $\C{// x != 0}$
     638if ( ®int x = f(), y = g()® ) ...       $\C{// x != 0 \&\& y != 0}$
    638639if ( ®int x = f(), y = g(); x < y® ) ... $\C{// relational expression}$
    639640if ( ®struct S { int i; } x = { f() }; x.i < 4® ) $\C{// relational expression}$
    640641
    641 while ( ®int x = f()® ) ... $\C{// x != 0}$
     642while ( ®int x = f()® ) ...                     $\C{// x != 0}$
    642643while ( ®int x = f(), y = g()® ) ... $\C{// x != 0 \&\& y != 0}$
    643644while ( ®int x = f(), y = g(); x < y® ) ... $\C{// relational expression}$
     
    653654\label{s:caseClause}
    654655
    655 C restricts the \Indexc{case} clause of a \Indexc{switch} statement to a single value.
    656 For multiple ©case© clauses associated with the same statement, it is necessary to have multiple ©case© clauses rather than multiple values.
     656C restricts a \Indexc{case} clause in \Indexc{switch} statement to a single value.
     657For multiple ©case© clauses prefixing a statement within the ©switch© statement, it is necessary to have multiple ©case© clauses rather than multiple values.
    657658Requiring a ©case© clause for each value is not in the spirit of brevity normally associated with C.
    658659Therefore, the ©case© clause is extended with a list of values.
    659660\begin{cquote}
    660661\begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}}
    661 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{C}} \\
     662\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CFA}}      \\
     663\begin{cfa}
     664switch ( i ) {
     665  case 1: case 3 : case 5:
     666        ...
     667  case 2: case 4 : case 6:
     668        ...
     669}
     670\end{cfa}
     671&
    662672\begin{cfa}
    663673switch ( i ) {
     
    670680&
    671681\begin{cfa}
    672 switch ( i ) {
    673   case 1: case 3 : case 5:
    674         ...
    675   case 2: case 4 : case 6:
    676         ...
    677 }
    678 \end{cfa}
    679 &
    680 \begin{cfa}
    681682
    682683// odd values
     
    688689\end{tabular}
    689690\end{cquote}
    690 In addition, subranges are allowed to specify case values.\footnote{
    691 gcc has the same mechanism but awkward syntax, \lstinline{2 ...42}, because a space is required after a number, otherwise the period is a decimal point.}
     691In addition, subranges are allowed to specify case values.
     692\begin{cquote}
     693\begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{\hspace{2em}}l@{}}
     694\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CFA}}      & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{©gcc©}}     \\
    692695\begin{cfa}
    693696switch ( i ) {
    694   case ®1~5:® $\C{// 1, 2, 3, 4, 5}$
     697  case 1: case 2: case 3: case 4:
    695698        ...
    696   case ®10~15:® $\C{// 10, 11, 12, 13, 14, 15}$
     699  case 10: case 11: case 12: case 13:
    697700        ...
    698701}
    699702\end{cfa}
    700 Lists of subranges are also allowed.
     703&
     704\begin{cfa}
     705switch ( i ) {
     706  case ®1~4:®
     707        ...
     708  case ®10~13:®
     709        ...
     710}
     711\end{cfa}
     712&
     713\begin{cfa}
     714switch ( i ) {
     715  case 1$\R{\textvisiblespace}$®...®4:
     716        ...
     717  case 10$\R{\textvisiblespace}$®...®13:
     718        ...
     719}
     720\end{cfa}
     721&
     722\begin{cfa}
     723
     724// 1, 2, 3, 4
     725
     726// 10, 11, 12, 13
     727
     728
     729\end{cfa}
     730\end{tabular}
     731\end{cquote}
     732While ©gcc© has the same range mechanism, it has an awkward syntax, ©2©\R{\textvisiblespace}©...42©, because a space is required after a number, otherwise the period is a decimal point.
     733
     734\CFA also allows lists of subranges.
    701735\begin{cfa}
    702736case ®1~5, 12~21, 35~42®:
     
    769803This situation is better handled by a list of case values \see{\VRef{s:caseClause}}.
    770804While fall-through itself is not a problem, the problem occurs when fall-through is the default, as this semantics is unintuitive to many programmers and is different from most programming languages with a ©switch© statement.
    771 Hence, default fall-through semantics results in a large number of programming errors as programmers often \emph{forget} the ©break© statement at the end of a ©case© clause, resulting in inadvertent fall-through.
     805Hence, default fall-through semantics results in a many programming errors as programmers often \emph{forget} the ©break© statement at the end of a ©case© clause, resulting in inadvertent fall-through.
    772806
    773807\item
     
    846880and there is only a medium amount of fall-through from one ©case© clause to the next, and most of these result from a list of case values executing common code, rather than a sequence of case actions that compound.
    847881\end{itemize}
    848 These observations put into perspective the \CFA changes to the ©switch©.
     882These observations put into perspective the \CFA changes to the ©switch© statement.
    849883\begin{enumerate}
    850884\item
     
    888922\begin{cfa}
    889923switch ( x ) {
    890         ®int i = 0;® $\C{// allowed only at start}$
     924        ®int i = 0;®                                            $\C{// allowed only at start}$
    891925  case 0:
    892926        ...
    893         ®int j = 0;® $\C{// disallowed}$
     927        ®int j = 0;®                                            $\C{// disallowed}$
    894928  case 1:
    895929        {
    896                 ®int k = 0;® $\C{// allowed at different nesting levels}$
     930                ®int k = 0;®                                    $\C{// allowed at different nesting levels}$
    897931                ...
    898           ®case 2:® $\C{// disallow case in nested statements}$
     932          ®case 2:®                                                     $\C{// disallow case in nested statements}$
    899933        }
    900934  ...
     
    907941
    908942The \Indexc{fallthrough} clause may be non-terminating within a \Indexc{case} clause or have a target label to common code from multiple case clauses.
    909 \begin{center}
     943\begin{cquote}
    910944\begin{tabular}{@{}lll@{}}
    911945\begin{cfa}
     
    957991\end{cfa}
    958992\end{tabular}
    959 \end{center}
     993\end{cquote}
    960994The target label must be below the \Indexc{fallthrough} and may not be nested in a control structure, and
    961995the target label must be at the same or higher level as the containing \Indexc{case} clause and located at
     
    964998
    965999\begin{figure}
    966 \begin{tabular}{@{}l@{\hspace{40pt}}|l@{}}
    967 \multicolumn{1}{@{}c@{\hspace{40pt}}|}{loop control} & \multicolumn{1}{c@{}}{output} \\
     1000\begin{tabular}{@{}l@{\hspace{50pt}}|l@{}}
     1001\multicolumn{1}{@{}c@{\hspace{50pt}}|}{loop control} & \multicolumn{1}{c@{}}{output} \\
    9681002\hline
    9691003\begin{cfa}
     
    10831117The \Indexc{for}, \Indexc{while}, and \Indexc{do} loop-control allow an empty conditional, which implies a comparison value of ©1© (true).
    10841118\begin{cfa}
    1085 while ( ®/*empty*/®  )                  $\C{// while ( true )}$
    1086 for ( ®/*empty*/®  )                    $\C{// for ( ; true; )}$
    1087 do ... while ( ®/*empty*/®  )    $\C{// do ... while ( true )}$
     1119while ( ®/* empty */®  )                                $\C{// while ( true )}$
     1120for ( ®/* empty */®  )                                  $\C{// for ( ; true; )}$
     1121do ... while ( ®/* empty */®  )                 $\C{// do ... while ( true )}$
    10881122\end{cfa}
    10891123
     
    11151149If no type is specified for the loop index, it is the type of the high value H (when the low value is implicit) or the low value L.
    11161150\begin{cfa}
    1117 for ( ®5® )                                             $\C{// typeof(5) anonymous-index; 5 is high value}$
    1118 for ( i; ®1.5® ~ 5.5 )                  $\C{// typeof(1.5) i; 1.5 is low value}$
    1119 for ( ®int i®; 0 ~ 10 ~ 2 )             $\C{// int i; type is explicit}$
     1151for ( ®5® )                                                             $\C{// typeof(5) anonymous-index; 5 is high value}$
     1152for ( i; ®1.5® ~ 5.5 )                                  $\C{// typeof(1.5) i; 1.5 is low value}$
     1153for ( ®int i®; 0 ~ 10 ~ 2 )                             $\C{// int i; type is explicit}$
    11201154\end{cfa}
    11211155
     
    11251159H is implicit up-to exclusive range [0,H\R{)}.
    11261160\begin{cfa}
    1127 for ( ®5® )                                             $\C{// for ( typeof(5) i; i < 5; i += 1 )}$
     1161for ( ®5® )                                                             $\C{// for ( typeof(5) i; i < 5; i += 1 )}$
    11281162\end{cfa}
    11291163\item
    11301164©~=© H is implicit up-to inclusive range [0,H\R{]}.
    11311165\begin{cfa}
    1132 for ( ®~=® 5 )                                  $\C{// for ( typeof(5) i; i <= 5; i += 1 )}$
     1166for ( ®~=® 5 )                                                  $\C{// for ( typeof(5) i; i <= 5; i += 1 )}$
    11331167\end{cfa}
    11341168\item
    11351169L ©~©\index{~@©~©} H is explicit up-to exclusive range [L,H\R{)}.
    11361170\begin{cfa}
    1137 for ( 1 ®~® 5 )                                 $\C{// for ( typeof(1) i = 1; i < 5; i += 1 )}$
     1171for ( 1 ®~® 5 )                                                 $\C{// for ( typeof(1) i = 1; i < 5; i += 1 )}$
    11381172\end{cfa}
    11391173\item
    11401174L ©~=©\index{~=@©~=©} H is explicit up-to inclusive range [L,H\R{]}.
    11411175\begin{cfa}
    1142 for ( 1 ®~=® 5 )                                        $\C{// for ( typeof(1) i = 1; i <= 5; i += 1 )}$
     1176for ( 1 ®~=® 5 )                                                $\C{// for ( typeof(1) i = 1; i <= 5; i += 1 )}$
    11431177\end{cfa}
    11441178\item
    11451179L ©-~©\index{-~@©-~©} H is explicit down-to exclusive range [H,L\R{)}, where L and H are implicitly interchanged to make the range down-to.
    11461180\begin{cfa}
    1147 for ( 1 ®-~® 5 )                                        $\C{// for ( typeof(1) i = 5; i > 0; i -= 1 )}$
     1181for ( 1 ®-~® 5 )                                                $\C{// for ( typeof(1) i = 5; i > 0; i -= 1 )}$
    11481182\end{cfa}
    11491183\item
    11501184L ©-~=©\index{-~=@©-~=©} H is explicit down-to inclusive range [H,L\R{]}, where L and H are implicitly interchanged to make the range down-to.
    11511185\begin{cfa}
    1152 for ( 1 ®-~=® 5 )                                       $\C{// for ( typeof(1) i = 5; i >= 0; i -= 1 )}$
     1186for ( 1 ®-~=® 5 )                                               $\C{// for ( typeof(1) i = 5; i >= 0; i -= 1 )}$
    11531187\end{cfa}
    11541188\item
    11551189©@© means put nothing in this field.
    11561190\begin{cfa}
    1157 for ( i; 1 ~ ®@® ~ 2 )                  $\C{// for ( typeof(1) i = 1; \R{/* empty */}; i += 2 )}$
    1158 for ( i; 1 ~ 10 ~ ®@® )                 $\C{// for ( typeof(1) i = 1; i < 10; \R{/* empty */} )}$
    1159 for ( i; 1 ~ ®@® ~ ®@® )                $\C{// for ( typeof(1) i = 1; /*empty*/; \R{/* empty */} )}$
     1191for ( i; 1 ~ ®@® ~ 2 )                                  $\C{// for ( typeof(1) i = 1; \R{/* empty */}; i += 2 )}$
     1192for ( i; 1 ~ 10 ~ ®@® )                                 $\C{// for ( typeof(1) i = 1; i < 10; \R{/* empty */} )}$
     1193for ( i; 1 ~ ®@® ~ ®@® )                                $\C{// for ( typeof(1) i = 1; /*empty*/; \R{/* empty */} )}$
    11601194\end{cfa}
    11611195L cannot be elided for the up-to range, \lstinline{@ ~ 5}, and H for the down-to range, \lstinline{1 -~ @}, because then the loop index is uninitialized.
     
    11641198©:© means low another index.
    11651199\begin{cfa}
    1166 for ( i; 5 ®:® j; 2 ~ 12 ~ 3 )          $\C{// for ( typeof(i) i = 1, j = 2; i < 5 \&\& j < 12; i += 1, j += 3 )}$
     1200for ( i; 5 ®:® j; 2 ~ 12 ~ 3 )                  $\C{// for ( typeof(i) i = 1, j = 2; i < 5 \&\& j < 12; i += 1, j += 3 )}$
    11671201\end{cfa}
    11681202\end{itemize}
    11691203\R{Warning}: specifying the down-to range maybe unexpected because the loop control \emph{implicitly} switches the L and H values (and toggles the increment/decrement for I):
    11701204\begin{cfa}
    1171 for ( i; 1 ~ 10 )       ${\C[1.5in]{// up range}$
    1172 for ( i; 1 -~ 10 )      ${\C{// down range}$
    1173 for ( i; ®10 -~ 1® )    ${\C{// \R{WRONG down range!}}\CRT}$
     1205for ( i; 1 ~ 10 )                                               ${\C{// up range}$
     1206for ( i; 1 -~ 10 )                                              ${\C{// down range}$
     1207for ( i; ®10 -~ 1® )                                    ${\C{// \R{WRONG down range!}}}$
    11741208\end{cfa}
    11751209The reason for this semantics is that the range direction can be toggled by adding/removing the minus, ©'-'©, versus interchanging the L and H expressions, which has a greater chance of introducing errors.
     
    11881222
    11891223\begin{figure}
    1190 \centering
    11911224\begin{lrbox}{\myboxA}
    1192 \begin{cfa}[tabsize=3]
     1225\begin{cfa}[tabsize=4]
    11931226®Compound:® {
    11941227        ®Try:® try {
     
    12201253
    12211254\begin{lrbox}{\myboxB}
    1222 \begin{cfa}[tabsize=3]
     1255\begin{cfa}[tabsize=4]
    12231256{
    12241257
     
    12491282\end{lrbox}
    12501283
    1251 \subfloat[\CFA]{\label{f:CFibonacci}\usebox\myboxA}
     1284\subfloat[C]{\label{f:CFAFibonacciGen}\usebox\myboxB}
    12521285\hspace{3pt}
    12531286\vrule
    12541287\hspace{3pt}
    1255 \subfloat[C]{\label{f:CFAFibonacciGen}\usebox\myboxB}
     1288\subfloat[\CFA]{\label{f:CFibonacci}\usebox\myboxA}
    12561289\caption{Multi-level Exit}
    12571290\label{f:MultiLevelExit}
     
    12871320int a[10];
    12881321\end{cfa}
    1289 \begin{tabular}{@{}lll@{}}
     1322\begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{3em}}l@{}}
    12901323\begin{cfa}
    12911324
     
    13281361Grouping heterogeneous data into an \newterm{aggregate} (structure/union) is a common programming practice, and aggregates may be nested:
    13291362\begin{cfa}
    1330 struct Person {                                                         $\C{// aggregate}$
    1331         struct Name { char first[20], last[20]; } name $\C{// nesting}$
    1332         struct Address { ... } address                  $\C{// nesting}$
     1363struct Person {                                                 $\C{// aggregate}$
     1364        struct Name {                                           $\C{// nesting}$
     1365                char first[20], last[20];
     1366        } name;
     1367        struct Address {                                        $\C{// nesting}$
     1368                ...
     1369        } address;
    13331370        int sex;
    13341371};
     
    13371374\begin{cfa}
    13381375Person p
    1339 ®p.®name; ®p.®address; ®p.®sex; $\C{// access containing fields}$
     1376®p.®name; ®p.®address; ®p.®sex;                 $\C{// access containing fields}$
    13401377\end{cfa}
    13411378which extends to multiple levels of qualification for nested aggregates and multiple aggregates.
     
    13521389\begin{cfa}
    13531390struct S {
    1354         struct $\R{\LstCommentStyle{/* unnamed */}}$ { int g,  h; } __attribute__(( aligned(64) ));
     1391        struct $\R{\LstCommentStyle{/* unnamed */}}$  { int g,  h; } __attribute__(( aligned(64) ));
    13551392        int tag;
    1356         union $\R{\LstCommentStyle{/* unnamed */}}$ {
     1393        union $\R{\LstCommentStyle{/* unnamed */}}$  {
    13571394                struct { char c1,  c2; } __attribute__(( aligned(128) ));
    13581395                struct { int i1,  i2; };
     
    13681405struct S {
    13691406        char ®c®;   int ®i®;   double ®d®;
    1370         void f( /* S * this */ ) {                              $\C{// implicit ``this'' parameter}$
    1371                 ®c®;   ®i®;   ®d®;                                      $\C{// this->c; this->i; this->d;}$
     1407        void f( /* S * this */ ) {                      $\C{// implicit ``this'' parameter}$
     1408                ®c®;   ®i®;   ®d®;                              $\C{// this->c; this->i; this->d;}$
    13721409        }
    13731410}
     
    13771414\begin{cfa}
    13781415struct T {
    1379         char ®m®;   int ®i®;   double ®n®;              $\C{// derived class variables}$
     1416        char ®m®;   int ®i®;   double ®n®;      $\C{// derived class variables}$
    13801417};
    13811418struct S : public T {
    1382         char ®c®;   int ®i®;   double ®d®;              $\C{// class variables}$
     1419        char ®c®;   int ®i®;   double ®d®;      $\C{// class variables}$
    13831420        void g( double ®d®, T & t ) {
    1384                 d;   ®t®.m;   ®t®.i;   ®t®.n;           $\C{// function parameter}$
    1385                 c;   i;   ®this->®d;   ®S::®d;          $\C{// class S variables}$
    1386                 m;   ®T::®i;   n;                                       $\C{// class T variables}$
     1421                d;   ®t®.m;   ®t®.i;   ®t®.n;   $\C{// function parameter}$
     1422                c;   i;   ®this->®d;   ®S::®d;  $\C{// class S variables}$
     1423                m;   ®T::®i;   n;                               $\C{// class T variables}$
    13871424        }
    13881425};
     
    13941431Hence, the qualified fields become variables with the side-effect that it is simpler to write, easier to read, and optimize field references in a block.
    13951432\begin{cfa}
    1396 void f( S & this ) ®with ( this )® {            $\C{// with statement}$
    1397         ®c®;   ®i®;   ®d®;                                              $\C{// this.c, this.i, this.d}$
     1433void f( S & this ) ®with ( this )® {    $\C{// with statement}$
     1434        ®c®;   ®i®;   ®d®;                                      $\C{// this.c, this.i, this.d}$
    13981435}
    13991436\end{cfa}
    14001437with the generality of opening multiple aggregate-parameters:
    14011438\begin{cfa}
    1402 void g( S & s, T & t ) ®with ( s, t )® {        $\C{// multiple aggregate parameters}$
    1403         c;   ®s.®i;   d;                                                $\C{// s.c, s.i, s.d}$
    1404         m;   ®t.®i;   n;                                                $\C{// t.m, t.i, t.n}$
     1439void g( S & s, T & t ) ®with ( s, t )® {$\C{// multiple aggregate parameters}$
     1440        c;   ®s.®i;   d;                                        $\C{// s.c, s.i, s.d}$
     1441        m;   ®t.®i;   n;                                        $\C{// t.m, t.i, t.n}$
    14051442}
    14061443\end{cfa}
     
    14251462struct R { int ®i®; int j; double ®m®; } r, w;
    14261463with ( r, q ) {
    1427         j + k;                                                                  $\C{// unambiguous, r.j + q.k}$
    1428         m = 5.0;                                                                $\C{// unambiguous, q.m = 5.0}$
    1429         m = 1;                                                                  $\C{// unambiguous, r.m = 1}$
    1430         int a = m;                                                              $\C{// unambiguous, a = r.i }$
    1431         double b = m;                                                   $\C{// unambiguous, b = q.m}$
    1432         int c = r.i + q.i;                                              $\C{// disambiguate with qualification}$
    1433         (double)m;                                                              $\C{// disambiguate with cast}$
     1464        j + k;                                                          $\C{// unambiguous, r.j + q.k}$
     1465        m = 5.0;                                                        $\C{// unambiguous, q.m = 5.0}$
     1466        m = 1;                                                          $\C{// unambiguous, r.m = 1}$
     1467        int a = m;                                                      $\C{// unambiguous, a = r.i }$
     1468        double b = m;                                           $\C{// unambiguous, b = q.m}$
     1469        int c = r.i + q.i;                                      $\C{// disambiguate with qualification}$
     1470        (double)m;                                                      $\C{// disambiguate with cast}$
    14341471}
    14351472\end{cfa}
     
    14391476\begin{cfa}
    14401477with ( r ) {
    1441         i;                                                                              $\C{// unambiguous, r.i}$
     1478        i;                                                                      $\C{// unambiguous, r.i}$
    14421479        with ( q ) {
    1443                 i;                                                                      $\C{// unambiguous, q.i}$
     1480                i;                                                              $\C{// unambiguous, q.i}$
    14441481        }
    14451482}
     
    14481485A cast can also be used to disambiguate among overload variables in a ©with© \emph{expression}:
    14491486\begin{cfa}
    1450 with ( w ) { ... }                                                      $\C{// ambiguous, same name and no context}$
    1451 with ( (Q)w ) { ... }                                           $\C{// unambiguous, cast}$
     1487with ( w ) { ... }                                              $\C{// ambiguous, same name and no context}$
     1488with ( (Q)w ) { ... }                                   $\C{// unambiguous, cast}$
    14521489\end{cfa}
    14531490Because there is no left-side in the ©with© expression to implicitly disambiguate between the ©w© variables, it is necessary to explicitly disambiguate by casting ©w© to type ©Q© or ©R©.
     
    14561493\begin{cfa}
    14571494void f( S & s, char c ) with ( s ) {
    1458         ®s.c = c;®  i = 3;  d = 5.5;                    $\C{// initialize fields}$
     1495        ®s.c = c;®  i = 3;  d = 5.5;            $\C{// initialize fields}$
    14591496}
    14601497\end{cfa}
     
    14621499To solve this problem, parameters \emph{not} explicitly opened are treated like an initialized aggregate:
    14631500\begin{cfa}
    1464 struct Params {                                                         $\C{// s explicitly opened so S \& s elided}$
     1501struct Params {                                                 $\C{// s explicitly opened so S \& s elided}$
    14651502        char c;
    14661503} params;
     
    14811518Transfer of control can be local, within a routine, or non-local, among routines.
    14821519Non-local transfer can cause stack unwinding, \ie non-local routine termination, depending on the kind of raise.
     1520
     1521Currently, \CFA uses macros ©ExceptionDecl© and ©ExceptionInst© to declare and instantiate an exception.
     1522\begin{cfa}
     1523#include <Exception.hfa>
     1524®ExceptionDecl®( E,             // must be global scope
     1525        ... // exception fields
     1526);
     1527try {
     1528        ...
     1529        if ( ... ) ®throwResume® ®ExceptionInst®( E, /* intialization */ );
     1530        if ( ... ) ®throw® ®ExceptionInst®( E, /* intialization */ );
     1531        ...
     1532} ®catchResume®( E * ) { // must be pointer
     1533        ...
     1534} catch( E * ) {
     1535        ...
     1536}
     1537\end{cfa}
     1538
    14831539\begin{cfa}
    14841540exception_t E {}; $\C{// exception type}$
     
    14891545try {
    14901546        f(...);
    1491 } catch( E e ; $boolean-predicate$ ) {          $\C{// termination handler}$
     1547} catch( E e ; $boolean-predicate$ ) {  $\C{// termination handler}$
    14921548        // recover and continue
    14931549} catchResume( E e ; $boolean-predicate$ ) { $\C{// resumption handler}$
     
    15011557The ©catch© and ©catchResume© handlers may appear in any oder.
    15021558However, the ©finally© clause must appear at the end of the ©try© statement.
     1559
     1560
     1561\section{Non-local Exception}
     1562
     1563\begin{cfa}
     1564void main() {
     1565        try {
     1566                _Enable {
     1567                        ... resume(); ...
     1568                }
     1569        } ®catchResume®( E & ) { // should be reference
     1570                ...
     1571        } catch( E & ) {
     1572                ...
     1573        }
     1574}
     1575\end{cfa}
    15031576
    15041577
     
    15661639\begin{cquote}
    15671640\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
    1568 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c}{\textbf{C}}        \\
     1641\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c}{\textbf{\CFA}}     \\
     1642\begin{cfa}[moredelim={**[is][\color{blue}]{\#}{\#}}]
     1643®int® #*# x1 #[5]#;
     1644®int® #(*#x2#)[5]#;
     1645#int (*#f®( int p )®#)[5]#;
     1646\end{cfa}
     1647&
    15691648\begin{cfa}[moredelim={**[is][\color{blue}]{\#}{\#}}]
    15701649#[5] *# ®int® x1;
    15711650#* [5]# ®int® x2;
    15721651#[* [5] int]# f®( int p )®;
    1573 \end{cfa}
    1574 &
    1575 \begin{cfa}[moredelim={**[is][\color{blue}]{\#}{\#}}]
    1576 ®int® #*# x1 #[5]#;
    1577 ®int® #(*#x2#)[5]#;
    1578 #int (*#f®( int p )®#)[5]#;
    15791652\end{cfa}
    15801653\end{tabular}
     
    15861659\begin{cquote}
    15871660\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
    1588 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c}{\textbf{C}}        \\
     1661\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c}{\textbf{\CFA}}     \\
     1662\begin{cfa}
     1663int ®*®x, ®*®y;
     1664\end{cfa}
     1665&
    15891666\begin{cfa}
    15901667®*® int x, y;
    1591 \end{cfa}
    1592 &
    1593 \begin{cfa}
    1594 int ®*®x, ®*®y;
    15951668\end{cfa}
    15961669\end{tabular}
     
    15991672\begin{cquote}
    16001673\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
    1601 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c}{\textbf{C}}        \\
     1674\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c}{\textbf{\CFA}}     \\
     1675\begin{cfa}
     1676int ®*®x, y;
     1677
     1678\end{cfa}
     1679&
    16021680\begin{cfa}
    16031681®*® int x;
    16041682int y;
    1605 \end{cfa}
    1606 &
    1607 \begin{cfa}
    1608 int ®*®x, y;
    1609 
    16101683\end{cfa}
    16111684\end{tabular}
     
    16151688\begin{cquote}
    16161689\begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}}
    1617 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{C}} \\
     1690\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CFA}}      \\
     1691\begin{cfa}
     1692int z[ 5 ];
     1693char * w[ 5 ];
     1694double (* v)[ 5 ];
     1695struct s {
     1696        int f0:3;
     1697        int * f1;
     1698        int * f2[ 5 ]
     1699};
     1700\end{cfa}
     1701&
    16181702\begin{cfa}
    16191703[ 5 ] int z;
     
    16281712&
    16291713\begin{cfa}
    1630 int z[ 5 ];
    1631 char * w[ 5 ];
    1632 double (* v)[ 5 ];
    1633 struct s {
    1634         int f0:3;
    1635         int * f1;
    1636         int * f2[ 5 ]
    1637 };
    1638 \end{cfa}
    1639 &
    1640 \begin{cfa}
    16411714// array of 5 integers
    16421715// array of 5 pointers to char
     
    16541727\begin{cquote}
    16551728\begin{tabular}{@{}l@{\hspace{1em}}l@{\hspace{1em}}l@{}}
    1656 \multicolumn{1}{c@{\hspace{1em}}}{\textbf{\CFA}}        & \multicolumn{1}{c@{\hspace{1em}}}{\textbf{C}} \\
     1729\multicolumn{1}{c@{\hspace{1em}}}{\textbf{C}}   & \multicolumn{1}{c@{\hspace{1em}}}{\textbf{\CFA}}      \\
     1730\begin{cfa}
     1731int const * const x;
     1732const int (* const y)[ 5 ]
     1733\end{cfa}
     1734&
    16571735\begin{cfa}
    16581736const * const int x;
    16591737const * [ 5 ] const int y;
    1660 \end{cfa}
    1661 &
    1662 \begin{cfa}
    1663 int const * const x;
    1664 const int (* const y)[ 5 ]
    16651738\end{cfa}
    16661739&
     
    16751748\begin{cquote}
    16761749\begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{2em}}l@{}}
    1677 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{C}} \\
     1750\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CFA}}      \\
     1751\begin{cfa}
     1752int extern x[ 5 ];
     1753const int static * y;
     1754\end{cfa}
     1755&
    16781756\begin{cfa}
    16791757extern [ 5 ] int x;
    16801758static * const int y;
    1681 \end{cfa}
    1682 &
    1683 \begin{cfa}
    1684 int extern x[ 5 ];
    1685 const int static * y;
    16861759\end{cfa}
    16871760&
     
    16961769\begin{cquote}
    16971770\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
    1698 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c}{\textbf{C}}        \\
     1771\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C}}   & \multicolumn{1}{c}{\textbf{\CFA}}     \\
     1772\begin{cfa}
     1773y = (int *)x;
     1774i = sizeof(int * [ 5 ]);
     1775\end{cfa}
     1776&
    16991777\begin{cfa}
    17001778y = (* int)x;
    17011779i = sizeof([ 5 ] * int);
    1702 \end{cfa}
    1703 &
    1704 \begin{cfa}
    1705 y = (int *)x;
    1706 i = sizeof(int * [ 5 ]);
    17071780\end{cfa}
    17081781\end{tabular}
     
    18991972\begin{cquote}
    19001973\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
    1901 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}        & \multicolumn{1}{c}{\textbf{C}}        \\
     1974\multicolumn{1}{c@{\hspace{3em}}}{\textbf{Cy}}  & \multicolumn{1}{c}{\textbf{\CFA}}     \\
     1975\begin{cfa}
     1976const int * ®const® * ®const® ccp;
     1977
     1978\end{cfa}
     1979&
    19021980\begin{cfa}
    19031981®const® * ®const® * const int ccp;
    19041982®const® & ®const® & const int ccr;
    1905 \end{cfa}
    1906 &
    1907 \begin{cfa}
    1908 const int * ®const® * ®const® ccp;
    1909 
    19101983\end{cfa}
    19111984\end{tabular}
     
    20682141\begin{cfa}
    20692142int x, &r = ®x®, f( int & p ); $\C{// lvalue variable (int) convert to reference (int \&)}$
    2070 f( ®x® ); $\C{// lvalue variable (int) convert to reference (int \&)}$
     2143f( ®x® ); $\C{// lvalue variable (int) convert to reference (int \&)}\CRT$
    20712144\end{cfa}
    20722145Conversion can restrict a type, where ©cv1© $\le$ ©cv2©, \eg passing an ©int© to a ©const volatile int &©, which has low cost.
     
    44304503\end{cfa}
    44314504To match a minus, put it as the first character, ©"-0-9"©.
    4432 Note, other complex forms of regular-expression matching is not supported.
     4505Other complex forms of regular-expression matching are not supported.
    44334506
    44344507The following \Index{manipulator}s control scanning of input values (reading), and only affect the format of the argument.
     
    86288701\begin{cquote}
    86298702\begin{tabular}{@{}l@{\hspace{\parindentlnth}}|@{\hspace{\parindentlnth}}l@{}}
    8630 \multicolumn{1}{@{}c|@{\hspace{\parindentlnth}}}{\textbf{\CFA}} & \multicolumn{1}{@{\hspace{\parindentlnth}}c@{}}{\textbf{C}}   \\
     8703\multicolumn{1}{@{}c|@{\hspace{\parindentlnth}}}{\textbf{C}}    & \multicolumn{1}{@{\hspace{\parindentlnth}}c@{}}{\textbf{\CFA}}        \\
    86318704\hline
    8632 \begin{cfa}
    8633 #include <gmp.hfa>$\indexc{gmp}$
    8634 int main( void ) {
    8635         sout | "Factorial Numbers";
    8636         Int fact = 1;
    8637 
    8638         sout | 0 | fact;
    8639         for ( i; 40 ) {
    8640                 fact *= i;
    8641                 sout | i | fact;
    8642         }
    8643 }
    8644 \end{cfa}
    8645 &
    86468705\begin{cfa}
    86478706#include <gmp.h>$\indexc{gmp.h}$
     
    86548713                ®mpz_mul_ui®( fact, fact, i );
    86558714                ®gmp_printf®( "%d %Zd\n", i, fact );
     8715        }
     8716}
     8717\end{cfa}
     8718&
     8719\begin{cfa}
     8720#include <gmp.hfa>$\indexc{gmp}$
     8721int main( void ) {
     8722        sout | "Factorial Numbers";
     8723        Int fact = 1;
     8724
     8725        sout | 0 | fact;
     8726        for ( i; 40 ) {
     8727                fact *= i;
     8728                sout | i | fact;
    86568729        }
    86578730}
Note: See TracChangeset for help on using the changeset viewer.