# Changeset ebec8ed

Ignore:
Timestamp:
Oct 1, 2020, 3:54:12 PM (13 months ago)
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
615767b
Parents:
506d4f0
Message:

finish last changes to report

File:
1 edited

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

 r506d4f0 \documentclass[twoside,12pt]{article} \documentclass[twoside,11pt]{article} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[labelformat=simple,aboveskip=0pt,farskip=0pt]{subfig} \renewcommand{\thesubfigure}{\alph{subfigure})} \usepackage[flushmargin]{footmisc}                                              % support label/reference in footnote \usepackage{latexsym}                                   % \Box glyph \usepackage{mathptmx}                                   % better math font with "times" \usepackage{appendix} \usepackage[toc]{appendix}                                                              % article does not have appendix \usepackage[usenames]{color} \input{common}                                          % common CFA document macros \subsubsection{Source: \lstinline{AST/SymbolTable.hpp}} \subsubsection{Source: \lstinline{SymTab/Indexer.h}} Function \begin{C++} \begin{appendices}[toc,titletoc] \appendix \section{Appendix} \subsection{Kinds of Type Parameters} \label{s:KindsTypeParameters} A type parameter in a @forall@ clause has three possible kinds: A type parameter in a @forall@ clause has 3 kinds: \begin{enumerate}[listparindent=0pt] \item @dtype@: any data type (built-in or user defined). There is also a difference between opaque types (incomplete types, \ie those with only a forward declaration) and concrete types. Only concrete types can be directly used as a variable type. \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.}. \item @ftype@: any function type. @ftype@ provides two purposes: \begin{itemize} \item Differentiate function pointer from data pointer because (in theory) some systems have different sizes for these pointers. \item Disallow a function pointer to match an overloaded data pointer, since variables and functions can have the same names. \end{itemize} @dtype@: any data type (built-in or user defined) that is not a concrete type. 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. \item @otype@: any data type (built-in or user defined) that is concrete type. 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.}. % \item % @ftype@: any function type. % % @ftype@ provides two purposes: % \begin{itemize} % \item % Differentiate function pointer from data pointer because (in theory) some systems have different sizes for these pointers. % \item % Disallow a function pointer to match an overloaded data pointer, since variables and functions can have the same names. % \end{itemize} \item @ttype@: tuple (variadic) type. @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. Restricted to the type for the last parameter in a function, it provides a type-safe way to implement variadic functions. Note however, that it has certain restrictions, as described in the implementation section below. \end{enumerate} \begin{enumerate} \item All types are function declarations are candidates of implicit parameters. All types, variables, and functions are candidates of implicit parameters \item The parameter (assertion) name must match the actual declarations. \item Currently, assertions are all functions. Note that since \CFA has variable overloading, implicit value parameters might also be supported in the future. \end{enumerate} 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. 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). \end{appendices} \bibliographystyle{plain}
Note: See TracChangeset for help on using the changeset viewer.