| 1 |
#ifndef _ALTINFO_H_ |
| 2 |
#define _ALTINFO_H_ |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include "types.h" |
| 10 |
#include "acode.h" |
| 11 |
#include "params.h" |
| 12 |
#include "ParameterPosition.h" |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#define GLOBAL_LEVEL (0) |
| 18 |
#define LOCATION_LEVEL (1) |
| 19 |
#define PARAMETER_LEVEL (2) |
| 20 |
|
| 21 |
#define NO_PARAMETER ((Aword)-1) |
| 22 |
#define NO_INSTANCE ((Aword)-1) |
| 23 |
#define NO_CLASS ((Aword)-1) |
| 24 |
|
| 25 |
|
| 26 |
#define EXECUTE_CHECK_BODY_ON_FAIL true |
| 27 |
#define DONT_EXECUTE_CHECK_BODY_ON_FAIL false |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
typedef struct AltInfo { |
| 33 |
bool end; |
| 34 |
AltEntry *alt; |
| 35 |
bool done; |
| 36 |
Aint level; |
| 37 |
Aid class; |
| 38 |
Aid instance; |
| 39 |
|
| 40 |
Aid parameter; |
| 41 |
} AltInfo; |
| 42 |
|
| 43 |
typedef AltEntry *(*AltEntryFinder)(int verb, int parameterNumber, int theInstance, int theClass); |
| 44 |
|
| 45 |
typedef AltInfo AltInfoArray[]; |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
extern void primeAltInfo(AltInfo *altInfo, int level, int parameter, int instance, int class); |
| 54 |
extern bool executedOk(AltInfo *altInfo); |
| 55 |
extern bool checkFailed(AltInfo *altInfo, bool execute); |
| 56 |
extern bool canBeExecuted(AltInfo *altInfo); |
| 57 |
extern AltInfo *duplicateAltInfoArray(AltInfoArray altInfos); |
| 58 |
extern int lastAltInfoIndex(AltInfoArray altInfos); |
| 59 |
extern bool anyCheckFailed(AltInfoArray altInfos, bool execute); |
| 60 |
extern bool anythingToExecute(AltInfoArray altInfos); |
| 61 |
extern bool possible(int verb, Parameter parameters[], ParameterPosition parameterPositions[]); |
| 62 |
extern AltInfo *findAllAlternatives(int verb, Parameter parameters[]); |
| 63 |
|
| 64 |
#endif |