Changeset ebec8ed
- Timestamp:
- Oct 1, 2020, 3:54:12 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 615767b
- Parents:
- 506d4f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/fangren_yu_COOP_S20/Report.tex
r506d4f0 rebec8ed 1 \documentclass[twoside,1 2pt]{article}1 \documentclass[twoside,11pt]{article} 2 2 3 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 11 11 \usepackage[labelformat=simple,aboveskip=0pt,farskip=0pt]{subfig} 12 12 \renewcommand{\thesubfigure}{\alph{subfigure})} 13 \usepackage[flushmargin]{footmisc} % support label/reference in footnote 13 14 \usepackage{latexsym} % \Box glyph 14 15 \usepackage{mathptmx} % better math font with "times" 15 \usepackage {appendix}16 \usepackage[toc]{appendix} % article does not have appendix 16 17 \usepackage[usenames]{color} 17 18 \input{common} % common CFA document macros … … 381 382 \subsubsection{Source: \lstinline{AST/SymbolTable.hpp}} 382 383 383 384 \subsubsection{Source: \lstinline{SymTab/Indexer.h}}385 386 384 Function 387 385 \begin{C++} … … 612 610 613 611 614 \ begin{appendices}[toc,titletoc]612 \appendix 615 613 \section{Appendix} 616 617 614 618 615 \subsection{Kinds of Type Parameters} 619 616 \label{s:KindsTypeParameters} 620 617 621 A type parameter in a @forall@ clause has three possiblekinds:618 A type parameter in a @forall@ clause has 3 kinds: 622 619 \begin{enumerate}[listparindent=0pt] 623 620 \item 624 @dtype@: any data type (built-in or user defined). 625 626 There is also a difference between opaque types (incomplete types, \ie those with only a forward declaration) and concrete types. 627 Only 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 636 Differentiate function pointer from data pointer because (in theory) some systems have different sizes for these pointers. 637 \item 638 Disallow a function pointer to match an overloaded data pointer, since variables and functions can have the same names. 639 \end{itemize} 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} 640 638 641 639 \item 642 640 @ttype@: tuple (variadic) type. 643 641 644 @ttype@ parameter may only appear as type of the last parameter in a function, andit provides a type-safe way to implement variadic functions.642 Restricted to the type for the last parameter in a function, it provides a type-safe way to implement variadic functions. 645 643 Note however, that it has certain restrictions, as described in the implementation section below. 646 644 \end{enumerate} … … 673 671 \begin{enumerate} 674 672 \item 675 All types are function declarations are candidates of implicit parameters.673 All types, variables, and functions are candidates of implicit parameters 676 674 \item 677 675 The parameter (assertion) name must match the actual declarations. 678 \item679 Currently, assertions are all functions.680 Note that since \CFA has variable overloading, implicit value parameters might also be supported in the future.681 676 \end{enumerate} 682 677 … … 732 727 In 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. 733 728 The \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}735 729 736 730 \bibliographystyle{plain}
Note: See TracChangeset
for help on using the changeset viewer.