Changeset f24733 in git
- Timestamp:
- Mar 15, 2011, 7:17:49 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 9e8da7ec659821d053dbf793a28c79fc2d851551
- Parents:
- 5cdbfef15d0014847a35358d543945451f68ff41
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/blackbox.cc
r5cdbfe rf24733 42 42 return NULL; 43 43 } 44 45 // Tok2Cmdname -> iiTwoOps 46 BOOLEAN WrongOp(const char* cmd, int op, leftv bb) 47 { 48 assume( bb->Typ() > MAX_TOK ); // it IS a blackbox type, right?! 49 50 if( op > 127 ) 51 Werror("'%s' of type %s(%d) for op %s(%d) not implemented", 52 cmd, 53 getBlackboxName(bb->Typ()),bb->Typ(), 54 iiTwoOps(op), op); 55 else 56 Werror("'%s' of type %s(%d) for op '%c' not implemented", 57 cmd, 58 getBlackboxName(bb->Typ()), bb->Typ(), 59 op); 60 61 return TRUE; 62 } 63 44 64 BOOLEAN blackboxDefaultOp1(int op,leftv l, leftv r) 45 65 { … … 50 70 return FALSE; 51 71 } 52 if (op<127) 53 Werror("blackbox_Op1 of type %s(%d) for op '%c' not implemented", 54 getBlackboxName(r->Typ()),r->Typ(),op); 55 else 56 Werror("blackbox_Op1 of type %s(%d) for op %s(%d) not implemented", 57 getBlackboxName(r->Typ()),r->Typ(),Tok2Cmdname(op),op); 58 return TRUE; 72 73 return WrongOp("blackbox_Op1", op, r); 59 74 } 75 60 76 BOOLEAN blackboxDefaultOp2(int op,leftv l, leftv r1, leftv r2) 61 77 { 62 if (op<127) 63 Werror("blackbox_Op2 of type %s(%d) for op '%c' not implemented", 64 getBlackboxName(r1->Typ()),r1->Typ(),op); 65 else 66 Werror("blackbox_Op2 of type %s(%d) for op %s(%d) not implemented", 67 getBlackboxName(r1->Typ()),r1->Typ(),Tok2Cmdname(op),op); 68 return TRUE; 78 return WrongOp("blackbox_Op2", op, r1); 69 79 } 80 70 81 BOOLEAN blackbox_default_Op3(int op,leftv l, leftv r1,leftv r2, leftv r3) 71 82 { 72 if (op<127) 73 Werror("blackbox_Op3 of type %s(%d) for op '%c' not implemented", 74 getBlackboxName(r1->Typ()),r1->Typ(),op); 75 else 76 Werror("blackbox_Op3 of type %s(%d) for op %s(%d) not implemented", 77 getBlackboxName(r1->Typ()),r1->Typ(),Tok2Cmdname(op),op); 78 return TRUE; 83 return WrongOp("blackbox_Op3", op, r1); 79 84 } 85 80 86 BOOLEAN blackbox_default_OpM(int op,leftv l, leftv r) 81 87 { 82 if (op<127) 83 Werror("blackbox_OpM of type %s(%d) for op '%c' not implemented", 84 getBlackboxName(r->Typ()),r->Typ(),op); 85 else 86 Werror("blackbox_OpM of type %s(%d) for op %s(%d) not implemented", 87 getBlackboxName(r->Typ()),r->Typ(),Tok2Cmdname(op),op); 88 return TRUE; 88 return WrongOp("blackbox_OpM", op, r); 89 89 } 90 90 -
Singular/blackbox.h
r5cdbfe rf24733 62 62 void printBlackboxTypes(); 63 63 64 /// Emit an "op not implemented" error message and return TRUE 65 BOOLEAN WrongOp(const char* cmd, int op, leftv bb); 66 64 67 #endif -
dyn_modules/bigintm/bigintm.cc
r5cdbfe rf24733 15 15 16 16 #define HAVE_BIGINTM 1 17 18 namespace 19 { 17 20 18 21 #ifdef HAVE_BIGINTM … … 85 88 } 86 89 87 // Tok2Cmdname88 static inline BOOLEAN WrongOp(const char* cmd, int op, leftv bb)89 {90 assume( bb->Typ() > MAX_TOK ); // it IS a blackbox type, right?!91 if( op > 127 )92 Werror("'%s' of type %s(%d) for op %s(%d) not implemented",93 cmd,94 getBlackboxName(bb->Typ()),bb->Typ(),95 iiTwoOps(op), op);96 else97 Werror("'%s' of type %s(%d) for op '%c' not implemented",98 cmd,99 getBlackboxName(bb->Typ()), bb->Typ(),100 op);101 102 }103 104 90 BOOLEAN bigintm_Op1(int op,leftv l, leftv r) 105 91 { … … 118 104 if( op=='(' ) // <bigintm> VAR(); 119 105 { 120 Werror("bigintm_Op1: What d uyou mean by '<bigintm>()'?!");106 Werror("bigintm_Op1: What do you mean by '<bigintm>()'?!"); 121 107 return TRUE; 122 108 } 123 109 124 WrongOp("bigintm_Op1", op, r);125 110 return blackboxDefaultOp1(op, l, r); 126 111 } … … 159 144 160 145 Werror("bigintm_Op2: Op: '+': Sorry unsupported 2nd argument-type: %s in", Tok2Cmdname(a2->Typ())); 161 WrongOp("bigintm_Op2", op, a1); 162 return TRUE; 146 return WrongOp("bigintm_Op2", op, a1); 163 147 } 164 148 … … 286 270 case '(' : // <bigintm> VAR(b,...); 287 271 { 288 Werror("bigintm_OpM: What d uyou mean by '<bigintm>(...)'?!");272 Werror("bigintm_OpM: What do you mean by '<bigintm>(...)'?!"); 289 273 return TRUE; 290 274 } … … 308 292 #endif 309 293 310 311 294 }; 312 295 313 296 // this is only a demo -
dyn_modules/bigintm/mod_main.cc
r5cdbfe rf24733 15 15 #include "bigintm.h" 16 16 17 namespace 18 { 17 19 18 20 static inline void NoReturn(leftv& res) … … 24 26 25 27 /// listing all blackbox types (debug stuff) 26 BOOLEAN printBlackboxTypes0(leftv __res, leftv __v)28 static BOOLEAN printBlackboxTypes0(leftv __res, leftv __v) 27 29 { 28 30 NoReturn(__res); … … 32 34 33 35 /// init the bigintm (a sample blackbox) type 34 BOOLEAN bigintm_setup0(leftv __res, leftv __v)36 static BOOLEAN bigintm_setup0(leftv __res, leftv __v) 35 37 { 36 38 NoReturn(__res); … … 41 43 42 44 /// init the bigintm (a sample blackbox) type 43 BOOLEAN print_load_counter(leftv __res, leftv __v)45 static BOOLEAN print_load_counter(leftv __res, leftv __v) 44 46 { 45 47 Print("print_load_counter: load counter: %ld", load_counter); … … 51 53 return FALSE; 52 54 } 55 56 }; 53 57 54 58
Note: See TracChangeset
for help on using the changeset viewer.