aboutsummaryrefslogtreecommitdiffstats
path: root/asmitree.h
blob: 511447b5dc0bad31381fc2fc586aa6b8e98f8760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* asmitree.h */
/*****************************************************************************/
/* AS-Portierung                                                             */
/*                                                                           */
/* Opcode-Abfrage als Binaerbaum                                             */
/*                                                                           */
/* Historie: 30.10.1996 Grundsteinlegung                                     */
/*            6.12.1998 dynamische Variante                                  */
/*                                                                           */
/*****************************************************************************/

typedef void (*InstProc)(
#ifdef __PROTOS__
Word Index
#endif
);
typedef struct _TInstTreeNode
         { 
          struct _TInstTreeNode *Left,*Right;
          InstProc Proc;
          char *Name;
          Word Index;
          ShortInt Balance;
         } TInstTreeNode,*PInstTreeNode;

typedef struct _TInstTableEntry
         {
          InstProc Proc;
          char *Name;
          Word Index;
          int Coll;
         }
        TInstTableEntry,*PInstTableEntry;

typedef struct
         {
          int Fill,Size;
          Boolean Dynamic;
          PInstTableEntry Entries;
         } TInstTable,*PInstTable;

extern void AddInstTree(PInstTreeNode *Root, char *NName, InstProc NProc, Word NIndex);

extern void ClearInstTree(PInstTreeNode *Root);

extern Boolean SearchInstTree(PInstTreeNode Root, char *OpPart);

extern void PrintInstTree(PInstTreeNode Root);


extern PInstTable CreateInstTable(int TableSize);

extern void SetDynamicInstTable(PInstTable Table);

extern void DestroyInstTable(PInstTable tab);

extern void AddInstTable(PInstTable tab, char *Name, Word Index, InstProc Proc);

extern void RemoveInstTable(PInstTable tab, char *Name);

extern Boolean LookupInstTable(PInstTable tab, char *Name);

extern void PrintInstTable(FILE *stream, PInstTable tab);

extern void asmitree_init(void);