symsymh.inc 11 KB

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