Changeset 599dc6a
- Timestamp:
- Jun 30, 2023, 1:48:33 PM (2 years ago)
- Branches:
- master
- Children:
- 4bae7b4
- Parents:
- c9019ce (diff), 48ee593 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/bibliography/pl.bib
rc9019ce r599dc6a 230 230 publisher = {MIT Press, Cambridge}, 231 231 year = 1986 232 }233 234 @inproceedings{Srinivasan08,235 author = {Srinivasan, Sriram and Mycroft, Alan},236 editor = {Vitek, Jan},237 title = {Kilim: Isolation-Typed Actors for Java},238 organization= {ECOOP 2008 -- Object-Oriented Programming},239 year = {2008},240 publisher = {Springer Berlin Heidelberg},241 address = {Berlin, Heidelberg},242 pages = {104--128},243 232 } 244 233 … … 430 419 } 431 420 421 @article{Delisle21, 422 keywords = {concurrency, Cforall}, 423 contributer = {pabuhr@plg}, 424 author = {Thierry Delisle and Peter A. Buhr}, 425 title = {Advanced Control-flow and Concurrency in \textsf{C}$\mathbf{\forall}$}, 426 journal = spe, 427 month = may, 428 year = 2021, 429 volume = 51, 430 number = 5, 431 pages = {1005-1042}, 432 optnote = {\href{https://onlinelibrary.wiley.com/doi/10.1002/spe.2925}{https://\-onlinelibrary.wiley.com/\-doi/\-10.1002/\-spe.2925}}, 433 } 434 432 435 @article{Buhr00a, 433 436 keywords = {exception handling}, … … 1226 1229 } 1227 1230 1231 @phdthesis{Delisle22, 1232 contributer = {pabuhr@plg}, 1233 author = {Delisle, Thierry}, 1234 title = {The \textsf{C}$\mathbf{\forall}$ Scheduler}, 1235 school = {School of Computer Science, University of Waterloo}, 1236 address = {Waterloo, Ontario, Canada, N2L 3G1}, 1237 publisher = {UWSpace}, 1238 year = 2022, 1239 note = {\url{http://hdl.handle.net/10012/18941}} 1240 } 1241 1228 1242 @misc{CFAStackEvaluation, 1229 1243 contributer = {a3moss@plg}, … … 1643 1657 volume = 21, 1644 1658 number = 8, 1645 pages = {666-677} 1659 pages = {666-677}, 1660 publisher = {ACM New York, NY, USA}, 1646 1661 } 1647 1662 … … 1988 2003 title = {Concurrency in \textsf{C}$\mathbf{\forall}$}, 1989 2004 school = {School of Computer Science, University of Waterloo}, 2005 address = {Waterloo, Ontario, Canada, N2L 3G1}, 2006 publisher = {UWSpace}, 1990 2007 year = 2018, 1991 optaddress = {Waterloo, Ontario, Canada, N2L 3G1}, 1992 note = {\href{https://uwspace.uwaterloo.ca/handle/10012/12888}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-12888}}, 1993 } 1994 1995 @article{Delisle21, 1996 keywords = {concurrency, Cforall}, 1997 contributer = {pabuhr@plg}, 1998 author = {Thierry Delisle and Peter A. Buhr}, 1999 title = {Advanced Control-flow and Concurrency in \textsf{C}$\mathbf{\forall}$}, 2000 journal = spe, 2001 month = may, 2002 year = 2021, 2003 volume = 51, 2004 number = 5, 2005 pages = {1005-1042}, 2006 optnote = {\href{https://onlinelibrary.wiley.com/doi/10.1002/spe.2925}{https://\-onlinelibrary.wiley.com/\-doi/\-10.1002/\-spe.2925}}, 2008 note = {\url{http://hdl.handle.net/10012/12888}}, 2007 2009 } 2008 2010 … … 3345 3347 } 3346 3348 3349 @mastersthesis{Beach21, 3350 contributer = {pabuhr@plg}, 3351 author = {Beach, Andrew James}, 3352 title = {Exception Handling in \textsf{C}$\mathbf{\forall}$}, 3353 school = {School of Computer Science, University of Waterloo}, 3354 address = {Waterloo, Ontario, Canada, N2L 3G1}, 3355 publisher = {UWSpace}, 3356 year = {2021}, 3357 note = {\url{http://hdl.handle.net/10012/17617}}, 3358 } 3359 3347 3360 @article{Liskov79, 3348 3361 keywords = {exception handling}, … … 4076 4089 year = 2022, 4077 4090 address = {Waterloo, Ontario, Canada, N2L 3G1}, 4078 note = {\ href{https://uwspace.uwaterloo.ca/handle/10012/18329}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/18329}},4091 note = {\url{http://hdl.handle.net/10012/18329}}, 4079 4092 } 4080 4093 … … 4328 4341 month = sep, 4329 4342 optaddress = {Waterloo, Ontario, Canada, N2L 3G1}, 4330 note = {\ href{https://uwspace.uwaterloo.ca/handle/10012/13935}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-13935}},4343 note = {\url{https://uwspace.uwaterloo.ca/handle/10012/13935}}, 4331 4344 } 4332 4345 … … 4725 4738 year = 1996, 4726 4739 pages = {80-87}, 4740 } 4741 4742 @inproceedings{Srinivasan08, 4743 author = {Srinivasan, Sriram and Mycroft, Alan}, 4744 editor = {Vitek, Jan}, 4745 title = {Kilim: Isolation-Typed Actors for Java}, 4746 organization= {ECOOP 2008 -- Object-Oriented Programming}, 4747 year = {2008}, 4748 publisher = {Springer Berlin Heidelberg}, 4749 address = {Berlin, Heidelberg}, 4750 pages = {104--128}, 4727 4751 } 4728 4752 … … 5078 5102 } 5079 5103 5104 @article{Hesselink23, 5105 keywords = {Concurrency, mutual exclusion, atomicity, critical section, efficiency}, 5106 contributer = {pabuhr@plg}, 5107 author = {Hesselink, Wim H. and Buhr, Peter A.}, 5108 title = {MCSH, a Lock with the Standard Interface}, 5109 issue_date = {June 2023}, 5110 publisher = {Association for Computing Machinery}, 5111 address = {New York, NY, USA}, 5112 volume = 10, 5113 number = 2, 5114 journal = {ACM Trans. Parallel Comput.}, 5115 issn = {2329-4949}, 5116 url = {https://doi.org/10.1145/3584696}, 5117 doi = {10.1145/3584696}, 5118 articleno = 11, 5119 numpages = 23, 5120 month = jun, 5121 year = {2023}, 5122 } 5123 5080 5124 @inproceedings{mprof, 5081 5125 keywords = {malloc}, -
doc/user/Makefile
rc9019ce r599dc6a 68 68 -${BibTeX} ${Build}/${basename $@} 69 69 # Some citations reference others so run again to resolve these citations 70 #${LaTeX} ${basename $@}.tex71 -${BibTeX} ${Build}/${basename $@}70 ${LaTeX} ${basename $@}.tex 71 # -${BibTeX} ${Build}/${basename $@} 72 72 # Make index from *.aux entries and input index at end of document 73 73 makeindex -s ${Macros}/indexstyle ${Build}/${basename $@}.idx -
doc/user/user.tex
rc9019ce r599dc6a 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Jun 5 21:18:29202314 %% Update Count : 55 2113 %% Last Modified On : Thu Jun 29 21:52:51 2023 14 %% Update Count : 5533 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 3981 3981 3982 3982 The following \Index{manipulator}s control \Index{implicit output separation}. 3983 The effect of these manipulators is global for an output stream (except ©sep On© and ©sepOff©).3983 The effect of these manipulators is global for an output stream (except ©sep© and ©nosep©). 3984 3984 \begin{enumerate} 3985 3985 \item 3986 \Indexc{sepSet}\index{manipulator!sepSet@©sepSet©} and \Indexc{sep }\index{manipulator!sep@©sep©}/\Indexc{sepGet}\index{manipulator!sepGet@©sepGet©} set and get the separator string.3986 \Indexc{sepSet}\index{manipulator!sepSet@©sepSet©} and \Indexc{sepVal}\index{manipulator!sepVal@©sepVal©}/\Indexc{sepGet}\index{manipulator!sepGet@©sepGet©} set and get the separator string. 3987 3987 The separator string can be at most 16 characters including the ©'\0'© string terminator (15 printable characters). 3988 3988 \begin{cfa}[belowskip=0pt] 3989 3989 sepSet( sout, ", $\LstStringStyle{\textdollar}$" ); $\C{// set separator from " " to ", \$"}$ 3990 sout | 1 | 2 | 3 | " \"" | ®sep ® | "\"";3990 sout | 1 | 2 | 3 | " \"" | ®sepVal® | "\""; 3991 3991 \end{cfa} 3992 3992 \begin{cfa}[showspaces=true,aboveskip=0pt] 3993 1®, $\ LstStringStyle{\textdollar}$®2®, $\LstStringStyle{\textdollar}$®3 ®", $\LstStringStyle{\textdollar}$"®3993 1®, $\color{red}\LstStringStyle{\textdollar}$®2®, $\color{red}\LstStringStyle{\textdollar}$®3 ®", $\color{red}\LstStringStyle{\textdollar}$"® 3994 3994 \end{cfa} 3995 3995 \begin{cfa}[belowskip=0pt] … … 4019 4019 4020 4020 \item 4021 \Indexc{sepSetTuple}\index{manipulator!sepSetTuple@©sepSetTuple©} and \Indexc{sepTuple }\index{manipulator!sepTuple@©sepTuple©}/\Indexc{sepGetTuple}\index{manipulator!sepGetTuple@©sepGetTuple©} get and set the tuple separator-string.4021 \Indexc{sepSetTuple}\index{manipulator!sepSetTuple@©sepSetTuple©} and \Indexc{sepTupleVal}\index{manipulator!sepTupleVal@©sepTupleVal©}/\Indexc{sepGetTuple}\index{manipulator!sepGetTuple@©sepGetTuple©} get and set the tuple separator-string. 4022 4022 The tuple separator-string can be at most 16 characters including the ©'\0'© string terminator (15 printable characters). 4023 4023 \begin{cfa}[belowskip=0pt] 4024 4024 sepSetTuple( sout, " " ); $\C{// set tuple separator from ", " to " "}$ 4025 sout | t1 | t2 | " \"" | ®sepTuple ® | "\"";4025 sout | t1 | t2 | " \"" | ®sepTupleVal® | "\""; 4026 4026 \end{cfa} 4027 4027 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 4038 4038 4039 4039 \item 4040 \Indexc{sep Disable}\index{manipulator!sepDisable@©sepDisable©} and \Indexc{sepEnable}\index{manipulator!sepEnable@©sepEnable©} globally toggle printing the separator.4040 \Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} and \Indexc{sepOn}\index{manipulator!sepOn@©sepOn©} globally toggle printing the separator. 4041 4041 \begin{cfa}[belowskip=0pt] 4042 sout | sepDisable| 1 | 2 | 3; $\C{// turn off implicit separator}$4042 sout | ®sepOff® | 1 | 2 | 3; $\C{// turn off implicit separator}$ 4043 4043 \end{cfa} 4044 4044 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4046 4046 \end{cfa} 4047 4047 \begin{cfa}[belowskip=0pt] 4048 sout | sepEnable| 1 | 2 | 3; $\C{// turn on implicit separator}$4048 sout | ®sepOn® | 1 | 2 | 3; $\C{// turn on implicit separator}$ 4049 4049 \end{cfa} 4050 4050 \begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4053 4053 4054 4054 \item 4055 \Indexc{sep On}\index{manipulator!sepOn@©sepOn©} and \Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} locally toggle printing the separator with respect to the next printed item, and then return to the global separator setting.4055 \Indexc{sep}\index{manipulator!sep@©sep©} and \Indexc{nosep}\index{manipulator!nosep@©nosep©} locally toggle printing the separator with respect to the next printed item, and then return to the global separator setting. 4056 4056 \begin{cfa}[belowskip=0pt] 4057 sout | 1 | sepOff| 2 | 3; $\C{// turn off implicit separator for the next item}$4057 sout | 1 | ®nosep® | 2 | 3; $\C{// turn off implicit separator for the next item}$ 4058 4058 \end{cfa} 4059 4059 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4061 4061 \end{cfa} 4062 4062 \begin{cfa}[belowskip=0pt] 4063 sout | sep Disable | 1 | sepOn| 2 | 3; $\C{// turn on implicit separator for the next item}$4063 sout | sepOff | 1 | ®sep® | 2 | 3; $\C{// turn on implicit separator for the next item}$ 4064 4064 \end{cfa} 4065 4065 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4068 4068 The tuple separator also responses to being turned on and off. 4069 4069 \begin{cfa}[belowskip=0pt] 4070 sout | t1 | sepOff| t2; $\C{// turn off implicit separator for the next item}$4070 sout | t1 | ®nosep® | t2; $\C{// turn off implicit separator for the next item}$ 4071 4071 \end{cfa} 4072 4072 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] 4073 4073 1, 2, 34, 5, 6 4074 4074 \end{cfa} 4075 ©sep On© \emph{cannot} be used to start/end a line with a separator because separators do not appear at the start/end of a line;4075 ©sep© \emph{cannot} be used to start/end a line with a separator because separators do not appear at the start/end of a line; 4076 4076 use ©sep© to accomplish this functionality. 4077 4077 \begin{cfa}[belowskip=0pt] 4078 sout | sepOn | 1 | 2 | 3 | sepOn; $\C{// sepOndoes nothing at start/end of line}$4078 sout | ®sep® | 1 | 2 | 3 | ®sep®; $\C{// sep does nothing at start/end of line}$ 4079 4079 \end{cfa} 4080 4080 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4082 4082 \end{cfa} 4083 4083 \begin{cfa}[belowskip=0pt] 4084 sout | sep | 1 | 2 | 3 | sep ; $\C{// use septo print separator at start/end of line}$4084 sout | ®sepVal® | 1 | 2 | 3 | ®sepVal® ; $\C{// use sepVal to print separator at start/end of line}$ 4085 4085 \end{cfa} 4086 4086 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4116 4116 \Indexc{nl}\index{manipulator!nl@©nl©} inserts a newline. 4117 4117 \begin{cfa} 4118 sout | nl; $\C{// only print newline}$4118 sout | ®nl®; $\C{// only print newline}$ 4119 4119 sout | 2; $\C{// implicit newline}$ 4120 sout | 3 | nl | 4 | nl; $\C{// terminating nl merged with implicit newline}$4121 sout | 5 | nl | nl; $\C{// again terminating nl merged with implicit newline}$4120 sout | 3 | ®nl® | 4 | ®nl®; $\C{// terminating nl merged with implicit newline}$ 4121 sout | 5 | ®nl® | ®nl®; $\C{// again terminating nl merged with implicit newline}$ 4122 4122 sout | 6; $\C{// implicit newline}$ 4123 4123 … … 4286 4286 For the C-string type, precision is the maximum number of printed characters, so the string is truncated if it exceeds the maximum. 4287 4287 \begin{cfa}[belowskip=0pt] 4288 sout | wd( 6,8, "abcd" ) | wd( 6,8, "abcdefghijk" ) | wd( 6,3, "abcd" ) ;4288 sout | wd( 6,8, "abcd" ) | wd( 6,8, "abcdefghijk" ) | wd( 6,3, "abcd" ) | ®wd( 10, "" )® | 'X'; 4289 4289 \end{cfa} 4290 4290 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] 4291 abcd abcdefgh abc 4292 \end{cfa} 4291 abcd abcdefgh abc® ®X 4292 \end{cfa} 4293 Note, printing the null string with minimum width L pads with L spaces. 4293 4294 4294 4295 \item … … 4373 4374 sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\""; 4374 4375 4375 sout | sep Disable| 1 | 2 | 3; // globally turn off implicit separator4376 sout | sep Enable| 1 | 2 | 3; // globally turn on implicit separator4377 4378 sout | 1 | sepOff| 2 | 3; // locally turn on implicit separator4379 sout | sep Disable | 1 | sepOn| 2 | 3; // globally turn off implicit separator4380 sout | sep Enable;4381 sout | t1 | sepOff| t2; // locally turn on/off implicit separator4382 4383 sout | sep On | 1 | 2 | 3 | sepOn ; // sepOndoes nothing at start/end of line4376 sout | sepOff | 1 | 2 | 3; // globally turn off implicit separator 4377 sout | sepOn | 1 | 2 | 3; // globally turn on implicit separator 4378 4379 sout | 1 | nosep | 2 | 3; // locally turn on implicit separator 4380 sout | sepOff | 1 | sep | 2 | 3; // globally turn off implicit separator 4381 sout | sepOn; 4382 sout | t1 | nosep | t2; // locally turn on/off implicit separator 4383 4384 sout | sep | 1 | 2 | 3 | sep ; // sep does nothing at start/end of line 4384 4385 sout | sep | 1 | 2 | 3 | sep ; // use sep to print separator at start/end of line 4385 4386 } … … 4692 4693 sout | i | j | k | x | y | s; 4693 4694 } 4694 4695 \end{cfa} 4696 \begin{cfa}[showspaces=true] 4695 4697 3 0x5 7 1.234568e+07 987.654n abc 4696 4698 3 0x5 7 1.234568e+07 987.654n abc -
libcfa/src/containers/string_res.cfa
rc9019ce r599dc6a 9 9 // Author : Michael L. Brooks 10 10 // Created On : Fri Sep 03 11:00:00 2021 11 // Last Modified By : Michael L. Brooks12 // Last Modified On : Fri Sep 03 11:00:00 202113 // Update Count : 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 29 09:29:06 2023 13 // Update Count : 2 14 14 // 15 15 … … 204 204 out | s[i]; 205 205 } 206 out | sep ;206 out | sepVal; 207 207 // Re-apply newlines after done, for chaining version 208 208 if (anl) nlOn(out); -
libcfa/src/fstream.cfa
rc9019ce r599dc6a 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 17 08:51:12 202313 // Update Count : 5 2812 // Last Modified On : Thu Jun 29 11:09:52 2023 13 // Update Count : 533 14 14 // 15 15 … … 43 43 } // ?{} 44 44 45 inline bool getNL$( ofstream & os ) { return os.sawNL$; } 46 inline void setNL$( ofstream & os, bool state ) { os.sawNL$ = state; } 47 inline bool getANL$( ofstream & os ) { return os.nlOnOff$; } 48 45 49 inline bool sepPrt$( ofstream & os ) { setNL$( os, false ); return os.sepOnOff$; } 46 50 inline void sepReset$( ofstream & os ) { os.sepOnOff$ = os.sepDefault$; } … … 48 52 inline const char * sepGetCur$( ofstream & os ) { return os.sepCur$; } 49 53 inline void sepSetCur$( ofstream & os, const char sepCur[] ) { os.sepCur$ = sepCur; } 50 inline bool getNL$( ofstream & os ) { return os.sawNL$; } 51 inline void setNL$( ofstream & os, bool state ) { os.sawNL$ = state; } 52 inline bool getANL$( ofstream & os ) { return os.nlOnOff$; } 54 53 55 inline bool getPrt$( ofstream & os ) { return os.prt$; } 54 56 inline void setPrt$( ofstream & os, bool state ) { os.prt$ = state; } … … 63 65 void ^?{}( ofstream & os ) { close( os ); } 64 66 65 void sepOn( ofstream & os ) { os.sepOnOff$ = ! getNL$( os ); } 66 void sepOff( ofstream & os ) { os.sepOnOff$ = false; } 67 68 bool sepDisable( ofstream & os ) { 67 void nlOn( ofstream & os ) { os.nlOnOff$ = true; } 68 void nlOff( ofstream & os ) { os.nlOnOff$ = false; } 69 70 void sep( ofstream & os ) { os.sepOnOff$ = ! getNL$( os ); } 71 void nosep( ofstream & os ) { os.sepOnOff$ = false; } 72 73 bool sepOn( ofstream & os ) { 74 bool temp = os.sepDefault$; 75 os.sepDefault$ = true; 76 if ( os.sepOnOff$ ) sepReset$( os ); // start of line ? 77 return temp; 78 } // sepOn 79 80 bool sepOff( ofstream & os ) { 69 81 bool temp = os.sepDefault$; 70 82 os.sepDefault$ = false; 71 83 sepReset$( os ); 72 84 return temp; 73 } // sepDisable 74 75 bool sepEnable( ofstream & os ) { 76 bool temp = os.sepDefault$; 77 os.sepDefault$ = true; 78 if ( os.sepOnOff$ ) sepReset$( os ); // start of line ? 79 return temp; 80 } // sepEnable 81 82 void nlOn( ofstream & os ) { os.nlOnOff$ = true; } 83 void nlOff( ofstream & os ) { os.nlOnOff$ = false; } 85 } // sepOff 84 86 85 87 const char * sepGet( ofstream & os ) { return os.separator$; } -
libcfa/src/fstream.hfa
rc9019ce r599dc6a 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 5 22:00:20202313 // Update Count : 2 4612 // Last Modified On : Thu Jun 29 11:08:31 2023 13 // Update Count : 251 14 14 // 15 15 … … 40 40 41 41 // private 42 bool getNL$( ofstream & ); 43 void setNL$( ofstream &, bool ); 44 bool getANL$( ofstream & ); 45 42 46 bool sepPrt$( ofstream & ); 43 47 void sepReset$( ofstream & ); … … 45 49 const char * sepGetCur$( ofstream & ); 46 50 void sepSetCur$( ofstream &, const char [] ); 47 bool getNL$( ofstream & ); 48 void setNL$( ofstream &, bool ); 49 bool getANL$( ofstream & ); 51 50 52 bool getPrt$( ofstream & ); 51 53 void setPrt$( ofstream &, bool ); … … 55 57 56 58 // public 57 void sepOn( ofstream & );58 void sepOff( ofstream & );59 bool sepDisable( ofstream & );60 bool sepEnable( ofstream & );61 59 void nlOn( ofstream & ); 62 60 void nlOff( ofstream & ); 63 61 62 void sep( ofstream & ); 63 void nosep( ofstream & ); 64 bool sepOn( ofstream & ); 65 bool sepOff( ofstream & ); 64 66 const char * sepGet( ofstream & ); 65 67 void sepSet( ofstream &, const char [] ); -
libcfa/src/gmp.hfa
rc9019ce r599dc6a 10 10 // Created On : Tue Apr 19 08:43:43 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Apr 20 20:59:21 202113 // Update Count : 3 212 // Last Modified On : Thu Jun 29 09:43:30 2023 13 // Update Count : 33 14 14 // 15 15 … … 265 265 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 266 266 gmp_printf( "%Zd", mp.mpz ); 267 sep On( os );267 sep( os ); 268 268 return os; 269 269 } // ?|? -
libcfa/src/iostream.cfa
rc9019ce r599dc6a 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 9 09:27:58202313 // Update Count : 13 6112 // Last Modified On : Thu Jun 29 10:12:39 2023 13 // Update Count : 1380 14 14 // 15 15 … … 50 50 fmt( os, "%c", c ); 51 51 if ( c == '\n' ) setNL$( os, true ); 52 return sepOff( os );52 return nosep( os ); 53 53 } // ?|? 54 54 void ?|?( ostype & os, char c ) { … … 284 284 285 285 if ( s == 0p ) { fmt( os, "%s", "0p" ); return os; } // null pointer 286 if ( s[0] == '\0' ) { sepOff( os ); return os; } // null string => noseparator286 if ( s[0] == '\0' ) { nosep( os ); return os; } // null string => no leading/trailing separator 287 287 288 288 // first character IS NOT spacing or closing punctuation => add left separator … … 300 300 fmt( os, "%s", s ); // fmt resets seperator, but reset it again 301 301 if ( sepPrt$( os ) && mask[ ch ] != Open && mask[ ch ] != OpenClose ) { 302 sep On( os );302 sep( os ); 303 303 } else { 304 sepOff( os );304 nosep( os ); 305 305 } // if 306 306 if ( ch == '\n' ) setNL$( os, true ); // check *AFTER* sepPrt$ call above as it resets NL flag … … 351 351 } // ?|? 352 352 353 ostype & sep( ostype & os ) {354 return (ostype &)(os | sepGet( os ));355 } // sep356 357 ostype & sepTuple( ostype & os ) {358 return os | sepGetTuple( os );359 } // sepTuple360 361 353 ostype & nl( ostype & os ) { 362 354 (ostype &)(os | '\n'); 363 355 setPrt$( os, false ); // turn off 364 356 setNL$( os, true ); 365 return sepOff( os );// prepare for next line357 return nosep( os ); // prepare for next line 366 358 } // nl 367 359 … … 371 363 } // nonl 372 364 365 ostype & nlOn( ostype & os ) { 366 nlOn( os ); // call void returning 367 return os; 368 } // nlOn 369 370 ostype & nlOff( ostype & os ) { 371 nlOff( os ); // call void returning 372 return os; 373 } // nlOff 374 375 ostype & sepVal( ostype & os ) { 376 return (ostype &)(os | sepGet( os )); 377 } // sepVal 378 379 ostype & sepTupleVal( ostype & os ) { 380 return os | sepGetTuple( os ); 381 } // sepTupleVal 382 383 ostype & sep( ostype & os ) { 384 sep( os ); // call void returning 385 return os; 386 } // sep 387 388 ostype & nosep( ostype & os ) { 389 nosep( os ); // call void returning 390 return os; 391 } // nosep 392 373 393 ostype & sepOn( ostype & os ) { 374 394 sepOn( os ); // call void returning … … 380 400 return os; 381 401 } // sepOff 382 383 ostype & sepEnable( ostype & os ) {384 sepEnable( os ); // call void returning385 return os;386 } // sepEnable387 388 ostype & sepDisable( ostype & os ) {389 sepDisable( os ); // call void returning390 return os;391 } // sepDisable392 393 ostype & nlOn( ostype & os ) {394 nlOn( os ); // call void returning395 return os;396 } // nlOn397 398 ostype & nlOff( ostype & os ) {399 nlOff( os ); // call void returning400 return os;401 } // nlOff402 402 } // distribution 403 403 … … 550 550 if ( cnt == 1 ) { 551 551 if ( f.flags.left ) { wd -= maxdig; f.wd = wd < 0 ? 1 : wd; } // update and restore f.wd for printing end chunk 552 sepOff( os ); // no seperator between chunks552 nosep( os ); // no seperator between chunks 553 553 } // if 554 554 } else { // print start chunk … … 595 595 else { f.pc = maxdig; f.flags.pc = true; } // left pad with precision 596 596 597 if ( cnt != 0 ) sepOff( os ); // no seperator between chunks597 if ( cnt != 0 ) nosep( os ); // no seperator between chunks 598 598 f.wd = wd; // reset f.wd for next chunk 599 599 f.flags.sign = false; // no leading +/- sign … … 773 773 } // if 774 774 775 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 775 if ( f.val[0] != '\0' && // null string => no leading separator 776 sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 776 777 777 778 #define SFMTNP "% * " … … 795 796 fmt( os, &fmtstr[star], f.wd, f.pc, f.val ); 796 797 } // if 798 if ( f.val[0] == '\0' ) { nosep( os ); } // null string => no trailing separator 797 799 return os; 798 800 } // ?|? -
libcfa/src/iostream.hfa
rc9019ce r599dc6a 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 15 22:34:31202313 // Update Count : 4 1112 // Last Modified On : Thu Jun 29 11:07:25 2023 13 // Update Count : 427 14 14 // 15 15 … … 36 36 void setPrt$( ostype &, bool ); // set fmt called in output cascade 37 37 // public 38 void sepOn( ostype & ); // turn separator state on39 void sepOff( ostype & ); // turn separator state off40 bool sepDisable( ostype & ); // set default state to off, and return previous state41 bool sepEnable( ostype & ); // set default state to on, and return previous state42 38 void nlOn( ostype & ); // turn auto-newline state on 43 39 void nlOff( ostype & ); // turn auto-newline state off 44 40 41 void sep( ostype & ); // turn separator state on 42 void nosep( ostype & ); // turn separator state off 43 bool sepOn( ostype & ); // set default state to on, and return previous state 44 bool sepOff( ostype & ); // set default state to off, and return previous state 45 45 const char * sepGet( ostype & ); // get separator string 46 46 void sepSet( ostype &, const char [] ); // set separator to string (15 character maximum) … … 135 135 ostype & ?|?( ostype &, ostype & (*)( ostype & ) ); 136 136 void ?|?( ostype &, ostype & (*)( ostype & ) ); 137 137 138 ostype & nl( ostype & ); 138 139 ostype & nonl( ostype & ); 140 ostype & nlOn( ostype & ); 141 ostype & nlOff( ostype & ); 142 143 ostype & sepVal( ostype & ); 144 ostype & sepTupleVal( ostype & ); 139 145 ostype & sep( ostype & ); 140 ostype & sepTuple( ostype & );146 ostype & nosep( ostype & ); 141 147 ostype & sepOn( ostype & ); 142 148 ostype & sepOff( ostype & ); 143 ostype & sepDisable( ostype & );144 ostype & sepEnable( ostype & );145 ostype & nlOn( ostype & );146 ostype & nlOff( ostype & );147 149 } // distribution 148 150 -
libcfa/src/parseconfig.cfa
rc9019ce r599dc6a 29 29 // TODO: use string interface when it's ready (and implement exception msg protocol) 30 30 [ void ] msg( * Missing_Config_Entries ex ) { 31 serr | "The config file is missing " | ex->num_missing | "entr" | sepOff| (ex->num_missing == 1 ? "y." : "ies.");31 serr | "The config file is missing " | ex->num_missing | "entr" | nosep | (ex->num_missing == 1 ? "y." : "ies."); 32 32 } // msg 33 33 -
libcfa/src/strstream.cfa
rc9019ce r599dc6a 10 10 // Created On : Thu Apr 22 22:24:35 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 10 16:13:20 202113 // Update Count : 10 112 // Last Modified On : Thu Jun 29 10:59:00 2023 13 // Update Count : 105 14 14 // 15 15 … … 32 32 33 33 // private 34 inline bool getNL$( ostrstream & os ) { return os.sawNL$; } 35 inline void setNL$( ostrstream & os, bool state ) { os.sawNL$ = state; } 36 inline bool getANL$( ostrstream & os ) { return os.nlOnOff$; } 34 37 inline bool sepPrt$( ostrstream & os ) { setNL$( os, false ); return os.sepOnOff$; } 35 38 inline void sepReset$( ostrstream & os ) { os.sepOnOff$ = os.sepDefault$; } … … 37 40 inline const char * sepGetCur$( ostrstream & os ) { return os.sepCur$; } 38 41 inline void sepSetCur$( ostrstream & os, const char sepCur[] ) { os.sepCur$ = sepCur; } 39 inline bool getNL$( ostrstream & os ) { return os.sawNL$; }40 inline void setNL$( ostrstream & os, bool state ) { os.sawNL$ = state; }41 inline bool getANL$( ostrstream & os ) { return os.nlOnOff$; }42 42 inline bool getPrt$( ostrstream & os ) { return os.prt$; } 43 43 inline void setPrt$( ostrstream & os, bool state ) { os.prt$ = state; } 44 44 45 45 // public 46 void nlOn( ostrstream & os ) { os.nlOnOff$ = true; } 47 void nlOff( ostrstream & os ) { os.nlOnOff$ = false; } 48 46 49 void ?{}( ostrstream & os, char buf[], size_t size ) { 47 50 os.buf$ = buf; … … 58 61 } // ?{} 59 62 60 void sep On( ostrstream & os ) { os.sepOnOff$ = ! getNL$( os ); }61 void sepOff( ostrstream & os ) { os.sepOnOff$ = false; }63 void sep( ostrstream & os ) { os.sepOnOff$ = ! getNL$( os ); } 64 void nosep( ostrstream & os ) { os.sepOnOff$ = false; } 62 65 63 bool sepDisable( ostrstream & os ) { 66 bool sepOn( ostrstream & os ) { 67 bool temp = os.sepDefault$; 68 os.sepDefault$ = true; 69 if ( os.sepOnOff$ ) sepReset$( os ); // start of line ? 70 return temp; 71 } // sepOn 72 73 bool sepOff( ostrstream & os ) { 64 74 bool temp = os.sepDefault$; 65 75 os.sepDefault$ = false; 66 76 sepReset$( os ); 67 77 return temp; 68 } // sepDisable 69 70 bool sepEnable( ostrstream & os ) { 71 bool temp = os.sepDefault$; 72 os.sepDefault$ = true; 73 if ( os.sepOnOff$ ) sepReset$( os ); // start of line ? 74 return temp; 75 } // sepEnable 76 77 void nlOn( ostrstream & os ) { os.nlOnOff$ = true; } 78 void nlOff( ostrstream & os ) { os.nlOnOff$ = false; } 78 } // sepOff 79 79 80 80 const char * sepGet( ostrstream & os ) { return os.separator$; } -
libcfa/src/strstream.hfa
rc9019ce r599dc6a 10 10 // Created On : Thu Apr 22 22:20:59 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 10 10:14:22 202113 // Update Count : 4712 // Last Modified On : Thu Jun 29 10:58:58 2023 13 // Update Count : 51 14 14 // 15 15 … … 53 53 54 54 // public 55 void sepOn( ostrstream & );56 void sepOff( ostrstream & );57 bool sepDisable( ostrstream & );58 bool sepEnable( ostrstream & );59 55 void nlOn( ostrstream & ); 60 56 void nlOff( ostrstream & ); 61 57 58 void sep( ostrstream & ); 59 void nosep( ostrstream & ); 60 bool sepOn( ostrstream & ); 61 bool sepOff( ostrstream & ); 62 62 const char * sepGet( ostrstream & ); 63 63 void sepSet( ostrstream &, const char [] ); -
src/AST/LinkageSpec.cpp
rc9019ce r599dc6a 27 27 namespace Linkage { 28 28 29 Spec update( CodeLocation loc, Spec spec, const std::string * cmd ) { 30 assert( cmd ); 31 std::unique_ptr<const std::string> guard( cmd ); // allocated by lexer 32 if ( *cmd == "\"Cforall\"" ) { 33 spec.is_mangled = true; 34 return spec; 35 } else if ( *cmd == "\"C\"" ) { 36 spec.is_mangled = false; 37 return spec; 38 } else { 39 SemanticError( loc, "Invalid linkage specifier " + *cmd ); 40 } 29 Spec update( CodeLocation loc, Spec spec, const std::string * cmd ) { 30 assert( cmd ); 31 std::unique_ptr<const std::string> guard( cmd ); // allocated by lexer 32 if ( *cmd == "\"Cforall\"" ) { 33 spec.is_mangled = true; 34 return spec; 35 } else if ( *cmd == "\"C\"" ) { 36 spec.is_mangled = false; 37 return spec; 38 } else { 39 SemanticError( loc, "Invalid linkage specifier " + *cmd ); 41 40 } 41 } 42 42 43 44 std::string name( Spec spec ) { 45 switch ( spec.val ) { 46 case Intrinsic.val: return "intrinsic"; 47 case C.val: return "C"; 48 case Cforall.val: return "Cforall"; 49 case AutoGen.val: return "autogenerated cfa"; 50 case Compiler.val: return "compiler built-in"; 51 case BuiltinCFA.val: return "cfa built-in"; 52 case BuiltinC.val: return "c built-in"; 53 default: return "<unnamed linkage spec>"; 54 } 43 std::string name( Spec spec ) { 44 switch ( spec.val ) { 45 case Intrinsic.val: return "intrinsic"; 46 case C.val: return "C"; 47 case Cforall.val: return "Cforall"; 48 case AutoGen.val: return "autogenerated cfa"; 49 case Compiler.val: return "compiler built-in"; 50 case BuiltinCFA.val: return "cfa built-in"; 51 case BuiltinC.val: return "c built-in"; 52 default: return "<unnamed linkage spec>"; 55 53 } 54 } 56 55 57 56 } -
src/AST/LinkageSpec.hpp
rc9019ce r599dc6a 25 25 namespace Linkage { 26 26 27 /// Bitflags for linkage specifiers 28 enum { 29 Mangle = 1 << 0, 30 Generate = 1 << 1, 31 Overrideable = 1 << 2, 32 Builtin = 1 << 3, 33 GccBuiltin = 1 << 4 27 /// Bitflags for linkage specifiers 28 enum { 29 Mangle = 1 << 0, 30 Generate = 1 << 1, 31 Overrideable = 1 << 2, 32 Builtin = 1 << 3, 33 GccBuiltin = 1 << 4 34 }; 35 36 /// Bitflag type for storage classes 37 struct spec_flags { 38 union { 39 unsigned int val; 40 struct { 41 bool is_mangled : 1; 42 bool is_generatable : 1; 43 bool is_overrideable : 1; 44 bool is_builtin : 1; 45 bool is_gcc_builtin : 1; 46 }; 34 47 }; 35 48 36 /// Bitflag type for storage classes 37 struct spec_flags { 38 union { 39 unsigned int val; 40 struct { 41 bool is_mangled : 1; 42 bool is_generatable : 1; 43 bool is_overrideable : 1; 44 bool is_builtin : 1; 45 bool is_gcc_builtin : 1; 46 }; 47 }; 49 constexpr spec_flags( unsigned int val ) : val(val) {} 50 }; 48 51 49 constexpr spec_flags( unsigned int val ) : val(val) {} 50 }; 52 using Spec = bitfield<spec_flags>; 51 53 52 using Spec = bitfield<spec_flags>; 54 /// If `cmd` = "C" returns `spec` with `is_mangled = false`. 55 /// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`. 56 Spec update( CodeLocation loc, Spec spec, const std::string * cmd ); 53 57 54 /// If `cmd` = "C" returns `spec` with `is_mangled = false`. 55 /// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`. 56 Spec update( CodeLocation loc, Spec spec, const std::string * cmd ); 58 /// A human-readable name for this spec 59 std::string name( Spec spec ); 57 60 58 /// A human-readable name for this spec 59 std::string name( Spec spec ); 61 // Pre-defined flag combinations 60 62 61 // Pre-defined flag combinations 63 /// C built-in defined in prelude 64 constexpr Spec Intrinsic = { Mangle | Generate | Overrideable | Builtin }; 65 /// Ordinary Cforall 66 constexpr Spec Cforall = { Mangle | Generate }; 67 /// C code: not overloadable, not mangled 68 constexpr Spec C = { Generate }; 69 /// Built by translator (e.g. struct assignment) 70 constexpr Spec AutoGen = { Mangle | Generate | Overrideable }; 71 /// GCC internal 72 constexpr Spec Compiler = { Mangle | Builtin | GccBuiltin }; 73 /// Mangled builtins 74 constexpr Spec BuiltinCFA = { Mangle | Generate | Builtin }; 75 /// Non-mangled builtins 76 constexpr Spec BuiltinC = { Generate | Builtin }; 62 77 63 /// C built-in defined in prelude64 constexpr Spec Intrinsic = { Mangle | Generate | Overrideable | Builtin };65 /// Ordinary Cforall66 constexpr Spec Cforall = { Mangle | Generate };67 /// C code: not overloadable, not mangled68 constexpr Spec C = { Generate };69 /// Built by translator (e.g. struct assignment)70 constexpr Spec AutoGen = { Mangle | Generate | Overrideable };71 /// GCC internal72 constexpr Spec Compiler = { Mangle | Builtin | GccBuiltin };73 /// Mangled builtins74 constexpr Spec BuiltinCFA = { Mangle | Generate | Builtin };75 /// Non-mangled builtins76 constexpr Spec BuiltinC = { Generate | Builtin };77 78 } 78 79 -
tests/PRNG.cfa
rc9019ce r599dc6a 10 10 // Created On : Wed Dec 29 09:38:12 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu May 25 15:39:52202313 // Update Count : 42 212 // Last Modified On : Thu Jun 29 10:18:35 2023 13 // Update Count : 424 14 14 // 15 15 … … 144 144 srand( rseed ); 145 145 146 sout | sep Disable;146 sout | sepOff; 147 147 sout | nl | wd(26, "rand()" ) | wd(12, "rand(5)") | wd(12, "rand(0,5)" ); 148 148 for ( 20 ) { … … 151 151 sout | wd(12, rand() % (5 - 0 + 1) + 0); 152 152 } // for 153 sout | sep Enable;153 sout | sepOn; 154 154 sout | "seed" | rseed; 155 155 … … 185 185 if ( seed != 0 ) set_seed( prng, seed ); 186 186 187 sout | sep Disable;187 sout | sepOff; 188 188 sout | nl | wd(26, "PRNG()" ) | wd(12, "PRNG(5)") | wd(12, "PRNG(0,5)" ); 189 189 for ( 20 ) { … … 192 192 sout | wd(12, prng( prng, 0, 5 )); 193 193 } // for 194 sout | sep Enable;194 sout | sepOn; 195 195 sout | "seed" | get_seed( prng ); 196 196 … … 220 220 if ( seed != 0 ) set_seed( seed ); 221 221 222 sout | sep Disable;222 sout | sepOff; 223 223 sout | nl | wd(26, "prng()" ) | wd(12, "prng(5)") | wd(12, "prng(0,5)" ); 224 224 for ( 20 ) { … … 227 227 sout | wd(12, prng( 0, 5 )); 228 228 } // for 229 sout | sep Enable;229 sout | sepOn; 230 230 sout | "seed" | get_seed( prng ); 231 231 … … 256 256 thread$ & th = *active_thread(); 257 257 258 sout | sep Disable;258 sout | sepOff; 259 259 sout | nl | wd(26, "prng(t)" ) | wd(12, "prng(t,5)") | wd(12, "prng(t,0,5)" ); 260 260 for ( 20 ) { … … 263 263 sout | wd(12, prng( th, 0, 5 )); 264 264 } // for 265 sout | sep Enable;265 sout | sepOn; 266 266 sout | "seed" | get_seed( prng ); 267 267 -
tests/designations.cfa
rc9019ce r599dc6a 10 10 // Created On : Thu Jun 29 15:26:36 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 28 22:41:55 2022 13 // Update Count : 15 14 // 12 // Last Modified On : Thu Jun 29 11:31:21 2023 13 // Update Count : 28 14 // 15 16 #include <fstream.hfa> 15 17 16 18 // Note: this test case has been crafted so that it compiles with both cfa and with gcc without any modifications. … … 21 23 #define AT @ 22 24 #else 23 int printf( const char *, ...);24 25 #define _ = 25 26 #define AT … … 28 29 const int indentAmt = 2; 29 30 void indent( int level ) { 30 for ( int i = 0; i < level; ++i ) { 31 printf( " " ); 32 } 31 sout | wd( level, "" ) | nonl; 33 32 } 34 33 … … 40 39 void printA( struct A a, int level ) { 41 40 indent( level ); 42 printf( "(A){ %d %d %p }\n", a.x, a.y, a.ptr );41 sout | "(A){ " | a.x | a.y | a.ptr | " }"; 43 42 } 44 43 … … 49 48 void printB( struct B b, int level ) { 50 49 indent( level ); 51 printf( "(B){\n" );50 sout | "(B){"; 52 51 printA( b.a0, level+indentAmt ); 53 52 printA( b.a1, level+indentAmt ); 54 53 indent( level ); 55 printf( "}\n" );54 sout | "}"; 56 55 } 57 56 … … 63 62 void printC( struct C c, int level ) { 64 63 indent( level ); 65 printf( "(C){\n" );64 sout | "(C){"; 66 65 indent( level+indentAmt ); 67 printf( "(int[]{ %d %d %d }\n", c.arr[0], c.arr[1], c.arr[2]);66 sout | "(int[]{ " | c.arr[0] | c.arr[1] | c.arr[2] | " }"; 68 67 printB( c.b, level+indentAmt ); 69 68 indent( level ); 70 printf( "}\n" );69 sout | "}"; 71 70 } 72 71 … … 79 78 void printD( struct D d, int level ) { 80 79 indent( level); 81 printf( "(D ){ %d }\n", d.x );80 sout | "(D){ " | d.x | "}"; 82 81 } 83 82 … … 92 91 93 92 struct Fred { 94 95 96 97 struct Jane {98 99 } j;100 double i;101 93 double i[3]; 94 int j; 95 struct Mary { 96 struct Jane { 97 double j; 98 } j; 99 double i; 100 } m; 102 101 }; 103 102 struct Fred s1 AT= { .m.j _ 3 }; … … 129 128 #endif 130 129 131 printf( "=====A=====\n" );130 sout | "=====A====="; 132 131 printA( y0, 0 ); 133 132 printA( y1, 0 ); 134 133 printA( y2, 0 ); 135 printf( "=====A=====\n\n" );134 sout | "=====A=====" | nl | nl; 136 135 137 136 // initialize only first element (z0.a.x), leaving everything else default-initialized (zero), no nested curly-braces … … 172 171 }; 173 172 174 printf( "=====B=====\n" );173 sout | "=====B====="; 175 174 printB( z0, 0 ); 176 175 printB( z1, 0 ); … … 179 178 printB( z5, 0 ); 180 179 printB( z6, 0 ); 181 printf( "=====B=====\n\n" );180 sout | "=====B=====" | nl | nl; 182 181 183 182 // TODO: what about extra things in a nested init? are empty structs skipped?? … … 190 189 }; 191 190 192 printf( "=====C=====\n" );191 sout | "=====C====="; 193 192 printC( c1, 0 ); 194 printf( "=====C=====\n\n" );193 sout | "=====C=====" | nl | nl; 195 194 196 195 #if ERROR … … 246 245 }; 247 246 248 printf( "=====E=====\n" );247 sout | "=====E====="; 249 248 printA( e0.a, 0 ); 250 249 printA( e1.a, 0 ); 251 250 printA( e2.a, 0 ); 252 251 printB( e3.b, 0 ); 253 printf( "=====E=====\n\n" );252 sout | "=====E=====" | nl | nl; 254 253 255 254 // special case of initialization: char[] can be initialized with a string literal -
tests/io/.expect/io.txt
rc9019ce r599dc6a 61 61 1, 2, 3 4, 5, 6 62 62 63 check sep On/sepOff63 check sep/nosep 64 64 1 2 3 65 65 12 3 -
tests/io/io.cfa
rc9019ce r599dc6a 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 21 10:56:33 202113 // Update Count : 12 112 // Last Modified On : Thu Jun 29 10:19:31 2023 13 // Update Count : 126 14 14 // 15 15 … … 122 122 sout | "toggle separator"; 123 123 sout | f | "" | d | "" | ld; // floating point without separator 124 sout | sep Disable | fc | dc | ldc;// complex without separator125 sout | fc | sep On | dc | ldc;// local separator add126 sout | sep Enable | fc | dc | ldc;// complex with separator127 sout | fc | sepOff| dc | ldc; // local separator removal128 sout | s1 | sepOff | s2;// local separator removal124 sout | sepOff | fc | dc | ldc; // complex without separator 125 sout | fc | sep | dc | ldc; // local separator add 126 sout | sepOn | fc | dc | ldc; // complex with separator 127 sout | fc | nosep | dc | ldc; // local separator removal 128 sout | s1 | nosep | s2; // local separator removal 129 129 sout | s1 | "" | s2; // local separator removal 130 130 sout | nl; 131 131 132 132 sout | "change separator"; 133 sout | "from \"" | sep | "\"" | nonl;133 sout | "from \"" | sepVal | "\"" | nonl; 134 134 sepSet( sout, ", $" ); // change separator, maximum of 15 characters 135 sout | " to \"" | sep | "\"";135 sout | " to \"" | sepVal | "\""; 136 136 sout | f | d | ld; 137 137 sout | fc | dc | ldc; … … 139 139 sout | t1 | t2; // print tuple 140 140 sout | nl; 141 sout | "from \"" | sep | "\" " | nonl;141 sout | "from \"" | sepVal | "\" " | nonl; 142 142 sepSet( sout, " " ); // restore separator 143 sout | "to \"" | sep | "\"";143 sout | "to \"" | sepVal | "\""; 144 144 sout | f | d | ld; 145 145 sout | fc | dc | ldc; … … 148 148 sout | nl; 149 149 150 sout | "check sep On/sepOff";151 sout | sep On | 1 | 2 | 3 | sepOn;// no separator at start/end of line152 sout | 1 | sepOff| 2 | 3; // locally turn off implicit separator153 sout | sep On | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn| '\n' | nonl; // no separator at start/end of line154 sout | 1 | 2 | 3 | "\n\n" | sep On | nonl;// no separator at start of next line150 sout | "check sep/nosep"; 151 sout | sep | 1 | 2 | 3 | sep; // no separator at start/end of line 152 sout | 1 | nosep | 2 | 3; // locally turn off implicit separator 153 sout | sep | sep | 1 | 2 | 3 | sep | nosep | sep | '\n' | nonl; // no separator at start/end of line 154 sout | 1 | 2 | 3 | "\n\n" | sep | nonl; // no separator at start of next line 155 155 sout | 1 | 2 | 3; 156 156 sout | nl; 157 157 158 158 sout | "check enable/disable"; 159 sout | sep Disable | 1 | 2 | 3;// globally turn off implicit separation160 sout | 1 | sep On | 2 | 3;// locally turn on implicit separator161 sout | sep Enable | 1 | 2 | 3 | sepDisable;// globally turn on/off implicit separation162 sout | 1 | 2 | 3 | sep Enable;// globally turn on implicit separation163 sout | 1 | 2 | 3 | sep On | sepDisable;// ignore seperate at end of line164 sout | 1 | 2 | 3 | sep On | sepEnable;// separator at end of line159 sout | sepOff | 1 | 2 | 3; // globally turn off implicit separation 160 sout | 1 | sep | 2 | 3; // locally turn on implicit separator 161 sout | sepOn | 1 | 2 | 3 | sepOff; // globally turn on/off implicit separation 162 sout | 1 | 2 | 3 | sepOn; // globally turn on implicit separation 163 sout | 1 | 2 | 3 | sep | sepOff; // ignore seperate at end of line 164 sout | 1 | 2 | 3 | sep | sepOn; // separator at end of line 165 165 sout | 1 | 2 | 3; 166 166 sout | nl; … … 169 169 170 170 sepSetTuple( sout, " " ); // set tuple separator from ", " to " " 171 sout | t1 | t2 | " \"" | sep | "\"";171 sout | t1 | t2 | " \"" | sepVal | "\""; 172 172 sepSetTuple( sout, ", " ); // reset tuple separator to ", " 173 sout | t1 | t2 | " \"" | sep | "\"";173 sout | t1 | t2 | " \"" | sepVal | "\""; 174 174 sout | t1 | t2; // print tuple 175 175 sout | nl; … … 180 180 sepSetTuple( sout, " " ); 181 181 sout | t3; 182 sout | sep On | t3 | sepDisable | t3 | sepEnable| t3;182 sout | sep | t3 | sepOff | t3 | sepOn | t3; 183 183 sepSet( sout, "^" ); 184 184 sepSetTuple( sout, "-" ); -
tests/raii/dtor-early-exit.cfa
rc9019ce r599dc6a 10 10 // Created On : Wed Aug 17 08:26:25 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 21 08:45:19 201813 // Update Count : 1 012 // Last Modified On : Thu Jun 29 11:15:56 2023 13 // Update Count : 11 14 14 // 15 15 … … 244 244 245 245 int main() { 246 sep Disable(sout);246 sepOff(sout); 247 247 for (int i = 0; i < 4; i++) { 248 248 f(i);
Note:
See TracChangeset
for help on using the changeset viewer.