Debian Codegraph @

terps/alan3/AltInfo.h

raw symbols SCIP
1 #ifndef _ALTINFO_H_
2 #define _ALTINFO_H_
3 /*----------------------------------------------------------------------*\
4
5 An info node about the Verb Alternatives found and possibly executed
6
7 \*----------------------------------------------------------------------*/
8
9 #include "types.h"
10 #include "acode.h"
11 #include "params.h"
12 #include "ParameterPosition.h"
13
14
15 /* Constants */
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 /* tryCheck() flags */
26 #define EXECUTE_CHECK_BODY_ON_FAIL true
27 #define DONT_EXECUTE_CHECK_BODY_ON_FAIL false
28
29
30 /* Types */
31
32 typedef struct AltInfo {
33 bool end; /* Indicator of end in AltInfoArray, first empty has TRUE here */
34 AltEntry *alt;
35 bool done;
36 Aint level; /* 0 - Global, 1 - location, 2 - parameter */
37 Aid class; /* In which class, only used for tracing */
38 Aid instance; /* In which instance the Alternative was found,
39 used to set current.instance and tracing */
40 Aid parameter; /* In which parameter, only used for tracing */
41 } AltInfo;
42
43 typedef AltEntry *(*AltEntryFinder)(int verb, int parameterNumber, int theInstance, int theClass);
44
45 typedef AltInfo AltInfoArray[];
46
47
48
49 /* Data */
50
51
52 /* Functions */
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