Changes in libcfa/src/enum.cfa [c333ed2:c5c123f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/enum.cfa
rc333ed2 rc5c123f 1 #include "enum.hfa"2 #include "fstream.hfa"3 4 forall(E, T| TypedEnum(E, T)) {5 // constructors6 7 // comparison8 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 removed17 // #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.