- Timestamp:
- Apr 18, 2024, 10:25:19 PM (8 months ago)
- Branches:
- master
- Children:
- cdd25ef
- Parents:
- 4da9142
- Location:
- doc/uC++toCFA
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/uC++toCFA/Makefile
r4da9142 r2b6db03 56 56 dvips ${Build}/$< -o $@ 57 57 58 ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} \59 ${Macros}/ common.sty ${Macros}/lstlang.sty ${Macros}/indexstyle ../bibliography/pl.bib build/version | ${Build}58 ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${Macros}/common.tex ${Macros}/common.sty \ 59 ${Macros}/lstlang.sty ${Macros}/indexstyle ../bibliography/pl.bib build/version | ${Build} 60 60 # Conditionally create an empty *.ind (index) file for inclusion until makeindex is run. 61 61 if [ ! -r ${basename $@}.ind ] ; then touch ${Build}/${basename $@}.ind ; fi -
doc/uC++toCFA/uC++toCFA.tex
r4da9142 r2b6db03 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Thu Jan 11 14:46:14202414 %% Update Count : 59 4213 %% Last Modified On : Sat Apr 13 11:11:39 2024 14 %% Update Count : 5969 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 141 141 \CFA uses parametric polymorphism and allows overloading of variables and routines: 142 142 \begin{cfa} 143 int i; char i; double i; // overload name i143 int i; char i; double i; $\C[2in]{// overload name i}$ 144 144 int i(); double i(); char i(); 145 i += 1; $\C[1.5in]{// int i}$146 i += 1.0; $\C{// double i}$147 i += 'a'; $\C{// char i}$148 int j = i(); $\C{// int i()}$149 double j = i(); $\C{// double i();}$150 char j = i(); $\C{// char i()}\CRT$145 i += 1; $\C{// int i}$ 146 i += 1.0; $\C{// double i}$ 147 i += 'a'; $\C{// char i}$ 148 int j = i(); $\C{// int i()}$ 149 double j = i(); $\C{// double i();}$ 150 char j = i(); $\C{// char i()}\CRT$ 151 151 \end{cfa} 152 152 \CFA has rebindable references. 153 154 \begin{cquote} 155 \begin{tabular}{l|l} 156 \multicolumn{2}{l}{\lstinline{ int x = 1, y = 2, * p1x = &x, * p1y = &y, ** p2i = &p1x,}} \\ 157 \multicolumn{2}{l}{\lstinline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ && r1x = x, & r1y = y, && r2i = r1x;}} \\ 153 \begin{cquote} 154 \begin{tabular}{@{}l|l@{}} 155 \multicolumn{2}{@{}l}{\lstinline{ int x = 1, y = 2, * p1x = &x, * p1y = &y, ** p2i = &p1x,}} \\ 156 \multicolumn{2}{@{}l}{\lstinline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ && r1x = x, & r1y = y, && r2i = r1x;}} \\ 158 157 \begin{uC++} 159 158 **p2i = 3; … … 201 200 202 201 \CFA output streams automatically separate values and insert a newline at the end of the print. 203 204 \begin{cquote} 205 \begin{tabular}{l|l} 202 \begin{cquote} 203 \begin{tabular}{@{}l|l@{}} 206 204 \begin{uC++} 207 205 #include <@iostream@> … … 226 224 227 225 \begin{cquote} 228 \begin{tabular}{ l|l}226 \begin{tabular}{@{}l|l@{}} 229 227 \begin{uC++} 230 228 for ( @;;@ ) { ... } / while ( @true@ ) { ... } … … 280 278 Currently, \CFA uses macros @ExceptionDecl@ and @ExceptionInst@ to declare and instantiate an exception. 281 279 \begin{cquote} 282 \begin{tabular}{ l|ll}280 \begin{tabular}{@{}l|ll@{}} 283 281 \begin{uC++} 284 282 … … 321 319 322 320 \begin{cquote} 323 \begin{tabular}{ l|ll}321 \begin{tabular}{@{}l|ll@{}} 324 322 \begin{uC++} 325 323 … … 360 358 361 359 \begin{cquote} 362 \begin{tabular}{ l|l}360 \begin{tabular}{@{}l|l@{}} 363 361 \begin{uC++} 364 362 struct S { … … 383 381 384 382 \begin{cquote} 385 \begin{tabular}{ l|l}386 \multicolumn{2}{ l}{\lstinline{string s1, s2;}} \\383 \begin{tabular}{@{}l|l@{}} 384 \multicolumn{2}{@{}l@{}}{\lstinline{string s1, s2;}} \\ 387 385 \begin{uC++} 388 386 s1 = "hi"; … … 425 423 426 424 \begin{cquote} 427 \begin{tabular}{ l|l}425 \begin{tabular}{@{}l|l@{}} 428 426 \begin{uC++} 429 427 struct S { … … 456 454 457 455 \begin{cquote} 458 \begin{tabular}{ l|l}456 \begin{tabular}{@{}l|l@{}} 459 457 \begin{uC++} 460 458 … … 493 491 494 492 \begin{cquote} 495 \begin{tabular}{ l|ll}493 \begin{tabular}{@{}l|ll@{}} 496 494 \begin{uC++} 497 495 … … 532 530 533 531 \begin{cquote} 534 \begin{tabular}{ l|ll}532 \begin{tabular}{@{}l|ll@{}} 535 533 \begin{uC++} 536 534 … … 567 565 568 566 \begin{cquote} 569 \begin{tabular}{ l|ll}567 \begin{tabular}{@{}l|ll@{}} 570 568 \begin{uC++} 571 569 … … 604 602 605 603 \begin{cquote} 606 \begin{tabular}{ l|ll}604 \begin{tabular}{@{}l|ll@{}} 607 605 \begin{uC++} 608 606
Note: See TracChangeset
for help on using the changeset viewer.