Changeset 37218fc for doc/refrat


Ignore:
Timestamp:
Apr 11, 2016, 11:51:07 AM (10 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
37f0da8
Parents:
3aba311 (diff), e55ca05 (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:/u/cforall/software/cfa/cfa-cc

Conflicts:

src/Parser/ParseNode.h

Location:
doc/refrat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/refrat/Makefile

    r3aba311 r37218fc  
    11## Define the appropriate configuration variables.
    22
    3 Macros =
    4 TeXLIB = .:${Macros}:
     3TeXLIB = .:../bibliography/:../LaTeXmacros/:
    54LaTeX  = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex
    6 BibTeX = BSTINPUTS=${TeXLIB} && export BSTINPUTS && bibtex
     5BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex
    76
    87## Define the text source files.
     
    4443        dvips $< -o $@
    4544
    46 ${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex ${basename ${DOCUMENT}}.bib
     45${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex \
     46                ../LaTeXmacros/common.tex ../LaTeXmacros/indexstyle ../bibliography/cfa.bib
    4747        # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run.
    4848        if [ ! -r ${basename $@}.ind ] ; then touch ${basename $@}.ind ; fi
     
    5454        -${BibTeX} ${basename $@}
    5555        # Make index from *.aux entries and input index at end of document
    56         makeindex -s indexstyle ${basename $@}.idx
     56        makeindex -s ../LaTeXmacros/indexstyle ${basename $@}.idx
    5757        ${LaTeX} ${basename $@}.tex
    5858        # Run again to get index title into table of contents
  • doc/refrat/refrat.tex

    r3aba311 r37218fc  
     1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
     2%%
     3%% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
     4%%
     5%% The contents of this file are covered under the licence agreement in the
     6%% file "LICENCE" distributed with Cforall.
     7%%
     8%% refrat.tex --
     9%%
     10%% Author           : Peter A. Buhr
     11%% Created On       : Wed Apr  6 14:52:25 2016
     12%% Last Modified By : Peter A. Buhr
     13%% Last Modified On : Fri Apr  8 18:32:07 2016
     14%% Update Count     : 6
     15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     16
    117% requires tex packages: texlive-base texlive-latex-base tex-common texlive-humanities texlive-latex-extra texlive-fonts-recommended
    218
     
    521
    622% Latex packages used in the document.
    7 
    823\usepackage{fullpage,times}
    924\usepackage{xspace}
     
    2136%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    2237
    23 % Names used in the document.
    24 
    25 \newcommand{\CFA}{C$\forall$\xspace}    % set language symbolic name
    26 \newcommand{\CFL}{Cforall\xspace}               % set language text name
    27 \newcommand{\CC}{C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name
    28 \def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name)
    29 
    30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    31 
    3238% Bespoke macros used in the document.
    33 
    34 \makeatletter
    35 % allow escape sequence in lstinline
    36 %\usepackage{etoolbox}
    37 %\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}}
    38 
    39 \renewcommand\small{%
    40    \@setfontsize\small{8.5}{11}%
    41    \abovedisplayskip 8.5pt \@plus 3pt \@minus 4pt
    42    \abovedisplayshortskip \z@ \@plus 2pt
    43    \belowdisplayshortskip 4pt \@plus 2pt \@minus 2pt
    44    \def\@listi{\leftmargin\leftmargini
    45                \topsep 4pt \@plus 2pt \@minus 2pt
    46                \parsep 2pt \@pluspt \@minuspt
    47                \itemsep \parsep}%
    48    \belowdisplayskip \abovedisplayskip
    49 }
    50 \usepackage{relsize}            % must be after change to small
    51 
    52 \renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}
    53 \renewenvironment{itemize}{\begin{list}{\labelitemi}{\topsep=5pt\itemsep=5pt\parsep=0pt}}{\end{list}}
    54 
    55 %  Reduce size of chapter/section titles
    56 \def\@makechapterhead#1{%
    57   \vspace*{50\p@}%
    58   {\parindent \z@ \raggedright \normalfont
    59     \ifnum \c@secnumdepth >\m@ne
    60         \large\bfseries \@chapapp\space \thechapter
    61         \par\nobreak
    62         \vskip 5\p@
    63     \fi
    64     \interlinepenalty\@M
    65     \Large \bfseries #1\par\nobreak
    66     \vskip 50\p@
    67   }}
    68 \def\@makeschapterhead#1{%
    69   \vspace*{50\p@}%
    70   {\parindent \z@ \raggedright
    71     \normalfont
    72     \interlinepenalty\@M
    73     \Large \bfseries  #1\par\nobreak
    74     \vskip 50\p@
    75   }}
    76 \renewcommand\section{\@startsection{section}{1}{\z@}{-3.0ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\large\bfseries}}
    77 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
    78 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
    79 \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}{-2.0ex \@plus -1ex \@minus -.2ex}{-1em}{\normalfont\normalsize\bfseries}}
    80 
    81 % index macros
    82 \newcommand{\italic}[1]{\emph{\hyperpage{#1}}}
    83 \newcommand{\definition}[1]{\textbf{\hyperpage{#1}}}
    84 \newcommand{\see}[1]{\emph{see} #1}
    85 
    86 % Define some commands that produce formatted index entries suitable for cross-references.
    87 % ``\spec'' produces entries for specifications of entities.  ``\impl'' produces entries for their
    88 % implementations, and ``\use'' for their uses.
    89 
    90 %  \newcommand{\bold}[1]{{\bf #1}}
    91 %  \def\spec{\@bsphack\begingroup
    92 %             \def\protect##1{\string##1\space}\@sanitize
    93 %             \@wrxref{|bold}}
    94 \def\impl{\@bsphack\begingroup
    95           \def\protect##1{\string##1\space}\@sanitize
    96           \@wrxref{|definition}}
    97 \newcommand{\indexcode}[1]{{\lstinline$#1$}}
    98 \def\use{\@bsphack\begingroup
    99          \def\protect##1{\string##1\space}\@sanitize
    100          \@wrxref{|hyperpage}}
    101 \def\@wrxref#1#2{\let\thepage\relax
    102     \xdef\@gtempa{\write\@indexfile{\string
    103     \indexentry{#2@{\lstinline$#2$}#1}{\thepage}}}\endgroup\@gtempa
    104     \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
    105 %\newcommand{\use}[1]{\index{#1@{\lstinline$#1$}}}
    106 %\newcommand{\impl}[1]{\index{\protect#1@{\lstinline$\protect#1$}|definition}}
    107 
    108 % inline text and lowercase index: \Index{inline and lowercase index text}
    109 % inline text and as-in index: \Index[as-is index text]{inline text}
    110 % inline text but index with different as-is text: \Index[index text]{inline text}
    111 \newcommand{\Index}{\@ifstar\@sIndex\@Index}
    112 \newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
    113 \newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
    114 \makeatother
    115 
    116 % blocks and titles
    117 \newenvironment{rationale}{%
    118   \begin{quotation}\noindent$\Box$\enspace
    119 }{%
    120   \hfill\enspace$\Box$\end{quotation}
    121 }%
    122 \newcommand{\define}[1]{\emph{#1\/}\index{#1}}
    123 \newcommand{\rewrite}{\(\Rightarrow\)}
    124 \newcommand{\rewriterules}{\paragraph{Rewrite Rules}~\par\noindent}
    125 \newcommand{\examples}{\paragraph{Examples}~\par\noindent}
    126 \newcommand{\semantics}{\paragraph{Semantics}~\par\noindent}
    127 \newcommand{\constraints}{\paragraph{Constraints}~\par\noindent}
    128 \newcommand{\predefined}{\paragraph{Predefined Identifiers}~\par\noindent}
    129 
    130 % BNF macros
    131 \def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]}
    132 \let\endsyntax=\endtrivlist
    133 \newcommand{\lhs}[1]{\par{\emph{#1:}}\index{#1@{\emph{#1}}|italic}}
    134 \newcommand{\rhs}{\hfil\break\hbox{\hskip1in}}
    135 \newcommand{\oldlhs}[1]{\emph{#1: \ldots}\index{#1@{\emph{#1}}|italic}}
    136 \newcommand{\nonterm}[1]{\emph{#1\/}\index{#1@{\emph{#1}}|italic}}
    137 \newcommand{\opt}{$_{opt}$\ }
    138 
    139 % adjust varioref package with default "section" and "page" titles, and optional title with faraway page numbers
    140 % \VRef{label} => Section 2.7, \VPageref{label} => page 17
    141 % \VRef[Figure]{label} => Figure 3.4, \VPageref{label} => page 17
    142 \renewcommand{\reftextfaceafter}{\unskip}
    143 \renewcommand{\reftextfacebefore}{\unskip}
    144 \renewcommand{\reftextafter}{\unskip}
    145 \renewcommand{\reftextbefore}{\unskip}
    146 \renewcommand{\reftextfaraway}[1]{\unskip, p.~\pageref{#1}}
    147 \renewcommand{\reftextpagerange}[2]{\unskip, pp.~\pageref{#1}--\pageref{#2}}
    148 \newcommand{\VRef}[2][Section]{\ifx#1\@empty\else{#1}\nobreakspace\fi\vref{#2}}
    149 \newcommand{\VPageref}[2][page]{\ifx#1\@empty\else{#1}\nobreakspace\fi\pageref{#2}}
    150 
    151 % CFA based on ANSI C
    152 \lstdefinelanguage{CFA}[ANSI]{C}%
    153 {morekeywords={asm,_Alignas,_Alignof,_At,_Atomic,_Bool,catch,catchResume,choose,_Complex,trait,disable,dtype,enable,
    154         fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,lvalue,_Noreturn,otype,restrict,_Static_assert,
    155         _Thread_local,throw,throwResume,try,},
    156 }%
    157 
    158 \lstset{
    159 language=CFA,
    160 columns=flexible,
    161 basicstyle=\sf\relsize{-1},
    162 tabsize=4,
    163 xleftmargin=\parindent,
    164 escapechar=@,
    165 keepspaces=true,
    166 showstringspaces=false,
    167 showlines=true,
    168 }%
    169 
    170 \makeatletter
    171 % replace/adjust listings characters that look bad in sanserif
    172 \lst@CCPutMacro
    173 \lst@ProcessOther{"2D}{\lst@ttfamily{-{}}{{\ttfamily\upshape -}}} % replace minus
    174 \lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than
    175 \lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than
    176 \lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % replace circumflex
    177 \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore
    178 \lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % replace tilde
    179 %\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde
    180 \@empty\z@\@empty
    181 \makeatother
     39\input{common}
    18240
    18341\setcounter{secnumdepth}{3}     % number subsubsections
     
    22684
    22785This document is a reference manual and rationale for \CFA, a polymorphic extension of the C programming language.
    228 It makes frequent reference to the {\c11} standard \cite{ANS:C11}, and occasionally compares \CFA to {\CC} \cite{c++}.
     86It makes frequent reference to the {\c11} standard \cite{C11}, and occasionally compares \CFA to {\CC} \cite{C++}.
    22987
    23088The manual deliberately imitates the ordering of the {\c11} standard (although the section numbering differs).
     
    720578
    721579There are two notable differences between \CFA's overload resolution rules and the rules for
    722 {\CC} defined in \cite{c++}.
     580{\CC} defined in \cite{C++}.
    723581First, the result type of a function plays a role.
    724582In {\CC}, a function call must be completely resolved based on the arguments to the call in most circumstances.
     
    33843242\begin{itemize}
    33853243\item
    3386 Inside a Clu cluster \cite{clu}, the declaration of an instance states which view applies.
     3244Inside a Clu cluster \cite{CLU}, the declaration of an instance states which view applies.
    33873245Two primitives called \lstinline$up$ and \lstinline$down$ can be used to convert between the views.
    33883246\item
    3389 The Simula class \cite{Simula87} is essentially a record type.
     3247The Simula class \cite{SIMULA87} is essentially a record type.
    33903248Since the only operations on a record are member selection and assignment, which can not be overloaded, there is never any ambiguity as to whether the abstraction or the implementation view is being used.
    33913249In {\CC}
    3392 \cite{c++}, operations on class instances include assignment and ``\lstinline$&$'', which can be overloaded.
     3250\cite{C++}, operations on class instances include assignment and ``\lstinline$&$'', which can be overloaded.
    33933251A ``scope resolution'' operator can be used inside the class to specify whether the abstract or implementation version of the operation should be used.
    33943252\item
    3395 An Ada derived type definition \cite{ada} creates a new type from an old type, and also implicitly declares derived subprograms that correspond to the existing subprograms that use the old type as a parameter type or result type.
     3253An Ada derived type definition \cite{Ada} creates a new type from an old type, and also implicitly declares derived subprograms that correspond to the existing subprograms that use the old type as a parameter type or result type.
    33963254The derived subprograms are clones of the existing subprograms with the old type replaced by the derived type.
    33973255Literals and aggregates of the old type are also cloned.
     
    38433701``\lstinline$Safe_pointer$ acts like a pointer to \lstinline$int$''.
    38443702\begin{lstlisting}
    3845 trait ptr_to( type P | pointer( P ), otype T ) {@\impl{ptr_to}@@\use{pointer}@
     3703trait ptr_to( otype P | pointer( P ), otype T ) {@\impl{ptr_to}@@\use{pointer}@
    38463704        lvalue T *?( P );
    38473705        lvalue T ?[?]( P, long int );
    38483706};
    3849 trait ptr_to_const( type P | pointer( P ), otype T ) {@\impl{ptr_to_const}@
     3707trait ptr_to_const( otype P | pointer( P ), otype T ) {@\impl{ptr_to_const}@
    38503708        const lvalue T *?( P );
    38513709        const lvalue T ?[?]( P, long int );@\use{pointer}@
    38523710};
    3853 trait ptr_to_volatile( type P | pointer( P ), otype T ) }@\impl{ptr_to_volatile}@
     3711trait ptr_to_volatile( otype P | pointer( P ), otype T ) }@\impl{ptr_to_volatile}@
    38543712        volatile lvalue T *?( P );
    38553713        volatile lvalue T ?[?]( P, long int );@\use{pointer}@
    38563714};
    3857 trait ptr_to_const_volatile( type P | pointer( P ), otype T ) }@\impl{ptr_to_const_volatile}@
     3715trait ptr_to_const_volatile( otype P | pointer( P ), otype T ) }@\impl{ptr_to_const_volatile}@
    38583716        const volatile lvalue T *?( P );@\use{pointer}@
    38593717        const volatile lvalue T ?[?]( P, long int );
     
    38653723``\lstinline$ptr_to$'' specifications.
    38663724\begin{lstlisting}
    3867 trait m_l_ptr_to( type P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to}@ otype T | ptr_to( P, T )@\use{ptr_to}@ {
     3725trait m_l_ptr_to( otype P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to}@ otype T | ptr_to( P, T )@\use{ptr_to}@ {
    38683726        P ?=?( P *, T * );
    38693727        T * ?=?( T **, P );
    38703728};
    3871 trait m_l_ptr_to_const( type P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to_const}@ otype T | ptr_to_const( P, T )@\use{ptr_to_const}@) {
     3729trait m_l_ptr_to_const( otype P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to_const}@ otype T | ptr_to_const( P, T )@\use{ptr_to_const}@) {
    38723730        P ?=?( P *, const T * );
    38733731        const T * ?=?( const T **, P );
    38743732};
    3875 trait m_l_ptr_to_volatile( type P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to_volatile}@ otype T | ptr_to_volatile( P, T )) {@\use{ptr_to_volatile}@
     3733trait m_l_ptr_to_volatile( otype P | m_l_pointer( P ),@\use{m_l_pointer}@@\impl{m_l_ptr_to_volatile}@ otype T | ptr_to_volatile( P, T )) {@\use{ptr_to_volatile}@
    38763734        P ?=?( P *, volatile T * );
    38773735        volatile T * ?=?( volatile T **, P );
    38783736};
    3879 trait m_l_ptr_to_const_volatile( type P | ptr_to_const_volatile( P ),@\use{ptr_to_const_volatile}@@\impl{m_l_ptr_to_const_volatile}@
    3880                 type T | m_l_ptr_to_volatile( P, T ) | m_l_ptr_to_const( P )) {@\use{m_l_ptr_to_const}@@\use{m_l_ptr_to_volatile}@
     3737trait m_l_ptr_to_const_volatile( otype P | ptr_to_const_volatile( P ),@\use{ptr_to_const_volatile}@@\impl{m_l_ptr_to_const_volatile}@
     3738                otype T | m_l_ptr_to_volatile( P, T ) | m_l_ptr_to_const( P )) {@\use{m_l_ptr_to_const}@@\use{m_l_ptr_to_volatile}@
    38813739        P ?=?( P *, const volatile T * );
    38823740        const volatile T * ?=?( const volatile T **, P );
     
    40063864
    40073865\bibliographystyle{plain}
    4008 \bibliography{refrat}
     3866\bibliography{cfa}
    40093867
    40103868
Note: See TracChangeset for help on using the changeset viewer.