- Timestamp:
- Sep 24, 2015, 9:45:18 AM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 20e409e
- Parents:
- 41b3ddd
- Location:
- doc/refrat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/refrat/predefined.sed
r41b3ddd rbfee448 1 /\\begin{predefined}/,/\\end{predefined}/ !d 2 /\\begin{predefined}/,/\\end{predefined}/ s/\\use{.*}//g 3 /\\begin{predefined}/ d 4 /\\end{predefined}/ d 1 /\\predefined/,/\\end{lstlisting}/ !d 2 /\\begin{lstlisting}/,/\\end{lstlisting}/ s/\\use{.*}//g 3 /\\predefined/ d 4 /\\begin{lstlisting}/ d 5 /\\end{lstlisting}/ d -
doc/refrat/refrat.tex
r41b3ddd rbfee448 30 30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 31 32 % Specialized macros used in the document. 33 32 % Bespoke macros used in the document. 33 34 \makeatletter 35 % index macros 34 36 \newcommand{\italic}[1]{\emph{\hyperpage{#1}}} 35 37 \newcommand{\definition}[1]{\textbf{\hyperpage{#1}}} 36 38 \newcommand{\see}[1]{\emph{see} #1} 37 39 38 \makeatletter39 40 % Define some commands that produce formatted index entries suitable for cross-references. 40 41 % ``\spec'' produces entries for specifications of entities. ``\impl'' produces entries for their … … 56 57 \indexentry{#2@{\lstinline$#2$}#1}{\thepage}}}\endgroup\@gtempa 57 58 \if@nobreak \ifvmode\nobreak\fi\fi\@esphack} 58 \makeatother59 59 %\newcommand{\use}[1]{\index{#1@{\lstinline$#1$}}} 60 60 %\newcommand{\impl}[1]{\index{\protect#1@{\lstinline$\protect#1$}|definition}} 61 61 62 % text inline and lowercase index: \Index{Inline and index text} 63 % text inline and as-in index: \Index{Inline and Index text} 64 % text inline but index with different as-is text: \Index[index text]{inline text} 65 \newcommand{\Index}{\@ifstar\@sIndex\@Index} 66 \newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi} 67 \newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi} 68 \makeatother 69 70 % blocks and titles 62 71 \newcommand{\define}[1]{\emph{#1\/}\index{#1}} 63 72 \newenvironment{rationale}{% … … 67 76 }% 68 77 \newcommand{\rewrite}{\(\Rightarrow\)} 69 \newcommand{\rewriterules}{\paragraph{Rewrite Rules}\hskip1em\par\noindent} 70 \newcommand{\examples}{\paragraph{Examples}\hskip1em\par\noindent} 71 \newcommand{\semantics}{\paragraph{Semantics}\hskip1em\par\noindent} 72 \newcommand{\constraints}{\paragraph{Constraints}\hskip1em\par\noindent} 73 \newenvironment{predefined}{% 74 \paragraph{Predefined Identifiers}% 75 % \begin{code}% 76 }{% 77 % \end{code} 78 }% 79 78 \newcommand{\rewriterules}{\paragraph{Rewrite Rules}~\par\noindent} 79 \newcommand{\examples}{\paragraph{Examples}~\par\noindent} 80 \newcommand{\semantics}{\paragraph{Semantics}~\par\noindent} 81 \newcommand{\constraints}{\paragraph{Constraints}~\par\noindent} 82 \newcommand{\predefined}{\paragraph{Predefined Identifiers}~\par\noindent} 83 84 % BNF macros 80 85 \def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]} 81 86 \let\endsyntax=\endtrivlist … … 86 91 \newcommand{\opt}{$_{opt}$\ } 87 92 93 % adjust varioref package with default "section" and "page" titles, and optional title with faraway page numbers 94 % \VRef{label} => Section 2.7, \VPageref{label} => page 17 95 % \VRef[Figure]{label} => Figure 3.4, \VPageref{label} => page 17 88 96 \renewcommand{\reftextfaceafter}{\unskip} 89 97 \renewcommand{\reftextfacebefore}{\unskip} … … 95 103 \newcommand{\VPageref}[2][page]{\ifx#1\@empty\else{#1}\nobreakspace\fi\pageref{#2}} 96 104 97 % replace/adjust characters that look bad in sanserif 98 \makeatletter 99 \lst@CCPutMacro 100 \lst@ProcessOther{"2D}{\lst@ttfamily{-{}}{{\ttfamily\upshape -}}} % replace minus 101 \lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than 102 \lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than 103 \lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % circumflex 104 \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore 105 %\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde 106 \lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % lower tilde 107 \@empty\z@\@empty 108 109 \newcommand{\Index}{\@ifstar\@sIndex\@Index} 110 \newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi} 111 \newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi} 112 \makeatother 113 105 % adjust listings macros 114 106 \lstdefinelanguage{CFA}[ANSI]{C}% 115 116 117 } 107 {morekeywords={asm,_At,_Atomic,catch,catchResume,choose,_Complex,context,disable,dtype,enable, 108 fallthru,finally,forall,ftype,_Imaginary,lvalue,restrict,throw,throwResume,try,type,}, 109 }% 118 110 119 111 \lstset{ … … 129 121 showtabs=true, 130 122 tab=, 131 } 123 }% 124 125 \makeatletter 126 % replace/adjust listings characters that look bad in sanserif 127 \lst@CCPutMacro 128 \lst@ProcessOther{"2D}{\lst@ttfamily{-{}}{{\ttfamily\upshape -}}} % replace minus 129 \lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than 130 \lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than 131 \lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % replace circumflex 132 \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore 133 \lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % replace tilde 134 %\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde 135 \@empty\z@\@empty 136 \makeatother 132 137 133 138 \setcounter{secnumdepth}{3} % number subsubsections … … 174 179 175 180 The manual deliberately imitates the ordering of the {\c11} standard (although the section numbering 176 differs). Unfortunately, this means th at the manual contains more ``forward references'' than177 usual, and that it will be hard to follow if the reader does not have a copy of the {\c11} standard 178 near-by. For a gentle introduction to \CFA, see the companion document ``An Overview of 179 \ CFA'' \cite{Ditchfield96:Overview}.181 differs). Unfortunately, this means the manual contains more ``forward references'' than usual, 182 making it harder to follow if the reader does not have a copy of the {\c11} standard. For a simple 183 introduction to \CFA, see the companion document ``An Overview of \CFA'' 184 \cite{Ditchfield96:Overview}. 180 185 181 186 \begin{rationale} … … 201 206 202 207 \section{Notation} 203 The syntax notation used in this document is the same as is used in the {\c11} standard, with one 204 exception: ellipsis in the definition of a nonterminal, as in ``\emph{declaration:} \ldots'', 205 indicates that these rules extend a previous definition, which occurs in this document or in the 206 {\c11} standard. 208 The syntax notation used in this document is the same as in the {\c11} standard, with one exception: 209 ellipsis in the definition of a nonterminal, as in ``\emph{declaration:} \ldots'', indicates that 210 these rules extend a previous definition, which occurs in this document or in the {\c11} standard. 207 211 208 212 … … 651 655 652 656 \begin{rationale} 653 The use of ``\lstinline$?$'' in identifiers means that some C programs are not \CFA programs. 654 For instance, the sequence of characters ``\lstinline$(i < 0)?--i:i$'' is legal in a C program, but 655 a \CFA compiler will detect a syntax error because it will treat ``\lstinline$?--$'' as an 656 identifier, notas the two tokens ``\lstinline$?$'' and ``\lstinline$--$''.657 The use of ``\lstinline$?$'' in identifiers means that some C programs are not \CFA programs. For 658 instance, the sequence of characters ``\lstinline$(i < 0)?--i:i$'' is legal in a C program, but a 659 \CFA compiler detects a syntax error because it treats ``\lstinline$?--$'' as an identifier, not 660 as the two tokens ``\lstinline$?$'' and ``\lstinline$--$''. 657 661 \end{rationale} 658 662 … … 796 800 \end{syntax} 797 801 798 \p aragraph{Predefined Identifiers}%802 \predefined 799 803 \begin{lstlisting} 800 804 const int 1;@\use{1}@ … … 892 896 \subsubsection{Array subscripting} 893 897 898 \predefined 894 899 \begin{lstlisting} 895 900 forall( type T ) lvalue T ?[?]( T *, ptrdiff_t );@\use{ptrdiff_t}@ … … 1132 1137 \subsubsection{Postfix increment and decrement operators} 1133 1138 1139 \predefined 1134 1140 \begin{lstlisting} 1135 1141 _Bool ?++( volatile _Bool * ), … … 1464 1470 \subsubsection{Prefix increment and decrement operators} 1465 1471 1472 \predefined 1466 1473 \begin{lstlisting} 1467 1474 _Bool ++?( volatile _Bool * ), … … 1648 1655 \subsubsection{Address and indirection operators} 1649 1656 1657 \predefined 1650 1658 \begin{lstlisting} 1651 1659 forall( type T ) lvalue T *?( T * ); … … 1683 1691 \subsubsection{Unary arithmetic operators} 1684 1692 1693 \predefined 1685 1694 \begin{lstlisting} 1686 1695 int … … 1891 1900 \end{lstlisting} 1892 1901 1902 \predefined 1893 1903 \begin{lstlisting} 1894 1904 int?*?( int, int ), … … 2034 2044 \end{lstlisting} 2035 2045 2046 \predefined 2036 2047 \begin{lstlisting} 2037 2048 int?+?( int, int ), … … 2174 2185 \end{lstlisting} 2175 2186 2187 \predefined 2176 2188 \begin{lstlisting} 2177 2189 int ?<<?( int, int ), … … 2224 2236 \end{lstlisting} 2225 2237 2238 \predefined 2226 2239 \begin{lstlisting} 2227 2240 int ?<?( int, int ), … … 2302 2315 \end{lstlisting} 2303 2316 2317 \predefined 2304 2318 \begin{lstlisting} 2305 2319 int ?==?( int, int ), … … 2419 2433 \end{lstlisting} 2420 2434 2435 \predefined 2421 2436 \begin{lstlisting} 2422 2437 int ?&?( int, int ); … … 2452 2467 \end{lstlisting} 2453 2468 2469 \predefined 2454 2470 \begin{lstlisting} 2455 2471 int ?^?( int, int ); … … 2485 2501 \end{lstlisting} 2486 2502 2503 \predefined 2487 2504 \begin{lstlisting} 2488 2505 int ?|?( int, int ); … … 2716 2733 \subsubsection{Simple assignment} 2717 2734 2735 \predefined 2718 2736 \begin{lstlisting} 2719 2737 _Bool … … 3003 3021 \subsubsection{Compound assignment} 3004 3022 3023 \predefined 3005 3024 \begin{lstlisting} 3006 3025 forall( type T ) T
Note: See TracChangeset
for help on using the changeset viewer.