Ignore:
Timestamp:
May 7, 2024, 7:04:17 PM (2 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
0b6c1c9
Parents:
164a6b6
Message:

Remove intermeidate type (enum attribute type); remove replacePseudoFunc (has been migrated to resolver)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/enum.cfa

    r164a6b6 rc333ed2  
     1#include "enum.hfa"
     2#include "fstream.hfa"
     3
     4forall(E, T| TypedEnum(E, T)) {
     5    // constructors
     6
     7    // comparison
     8    int ?==?(E l, E r) { return posE(l) == posE(r); }
     9    int ?!=?(E l, E r) { return !(l == r); }
     10    int ?!=?(E l, zero_t) { return !( posE(l) == 0 ); }
     11    int ?<?(E l, E r) { return posE(l) < posE(r); }
     12    int ?<=?(E l, E r) { return posE(l) <= posE(r); }
     13    int ?>?(E l, E r) { return posE(l) > posE(r); }
     14    int ?>=?(E l, E r) {  return posE(l) >= posE(r); }
     15
     16    // for testing; To be removed
     17    // #include <string.h>
     18    char * typeEnumString(E e) {
     19        // char* out = malloc(sizeof(char) * (5 + strlen(labelE(e) + 1)));
     20        // return strcat(strcat(out, "Enum "), labelE(e));
     21        return labelE(e);
     22    }
     23}
Note: See TracChangeset for help on using the changeset viewer.