1 /* Loglan82 Compiler&Interpreter
2 Copyright (C) 1993 Institute of Informatics, University of Warsaw
3 Copyright (C) 1993, 1994 LITA, Pau
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
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.
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.
19 contacts: Andrzej.Salwicki@univ-pau.fr
22 LITA Departement d'Informatique
24 Avenue de l'Universite
26 tel. ++33 59923154 fax. ++33 59841696
28 =======================================================================
41 * \defgroup AppetitesOfValues Appetites of values
44 /** integer,boolean,string,char */
48 #define APREAL sizeof(real)/sizeof(word)
51 * To tell apart a virtual address
52 * (any reference type) from any other type
56 /** actual size of reference type */
59 /** formal type value */
62 /** formal procedure or function value, = apref + 1 */
65 #define APOPCODE (sizeof(extopcode) + sizeof(word) - 1) / sizeof(word)
73 /* In Qt4 these 2 definitions are already made */
83 /* Values identifying types and formal parameters: */
86 #define FORMFUNC 7 /* parameter "function" */
87 #define FORMPROC 8 /* parameter "procedure" */
88 #define FORMTYPE 9 /* parameter "type", also formal type */
89 #define PARIN 11 /* parameter "input" */
90 #define PAROUT 12 /* parameter "output" */
91 #define PARINOUT 16 /* parameter "inout" */
92 #define PUREPROCESS 13 /* type PROCESS */
93 #define PURECOROUTINE 14 /* type COROUTINE */
94 #define PRIMITIVETYPE 15 /* simple type */
95 #define CLASSTYPE 17 /* class type */
96 #define FILETYPE 18 /* file type */
99 /* Values to identify kinds of array elements : */
101 #define AINT -1 /* arrayof integer */
102 #define AREAL -3 /* arrayof real */
103 #define AVIRT -2 /* arrayof reference */
104 #define APROCESS -4 /* process reference implemented as arrayof */
105 #define FILEOBJECT -11 /* file object */
106 #define SKILLED -99 /* killed object, only for compactification */
110 #define DUMMY -1 /* dummy unit or prefix : SL for main block */
111 #define MAINBLOCK 0 /* main block prototype number */
112 #define MAXPROT 500 /* limit for the number of prototypes */
115 /* L-code instruction addressing modes : */
117 #define GLOBAL 0 /* M[ N ] */
118 #define LOCAL 1 /* M[ c1+N ] */
119 #define TEMPLOCAL 2 /* M[ c2+N ] */
120 #define REMOTE 3 /* M[ M[ K ]+N ] */
121 #define INDIRECT 4 /* M[ M[ N ] ] */
122 #define IMMEDIATE 5 /* N */
123 #define CONSTANT 6 /* M[ N ] */
124 #define DOTACCESS 7 /* M[ M[ display+K ]+N ] */
125 #define NOARGUMENT 8 /* ------ */
129 /* Prototype kind : */
143 #define LRECORD RECORD
144 #define LFUNCTION FUNCTION
145 #define LPROCEDURE PROCEDURE
150 typedef int protaddr; /* mainblock..maxprot ; mainblock = 0; */
151 /* INDIRECT ADDRESS OF PROTOTYPE */
152 typedef int dprotaddr; /* PROTADDR + DUMMY */
153 typedef int protkind;
156 #define dprotaddr int
160 /* TODO: Conditionally restore it:*/
165 * \defgroup Prototype Prototype
170 * Prototype of syntactic father
171 * or dummy for the main block
173 dprotaddr slprototype;
175 /** address of code */
177 /** object's total length */
180 * distance from beginning of object to
181 * temporary reference variables
185 /** beginning and length of table with */
189 * offsets of reference values in object;
190 * without SL, DL, CL and temporary values
193 /** beginning and length of table with */
195 /** offsets of parameters */
198 /** beginning and length of table with */
200 /** prototype numbers of prefix sequence */
203 /** lastwill code address */
205 /** list of handlers, 0 if empty */
208 * address of table for conversion:
209 * virtual number --> prototype
214 * only for processes:
217 /** lowest procedure prototype number */
219 /** size of RPC mask for that process */
224 * for procedures and functions
225 * \defgroup PrototypeForFunctions
228 /* virtual number or -1 if not virtual */
234 * \defgroup PrototypeForAll
242 * only for procedures, functions and processes:
243 * \defgroup PrototypeForProceduresFunctionsProcesses
246 /** address of table with parameters descr. addresses */
251 * only for functions:
252 * \defgroup PrototypeForFunctions
260 } protdescr,*pointprdsc;
264 #endif /* __GENINT_H */