Ignore:
Timestamp:
Sep 20, 2024, 8:56:34 AM (2 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
fca78f1
Parents:
07dbcba
Message:

updated for uC++ to CFA document

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/uC++toCFA/uC++toCFA.tex

    r07dbcba rb723b63  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Fri Sep 13 07:48:54 2024
    14 %% Update Count     : 5987
     13%% Last Modified On : Wed Sep 18 21:35:47 2024
     14%% Update Count     : 5999
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    256256\hline
    257257\begin{uC++}
    258 L1: for ( ;; ) {
    259         L2: for ( ;; ) {
    260                 ... @break L1@; ... @break L2@; ...
    261         }
    262 }
    263 \end{uC++}
    264 &
    265 \begin{cfa}
    266 L1: for () {
    267         L2: for () {
    268                 ... @break L1@; ... @break L2@; ...
     258@L1:@ for ( ;; ) {
     259        @L2:@ for ( ;; ) {
     260                ... if ( ... ) @break L1@; ...
     261                ... if ( ... ) @break L2@; ...
     262        }
     263}
     264\end{uC++}
     265&
     266\begin{cfa}
     267@L1:@ for () {
     268        @L2:@ for () {
     269                ... if ( ... ) @break L1@; ...
     270                ... if ( ... ) @break L2@; ...
    269271        }
    270272}
     
    289291        if ( ... ) @_Throw@ E( /* initialization */ );
    290292                ...
    291 } @_CatchResume@( E & ) { // should be reference
    292         ...
    293 } catch( E & ) {
    294         ...
     293} @_CatchResume@( E & ) { ... // reference
     294} catch( E & ) { ...
     295} catch( ... ) { ... // catch any
     296} _Finally { ...
    295297}
    296298\end{uC++}
     
    306308        if ( ... ) @throw@ @ExceptionInst@( E, /* intialization */ );
    307309        ...
    308 } @catchResume@( E * ) { // must be pointer
    309         ...
    310 } catch( E * ) {
    311         ...
     310} @catchResume@( E * ) { ... // pointer
     311} catch( E * ) { ...
     312} catch( exception_t * ) { ... // catch any
     313} finally { ...
    312314}
    313315\end{cfa}
     
    362364struct S {
    363365        ... // fields
    364         @S@(...) { ... }
    365         @~S@(...) { ... }
     366        @S@( ... ) { ... }
     367        @~S@( ... ) { ... }
    366368};
    367369\end{uC++}
     
    371373        ... // fields
    372374};
    373 @?{}@( @S & s,@ ...) { ... }
     375@?{}@( @S & s,@ ... ) { ... }
    374376@^?{}@( @S & s@ ) { ... }
    375377\end{cfa}
     
    432434
    433435S s;
    434 @s.@setter( 3 );  // object-oriented calls
     436@s.@setter( 3 );  // object calls
    435437int k = @s.@getter();
    436438\end{uC++}
     
    444446int getter( @S & s@ ) @with(s)@ { return i; }
    445447S s;
    446 setter( @s,@ 3 );  // normal routine calls
     448setter( @s,@ 3 );  // normal calls
    447449int k = getter( @s@ );
    448450\end{cfa}
     
    520522}
    521523void mem( C & c, ... ) {
    522         ... resume(); ...
     524        ... resume( c ); ...
    523525}
    524526\end{cfa}
     
    558560        unlock( m );
    559561}
    560 @mutex( sout )@ sout | i;  // safe I/O
     562@mutex( sout )@ sout | i;  // thread safe I/O
    561563\end{cfa}
    562564\end{tabular}
Note: See TracChangeset for help on using the changeset viewer.