symsymh.inc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
  4. Interface for the symbols types of the symtable
  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.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {************************************************
  19. TSym
  20. ************************************************}
  21. { this object is the base for all symbol objects }
  22. tsym = object(tsymtableentry)
  23. typ : tsymtyp;
  24. symoptions : tsymoptions;
  25. fileinfo : tfileposinfo;
  26. {$ifdef GDB}
  27. isstabwritten : boolean;
  28. {$endif GDB}
  29. refs : longint;
  30. lastref,
  31. defref,
  32. lastwritten : pref;
  33. refcount : longint;
  34. constructor init(const n : string);
  35. constructor load;
  36. destructor done;virtual;
  37. procedure write;virtual;
  38. procedure prederef;virtual; { needed for ttypesym to be deref'd first }
  39. procedure deref;virtual;
  40. function mangledname : string;virtual;
  41. procedure insert_in_data;virtual;
  42. {$ifdef GDB}
  43. function stabstring : pchar;virtual;
  44. procedure concatstabto(asmlist : paasmoutput);virtual;
  45. {$endif GDB}
  46. procedure load_references;virtual;
  47. function write_references : boolean;virtual;
  48. {$ifdef BrowserLog}
  49. procedure add_to_browserlog;virtual;
  50. {$endif BrowserLog}
  51. end;
  52. plabelsym = ^tlabelsym;
  53. tlabelsym = object(tsym)
  54. lab : pasmlabel;
  55. used,
  56. defined : boolean;
  57. code : pointer; { should be ptree! }
  58. constructor init(const n : string; l : pasmlabel);
  59. destructor done;virtual;
  60. constructor load;
  61. function mangledname : string;virtual;
  62. procedure write;virtual;
  63. end;
  64. punitsym = ^tunitsym;
  65. tunitsym = object(tsym)
  66. unitsymtable : punitsymtable;
  67. prevsym : punitsym;
  68. constructor init(const n : string;ref : punitsymtable);
  69. constructor load;
  70. destructor done;virtual;
  71. procedure write;virtual;
  72. procedure restoreunitsym;
  73. {$ifdef GDB}
  74. procedure concatstabto(asmlist : paasmoutput);virtual;
  75. {$endif GDB}
  76. end;
  77. pmacrosym = ^tmacrosym;
  78. tmacrosym = object(tsym)
  79. defined,
  80. defined_at_startup,
  81. is_used : boolean;
  82. buftext : pchar;
  83. buflen : longint;
  84. { macros aren't written to PPU files ! }
  85. constructor init(const n : string);
  86. destructor done;virtual;
  87. end;
  88. perrorsym = ^terrorsym;
  89. terrorsym = object(tsym)
  90. constructor init;
  91. end;
  92. tprocsym = object(tsym)
  93. definition : pprocdef;
  94. {$ifdef CHAINPROCSYMS}
  95. nextprocsym : pprocsym;
  96. {$endif CHAINPROCSYMS}
  97. is_global : boolean;
  98. constructor init(const n : string);
  99. constructor load;
  100. destructor done;virtual;
  101. function mangledname : string;virtual;
  102. function demangledname:string;
  103. { writes all declarations }
  104. procedure write_parameter_lists(skipdef:pprocdef);
  105. { tests, if all procedures definitions are defined and not }
  106. { only forward }
  107. procedure check_forward;
  108. procedure order_overloaded;
  109. procedure write;virtual;
  110. procedure deref;virtual;
  111. procedure load_references;virtual;
  112. function write_references : boolean;virtual;
  113. {$ifdef BrowserLog}
  114. procedure add_to_browserlog;virtual;
  115. {$endif BrowserLog}
  116. {$ifdef GDB}
  117. function stabstring : pchar;virtual;
  118. procedure concatstabto(asmlist : paasmoutput);virtual;
  119. {$endif GDB}
  120. end;
  121. ttypesym = object(tsym)
  122. restype : ttype;
  123. {$ifdef SYNONYM}
  124. synonym : ptypesym;
  125. {$endif}
  126. {$ifdef GDB}
  127. isusedinstab : boolean;
  128. {$endif GDB}
  129. constructor init(const n : string;const tt : ttype);
  130. constructor initdef(const n : string;d : pdef);
  131. constructor load;
  132. {$ifdef SYNONYM}
  133. destructor done;virtual;
  134. {$endif}
  135. procedure write;virtual;
  136. procedure prederef;virtual;
  137. procedure load_references;virtual;
  138. function write_references : boolean;virtual;
  139. {$ifdef BrowserLog}
  140. procedure add_to_browserlog;virtual;
  141. {$endif BrowserLog}
  142. {$ifdef GDB}
  143. function stabstring : pchar;virtual;
  144. procedure concatstabto(asmlist : paasmoutput);virtual;
  145. {$endif GDB}
  146. end;
  147. pvarsym = ^tvarsym;
  148. tvarsym = object(tsym)
  149. address : longint;
  150. localvarsym : pvarsym;
  151. vartype : ttype;
  152. varoptions : tvaroptions;
  153. reg : tregister; { if reg<>R_NO, then the variable is an register variable }
  154. varspez : tvarspez; { sets the type of access }
  155. varstate : tvarstate;
  156. constructor init(const n : string;const tt : ttype);
  157. constructor init_dll(const n : string;const tt : ttype);
  158. constructor init_C(const n,mangled : string;const tt : ttype);
  159. constructor initdef(const n : string;p : pdef);
  160. constructor load;
  161. destructor done;virtual;
  162. procedure write;virtual;
  163. procedure deref;virtual;
  164. procedure setmangledname(const s : string);
  165. function mangledname : string;virtual;
  166. procedure insert_in_data;virtual;
  167. function getsize : longint;
  168. function getvaluesize : longint;
  169. function getpushsize : longint;
  170. {$ifdef GDB}
  171. function stabstring : pchar;virtual;
  172. procedure concatstabto(asmlist : paasmoutput);virtual;
  173. {$endif GDB}
  174. private
  175. _mangledname : pchar;
  176. end;
  177. ppropertysym = ^tpropertysym;
  178. tpropertysym = object(tsym)
  179. propoptions : tpropertyoptions;
  180. proptype : ttype;
  181. propoverriden : ppropertysym;
  182. indextype : ttype;
  183. index,
  184. default : longint;
  185. readaccess,
  186. writeaccess,
  187. storedaccess : psymlist;
  188. constructor init(const n : string);
  189. destructor done;virtual;
  190. constructor load;
  191. function getsize : longint;virtual;
  192. procedure write;virtual;
  193. procedure deref;virtual;
  194. procedure dooverride(overriden:ppropertysym);
  195. {$ifdef GDB}
  196. function stabstring : pchar;virtual;
  197. procedure concatstabto(asmlist : paasmoutput);virtual;
  198. {$endif GDB}
  199. end;
  200. pfuncretsym = ^tfuncretsym;
  201. tfuncretsym = object(tsym)
  202. funcretprocinfo : pointer{ should be pprocinfo};
  203. rettype : ttype;
  204. address : longint;
  205. constructor init(const n : string;approcinfo : pointer{pprocinfo});
  206. constructor load;
  207. destructor done;virtual;
  208. procedure write;virtual;
  209. procedure deref;virtual;
  210. procedure insert_in_data;virtual;
  211. {$ifdef GDB}
  212. procedure concatstabto(asmlist : paasmoutput);virtual;
  213. {$endif GDB}
  214. end;
  215. pabsolutesym = ^tabsolutesym;
  216. tabsolutesym = object(tvarsym)
  217. abstyp : absolutetyp;
  218. absseg : boolean;
  219. ref : psym;
  220. asmname : pstring;
  221. constructor init(const n : string;const tt : ttype);
  222. constructor initdef(const n : string;p : pdef);
  223. constructor load;
  224. procedure deref;virtual;
  225. function mangledname : string;virtual;
  226. procedure write;virtual;
  227. procedure insert_in_data;virtual;
  228. {$ifdef GDB}
  229. procedure concatstabto(asmlist : paasmoutput);virtual;
  230. {$endif GDB}
  231. end;
  232. ptypedconstsym = ^ttypedconstsym;
  233. ttypedconstsym = object(tsym)
  234. prefix : pstring;
  235. typedconsttype : ttype;
  236. is_really_const : boolean;
  237. constructor init(const n : string;p : pdef;really_const : boolean);
  238. constructor inittype(const n : string;const tt : ttype;really_const : boolean);
  239. constructor load;
  240. destructor done;virtual;
  241. function mangledname : string;virtual;
  242. procedure write;virtual;
  243. procedure deref;virtual;
  244. function getsize:longint;
  245. procedure insert_in_data;virtual;
  246. {$ifdef GDB}
  247. function stabstring : pchar;virtual;
  248. {$endif GDB}
  249. end;
  250. pconstsym = ^tconstsym;
  251. tconstsym = object(tsym)
  252. consttype : ttype;
  253. consttyp : tconsttyp;
  254. resstrindex, { needed for resource strings }
  255. value,
  256. len : longint; { len is needed for string length }
  257. constructor init(const n : string;t : tconsttyp;v : longint);
  258. constructor init_def(const n : string;t : tconsttyp;v : longint;def : pdef);
  259. constructor init_string(const n : string;t : tconsttyp;str:pchar;l:longint);
  260. constructor load;
  261. destructor done;virtual;
  262. function mangledname : string;virtual;
  263. procedure deref;virtual;
  264. procedure write;virtual;
  265. {$ifdef GDB}
  266. function stabstring : pchar;virtual;
  267. procedure concatstabto(asmlist : paasmoutput);virtual;
  268. {$endif GDB}
  269. end;
  270. tenumsym = object(tsym)
  271. value : longint;
  272. definition : penumdef;
  273. nextenum : penumsym;
  274. constructor init(const n : string;def : penumdef;v : longint);
  275. constructor load;
  276. procedure write;virtual;
  277. procedure deref;virtual;
  278. procedure order;
  279. {$ifdef GDB}
  280. procedure concatstabto(asmlist : paasmoutput);virtual;
  281. {$endif GDB}
  282. end;
  283. pprogramsym = ^tprogramsym;
  284. tprogramsym = object(tsym)
  285. constructor init(const n : string);
  286. end;
  287. psyssym = ^tsyssym;
  288. tsyssym = object(tsym)
  289. number : longint;
  290. constructor init(const n : string;l : longint);
  291. constructor load;
  292. destructor done;virtual;
  293. procedure write;virtual;
  294. {$ifdef GDB}
  295. procedure concatstabto(asmlist : paasmoutput);virtual;
  296. {$endif GDB}
  297. end;
  298. {
  299. $Log$
  300. Revision 1.3 2000-08-13 12:54:56 peter
  301. * class member decl wrong then no other error after it
  302. * -vb has now also line numbering
  303. * -vb is also used for interface/implementation different decls and
  304. doesn't list the current function (merged)
  305. Revision 1.2 2000/07/13 11:32:50 michael
  306. + removed logs
  307. }