1 /* $Id: $ */
2 
3 /* Copyright (C) 1998 Sverre Hvammen Johansen,
4  * Department of Informatics, University of Oslo.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
18 
19 void mbuilderInit();
20 void mout();
21 void moutIval();
22 void moutRval();
23 void moutTval();
24 void moutId();
25 void mbuilderReinit();
26 int min();
27 long minIval();
28 double minRval();
29 char *minTval();
30 char *minId();
31 
32 extern char *mpointer;
33 
34 
35 /* De forskjellige tokens som legges ut i pass 1
36  * og som skal leses inn av pass 2
37  * Alle opperatorer i uttrykk  legges ut postfix
38  * Uttrykk f�r et utvidet begrep i pass 2
39  *
40  * Setntokens   uten   id:       1 - 33
41  * Setntokens   med    id:      35 - 39
42  *
43  * Exprtokens med  id/val:      40 - 48
44  * Exprtokens uten id/val:      49 - ->
45  * Exprtokens       bin�r:      50 - 98
46  * Error som  yacc sender:        127
47  * Newline som lex sender:         0
48  * Filslutt   ->  ferdige:        - 1 */
49 
50 
51 #define setntokens(t) (t<=39)
52 #define exprvaltokens(t) (t>=40 && t<=44)
53 #define expridtokens(t) ((t>=45 && t<=48) || t==81 || t==135)
54 
55 #define MERROR   127
56 #define MNEWLINE 0
57 #define MSTOP    -1
58 
59 #define MBLOCK          1
60 #define MENDBLOCK       2
61 
62 #define MPRBLOCK        3
63 #define MENDPRBLOCK     4
64 
65 #define MPROCEDURE      5
66 #define MENDPROCEDURE   6
67 
68 #define MCLASS          7
69 #define MENDCLASS       8
70 
71 #define MINSPECT        9
72 #define MENDINSPECT     11
73 #define MDO             12
74 #define MENDDO          13
75 #define MWHEN           35	/* id */
76 #define MENDWHEN        14
77 #define MOTHERWISE      15
78 #define MENDOTHERWISE   16
79 
80 #define MFOR                    85
81 #define MFORR                   86
82 #define MLISTSEP                50
83 #define MFORWHILE               51
84 #define MSTEP                   52
85 #define MUNTIL                  53
86 #define MFORDO          17
87 #define MENDFOR         18
88 
89 #define MWHILE          19
90 #define MENDWHILE       21
91 
92 #define MIF             22
93 #define MELSE           24
94 #define MENDIF          25
95 
96 #define MGOTO           26
97 
98 #define MINNER          28
99 
100 #define MSWITCH                 87
101 #define MSWITCHSEP              83
102 #define MENDSWITCH      29
103 
104 #define MASSIGN                 84
105 #define MASSIGNR                91
106 #define MENDASSIGN      30
107 
108 #define MARRAY                  88
109 #define MARRAYSEP               89
110 #define MENDARRAY       31
111 #define MBOUNDPARSEP            54
112 #define MBOUNDSEP               55
113 
114 #define MENDLABEL       32
115 #define MCONST          34
116 #define MIFE                    56
117 #define MELSEE                  57
118 
119 #define MORELSEE                 58
120 #define MANDTHENE                59
121 #define MEQV                    60
122 #define MIMP                    61
123 #define MOR                     62
124 #define MAND                    63
125 #define MNOT                            100
126 
127 #define MEQ                     64
128 #define MNE                     65
129 #define MLT                     66
130 #define MLE                     67
131 #define MGT                     68
132 #define MGE                     69
133 
134 #define MNER                    70
135 #define MEQR                    71
136 
137 #define MIS                     72
138 #define MINS                    73
139 
140 #define MUADD                           101
141 #define MUSUB                           102
142 #define MADD                    74
143 #define MSUB                    75
144 #define MMUL                    76
145 #define MDIV                    77
146 #define MINTDIV                 78
147 #define MPRIMARY                79
148 
149 #define MNOOP                           103
150 
151 #define MTEXTKONST              40	/* val */
152 #define MCHARACTERKONST         41	/* val */
153 #define MREALKONST              42	/* val */
154 #define MINTEGERKONST           43	/* val */
155 #define MBOOLEANKONST           44	/* val */
156 #define MNONE                   49
157 
158 #define MIDENTIFIER             45	/* id */
159 #define MTHIS                   46	/* id */
160 #define MDOT                    80
161 #define MNEWARG                 47	/* id */
162 #define MQUA                    48	/* id */
163 
164 #define MARGUMENT               81
165 #define MARGUMENTSEP            82
166 
167 #define MENDSEP                 90
168 
169 
170 #define MPROCARG        105
171 #define MARRAYARG       106
172 
173 #define MREFASSIGNT     107
174 
175 
176 #define MEQT            108
177 #define MNET            109
178 #define MLTT            110
179 #define MLET            111
180 #define MGTT            112
181 #define MGET            113
182 
183 #define MNERT           114
184 #define MEQRT           115
185 
186 #define MUADDI          116
187 #define MUSUBI          117
188 
189 #define MADDI           118
190 #define MSUBI           119
191 #define MMULI           120
192 
193 #define MPRIMARYII      121
194 #define MPRIMARYRI      122
195 
196 #define MQUANOTNONE     123
197 #define MQUANONEAND     124
198 
199 #define MREAINT         125
200 #define MINTREA         126
201 
202 #define MSTACK                128
203 
204 #define MARRAYADR       131
205 #define MDOTARRAYADR    132
206 #define MVALASSIGNT     133
207 #define MTEXTADR        134
208 #define MLABEL          135
209 #define MCONC           136
210 #define MDOTCONST	137
211 #define MNAMEADR        138
212 #define MPROCASSIGN	139
213 
214 #define MFLAG		99
215 #define MNONETEST	2
216 #define MINDEXTEST	4
217 #define MSTRIPSIDEEFFECTS 6
218 
219 #define MMODULE		140
220 #define MTHEN		141
221 
222 #define MENDDECL	142
223 #define MENTRY		143
224 #define MBLOCKENTRY	144
225 #define MPROCEDUREENTRY	145
226 
227 #define MSL		146
228 #define MSENTCONC	147
229 #define MINSTRONGEST    148
230 #define MEXITARGUMENT   149
231 #define MASSIGND        150
232 #define MNAMEREADTEXT   151
233 #define MNAMEREADACESS  152
234 #define MNAMEWRITEACESS 153
235 #define MORELSE         154
236 #define MANDTHEN        155
237 #define MTHUNKSIMPLEADDRESS	156
238 #define MTHUNKSIMPLEVALUE	157
239 #define MTHUNKLABLE	158
240 #define MTHUNKARRAY	159
241 #define MTHUNKPROCEDURE	160
242 #define MGOTOSTOP      	161
243 #define MSIGNDX         162
244 #define MSIGNDI         163
245 #define MSIGNDR         164
246 #define MASSIGNADD      165
247 #define MSENDADDRESSTHUNKTOFORMALPAR	166
248 #define MSENDVALUETHUNKTOFORMALPAR	167
249