Changeset 5eb3f65 for libcfa/src


Ignore:
Timestamp:
Jun 24, 2024, 11:06:35 PM (12 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
089b39e1, 6803ff1
Parents:
253d0b4
Message:

change enumeration function names labelE, valueE, posE to label, value, posn

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/enum.cfa

    r253d0b4 r5eb3f65  
    66forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V))
    77ostype & ?|?(ostype& os, E e) {
    8     return os | type_name(e) | "." | labelE(e);
     8    return os | type_name(e) | "." | label(e);
    99}
    1010
    1111forall(ostype & | basic_ostream(ostype), E| CfaEnum(E, quasi_void))
    1212ostype & ?|?(ostype& os, E e) {
    13     return os | type_name(e) | "." | labelE(e);
     13    return os | type_name(e) | "." | label(e);
    1414}
    1515
    1616forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V)) {
    17     int ?==?(E l, E r) { return posE(l) == posE(r); }
    18     int ?<=?(E l, E r) { return posE(l) <= posE(r); }
    19     int ?>=?(E l, E r) { return posE(l) >= posE(r); }
    20     int ?<?(E l, E r) { return posE(l) < posE(r); }
    21     int ?>?(E l, E r) { return posE(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); }
    2222}
  • libcfa/src/enum.hfa

    r253d0b4 r5eb3f65  
    1717// Design one
    1818forall(E, V | Serial(E)) trait CfaEnum {
    19     char* labelE(E e);
    20     unsigned int posE(E e);
    21     V valueE(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);
    2323};
    2424
    25 forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V))
     25forall(ostype & | basic_ostream(ostype), E, V | CfaEnum(E, V))
    2626ostype & ?|?(ostype&, E);
    2727
     
    3131// Design two <- should go for this if we have change the cost model
    3232// forall(E | Serial(E)) trait CfaEnum {
    33 //     char* labelE(E e);
    34 //     unsigned int posE(E e);
     33//     char * label(E e);
     34//     unsigned int posn(E e);
    3535// };
    3636
    3737// forall(E, V| CfaEnum(E)) trait TypedEnum {
    38 //     V valueE(E e);
     38//     V value(E e);
    3939// };
    4040
Note: See TracChangeset for help on using the changeset viewer.