Changeset 51b5a02
- Timestamp:
- Feb 4, 2018, 12:21:38 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- bf7b6015, cbe477e
- Parents:
- d03fa6d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/Paper.tex
rd03fa6d r51b5a02 130 130 131 131 \lstnewenvironment{cfa}[1][] 132 {\ CFA\lstset{#1}}132 {\lstset{#1}} 133 133 {} 134 134 \lstnewenvironment{C++}[1][] % use C++ style 135 {\lstset{language=C++,moredelim=**[is][\protect\color{red}]{`}{`},#1} }135 {\lstset{language=C++,moredelim=**[is][\protect\color{red}]{`}{`},#1}\lstset{#1}} 136 136 {} 137 137 … … 946 946 \begin{tabular}{@{\hspace{\parindentlnth}}l@{\hspace{\parindentlnth}}l@{\hspace{\parindentlnth}}l@{}} 947 947 \multicolumn{1}{@{\hspace{\parindentlnth}}c@{\hspace{\parindentlnth}}}{\textbf{\CFA}} & \multicolumn{1}{@{\hspace{\parindentlnth}}c}{\textbf{C}} \\ 948 \begin{ lstlisting}948 \begin{cfa} 949 949 `LC:` { 950 950 ... $declarations$ ... … … 968 968 } // switch 969 969 } // compound 970 \end{ lstlisting}970 \end{cfa} 971 971 & 972 \begin{ lstlisting}972 \begin{cfa} 973 973 { 974 974 ... $declarations$ ... … … 992 992 } `LS:` ; 993 993 } `LC:` ; 994 \end{ lstlisting}994 \end{cfa} 995 995 & 996 \begin{ lstlisting}996 \begin{cfa} 997 997 998 998 … … 1016 1016 1017 1017 1018 \end{ lstlisting}1018 \end{cfa} 1019 1019 \end{tabular} 1020 1020 \lstMakeShortInline@% … … 1055 1055 int i, j; 1056 1056 int mem() { $\C{\color{red}// implicit "this" parameter}$ 1057 i = 1; $\C{\color{red}// this- >i}$1058 j = 2; $\C{\color{red}// this- >j}$1057 i = 1; $\C{\color{red}// this-{\textgreater}i}$ 1058 j = 2; $\C{\color{red}// this-{\textgreater}j}$ 1059 1059 } 1060 1060 } 1061 1061 \end{C++} 1062 Since CFA is non-object-oriented, the equivalent object-oriented program looks like:1062 Since \CFA is non-object-oriented, the equivalent object-oriented program looks like: 1063 1063 \begin{cfa} 1064 1064 struct S { int i, j; }; … … 1188 1188 1189 1189 {\lstset{language=CFA,deletedelim=**[is][]{`}{`},moredelim=**[is][\color{red}]{@}{@}} 1190 \begin{ lstlisting}1190 \begin{cfa} 1191 1191 struct Weight { double stones; }; 1192 1192 … … 1208 1208 w = 5@`st@ + 8@`kg@ + 25@`lb@ + hw; 1209 1209 } 1210 \end{ lstlisting}1210 \end{cfa} 1211 1211 }% 1212 1212
Note: See TracChangeset
for help on using the changeset viewer.