Changeset 6803ff1 for libcfa/src
- Timestamp:
- Jun 25, 2024, 12:09:43 PM (16 months ago)
- Branches:
- master
- Children:
- d96d4f0
- Parents:
- f3b67b6 (diff), 5eb3f65 (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:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/enum.cfa
rf3b67b6 r6803ff1 6 6 forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V)) 7 7 ostype & ?|?(ostype& os, E e) { 8 return os | type_name(e) | "." | label E(e);8 return os | type_name(e) | "." | label(e); 9 9 } 10 10 11 11 forall(ostype & | basic_ostream(ostype), E| CfaEnum(E, quasi_void)) 12 12 ostype & ?|?(ostype& os, E e) { 13 return os | type_name(e) | "." | label E(e);13 return os | type_name(e) | "." | label(e); 14 14 } 15 15 16 16 forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V)) { 17 int ?==?(E l, E r) { return pos E(l) == posE(r); }18 int ?<=?(E l, E r) { return pos E(l) <= posE(r); }19 int ?>=?(E l, E r) { return pos E(l) >= posE(r); }20 int ?<?(E l, E r) { return pos E(l) < posE(r); }21 int ?>?(E l, E r) { return pos E(l) > posE(r); }17 int ?==?(E l, E r) { return posn(l) == posn(r); } 18 int ?<=?(E l, E r) { return posn(l) <= posn(r); } 19 int ?>=?(E l, E r) { return posn(l) >= posn(r); } 20 int ?<?(E l, E r) { return posn(l) < posn(r); } 21 int ?>?(E l, E r) { return posn(l) > posn(r); } 22 22 } -
libcfa/src/enum.hfa
rf3b67b6 r6803ff1 17 17 // Design one 18 18 forall(E, V | Serial(E)) trait CfaEnum { 19 char * labelE(E e);20 unsigned int pos E(E e);21 V value E(E e);22 char * type_name(E e);19 char * label(E e); 20 unsigned int posn(E e); 21 V value(E e); 22 char * type_name(E e); 23 23 }; 24 24 25 forall(ostype & | basic_ostream(ostype), E, V | CfaEnum(E, V))25 forall(ostype & | basic_ostream(ostype), E, V | CfaEnum(E, V)) 26 26 ostype & ?|?(ostype&, E); 27 27 … … 31 31 // Design two <- should go for this if we have change the cost model 32 32 // forall(E | Serial(E)) trait CfaEnum { 33 // char * labelE(E e);34 // unsigned int pos E(E e);33 // char * label(E e); 34 // unsigned int posn(E e); 35 35 // }; 36 36 37 37 // forall(E, V| CfaEnum(E)) trait TypedEnum { 38 // V value E(E e);38 // V value(E e); 39 39 // }; 40 40
Note:
See TracChangeset
for help on using the changeset viewer.