- Timestamp:
- Jul 11, 2024, 3:04:34 PM (4 months ago)
- Branches:
- master
- Children:
- 9c447e2
- Parents:
- 9d5eacb
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/enum.cfa
r9d5eacb r236f133 10 10 } // scmp 11 11 12 forall( istype & | istream( istype ), E , V | CfaEnum( E, V) )12 forall( istype & | istream( istype ), E | CfaEnum( E ) ) 13 13 istype & ?|?( istype & is, E & e ) { 14 14 // printf( "here0\n" ); … … 70 70 } 71 71 72 forall( ostype & | ostream( ostype ), E, V | CfaEnum( E, V ) ) { 72 // forall( ostype & | ostream( ostype ), E | CfaEnum( E, quasi_void ) ) { 73 // ostype & ?|?( ostype & os, E e ) { 74 // return os | label( e ); 75 // } 76 // OSTYPE_VOID_IMPL( E ) 77 // } 78 79 forall( ostype & | ostream( ostype ), E | CfaEnum( E ) ) { 73 80 ostype & ?|?( ostype & os, E e ) { 74 81 return os | label( e ); … … 77 84 } 78 85 79 forall( ostype & | ostream( ostype ), E | CfaEnum( E, quasi_void ) ) { 80 ostype & ?|?( ostype & os, E e ) { 81 return os | label( e ); 82 } 83 OSTYPE_VOID_IMPL( E ) 84 } 86 // -
libcfa/src/enum.hfa
r9d5eacb r236f133 15 15 }; 16 16 17 // Design one 18 forall( E, V | Serial( E ) ) trait CfaEnum { 17 forall( E | Serial( E ) ) trait CfaEnum { 19 18 const char * label( E e ); 20 19 unsigned int posn( E e ); 20 }; 21 22 forall( E, V | CfaEnum( E ) ) trait TypedEnum { 21 23 V value( E e ); 22 24 }; … … 24 26 // I/O 25 27 26 forall( istype & | istream( istype ), E , V | CfaEnum( E, V) )28 forall( istype & | istream( istype ), E | CfaEnum( E ) ) 27 29 istype & ?|?( istype &, E & ); 28 30 29 forall( ostype & | ostream( ostype ), E , V | CfaEnum( E, V) ) {31 forall( ostype & | ostream( ostype ), E | CfaEnum( E ) ) { 30 32 ostype & ?|?( ostype &, E ); 31 33 OSTYPE_VOID( E ); 32 34 } 33 35 34 forall( ostype & | ostream( ostype ), E | CfaEnum( E, quasi_void ) ) {35 ostype & ?|?( ostype &, E );36 OSTYPE_VOID( E );37 }36 // forall( ostype & | ostream( ostype ), E | CfaEnum( E, quasi_void ) ) { 37 // ostype & ?|?( ostype &, E ); 38 // OSTYPE_VOID( E ); 39 // } 38 40 39 41 // Design two <- should go for this if we have change the cost model … … 48 50 49 51 static inline 50 forall( E , V | CfaEnum( E, V) ) {52 forall( E | CfaEnum( E ) ) { 51 53 int ?==?( E l, E r ) { return posn( l ) == posn( r ); } // relational operators 52 54 int ?!=?( E l, E r ) { return posn( l ) != posn( r ); }
Note: See TracChangeset
for help on using the changeset viewer.