Ignore:
Timestamp:
Jun 25, 2024, 10:53:13 PM (5 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
55ba259e, d3aa55e9
Parents:
343c8be
Message:

first attempt at updating enum auxiliary operations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/enum.cfa

    r343c8be rd5efcb7  
    44#pragma GCC visibility push(default)
    55
    6 forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V))
    7 ostype & ?|?(ostype& os, E e) {
    8     return os | type_name(e) | "." | label(e);
     6forall( ostype & | basic_ostream(ostype), E, V | CfaEnum(E, V) ) {
     7        ostype & ?|?( ostype& os, E e ) {
     8//              if ( scoped( e ) ) os | type_name( e ) | '.' | nonl;
     9                return os | label( e );
     10        }
     11        OSTYPE_VOID_IMPL( E )
    912}
    1013
    11 forall(ostype & | basic_ostream(ostype), E| CfaEnum(E, quasi_void))
    12 ostype & ?|?(ostype& os, E e) {
    13     return os | type_name(e) | "." | label(e);
     14// forall( ostype & | basic_ostream(ostype), E | CfaEnum(E, quasi_void) )
     15// ostype & ?|?( ostype & os, E e ) {
     16// //    return os | type_name(e) | "." | label(e);
     17//     return os | label( e );
     18// }
     19
     20forall( E, V | CfaEnum(E, V) ) {                                                // relational operators
     21    int ?==?(E l, E r) { return posn(l) == posn(r); }
     22    int ?!=?(E l, E r) { return posn(l) != posn(r); }
     23    int ?<?(E l, E r) { return posn(l) < posn(r); }
     24    int ?<=?(E l, E r) { return posn(l) <= posn(r); }
     25    int ?>?(E l, E r) { return posn(l) > posn(r); }
     26    int ?>=?(E l, E r) { return posn(l) >= posn(r); }
    1427}
    15 
    16 forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V)) {
    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 }
Note: See TracChangeset for help on using the changeset viewer.