Changes in / [f2e482cb:8a5530c]


Ignore:
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • doc/bibliography/pl.bib

    rf2e482cb r8a5530c  
    19191919    year        = 1965,
    19201920    note        = {Reprinted in \cite{Genuys68} pp. 43--112.}
    1921 }
    1922 
    1923 @manual{C++20Coroutine19,
    1924     keywords    = {coroutine},
    1925     contributer = {pabuhr@plg},
    1926     title       = {Coroutines (C++20)},
    1927     organization= {cppreference.com},
    1928     month       = apr,
    1929     year        = 2019,
    1930     note        = {\href{https://en.cppreference.com/w/cpp/language/coroutines}{https://\-en.cppreference.com/\-w/\-cpp/\-language/\-coroutines}},
    19311921}
    19321922
  • libcfa/src/fstream.cfa

    rf2e482cb r8a5530c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 16 08:33:28 2019
    13 // Update Count     : 328
     12// Last Modified On : Sat Apr 20 12:03:43 2019
     13// Update Count     : 311
    1414//
    1515
     
    2727#define IO_MSG "I/O error: "
    2828
    29 void ?{}( ofstream & os, void * file ) {
     29void ?{}( ofstream & os, void * file, bool sepDefault, bool sepOnOff, bool nlOnOff, bool prt, const char * separator, const char * tupleSeparator ) {
    3030        os.file = file;
    31         os.sepDefault = true;
    32         os.sepOnOff = false;
    33         os.nlOnOff = true;
    34         os.prt = false;
     31        os.sepDefault = sepDefault;
     32        os.sepOnOff = sepOnOff;
     33        os.nlOnOff = nlOnOff;
     34        os.prt = prt;
    3535        os.sawNL = false;
    36         sepSet( os, " " );
     36        sepSet( os, separator );
    3737        sepSetCur( os, sepGet( os ) );
    38         sepSetTuple( os, ", " );
     38        sepSetTuple( os, tupleSeparator );
    3939}
    4040
     
    104104
    105105void open( ofstream & os, const char * name, const char * mode ) {
    106         FILE * file = fopen( name, mode );
     106        FILE *file = fopen( name, mode );
    107107        #ifdef __CFA_DEBUG__
    108108        if ( file == 0 ) {
     
    110110        } // if
    111111        #endif // __CFA_DEBUG__
    112         (os){ file };
     112        (os){ file, true, false, true, false, " ", ", " };
    113113} // open
    114114
     
    152152} // fmt
    153153
    154 static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_) };
     154static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), true, false, true, false, " ", ", " };
    155155ofstream & sout = soutFile;
    156 static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_) };
     156static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), true, false, true, false, " ", ", " };
    157157ofstream & serr = serrFile;
    158158
    159 // static ofstream sexitFile = { (FILE *)(&_IO_2_1_stdout_) };
    160 // ofstream & sexit = sexitFile;
    161 // static ofstream sabortFile = { (FILE *)(&_IO_2_1_stderr_) };
    162 // ofstream & sabort = sabortFile;
    163 
    164 void nl( ofstream & os ) {
    165         if ( getANL( os ) ) (ofstream &)(nl( os ));                     // implementation only
    166         else setPrt( os, false );                                                       // turn off
    167 }
    168159
    169160//---------------------------------------
  • libcfa/src/fstream.hfa

    rf2e482cb r8a5530c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 16 08:34:10 2019
    13 // Update Count     : 157
     12// Last Modified On : Sat Apr 20 12:03:58 2019
     13// Update Count     : 151
    1414//
    1515
     
    7070extern ofstream & sout, & serr;
    7171
    72 // extern ofstream & sout, & serr, & sexit, & sabort;
    73 // void nl( ofstream & os );
    74 
    7572
    7673struct ifstream {
  • libcfa/src/iostream.cfa

    rf2e482cb r8a5530c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 13 12:46:45 2019
    13 // Update Count     : 650
     12// Last Modified On : Sat Apr 20 14:02:43 2019
     13// Update Count     : 617
    1414//
    1515
     
    2323extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
    2424#include <float.h>                                                                              // DBL_DIG, LDBL_DIG
    25 #include <math.h>                                                                               // modff, modf, modlf
    2625#include <complex.h>                                                                    // creal, cimag
    2726}
     
    157156                if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    158157                fmt( os, "%g", f );
    159                 float tempi;
    160                 if ( isfinite( f ) && modff( f, &tempi ) == 0.0F ) fmt( os, "." ); // always print decimal point
    161158                return os;
    162159        } // ?|?
     
    168165                if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    169166                fmt( os, "%.*lg", DBL_DIG, d );
    170                 // fmt( os, "%lg", d );
    171                 double tempi;
    172                 if ( isfinite( d ) && modf( d, &tempi ) == 0.0D ) fmt( os, "." ); // always print decimal point
    173167                return os;
    174168        } // ?|?
     
    180174                if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    181175                fmt( os, "%.*Lg", LDBL_DIG, ld );
    182                 // fmt( os, "%Lg", ld );
    183                 long double tempi;
    184                 if ( isfinite( ld ) && modfl( ld, &tempi ) == 0.0L ) fmt( os, "." ); // always print decimal point
    185176                return os;
    186177        } // ?|?
     
    191182        ostype & ?|?( ostype & os, float _Complex fc ) {
    192183                if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    193                 float temp = crealf( fc ), tempi;
    194                 fmt( os, "%g", temp );
    195                 if ( isfinite( temp ) && modff( temp, &tempi ) == 0.0F ) fmt( os, "." ); // always print decimal point
    196                 temp = cimagf( fc );
    197                 fmt( os, "%+g", temp );
    198                 if ( isfinite( temp ) && modff( temp, &tempi ) == 0.0F ) fmt( os, "." ); // always print decimal point
    199                 fmt( os, "i" );
     184                fmt( os, "%g%+gi", crealf( fc ), cimagf( fc ) );
    200185                return os;
    201186        } // ?|?
     
    206191        ostype & ?|?( ostype & os, double _Complex dc ) {
    207192                if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    208                 double temp = creal( dc ), tempi;
    209                 fmt( os, "%.*lg", DBL_DIG, temp );
    210                 if ( isfinite( temp ) && modf( temp, &tempi ) == 0.0D ) fmt( os, "." ); // always print decimal point
    211                 temp = cimag( dc );
    212                 fmt( os, "%+.*lg", DBL_DIG, temp );
    213                 if ( isfinite( temp ) && modf( temp, &tempi ) == 0.0D ) fmt( os, "." ); // always print decimal point
    214                 fmt( os, "i" );
    215                 // fmt( os, "%lg%+lgi", creal( dc ), cimag( dc ) );
     193                fmt( os, "%.*lg%+.*lgi", DBL_DIG, creal( dc ), DBL_DIG, cimag( dc ) );
    216194                return os;
    217195        } // ?|?
     
    222200        ostype & ?|?( ostype & os, long double _Complex ldc ) {
    223201                if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
    224                 long double temp = creall( ldc ), tempi;
    225                 fmt( os, "%.*Lg", LDBL_DIG, temp );
    226                 if ( isfinite( temp ) && modfl( temp, &tempi ) == 0.0L ) fmt( os, "." ); // always print decimal point
    227                 temp = cimagl( ldc );
    228                 fmt( os, "%+.*Lg", LDBL_DIG, cimagl( ldc ) );
    229                 if ( isfinite( temp ) && modfl( temp, &tempi ) == 0.0L ) fmt( os, "." ); // always print decimal point
    230                 fmt( os, "i" );
    231                 // fmt( os, "%Lg%+Lgi", creall( ldc ), cimagl( ldc ) );
     202                fmt( os, "%.*Lg%+.*Lgi", LDBL_DIG, creall( ldc ), LDBL_DIG, cimagl( ldc ) );
    232203                return os;
    233204        } // ?|?
     
    523494        } // ?|?
    524495
     496
    525497        // manipulators
    526498        istype & ?|?( istype & is, istype & (* manip)( istype & ) ) {
     
    529501
    530502        istype & nl( istype & is ) {
    531                 fmt( is, "%*[^\n]" );                                                   // ignore characters to newline
     503                fmt( is, "%*[ \t\f\n\r\v]" );                                   // ignore whitespace
    532504                return is;
    533505        } // nl
  • libcfa/src/iostream.hfa

    rf2e482cb r8a5530c  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat May 11 10:31:27 2019
    13 // Update Count     : 232
     12// Last Modified On : Fri May  3 22:55:04 2019
     13// Update Count     : 230
    1414//
    1515
     
    190190
    191191        // manipulators
     192        istype & nlOn( istype & );
     193        istype & nlOff( istype & );
    192194        istype & ?|?( istype &, istype & (*)( istype & ) );
    193195        istype & nl( istype & is );
    194         istype & nlOn( istype & );
    195         istype & nlOff( istype & );
    196196} // distribution
    197197
     
    215215
    216216// Local Variables: //
     217// mode: c //
    217218// tab-width: 4 //
    218219// End: //
  • src/Parser/lex.ll

    rf2e482cb r8a5530c  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Wed May 15 21:25:27 2019
    13  * Update Count     : 708
     12 * Last Modified On : Wed Mar 13 14:54:30 2019
     13 * Update Count     : 707
    1414 */
    1515
     
    265265fortran                 { KEYWORD_RETURN(FORTRAN); }
    266266ftype                   { KEYWORD_RETURN(FTYPE); }                              // CFA
    267 generator               { KEYWORD_RETURN(GENERATOR); }                  // CFA
    268267_Generic                { KEYWORD_RETURN(GENERIC); }                    // C11
    269268goto                    { KEYWORD_RETURN(GOTO); }
  • src/Parser/parser.yy

    rf2e482cb r8a5530c  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 15 21:25:27 2019
    13 // Update Count     : 4296
     12// Last Modified On : Mon Apr 15 15:02:56 2019
     13// Update Count     : 4290
    1414//
    1515
     
    173173DeclarationNode * fieldDecl( DeclarationNode * typeSpec, DeclarationNode * fieldList ) {
    174174        if ( ! fieldList ) {                                                            // field declarator ?
    175                 if ( ! ( typeSpec->type && (typeSpec->type->kind == TypeData::Aggregate || typeSpec->type->kind == TypeData::Enum) ) ) {
     175                if ( ! ( typeSpec->type && typeSpec->type->kind == TypeData::Aggregate ) ) {
    176176                        stringstream ss;
    177177                        typeSpec->type->print( ss );
     
    275275%token ENUM STRUCT UNION
    276276%token EXCEPTION                                                                                // CFA
    277 %token GENERATOR COROUTINE MONITOR THREAD                               // CFA
     277%token COROUTINE MONITOR THREAD                                                 // CFA
    278278%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
    279279%token SIZEOF OFFSETOF
     
    677677        // empty
    678678                { $$ = nullptr; }
    679         | '@'                                                                                           // CFA, default parameter
     679        | '?'                                                                                           // CFA, default parameter
    680680                { SemanticError( yylloc, "Default parameter for argument is currently unimplemented." ); $$ = nullptr; }
    681681                // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); }
     
    796796                { $$ = new ExpressionNode( build_cast( $2, $4 ) ); }
    797797                // keyword cast cannot be grouped because of reduction in aggregate_key
    798         | '(' GENERATOR '&' ')' cast_expression                         // CFA
    799                 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); }
    800798        | '(' COROUTINE '&' ')' cast_expression                         // CFA
    801799                { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); }
     
    20632061        | EXCEPTION
    20642062                { yyy = true; $$ = DeclarationNode::Exception; }
    2065         | GENERATOR
    2066                 { yyy = true; $$ = DeclarationNode::Coroutine; }
    20672063        | COROUTINE
    20682064                { yyy = true; $$ = DeclarationNode::Coroutine; }
  • tests/.expect/abs.txt

    rf2e482cb r8a5530c  
    33signed long int         -65     abs 65
    44signed long long int    -65     abs 65
    5 float                   -65.    abs 65.
    6 double                  -65.    abs 65.
    7 long double             -65.    abs 65.
    8 float _Complex          -65.-2.i        abs 65.0308
    9 double _Complex         -65.-2.i        abs 65.0307619515564
    10 long double _Complex    -65.-2.i        abs 65.0307619515564342
     5float                   -65     abs 65
     6double                  -65     abs 65
     7long double             -65     abs 65
     8float _Complex          -65-2i  abs 65.0308
     9double _Complex         -65-2i  abs 65.0307619515564
     10long double _Complex    -65-2i  abs 65.0307619515564342
  • tests/.expect/ato.txt

    rf2e482cb r8a5530c  
    2222-123.456789012345679 -123.45678901234567890123456789
    2323-123.456-123.456i -123.456-123.456i
    24 0.+0.i 2  3
     240+0i 2  3
    2525-123.456789012346+123.456789012346i -123.4567890123456+123.4567890123456i
    2626123.456789012345679-123.456789012345679i 123.45678901234567890123456789-123.45678901234567890123456789i
  • tests/.expect/complex.txt

    rf2e482cb r8a5530c  
    11x:3+2i y:4+5i z:7+7i
    2 x:3.+2.i y:4.+5.i z:7.+7.i
     2x:3+2i y:4+5i z:7+7i
    33x:2.1+1.3i y:3.2+4.5i z:5.3+5.8i
    44x:2.1+1.3i y:3.2+4.5i z:5.3+5.8i
  • tests/.expect/identity.txt

    rf2e482cb r8a5530c  
    99double                  4.1
    1010long double             4.1
    11 float _Complex          -4.1-2.i
    12 double _Complex         -4.1-2.i
    13 long double _Complex    -4.1-2.i
     11float _Complex          -4.1-2i
     12double _Complex         -4.1-2i
     13long double _Complex    -4.1-2i
  • tests/.expect/math1.txt

    rf2e482cb r8a5530c  
    1 fmod:1. 1. 1. 1. 1. 1.
    2 remainder:-1. -1. -1.
     1fmod:1 1 1 1 1 1
     2remainder:-1 -1 -1
    33remquo:7 0.0999999 7 0.1 7 0.0999999999999999999
    4 div:7., 0.2 7., 0.2 7., 0.2
    5 fma:-2. -2. -2.
    6 fdim:2. 2. 2.
     4div:7, 0.2 7, 0.2 7, 0.2
     5fma:-2 -2 -2
     6fdim:2 2 2
    77nan:nan nan nan
    88exp:2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i
    9 exp2:2. 2. 2.
     9exp2:2 2 2
    1010expm1:1.71828 1.71828182845905 1.71828182845904524
    11 pow:1. 1. 1. 0.273957+0.583701i 0.273957253830121+0.583700758758615i -0.638110484918098871+0.705394566961838155i
     11pow:1 1 1 0.273957+0.583701i 0.273957253830121+0.583700758758615i -0.638110484918098871+0.705394566961838155i
    121216 \ 2 = 256
    1313912673 256 64 -64 0 0
  • tests/.expect/math2.txt

    rf2e482cb r8a5530c  
    1 log:0. 0. 0. 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    2 log2:3. 3. 3.
    3 log10:2. 2. 2.
     1log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     2log2:3 3 3
     3log10:2 2 2
    44log1p:0.693147 0.693147180559945 0.693147180559945309
    55ilogb:0 0 0
    6 logb:3. 3. 3.
    7 sqrt:1. 1. 1. 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    8 cbrt:3. 3. 3.
     6logb:3 3 3
     7sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     8cbrt:3 3 3
    99hypot:1.41421 1.4142135623731 1.41421356237309505
    1010sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
     
    1212tan:1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
    1313asin:1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
    14 acos:0. 0. 0. 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
     14acos:0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
    1515atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    1616atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831
  • tests/.expect/math3.txt

    rf2e482cb r8a5530c  
    22cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    33tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    4 acosh:0. 0. 0. 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     4acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    55asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    66atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     
    99lgamma:1.79176 1.79175946922805 1.791759469228055
    1010lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
    11 tgamma:6 6. 6.
     11tgamma:6 6 6
  • tests/.expect/math4.txt

    rf2e482cb r8a5530c  
    1 floor:1. 1. 1.
    2 ceil:2. 2. 2.
    3 trunc:3. 3. 3.
    4 rint:2. 2. 2.
     1floor:1 1 1
     2ceil:2 2 2
     3trunc:3 3 3
     4rint:2 2 2
    55rint:2 2 2
    66rint:2 2 2
    77lrint:2 2 2
    88llrint:2 2 2
    9 nearbyint:4. 4. 4.
    10 round:2. 2. 2.
     9nearbyint:4 4 4
     10round:2 2 2
    1111round:2 2 2
    1212round:2 2 2
    1313lround:2 2 2
    1414llround:2 2 2
    15 copysign:-1. -1. -1.
     15copysign:-1 -1 -1
    1616frexp:0.5 3 0.5 3 0.5 3
    17 ldexp:8. 8. 8.
    18 modf:2. 0.3 2. 0.3 2. 0.3
    19 modf:2., 0.3 2., 0.3 2., 0.3
     17ldexp:8 8 8
     18modf:2 0.3 2 0.3 2 0.3
     19modf:2, 0.3 2, 0.3 2, 0.3
    2020nextafter:2 2 2
    2121nexttoward:2 2 2
    22 scalbn:16. 16. 16.
    23 scalbln:16. 16. 16.
     22scalbn:16 16 16
     23scalbln:16 16 16
  • tests/.expect/minmax.txt

    rf2e482cb r8a5530c  
    66signed long long int    4 3     min 3
    77unsigned long long int  4 3     min 3
    8 float                   4. 3.1  min 3.1
    9 double                  4. 3.1  min 3.1
    10 long double             4. 3.1  min 3.1
     8float                   4 3.1   min 3.1
     9double                  4 3.1   min 3.1
     10long double             4 3.1   min 3.1
    1111
    1212char                    z a     max z
     
    1717signed long long int    4 3     max 4
    1818unsigned long long int  4 3     max 4
    19 float                   4. 3.1  max 4.
    20 double                  4. 3.1  max 4.
    21 long double             4. 3.1  max 4.
     19float                   4 3.1   max 4
     20double                  4 3.1   max 4
     21long double             4 3.1   max 4
  • tests/.expect/references.txt

    rf2e482cb r8a5530c  
    35353
    36363
    37 3 9 { 1., 7. }, [1, 2, 3]
     373 9 { 1, 7 }, [1, 2, 3]
    3838Destructing a Y
    3939Destructing a Y
Note: See TracChangeset for help on using the changeset viewer.