- Timestamp:
- Aug 25, 2017, 10:47:42 AM (7 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:
- 19a9822, 6b224a52, f22b7aef
- Parents:
- ddf8a29 (diff), 3eab308c (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. - Location:
- src
- Files:
-
- 3 added
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rddf8a29 rf676b84 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 23 18:00:46201713 // Update Count : 270 312 // Last Modified On : Wed Aug 23 21:08:08 2017 13 // Update Count : 2704 14 14 // 15 15 … … 303 303 // Similar issues exit with the waitfor statement. 304 304 305 // Order of these lines matters . THEN is left associative over WOR/TIMEOUT/ELSE, WOR is left associative over306 // TIMEOUT/ELSE, and TIMEOUT is left associative over ELSE.305 // Order of these lines matters (low-to-high precedence). THEN is left associative over WOR/TIMEOUT/ELSE, WOR is left 306 // associative over TIMEOUT/ELSE, and TIMEOUT is left associative over ELSE. 307 307 %precedence THEN // rule precedence for IF/WAITFOR statement 308 308 %precedence WOR // token precedence for start of WOR in WAITFOR statement -
src/libcfa/gmp
rddf8a29 rf676b84 10 10 // Created On : Tue Apr 19 08:43:43 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 7 09:33:20201713 // Update Count : 1 512 // Last Modified On : Thu Aug 24 09:24:51 2017 13 // Update Count : 16 14 14 // 15 15 … … 252 252 // I/O 253 253 static inline forall( dtype istype | istream( istype ) ) 254 istype * ?|?( istype * is, Int *mp ) {255 gmp_scanf( "%Zd", mp );254 istype * ?|?( istype * is, Int & mp ) { 255 gmp_scanf( "%Zd", &mp ); 256 256 return is; 257 257 } // ?|? -
src/libcfa/iostream
rddf8a29 rf676b84 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 9 16:42:47201713 // Update Count : 13 112 // Last Modified On : Thu Aug 24 08:14:29 2017 13 // Update Count : 133 14 14 // 15 15 … … 117 117 }; // readable 118 118 119 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, char *);119 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, char & ); 120 120 121 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, short int *);122 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned short int *);123 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, int *);124 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned int *);125 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long int *);126 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long long int *);127 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long int *);128 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long long int *);121 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, short int & ); 122 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned short int & ); 123 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, int & ); 124 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned int & ); 125 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long int & ); 126 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long long int & ); 127 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long int & ); 128 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long long int & ); 129 129 130 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float *);131 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double *);132 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double *);130 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float & ); 131 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double & ); 132 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double & ); 133 133 134 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float _Complex *);135 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double _Complex *);136 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double _Complex *);134 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float _Complex & ); 135 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double _Complex & ); 136 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double _Complex & ); 137 137 138 138 struct _Istream_cstrUC { char * s; }; -
src/libcfa/iostream.c
rddf8a29 rf676b84 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 9 16:46:51201713 // Update Count : 40 112 // Last Modified On : Thu Aug 24 08:41:53 2017 13 // Update Count : 405 14 14 // 15 15 … … 271 271 272 272 forall( dtype istype | istream( istype ) ) 273 istype * ?|?( istype * is, char *c ) {274 fmt( is, "%c", c );275 return is; 276 } // ?|? 277 278 forall( dtype istype | istream( istype ) ) 279 istype * ?|?( istype * is, short int *si ) {280 fmt( is, "%hd", si );281 return is; 282 } // ?|? 283 284 forall( dtype istype | istream( istype ) ) 285 istype * ?|?( istype * is, unsigned short int *usi ) {286 fmt( is, "%hu", usi );287 return is; 288 } // ?|? 289 290 forall( dtype istype | istream( istype ) ) 291 istype * ?|?( istype * is, int *i ) {292 fmt( is, "%d", i );293 return is; 294 } // ?|? 295 296 forall( dtype istype | istream( istype ) ) 297 istype * ?|?( istype * is, unsigned int *ui ) {298 fmt( is, "%u", ui );299 return is; 300 } // ?|? 301 302 forall( dtype istype | istream( istype ) ) 303 istype * ?|?( istype * is, long int *li ) {304 fmt( is, "%ld", li );305 return is; 306 } // ?|? 307 308 forall( dtype istype | istream( istype ) ) 309 istype * ?|?( istype * is, unsigned long int *ulli ) {310 fmt( is, "%lu", ulli );311 return is; 312 } // ?|? 313 314 forall( dtype istype | istream( istype ) ) 315 istype * ?|?( istype * is, long long int *lli ) {316 fmt( is, "%lld", lli );317 return is; 318 } // ?|? 319 320 forall( dtype istype | istream( istype ) ) 321 istype * ?|?( istype * is, unsigned long long int *ulli ) {322 fmt( is, "%llu", ulli );323 return is; 324 } // ?|? 325 326 327 forall( dtype istype | istream( istype ) ) 328 istype * ?|?( istype * is, float *f ) {329 fmt( is, "%f", f );330 return is; 331 } // ?|? 332 333 forall( dtype istype | istream( istype ) ) 334 istype * ?|?( istype * is, double *d ) {335 fmt( is, "%lf", d );336 return is; 337 } // ?|? 338 339 forall( dtype istype | istream( istype ) ) 340 istype * ?|?( istype * is, long double *ld ) {341 fmt( is, "%Lf", ld );342 return is; 343 } // ?|? 344 345 346 forall( dtype istype | istream( istype ) ) 347 istype * ?|?( istype * is, float _Complex *fc ) {273 istype * ?|?( istype * is, char & c ) { 274 fmt( is, "%c", &c ); // must pass pointer through varg to fmt 275 return is; 276 } // ?|? 277 278 forall( dtype istype | istream( istype ) ) 279 istype * ?|?( istype * is, short int & si ) { 280 fmt( is, "%hd", &si ); 281 return is; 282 } // ?|? 283 284 forall( dtype istype | istream( istype ) ) 285 istype * ?|?( istype * is, unsigned short int & usi ) { 286 fmt( is, "%hu", &usi ); 287 return is; 288 } // ?|? 289 290 forall( dtype istype | istream( istype ) ) 291 istype * ?|?( istype * is, int & i ) { 292 fmt( is, "%d", &i ); 293 return is; 294 } // ?|? 295 296 forall( dtype istype | istream( istype ) ) 297 istype * ?|?( istype * is, unsigned int & ui ) { 298 fmt( is, "%u", &ui ); 299 return is; 300 } // ?|? 301 302 forall( dtype istype | istream( istype ) ) 303 istype * ?|?( istype * is, long int & li ) { 304 fmt( is, "%ld", &li ); 305 return is; 306 } // ?|? 307 308 forall( dtype istype | istream( istype ) ) 309 istype * ?|?( istype * is, unsigned long int & ulli ) { 310 fmt( is, "%lu", &ulli ); 311 return is; 312 } // ?|? 313 314 forall( dtype istype | istream( istype ) ) 315 istype * ?|?( istype * is, long long int & lli ) { 316 fmt( is, "%lld", &lli ); 317 return is; 318 } // ?|? 319 320 forall( dtype istype | istream( istype ) ) 321 istype * ?|?( istype * is, unsigned long long int & ulli ) { 322 fmt( is, "%llu", &ulli ); 323 return is; 324 } // ?|? 325 326 327 forall( dtype istype | istream( istype ) ) 328 istype * ?|?( istype * is, float & f ) { 329 fmt( is, "%f", &f ); 330 return is; 331 } // ?|? 332 333 forall( dtype istype | istream( istype ) ) 334 istype * ?|?( istype * is, double & d ) { 335 fmt( is, "%lf", &d ); 336 return is; 337 } // ?|? 338 339 forall( dtype istype | istream( istype ) ) 340 istype * ?|?( istype * is, long double & ld ) { 341 fmt( is, "%Lf", &ld ); 342 return is; 343 } // ?|? 344 345 346 forall( dtype istype | istream( istype ) ) 347 istype * ?|?( istype * is, float _Complex & fc ) { 348 348 float re, im; 349 349 fmt( is, "%g%gi", &re, &im ); 350 *fc = re + im * _Complex_I;351 return is; 352 } // ?|? 353 354 forall( dtype istype | istream( istype ) ) 355 istype * ?|?( istype * is, double _Complex *dc ) {350 fc = re + im * _Complex_I; 351 return is; 352 } // ?|? 353 354 forall( dtype istype | istream( istype ) ) 355 istype * ?|?( istype * is, double _Complex & dc ) { 356 356 double re, im; 357 357 fmt( is, "%lf%lfi", &re, &im ); 358 *dc = re + im * _Complex_I;359 return is; 360 } // ?|? 361 362 forall( dtype istype | istream( istype ) ) 363 istype * ?|?( istype * is, long double _Complex *ldc ) {358 dc = re + im * _Complex_I; 359 return is; 360 } // ?|? 361 362 forall( dtype istype | istream( istype ) ) 363 istype * ?|?( istype * is, long double _Complex & ldc ) { 364 364 long double re, im; 365 365 fmt( is, "%Lf%Lfi", &re, &im ); 366 *ldc = re + im * _Complex_I;366 ldc = re + im * _Complex_I; 367 367 return is; 368 368 } // ?|? -
src/libcfa/rational
rddf8a29 rf676b84 12 12 // Created On : Wed Apr 6 17:56:25 2016 13 13 // Last Modified By : Peter A. Buhr 14 // Last Modified On : Fri Jul 7 09:34:33201715 // Update Count : 9 314 // Last Modified On : Wed Aug 23 22:35:09 2017 15 // Update Count : 95 16 16 // 17 17 … … 135 135 // I/O 136 136 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 137 forall( dtype istype | istream( istype ) | { istype * ?|?( istype *, RationalImpl *); } )138 istype * ?|?( istype *, Rational(RationalImpl) *);137 forall( dtype istype | istream( istype ) | { istype * ?|?( istype *, RationalImpl & ); } ) 138 istype * ?|?( istype *, Rational(RationalImpl) & ); 139 139 140 140 forall( otype RationalImpl | arithmetic( RationalImpl ) ) -
src/libcfa/rational.c
rddf8a29 rf676b84 10 10 // Created On : Wed Apr 6 17:54:28 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 16 18:35:36201713 // Update Count : 15 012 // Last Modified On : Wed Aug 23 22:38:48 2017 13 // Update Count : 154 14 14 // 15 15 … … 34 34 35 35 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 36 static RationalImpl simplify( RationalImpl * n, RationalImpl *d ) {37 if ( *d == (RationalImpl){0} ) {36 static RationalImpl simplify( RationalImpl & n, RationalImpl & d ) { 37 if ( d == (RationalImpl){0} ) { 38 38 serr | "Invalid rational number construction: denominator cannot be equal to 0." | endl; 39 39 exit( EXIT_FAILURE ); 40 40 } // exit 41 if ( *d < (RationalImpl){0} ) { *d = -*d; *n = -*n; }// move sign to numerator42 return gcd( abs( *n ), *d );// simplify41 if ( d < (RationalImpl){0} ) { d = -d; n = -n; } // move sign to numerator 42 return gcd( abs( n ), d ); // simplify 43 43 } // Rationalnumber::simplify 44 44 … … 58 58 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 59 59 void ?{}( Rational(RationalImpl) & r, RationalImpl n, RationalImpl d ) { 60 RationalImpl t = simplify( &n, &d );// simplify60 RationalImpl t = simplify( n, d ); // simplify 61 61 r.numerator = n / t; 62 62 r.denominator = d / t; … … 95 95 RationalImpl denominator( Rational(RationalImpl) r, RationalImpl d ) { 96 96 RationalImpl prev = r.denominator; 97 RationalImpl t = simplify( &r.numerator, &d ); // simplify97 RationalImpl t = simplify( r.numerator, d ); // simplify 98 98 r.numerator = r.numerator / t; 99 99 r.denominator = d / t; … … 228 228 229 229 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 230 forall( dtype istype | istream( istype ) | { istype * ?|?( istype *, RationalImpl *); } )231 istype * ?|?( istype * is, Rational(RationalImpl) *r ) {230 forall( dtype istype | istream( istype ) | { istype * ?|?( istype *, RationalImpl & ); } ) 231 istype * ?|?( istype * is, Rational(RationalImpl) & r ) { 232 232 RationalImpl t; 233 is | &(r->numerator) | &(r->denominator);234 t = simplify( &(r->numerator), &(r->denominator));235 r ->numerator /= t;236 r ->denominator /= t;233 is | r.numerator | r.denominator; 234 t = simplify( r.numerator, r.denominator ); 235 r.numerator /= t; 236 r.denominator /= t; 237 237 return is; 238 238 } // ?|? -
src/tests/.expect/gmp.txt
rddf8a29 rf676b84 27 27 16666666666666666666, 2 16666666666666666666, 2 28 28 x:16666666666666666666 y:2 29 30 12345678901234567890123456789 12345678901234567890123456789 12345678901234567890123456789 29 31 30 32 Fibonacci Numbers -
src/tests/fstream_test.c
rddf8a29 rf676b84 7 7 // fstream_test.c -- 8 8 // 9 // Author : Richard C. Bilson9 // Author : Peter A. Buhr 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 2 15:25:54 201613 // Update Count : 6 112 // Last Modified On : Thu Aug 24 11:30:26 2017 13 // Update Count : 65 14 14 // 15 15 … … 19 19 int nombre; 20 20 sout | "Entrez un nombre, s'il vous plaît:" | endl; 21 sin | &nombre; 22 sout | "Vous avez entré" | nombre | "stocké à l'adresse" | &nombre | endl; 23 sout | "nombre" | nombre | "est" 24 | (nombre > 0 ? "plus grand que" : nombre == 0 ? "égal à" : "moins de") 25 | "zéro" | endl; 21 sin | nombre; 22 sout | "Vous avez entré" | nombre | endl; 23 sout | "le nombre" | nombre | "est" 24 | (nombre > 0 ? "positif" : nombre == 0 ? "zéro" : "négatif") | endl; 26 25 27 26 sout | "Entrez trois nombres, s'il vous plaît: " | endl; 28 27 int i, j, k; 29 sin | &i | &j | &k;28 sin | i | j | k; 30 29 sout | "Vous avez entré" | "i:" | "" | i | "j:" | "" | j | "k:" | "" | k | endl; 31 30 } -
src/tests/gmp.c
rddf8a29 rf676b84 10 10 // Created On : Tue Apr 19 08:55:51 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 13 16:35:01201713 // Update Count : 54 112 // Last Modified On : Thu Aug 24 09:33:26 2017 13 // Update Count : 543 14 14 // 15 15 … … 70 70 sout | endl; 71 71 72 sin | x | y | z; 73 sout | x | y | z | endl; 74 75 sout | endl; 76 72 77 sout | "Fibonacci Numbers" | endl; 73 78 Int fn, fn1, fn2; -
src/tests/io.c
rddf8a29 rf676b84 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 6 23:26:12201713 // Update Count : 7 812 // Last Modified On : Wed Aug 23 21:27:50 2017 13 // Update Count : 79 14 14 // 15 15 … … 89 89 90 90 sout | "input bacis types" | endl; 91 &in | &c// character92 | &si | &usi | &i | &ui | &li | &uli | &lli | &ulli// integral93 | &f | &d | &ld // floating point94 | &fc | &dc | &ldc// floating-point complex91 &in | c // character 92 | si | usi | i | ui | li | uli | lli | ulli // integral 93 | f | d | ld // floating point 94 | fc | dc | ldc // floating-point complex 95 95 | cstr( s1 ) | cstr( s2, size ); // C string, length unchecked and checked 96 96 sout | endl; -
src/tests/rational.c
rddf8a29 rf676b84 10 10 // Created On : Mon Mar 28 08:43:12 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 17 15:46:35201713 // Update Count : 6 512 // Last Modified On : Wed Aug 23 21:40:11 2017 13 // Update Count : 66 14 14 // 15 15 … … 92 92 sout | x | endl; 93 93 94 sin | &a | &b;94 sin | a | b; 95 95 sout | a | b | endl; 96 96 } // main -
src/tests/test.py
rddf8a29 rf676b84 174 174 if make_ret == 0 : 175 175 # fetch optional input 176 stdinput = "< .in/%s.txt" % test.name if isfile(".in/%s.txt" % test. path) else ""176 stdinput = "< .in/%s.txt" % test.name if isfile(".in/%s.txt" % test.name) else "" 177 177 178 178 if fileIsExecutable(test.name) : -
src/tests/vector/vector_test.c
rddf8a29 rf676b84 9 9 // Author : Richard C. Bilson 10 10 // Created On : Wed May 27 17:56:53 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Wed Apr 27 17:31:27 201613 // Update Count : 1 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 24 08:15:38 2017 13 // Update Count : 19 14 14 // 15 15 … … 27 27 sout | "enter N elements and C-d on a separate line:" | endl; 28 28 for ( ;; ) { 29 sin | #29 sin | num; 30 30 if ( fail( sin ) || eof( sin ) ) break; 31 31 append( &vec, num );
Note: See TracChangeset
for help on using the changeset viewer.