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 =======================================================================
45 * \defgroup AppetitesOfValues Appetites of values
48 /** integer,boolean,string,char */
52 #define APREAL sizeof(real)/sizeof(word)
55 * To tell apart a virtual address
56 * (any reference type) from any other type
60 /** actual size of reference type */
63 /** formal type value */
66 /** formal procedure or function value, = apref + 1 */
69 #define APOPCODE (sizeof(extopcode) + sizeof(word) - 1) / sizeof(word)
77 /* In Qt4 these 2 definitions are already made */
87 /* Values identifying types and formal parameters: */
90 #define FORMFUNC 7 /* parameter "function" */
91 #define FORMPROC 8 /* parameter "procedure" */
92 #define FORMTYPE 9 /* parameter "type", also formal type */
93 #define PARIN 11 /* parameter "input" */
94 #define PAROUT 12 /* parameter "output" */
95 #define PARINOUT 16 /* parameter "inout" */
96 #define PUREPROCESS 13 /* type PROCESS */
97 #define PURECOROUTINE 14 /* type COROUTINE */
98 #define PRIMITIVETYPE 15 /* simple type */
99 #define CLASSTYPE 17 /* class type */
100 #define FILETYPE 18 /* file type */
103 /* Values to identify kinds of array elements : */
105 #define AINT -1 /* arrayof integer */
106 #define AREAL -3 /* arrayof real */
107 #define AVIRT -2 /* arrayof reference */
108 #define APROCESS -4 /* process reference implemented as arrayof */
109 #define FILEOBJECT -11 /* file object */
110 #define SKILLED -99 /* killed object, only for compactification */
114 #define DUMMY -1 /* dummy unit or prefix : SL for main block */
115 #define MAINBLOCK 0 /* main block prototype number */
116 #define MAXPROT 500 /* limit for the number of prototypes */
119 /* L-code instruction addressing modes : */
121 #define GLOBAL 0 /* M[ N ] */
122 #define LOCAL 1 /* M[ c1+N ] */
123 #define TEMPLOCAL 2 /* M[ c2+N ] */
124 #define REMOTE 3 /* M[ M[ K ]+N ] */
125 #define INDIRECT 4 /* M[ M[ N ] ] */
126 #define IMMEDIATE 5 /* N */
127 #define CONSTANT 6 /* M[ N ] */
128 #define DOTACCESS 7 /* M[ M[ display+K ]+N ] */
129 #define NOARGUMENT 8 /* ------ */
133 /* Prototype kind : */
147 #define LRECORD RECORD
148 #define LFUNCTION FUNCTION
149 #define LPROCEDURE PROCEDURE
154 typedef int protaddr; /* mainblock..maxprot ; mainblock = 0; */
155 /* INDIRECT ADDRESS OF PROTOTYPE */
156 typedef int dprotaddr; /* PROTADDR + DUMMY */
157 typedef int protkind;
160 #define dprotaddr int
164 /* TODO: Conditionally restore it:*/
169 * \defgroup Prototype Prototype
174 * Prototype of syntactic father
175 * or dummy for the main block
177 dprotaddr slprototype;
179 /** address of code */
181 /** object's total length */
184 * distance from beginning of object to
185 * temporary reference variables
189 /** beginning and length of table with */
193 * offsets of reference values in object;
194 * without SL, DL, CL and temporary values
197 /** beginning and length of table with */
199 /** offsets of parameters */
202 /** beginning and length of table with */
204 /** prototype numbers of prefix sequence */
207 /** lastwill code address */
209 /** list of handlers, 0 if empty */
212 * address of table for conversion:
213 * virtual number --> prototype
218 * only for processes:
221 /** lowest procedure prototype number */
223 /** size of RPC mask for that process */
228 * for procedures and functions
229 * \defgroup PrototypeForFunctions
232 /* virtual number or -1 if not virtual */
238 * \defgroup PrototypeForAll
246 * only for procedures, functions and processes:
247 * \defgroup PrototypeForProceduresFunctionsProcesses
250 /** address of table with parameters descr. addresses */
255 * only for functions:
256 * \defgroup PrototypeForFunctions
264 } protdescr,*pointprdsc;
268 #endif /* __GENINT_H */