pgentype.pas 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. Copyright (c) 2015 by Sven Barth
  3. Contains different types that are used in the context of parsing generics.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit pgentype;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. cclasses,
  22. symtype,symbase;
  23. type
  24. tspecializationstate = record
  25. oldsymtablestack : tsymtablestack;
  26. oldextendeddefs : tfphashobjectlist;
  27. oldgenericdummysyms: tfphashobjectlist;
  28. end;
  29. tspecializationcontext=class
  30. public
  31. genericdeflist : tfpobjectlist;
  32. poslist : tfplist;
  33. prettyname : ansistring;
  34. specializename : ansistring;
  35. genname : string;
  36. sym : tsym;
  37. symtable : tsymtable;
  38. constructor create;
  39. destructor destroy;override;
  40. end;
  41. implementation
  42. uses
  43. globtype;
  44. constructor tspecializationcontext.create;
  45. begin
  46. genericdeflist:=tfpobjectlist.create(false);
  47. poslist:=tfplist.create;
  48. end;
  49. destructor tspecializationcontext.destroy;
  50. var
  51. i : longint;
  52. begin
  53. genericdeflist.free;
  54. for i:=0 to poslist.count-1 do
  55. dispose(pfileposinfo(poslist[i]));
  56. poslist.free;
  57. inherited destroy;
  58. end;
  59. end.