OSDN Git Service

Initial Update.
[bcpl-language/BCPL.git] / compiler / bcpl.h
1 /*
2  *
3  */
4
5
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <malloc.h>
10
11
12 #define MAX_STRING_LENGTH       255
13 #define MAX_TAG                 10
14
15 struct symbol
16 {
17   int           type;
18   struct symbol *hash;
19   int           length;
20   char          *value;
21 };
22
23
24 struct string
25 {
26   int           type;
27   int           length;
28   char          *value;
29 };
30
31
32 struct character
33 {
34   int           type;
35   int           value;
36 };
37
38
39 struct number
40 {
41   int           type;
42   int           value;
43 };
44
45
46 struct node
47 {
48   int           type;
49   void          *head;
50   void          *body;
51   void          *next;
52 };
53
54
55 #define OP_MANIFEST             1
56 #define OP_CONST                2
57 #define OP_DECLARE              3
58 #define OP_GLOBAL               4
59 #define OP_EXPR                 5
60 #define OP_PLUSOP               6
61 #define OP_SUBOP                7
62 #define OP_FUNCTION             8
63 #define OP_ARGS                 9
64 #define OP_STATEMENT            10
65 #define OP_PROCEDURE            11
66 #define OP_CALL                 12
67 #define OP_VALOF                13
68 #define OP_RETURN               14
69 #define OP_VARIABLE             15
70 #define OP_CONST_LIST           16
71 #define OP_INITIALVAR           17
72 #define OP_IF                   18
73 #define OP_WHILE                19
74 #define OP_SET                  20      /* ÂåÆþ */
75 #define OP_STATIC               21
76 #define OP_MULTOP               22
77 #define OP_DIVOP                23
78 #define OP_LT                   24
79 #define OP_GT                   25
80 #define OP_OR                   26
81 #define OP_AND                  27
82 #define OP_EQUAL                28
83 #define OP_VECIS                29      /* ! */
84 #define OP_SWITCHON             30
85 #define OP_CASE                 31
86 #define OP_GE                   32
87 #define OP_LE                   33
88 #define OP_REPEATUNTIL          34
89 #define OP_CASECONT             35
90 #define OP_GET                  36
91 #define OP_BLOCK                37
92
93
94 extern struct symbol    *make_symbol ();
95 extern struct string    *make_string ();
96 extern struct node      *make_node ();
97 extern struct number    *make_number ();
98
99 extern void             debug_print ();
100
101 extern int              nlcount;