Changes in / [615767b:dd53f75]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/fangren_yu_COOP_S20/Report.tex

    r615767b rdd53f75  
    1 \documentclass[twoside,11pt]{article}
     1\documentclass[twoside,12pt]{article}
    22
    33%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    1111\usepackage[labelformat=simple,aboveskip=0pt,farskip=0pt]{subfig}
    1212\renewcommand{\thesubfigure}{\alph{subfigure})}
    13 \usepackage[flushmargin]{footmisc}                                              % support label/reference in footnote
    1413\usepackage{latexsym}                                   % \Box glyph
    1514\usepackage{mathptmx}                                   % better math font with "times"
    16 \usepackage[toc]{appendix}                                                              % article does not have appendix
     15\usepackage{appendix}
    1716\usepackage[usenames]{color}
    1817\input{common}                                          % common CFA document macros
     
    382381\subsubsection{Source: \lstinline{AST/SymbolTable.hpp}}
    383382
     383
     384\subsubsection{Source: \lstinline{SymTab/Indexer.h}}
     385
    384386Function
    385387\begin{C++}
     
    610612
    611613
    612 \appendix
     614\begin{appendices}[toc,titletoc]
    613615\section{Appendix}
     616
    614617
    615618\subsection{Kinds of Type Parameters}
    616619\label{s:KindsTypeParameters}
    617620
    618 A type parameter in a @forall@ clause has 3 kinds:
     621A type parameter in a @forall@ clause has three possible kinds:
    619622\begin{enumerate}[listparindent=0pt]
    620623\item
    621 @dtype@: any data type (built-in or user defined) that is not a concrete type.
    622 
    623 A non-concrete type is an incomplete type such as an opaque type or pointer/reference with an implicit (pointer) size and implicitly generated reference and dereference operations.
    624 \item
    625 @otype@: any data type (built-in or user defined) that is concrete type.
    626 
    627 A concrete type is a complete type, \ie types that can be used to create a variable, which also implicitly asserts the existence of default and copy constructors, assignment, and destructor\footnote{\CFA implements the same automatic resource management (RAII) semantics as \CC.}.
    628 % \item
    629 % @ftype@: any function type.
    630 %
    631 % @ftype@ provides two purposes:
    632 % \begin{itemize}
    633 % \item
    634 % Differentiate function pointer from data pointer because (in theory) some systems have different sizes for these pointers.
    635 % \item
    636 % Disallow a function pointer to match an overloaded data pointer, since variables and functions can have the same names.
    637 % \end{itemize}
     624@dtype@: any data type (built-in or user defined).
     625
     626There is also a difference between opaque types (incomplete types, \ie those with only a forward declaration) and concrete types.
     627Only concrete types can be directly used as a variable type.
     628
     629\CFA provides the @otype@ shorthand to require a type parameter be concrete, which also implicitly asserts the existence of its default and copy constructors, assignment, and destructor\footnote{\CFA implements the same automatic resource management (RAII) semantics as \CC.}.
     630\item
     631@ftype@: any function type.
     632
     633@ftype@ provides two purposes:
     634\begin{itemize}
     635\item
     636Differentiate function pointer from data pointer because (in theory) some systems have different sizes for these pointers.
     637\item
     638Disallow a function pointer to match an overloaded data pointer, since variables and functions can have the same names.
     639\end{itemize}
    638640
    639641\item
    640642@ttype@: tuple (variadic) type.
    641643
    642 Restricted to the type for the last parameter in a function, it provides a type-safe way to implement variadic functions.
     644@ttype@ parameter may only appear as type of the last parameter in a function, and it provides a type-safe way to implement variadic functions.
    643645Note however, that it has certain restrictions, as described in the implementation section below.
    644646\end{enumerate}
     
    671673\begin{enumerate}
    672674\item
    673 All types, variables, and functions are candidates of implicit parameters
     675All types are function declarations are candidates of implicit parameters.
    674676\item
    675677The parameter (assertion) name must match the actual declarations.
     678\item
     679Currently, assertions are all functions.
     680Note that since \CFA has variable overloading, implicit value parameters might also be supported in the future.
    676681\end{enumerate}
    677682
     
    727732In particular, polymorphic variadic recursion must be structural (\ie the number of arguments decreases in any possible recursive calls), otherwise code generation gets into an infinite loop.
    728733The \CFA compiler sets a limit on assertion depth and reports an error if assertion resolution does not terminate within the limit (as for \lstinline[language=C++]@templates@ in \CC).
     734\end{appendices}
    729735
    730736\bibliographystyle{plain}
Note: See TracChangeset for help on using the changeset viewer.