Changes in / [509ec82:1c0a3a4]
- Files:
-
- 3 edited
-
libcfa/prelude/builtins.c (modified) (1 diff)
-
libcfa/src/enum.hfa (modified) (1 diff)
-
src/AST/Decl.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/builtins.c
r509ec82 r1c0a3a4 160 160 static inline quasi_void ?=?(quasi_void &, quasi_void & _src) { return _src; } 161 161 162 forall( E ) trait Bounded {163 E lowerBound(void);164 E upperBound(void);165 };166 167 forall( E | Bounded( E ) ) trait Serial {168 int fromInstance( E e );169 E fromInt_unsafe( int i );170 E succ_unsafe( E e );171 E pred_unsafe( E e );172 };173 174 forall( E | Serial( E ) ) {175 E fromInt( int i );176 E succ( E e );177 E pred( E e );178 int Countof( E );179 }180 181 182 forall( E ) trait CfaEnum {183 const char * label( E e );184 int posn( E e );185 };186 187 forall( E, V | CfaEnum( E ) ) trait TypedEnum {188 V value( E e );189 };190 191 162 // Local Variables: // 192 163 // mode: c // -
libcfa/src/enum.hfa
r509ec82 r1c0a3a4 2 2 3 3 #include "iostream.hfa" 4 5 forall( E ) trait Bounded { 6 E lowerBound(void); 7 E upperBound(void); 8 }; 9 10 forall( E | Bounded( E ) ) trait Serial { 11 int fromInstance( E e ); 12 E fromInt_unsafe( int i ); 13 E succ_unsafe( E e ); 14 E pred_unsafe( E e ); 15 }; 16 17 forall( E | Serial( E ) ) { 18 E fromInt( int i ); 19 E succ( E e ); 20 E pred( E e ); 21 int Countof( E ); 22 } 23 24 // forall( E | Bounded(E) ) trait SafeSerial { 25 // // unsigned fromInstance( E e ); 26 // E fromInt_unsafe( unsigned i ); 27 // // E succ_unsafe( E e ); 28 // //E pred_unsafe( E e ); 29 30 // unsigned fromInstance( E e ); 31 // E fromInt( unsigned i ); 32 // E succ( E e ); 33 // E pred( E e ); 34 // }; 35 36 forall( E ) trait CfaEnum { 37 const char * label( E e ); 38 int posn( E e ); 39 }; 40 41 forall( E, V | CfaEnum( E ) ) trait TypedEnum { 42 V value( E e ); 43 }; 44 45 // I/O 4 46 5 47 forall( istype & | istream( istype ), E | CfaEnum( E ) | Serial(E) ) -
src/AST/Decl.hpp
r509ec82 r1c0a3a4 74 74 bool isTypeFixed = false; 75 75 bool isHidden = false; 76 bool isMember = false;77 76 78 77 DeclWithType( const CodeLocation& loc, const std::string& name, Storage::Classes storage,
Note:
See TracChangeset
for help on using the changeset viewer.