Changeset e229c22 for doc/user


Ignore:
Timestamp:
Jun 4, 2016, 12:34:24 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, with_gc
Children:
57aa6f5, b8387fc
Parents:
31eed869
Message:

change gitignore with respect to latex-generated files, small updates to manuals, replace bibtex link with actual file

Location:
doc/user
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    r31eed869 re229c22  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Tue May  3 08:05:33 2016
    14 %% Update Count     : 246
     13%% Last Modified On : Fri Jun  3 09:49:31 2016
     14%% Update Count     : 281
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    3030\usepackage{textcomp}
    3131\usepackage[latin1]{inputenc}
    32 \usepackage{upquote}
    33 \usepackage{fullpage,times}
     32\usepackage{fullpage,times,comment}
    3433\usepackage{epic,eepic}
     34\usepackage{upquote}                                                                    % switch curled `' to straight `'
    3535\usepackage{xspace}
    36 \usepackage{varioref}
    37 \usepackage{listings}
    38 \usepackage{footmisc}
    39 \usepackage{comment}
    40 \usepackage{latexsym}                                   % \Box
     36\usepackage{varioref}                                                                   % extended references
     37\usepackage{listings}                                                                   % format program code
     38\usepackage{footmisc}                                                                   % support label/reference in footnote
     39\usepackage{latexsym}                                   % \Box glyph
    4140\usepackage{mathptmx}                                   % better math font with "times"
    4241\usepackage[pagewise]{lineno}
     
    113112The syntax of the \CFA language builds from C, and should look immediately familiar to C programmers.
    114113% Any language feature that is not described here can be assumed to be using the standard C11 syntax.
    115 \CFA adds many modern programming-language features, which directly leads to increased safety and productivity, while maintaining interoperability with existing C programs and achieving C performance.
     114\CFA adds many modern programming-language features that directly leads to increased \emph{safety} and \emph{productivity}, while maintaining interoperability with existing C programs and achieving C performance.
    116115Like C, \CFA is a statically typed, procedural language with a low-overhead runtime, meaning there is no global garbage-collection.
    117116The primary new features include parametric-polymorphism routines and types, exceptions, concurrency, and modules.
     
    244243The 1999 C standard plus GNU extensions.
    245244\item\hspace*{-4pt}\Indexc{-fgnu89-¶inline¶}\index{compilation option!-fgnu89-inline@{©-fgnu89-¶inline¶©}}
    246 Use the traditional GNU semantics for inline routines in C99 mode.
     245Use the traditional GNU semantics for inline routines in C99 mode, which allows inline routines in header files.
    247246\end{description}
    248247The following new \CFA option is available:
     
    11741173Unfortunately, this restriction forces programmers to use ©goto© to achieve the equivalent for more than one level of nesting.
    11751174To prevent having to make this switch, the ©break© and ©continue© are extended with a target label to support static multi-level exit~\cite{Buhr85,Java}.
    1176 For the labelled ©break©, it is possible to specify which control structure is the target for exit, as in:
    1177 \begin{quote2}
     1175\VRef[Figure]{f:LabelledBreak} shows the labelled ©break©, and the target control structure of the exit.
     1176The inner most loop has three exit points, which cause termination of one or more of the three nested loops, respectively.
     1177\VRef[Figure]{f:LabelledContinue} shows the labelled ©continue©, and which control structure is the target of the next loop iteration.
     1178The inner most loop has three restart points, which cause the next loop iteration to begin, respectively.
     1179
     1180\begin{figure}
     1181\centering
    11781182\begin{tabular}{@{}l@{\hspace{30pt}}l@{}}
    11791183\multicolumn{1}{c@{\hspace{30pt}}}{\textbf{\CFA}}       & \multicolumn{1}{c}{\textbf{C}}        \\
     
    11961200                        ... goto L1; ...
    11971201                        ... goto L2; ...
    1198                         ... goto L3; // or break
     1202                        ... goto L3; // or break 
    11991203                } L3: ;
    12001204        } L2: ;
     
    12021206\end{lstlisting}
    12031207\end{tabular}
    1204 \end{quote2}
    1205 The inner most loop has three exit points, which cause termination of one or more of the three nested loops, respectively.
    1206 For the labelled ©continue©, it is possible to specify which control structure is the target for the next loop iteration, as in:
    1207 \begin{quote2}
     1208\caption{Labelled Break}
     1209\label{f:LabelledBreak}
     1210
     1211\vspace*{0.25in}
     1212
    12081213\begin{tabular}{@{}l@{\hspace{30pt}}l@{}}
    12091214\multicolumn{1}{c@{\hspace{30pt}}}{\textbf{\CFA}}       & \multicolumn{1}{c}{\textbf{C}}        \\
     
    12141219                        ... continue ®L1®; ...
    12151220                        ... continue ®L2®; ...
    1216                         ... continue ®L3®; ...
     1221                        ... continue ®L3®; // or continue
    12171222
    12181223                }
     
    12291234                        ... goto L1; ...
    12301235                        ... goto L2; ...
    1231                         ... goto L3; ...
     1236                        ... goto L3; // or continue
    12321237                  L3: ;
    12331238                }
     
    12381243\end{lstlisting}
    12391244\end{tabular}
    1240 \end{quote2}
    1241 The inner most loop has three restart points, which cause the next loop iteration to begin, respectively.
     1245\caption{Labelled Continue}
     1246\label{f:LabelledContinue}
     1247\end{figure}
     1248
    12421249For both ©break© and ©continue©, the target label must be directly associated with a ©for©, ©while© or ©do© statement;
    12431250for ©break©, the target label can also be associated with a ©switch© statement.
     
    33293336\begin{lstlisting}
    33303337struct Line {
    3331         float length;
     3338        float lnth;
    33323339}
    33333340// default constructor
    33343341void ?{}( Line * l ) {
     3342        l->lnth = 0.0;
    33353343        sout | "default" | endl;
    3336         l.length = 0.0;
    33373344}
    33383345
    33393346
    33403347// constructor with length
    3341 void ?{}( Line * l, float length ) {
    3342         sout | "length" | length | endl;
    3343 
    3344         l.length = length;
     3348void ?{}( Line * l, float lnth ) {
     3349        l->lnth = lnth;
     3350        sout | "lnth" | l->lnth | endl;
     3351
    33453352}
    33463353
    33473354// destructor
    3348 void ^?(Line &l) {
     3355void ^?() {
    33493356        sout | "destroyed" | endl;
    3350         l.length = 0.0;
     3357        l.lnth = 0.0;
    33513358}
    33523359
    33533360// usage
    33543361Line line1;
    3355 Line line2{ 3.4 };
     3362Line line2 = { 3.4 };
    33563363\end{lstlisting}
    33573364&
    33583365\begin{lstlisting}[language=C++]
    33593366class Line {
    3360         float length;
     3367        float lnth;
    33613368
    33623369        // default constructor
    33633370        Line() {
    33643371                cout << "default" << endl;
    3365                 length = 0.0;
     3372                lnth = 0.0;
    33663373        }
    33673374
    33683375
    3369         // constructor with length
     3376        // constructor with lnth
    33703377        Line( float l ) {
    33713378                cout << "length " << length
Note: See TracChangeset for help on using the changeset viewer.