Changeset df24d37
- Timestamp:
- Apr 26, 2021, 4:37:36 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:
- edc6ea2
- Parents:
- 5456537
- Location:
- doc/theses/andrew_beach_MMath
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/cfalab.sty
r5456537 rdf24d37 10 10 11 11 % Other packages required. 12 % 13 % Access to new basic LaTeX tools and other low level commands. 12 14 \RequirePackage{etoolbox} 15 % Code formatting tools and environments. 13 16 \RequirePackage{listings} 17 % Automatically adds spaces. 14 18 \RequirePackage{xspace} 19 % Improved reference tools. 20 \RequirePackage[nospace]{varioref} 15 21 16 22 % Symbols: All symbols are zero argument robust commands with special rules … … 28 34 \newsymbolcmd\CFA{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}} 29 35 % C++ with kerning. (No standard number support.) 30 \newsymbolcmd\C PP{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}}36 \newsymbolcmd\Cpp{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}} 31 37 32 % This is executed very early in the \begin{document} code. 38 % This is executed very early in the \begin{document} code, before the 39 % document's contents but after packages are loaded. 33 40 \AtEndPreamble{ 34 41 \@ifpackageloaded{hyperref}{ … … 36 43 \pdfstringdefDisableCommands{ 37 44 \def\CFA{CFA} 38 \def\CPP{C++} 45 \def\Cpp{C++} 46 \def\lstinline{} 39 47 } 40 48 }{} 41 49 } 50 51 % \colour{<colour>}{<text>} 52 % Just \colour but using the LaTeX style instead of TeX style command. 53 \newcommand*\colour[2]{{\color{#1}#2}} 54 55 % \code*{<code>} 56 % Use the listings package to format a snipit of <code>. 57 \newrobustcmd*\codeCFA[1]{\lstinline[language=CFA]{#1}} 58 \newrobustcmd*\codeC[1]{\lstinline[language=C]{#1}} 59 \newrobustcmd*\codeCpp[1]{\lstinline[language=C++]{#1}} 60 \newrobustcmd*\codePy[1]{\lstinline[language=Python]{#1}} 61 62 \lstnewenvironment{cfa}[1][]{\lstset{language=CFA}\lstset{#1}}{} 63 64 % \settextunderscore{(new|old)} 65 % Redefines the underscore either as a new repersentation or the old one. 66 % Not that some other packages (ex. hyperref) can override this. Set it up 67 % after loading them. 68 \let\cfalab@textunderscore@old=\textunderscore 69 \newcommand\cfalab@textunderscore@new{% 70 \leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}} 71 \newcommand\settextunderscore[1]{% 72 \renewcommand\textunderscore{\csuse{cfalab@textunderscore@#1}}} 42 73 43 74 % The CFA listings language. Based off of ANCI C and including GCC extensions. … … 68 99 } 69 100 70 % \code*[<escape character>]{<code>} 71 % Use the listings package to format a snipit of <code>. 72 % The <escape character> must be a character that does not appear in 73 % <code> and defaults to a backtick. 74 \newcommand*\codeC[2][\`]{\lstinline[language=C]#1#2#1} 75 \newcommand*\codeCFA[2][\`]{\lstinline[language=CFA]#1#2#1} 101 % common.tex Compatablity =================================================== 102 % Below this line is for compatability with the old common.tex file. 76 103 77 % \settextunderscore{(new|old)} 78 % Redefines the underscore either as a new repersentation or the old one. 79 % Not that some other packages (ex. hyperref) can override this. Set it 80 % up after loading them. 81 \let\cfalab@textunderscore@old=\textunderscore 82 \newcommand\cfalab@textunderscore@new{% 83 \leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}} 84 \newcommand\settextunderscore[1]{% 85 \renewcommand\textunderscore{\csuse{cfalab@textunderscore@#1}}} 104 \newcommand{\CFAStyle}{% 105 \lstset{ 106 columns=fullflexible, 107 % reduce line spacing and use sanserif font 108 basicstyle=\linespread{0.9}\sf, 109 % use typewriter font 110 stringstyle=\tt, 111 tabsize=5, 112 % indent code to paragraph indentation 113 %xleftmargin=\parindentlnth, 114 % Allow ASCII characters in the range 128-255. 115 extendedchars=true, 116 % This allows you to use "math mode" to insert LaTeX into the code. 117 % Use \( and \) if you need to insert math mode inside that code. 118 escapechar=\$, 119 % LaTeX math escape in CFA code $...$ 120 mathescape=false, 121 keepspaces=true, 122 % do not show spaces with cup 123 showstringspaces=false, 124 % show blank lines at end of code 125 showlines=true, 126 aboveskip=4pt, % spacing above/below code block 127 belowskip=0pt, 128 % numbering style 129 numberstyle=\footnotesize\sf, 130 % replace/adjust listing characters that look bad in sanserif 131 literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1 132 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1 133 {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1 134 {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 135 {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2, 136 } 137 } 138 139 \newcommand{\abbrevFont}{\textit} % set empty for no italics 140 \@ifundefined{eg}{ 141 \newcommand{\EG}{\abbrevFont{e}.\abbrevFont{g}.} 142 \newcommand*{\eg}{% 143 \@ifnextchar{,}{\EG}% 144 {\@ifnextchar{:}{\EG}% 145 {\EG,\xspace}}% 146 }}{}% 147 \@ifundefined{ie}{ 148 \newcommand{\IE}{\abbrevFont{i}.\abbrevFont{e}.} 149 \newcommand*{\ie}{% 150 \@ifnextchar{,}{\IE}% 151 {\@ifnextchar{:}{\IE}% 152 {\IE,\xspace}}% 153 }}{}% 154 \@ifundefined{etc}{ 155 \newcommand{\ETC}{\abbrevFont{etc}} 156 \newcommand*{\etc}{% 157 \@ifnextchar{.}{\ETC}% 158 {\ETC.\xspace}% 159 }}{}% 160 \@ifundefined{etal}{ 161 \newcommand{\ETAL}{\abbrevFont{et}~\abbrevFont{al}} 162 \newcommand*{\etal}{% 163 \@ifnextchar{.}{\protect\ETAL}% 164 {\protect\ETAL.\xspace}% 165 }}{}% 166 \@ifundefined{viz}{ 167 \newcommand{\VIZ}{\abbrevFont{viz}} 168 \newcommand*{\viz}{% 169 \@ifnextchar{.}{\VIZ}% 170 {\VIZ.\xspace}% 171 }}{}% 86 172 87 173 \endinput -
doc/theses/andrew_beach_MMath/existing.tex
r5456537 rdf24d37 16 16 to be defined~\cite{Moss18}. 17 17 \begin{cfa} 18 char i; int i; double i; $\C[3.75in]{// variable overload}$19 int f(); double f(); $\C{// return overload}$20 void g( int ); void g( double ); $\C{// parameter overload}\CRT$18 char i; int i; double i; 19 int f(); double f(); 20 void g( int ); void g( double ); 21 21 \end{cfa} 22 22 This feature requires name mangling so the assembly symbols are unique for -
doc/theses/andrew_beach_MMath/features.tex
r5456537 rdf24d37 20 20 \subparagraph{Raise} 21 21 The raise is the starting point for exception handling. It marks the beginning 22 of exception handling by \newterm{raising}an excepion, which passes it to22 of exception handling by raising an excepion, which passes it to 23 23 the EHM. 24 24 … … 235 235 Both traits ensure a pair of types are an exception type and its virtual table 236 236 and defines one of the two default handlers. The default handlers are used 237 as fallbacks and are discussed in detail in \ VRef{s:ExceptionHandling}.237 as fallbacks and are discussed in detail in \vref{s:ExceptionHandling}. 238 238 239 239 However, all three of these traits can be tricky to use directly. … … 351 351 for particular exception type. 352 352 The global default termination handler performs a cancellation 353 \see{\VRef{s:Cancellation}}on the current stack with the copied exception.353 (see \vref{s:Cancellation}) on the current stack with the copied exception. 354 354 355 355 \subsection{Resumption} … … 426 426 427 427 \subsubsection{Resumption Marking} 428 \label{s:ResumptionMarking} 428 429 A key difference between resumption and termination is that resumption does 429 430 not unwind the stack. A side effect that is that when a handler is matched -
doc/theses/andrew_beach_MMath/future.tex
r5456537 rdf24d37 110 110 \section{Zero-Cost Try} 111 111 \CFA does not have zero-cost try-statements because the compiler generates C 112 code rather than assembler code \see{\VPageref{p:zero-cost}}. When the compiler112 code rather than assembler code (see \vpageref{p:zero-cost}). When the compiler 113 113 does create its own assembly (or LLVM byte-code), then zero-cost try-statements 114 114 are possible. The downside of zero-cost try-statements is the LSDA complexity, -
doc/theses/andrew_beach_MMath/implement.tex
r5456537 rdf24d37 9 9 % Virtual table rules. Virtual tables, the pointer to them and the cast. 10 10 While the \CFA virtual system currently has only one public feature, virtual 11 cast \see{\VPageref{p:VirtualCast}}, substantial structure is required to12 su pport it, and provide features for exception handling and the standard13 library.11 cast (see the virtual cast feature \vpageref{p:VirtualCast}), 12 substantial structure is required to support it, 13 and provide features for exception handling and the standard library. 14 14 15 15 \subsection{Virtual Type} … … 215 215 \subsection{libunwind Usage} 216 216 Libunwind, accessed through @unwind.h@ on most platforms, is a C library that 217 provides \C C-style stack-unwinding. Its operation is divided into two phases:217 provides \Cpp-style stack-unwinding. Its operation is divided into two phases: 218 218 search and cleanup. The dynamic target search -- phase 1 -- is used to scan the 219 219 stack and decide where unwinding should stop (but no unwinding occurs). The … … 291 291 @_UA_FORCE_UNWIND@ specifies a forced unwind call. Forced unwind only performs 292 292 the cleanup phase and uses a different means to decide when to stop 293 \see{\VRef{s:ForcedUnwind}}.293 (see \vref{s:ForcedUnwind}). 294 294 \end{enumerate} 295 295 … … 400 400 401 401 Termination exceptions use libunwind heavily because it matches the intended 402 use from \C Cexceptions closely. The main complication for \CFA is that the402 use from \Cpp exceptions closely. The main complication for \CFA is that the 403 403 compiler generates C code, making it very difficult to generate the assembly to 404 404 form the LSDA for try blocks or destructors. … … 509 509 510 510 % Recursive Resumption Stuff: 511 Search skipping \see{\VPageref{p:searchskip}}, which ignores parts of the stack 511 Search skipping (see \vpageref{s:ResumptionMarking}), which ignores parts of 512 the stack 512 513 already examined, is accomplished by updating the front of the list as the 513 514 search continues. Before the handler at a node is called the head of the list … … 554 555 Cancellation also uses libunwind to do its stack traversal and unwinding, 555 556 however it uses a different primary function @_Unwind_ForcedUnwind@. Details 556 of its interface can be found in the \ VRef{s:ForcedUnwind}.557 of its interface can be found in the \vref{s:ForcedUnwind}. 557 558 558 559 The first step of cancellation is to find the cancelled stack and its type: -
doc/theses/andrew_beach_MMath/uw-ethesis.tex
r5456537 rdf24d37 66 66 % Tip: Photographs should be cropped and compressed so as not to be too large. 67 67 68 % To create a PDF output that is optimized for double-sided printing:69 % 1) comment-out the \documentclass statement in the preamble below, and70 % un-comment the second \documentclass line.71 % 2) change the value assigned below to the boolean variable "PrintVersion"72 % from "false" to "true".73 74 68 % ====================================================================== 75 69 % D O C U M E N T P R E A M B L E … … 87 81 } 88 82 89 % Some LaTeX commands I define for my own nomenclature. 90 % If you have to, it's easier to make changes to nomenclature once here than 91 % in a million places throughout your thesis! 92 \newcommand{\package}[1]{\textbf{#1}} % package names in bold text 93 \newcommand{\cmmd}[1]{\textbackslash\texttt{#1}} % command name in tt font 94 \newcommand{\href}[1]{#1} % does nothing, but defines the command so the 83 % 84 \newcommand{\href}[1]{#1} 85 % Does nothing, but defines the command so the 95 86 % print-optimized version will ignore \href tags (redefined by hyperref pkg). 96 87 % Anything defined here may be redefined by packages added below... … … 107 98 % Adds todos (Must be included after comment.) 108 99 \usepackage{todonotes} 100 % cfa macros used in the document 101 \usepackage{cfalab} 109 102 110 103 % Hyperlinks make it very easy to navigate an electronic document. … … 208 201 \makeglossaries 209 202 210 % cfa macros used in the document 211 %\usepackage{cfalab} 212 % I'm going to bring back eventually. 213 \makeatletter 214 % Combines all \CC* commands: 215 \newrobustcmd*\Cpp[1][\xspace]{\cfalab@Cpp#1} 216 \newcommand\cfalab@Cpp{C\kern-.1em\hbox{+\kern-.25em+}} 217 % Optional arguments do not work with pdf string. (Some fix-up required.) 218 \pdfstringdefDisableCommands{\def\Cpp{C++}} 219 220 % Wrappers for inline code snippits. 221 \newrobustcmd*\codeCFA[1]{\lstinline[language=CFA]{#1}} 222 \newrobustcmd*\codeC[1]{\lstinline[language=C]{#1}} 223 \newrobustcmd*\codeCpp[1]{\lstinline[language=C++]{#1}} 224 \newrobustcmd*\codePy[1]{\lstinline[language=Python]{#1}} 225 226 % Colour text, formatted in LaTeX style instead of TeX style. 227 \newcommand*\colour[2]{{\color{#1}#2}} 228 \makeatother 229 230 \input{common} 203 \lstMakeShortInline@ 204 231 205 % CFA code-style for all languages 232 206 \CFAStyle
Note: See TracChangeset
for help on using the changeset viewer.