Changeset 0583064b
- Timestamp:
- Mar 23, 2017, 10:39:30 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 6013bd7, 7895d46
- Parents:
- 89e1b16
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/user.tex
r89e1b16 r0583064b 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Feb 20 12:35:48201714 %% Update Count : 13 7713 %% Last Modified On : Thu Mar 23 09:53:57 2017 14 %% Update Count : 1399 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 91 91 }% title 92 92 93 \author{\huge 94 Peter A. Buhr and ... 93 \author{ 94 \huge \CFA Team \medskip \\ 95 \Large Peter A. Buhr, Richard Bilson, Thierry Delisle, \smallskip \\ 96 \Large Glen Ditchfield, Rodolfo G. Esteves, Aaron Moss, Rob Schluntz 95 97 }% author 96 98 … … 4657 4659 which is a local mechanism to disable insertion of the separator character. 4658 4660 \item 4659 A separator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off]@([{ $£¥¡¿«@4661 A separator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off]@([{=$£¥¡¿«@ 4660 4662 %$ 4661 4663 \begin{lstlisting}[mathescape=off] 4662 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 74663 | "x ¿" | 8 | "x «" | 9| endl;4664 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" | 7 4665 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl; 4664 4666 \end{lstlisting} 4665 4667 %$ 4666 4668 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] 4667 x (1 x [2 x {3 x $4 x £5 x ¥6 x ¡7 x ¿8 x «94669 x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10 4668 4670 \end{lstlisting} 4669 4671 %$ 4670 4672 \item 4673 {\lstset{deletedelim=**[is][]{¢}{¢}} 4671 4674 A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: ©,.:;!?)]}%¢»© 4672 4675 \begin{lstlisting}[belowskip=0pt] 4673 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 4674 | ") x" | 8 | "] x" | 9 | "} x" | 10 | "% x" | 11 | "¢ x" | 12 | "»x" | endl;4676 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | "% x" 4677 | 8 | "¢ x" | 9 | "» x" | 10 | ") x" | 11 | "] x" | 12 | "} x" | endl; 4675 4678 \end{lstlisting} 4676 4679 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] 4677 1, x 2. x 3: x 4; x 5! x 6? x 7 ) x 8] x 9} x 10% x 11¢ 12»4678 \end{lstlisting} 4680 1, x 2. x 3: x 4; x 5! x 6? x 7% x 8¢ x 9» x 10) x 11] x 12} x 4681 \end{lstlisting}}% 4679 4682 \item 4680 4683 A seperator does not appear before or after a C string begining/ending with the \Index{ASCII} quote or whitespace characters: \lstinline[showspaces=true]@`'" \t\v\f\r\n@ … … 4694 4697 \end{lstlisting} 4695 4698 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4696 sout | 1 | sepOff | 2 | 3 | endl; §\C{// turn off implicit separator temporarily}§4699 sout | 1 | sepOff | 2 | 3 | endl; §\C{// turn off implicit separator locally}§ 4697 4700 \end{lstlisting} 4698 4701 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4700 4703 \end{lstlisting} 4701 4704 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4702 sout | sepDisable | 1 | 2 | 3 | endl; §\C{// turn off implicit separation , affects all subsequent prints}§4705 sout | sepDisable | 1 | 2 | 3 | endl; §\C{// turn off implicit separation globally}§ 4703 4706 \end{lstlisting} 4704 4707 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4706 4709 \end{lstlisting} 4707 4710 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4708 sout | 1 | sepOn | 2 | 3 | endl; §\C{// turn on implicit separator temporarily}§4711 sout | 1 | sepOn | 2 | 3 | endl; §\C{// turn on implicit separator locally}§ 4709 4712 \end{lstlisting} 4710 4713 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4712 4715 \end{lstlisting} 4713 4716 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4714 sout | sepEnable | 1 | 2 | 3 | endl; §\C{// turn on implicit separation , affects all subsequent prints}§4717 sout | sepEnable | 1 | 2 | 3 | endl; §\C{// turn on implicit separation globally}§ 4715 4718 \end{lstlisting} 4716 4719 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4730 4733 4731 4734 int main() { 4732 int x = 3, y = 5, z = 7;4733 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl ;4735 int x = 0, y = 1, z = 2; 4736 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl | endl; 4734 4737 sout | 1 | 2 | 3 | endl; 4735 4738 sout | '1' | '2' | '3' | endl; 4736 4739 sout | 1 | "" | 2 | "" | 3 | endl; 4737 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7 | "x ¿" | 8 | "x «" | 9 | endl; 4738 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | ") x" | 8 | "] x" | 9 | "} x" 4739 | 10 | "% x" | 11 | "¢ x" | 12 | "» x" | endl; 4740 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" | 7 4741 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl; 4742 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | "% x" 4743 | 8 | "¢ x" | 9 | "» x" | 10 | ") x" | 11 | "] x" | 12 | "} x" | endl; 4740 4744 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x" | "x " | 4 | " x" | "x\t" | 1 | "\tx" | endl; 4741 4745 sout | sepOn | 1 | 2 | 3 | sepOn | endl; // separator at start of line -
src/libcfa/fstream.c
r89e1b16 r0583064b 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 22 16:17:21 201713 // Update Count : 22 112 // Last Modified On : Thu Mar 23 08:20:41 2017 13 // Update Count : 226 14 14 // 15 15 … … 29 29 #define IO_MSG "I/O error: " 30 30 31 void ?{}( ofstream * this, void * file, _Bool sepDefault, _Bool sepOnOff, const char * separator, const char * tupleSeparator ) { 32 this->file = file; 33 this->sepDefault = sepDefault; 34 this->sepOnOff = sepOnOff; 35 sepSet( this, separator ); 36 sepSetCur( this, sepGet( this ) ); 37 sepSetTuple( this, tupleSeparator ); 38 } 39 31 40 _Bool sepPrt( ofstream * os ) { return os->sepOnOff; } 32 41 void sepOn( ofstream * os ) { os->sepOnOff = 1; } … … 83 92 exit( EXIT_FAILURE ); 84 93 } // if 85 os->file = file; 86 sepOff( os ); 87 sepSet( os, " " ); 94 ?{}( os, file, 1, 0, " ", ", " ); 88 95 } // open 89 96 … … 125 132 } // fmt 126 133 127 void ?{}( ofstream * this, void * file, _Bool sepDefault, _Bool sepOnOff, const char * separator, const char * tupleSeparator ) {128 this->file = file;129 this->sepDefault = sepDefault;130 this->sepOnOff = sepOnOff;131 sepSet( this, separator );132 sepSetCur( this, sepGet( this ) );133 sepSetTuple( this, tupleSeparator );134 }135 136 134 static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), 1, 0, " ", ", " }; 137 135 ofstream *sout = &soutFile; -
src/libcfa/iostream.c
r89e1b16 r0583064b 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 22 17:46:06201713 // Update Count : 3 5912 // Last Modified On : Thu Mar 23 08:20:40 2017 13 // Update Count : 367 14 14 // 15 15 … … 201 201 forall( dtype ostype, otype T, ttype Params | ostream( ostype ) | writeable( T ) | { ostype * ?|?( ostype *, Params ); } ) 202 202 ostype * ?|?( ostype * os, T arg, Params rest ) { 203 forall( ttype Params ) ostype * prtTuple( T arg, Params rest ) {204 os | arg; // print first argument205 os | rest; // print remaining arguments206 return os;207 } // prtTuple208 203 sepSetCur( os, sepGetTuple( os ) ); // switch to tuple separator 209 prtTuple( arg, rest ); // recursively print tuple 204 os | arg; // print first argument 205 os | rest; // print remaining arguments 210 206 sepSetCur( os, sepGet( os ) ); // switch to regular separator 211 207 return os; … … 223 219 os | '\n'; 224 220 flush( os ); 225 sepOff( os ); 221 sepOff( os ); // prepare for next line 226 222 return os; 227 223 } // endl
Note: See TracChangeset
for help on using the changeset viewer.