|
From: SourceForge.net <no...@so...> - 2009-01-11 22:43:37
|
Bugs item #2500102, was opened at 2009-01-11 22:43 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104213&aid=2500102&group_id=4213 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: parser (Delphi 200x features) Group: 0.11.0 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Error when parsing Delphi 2009 files with generics Initial Comment: In Delphi 2009, Generics where introduced using a syntax like type TMyList = TObjectList<MyClass> This creates an TObjectList descendant using Items of MyClass. Also you may inherit like type TMyList = class(TObjectList<MyClass>) {...} end; Unfortunately, PasDoc ist not able to parse these files because of the "<" and ">". Therefore, the whole file is not included in the documentation. All that is needed is to treat "<" and ">" as part of the class-name. Hopefully, this will be fixed soon. Thomas Hummes tho...@gm... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104213&aid=2500102&group_id=4213 |
|
From: SourceForge.net <no...@so...> - 2011-07-23 21:41:51
|
Bugs item #2500102, was opened at 2009-01-11 23:43 Message generated for change (Comment added) made by kambi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104213&aid=2500102&group_id=4213 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: parser (Delphi 200x features) Group: 0.11.0 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Error when parsing Delphi 2009 files with generics Initial Comment: In Delphi 2009, Generics where introduced using a syntax like type TMyList = TObjectList<MyClass> This creates an TObjectList descendant using Items of MyClass. Also you may inherit like type TMyList = class(TObjectList<MyClass>) {...} end; Unfortunately, PasDoc ist not able to parse these files because of the "<" and ">". Therefore, the whole file is not included in the documentation. All that is needed is to treat "<" and ">" as part of the class-name. Hopefully, this will be fixed soon. Thomas Hummes tho...@gm... ---------------------------------------------------------------------- >Comment By: Michalis Kamburelis (kambi) Date: 2011-07-23 23:41 Message: This is partially solved since some time. See my mail "[Pasdoc-main] Parsing of generics specialization" on pasdoc-main mailing list, https://sourceforge.net/mailarchive/forum.php?thread_name=4D386FD3.7060505%40gmail.com&forum_name=pasdoc-main See also SVN commit 1290. Works for Delphi and FPC generic syntax. Our testcase http://pasdoc.svn.sourceforge.net/viewvc/pasdoc/trunk/tests/ok_generic.pas includes some examples. This works exactly like you describe, we just add "<...>" to the class name. This isn't a fully correct solution (e.g. we will not correctly detect later that actually ancestor is "TObjectList", not literally "TObjectList<MyClass>"), that's why I'm leaving this bug open for now. But at least parsing the unit with generic specialization works, and result looks sensible. You can test it now by compiling pasdoc from SVN or getting http://pasdoc.sipsolutions.net/DevelopmentSnapshots ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104213&aid=2500102&group_id=4213 |
|
From: SourceForge.net <no...@so...> - 2011-08-08 10:27:50
|
Bugs item #2500102, was opened at 2009-01-11 23:43 Message generated for change (Comment added) made by kambi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104213&aid=2500102&group_id=4213 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: parser (Delphi 200x features) Group: 0.11.0 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Michalis Kamburelis (kambi) Summary: Error when parsing Delphi 2009 files with generics Initial Comment: In Delphi 2009, Generics where introduced using a syntax like type TMyList = TObjectList<MyClass> This creates an TObjectList descendant using Items of MyClass. Also you may inherit like type TMyList = class(TObjectList<MyClass>) {...} end; Unfortunately, PasDoc ist not able to parse these files because of the "<" and ">". Therefore, the whole file is not included in the documentation. All that is needed is to treat "<" and ">" as part of the class-name. Hopefully, this will be fixed soon. Thomas Hummes tho...@gm... ---------------------------------------------------------------------- >Comment By: Michalis Kamburelis (kambi) Date: 2011-08-08 12:27 Message: Generics are now fully handled by PasDoc (both specialization and declaration of generic classes). The current testcase http://pasdoc.svn.sourceforge.net/viewvc/pasdoc/trunk/tests/ok_generic.pas is parsed without problems :) To try it yourself, use PasDoc from SVN, or http://pasdoc.sipsolutions.net/DevelopmentSnapshots, or just wait for next release. ---------------------------------------------------------------------- Comment By: Michalis Kamburelis (kambi) Date: 2011-07-23 23:41 Message: This is partially solved since some time. See my mail "[Pasdoc-main] Parsing of generics specialization" on pasdoc-main mailing list, https://sourceforge.net/mailarchive/forum.php?thread_name=4D386FD3.7060505%40gmail.com&forum_name=pasdoc-main See also SVN commit 1290. Works for Delphi and FPC generic syntax. Our testcase http://pasdoc.svn.sourceforge.net/viewvc/pasdoc/trunk/tests/ok_generic.pas includes some examples. This works exactly like you describe, we just add "<...>" to the class name. This isn't a fully correct solution (e.g. we will not correctly detect later that actually ancestor is "TObjectList", not literally "TObjectList<MyClass>"), that's why I'm leaving this bug open for now. But at least parsing the unit with generic specialization works, and result looks sensible. You can test it now by compiling pasdoc from SVN or getting http://pasdoc.sipsolutions.net/DevelopmentSnapshots ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104213&aid=2500102&group_id=4213 |
|
From: Hans-Peter D. <DrD...@ao...> - 2009-01-12 02:41:57
|
SourceForge.net schrieb: > In Delphi 2009, Generics where introduced using a syntax like > > type TMyList = TObjectList<MyClass> > > This creates an TObjectList descendant using Items of MyClass. > > Also you may inherit like > > type TMyList = class(TObjectList<MyClass>) {...} end; > > Unfortunately, PasDoc ist not able to parse these files because of > the "<" and ">". Therefore, the whole file is not included in the > documentation. All that is needed is to treat "<" and ">" as part of > the class-name. You're welcome to provide the according grammar, so that the parser can be updated accordingly. Then we should agree about the usage of the new items, so that the generators can be updated. > Hopefully, this will be fixed soon. This depends... D2009 has more extensions to the grammar (local types...), for which a grammar is required. PasDoc2 already has provisions to handle such extensions, but any implementation deserves a grammar in the first place, followed by a decision about the representation of the added elements. DoDi |
|
From: Michalis K. <mic...@gm...> - 2009-01-15 18:27:12
|
Hans-Peter Diettrich wrote: > SourceForge.net schrieb: > >> In Delphi 2009, Generics where introduced using a syntax like >> >> type TMyList = TObjectList<MyClass> >> >> This creates an TObjectList descendant using Items of MyClass. >> >> Also you may inherit like >> >> type TMyList = class(TObjectList<MyClass>) {...} end; >> >> Unfortunately, PasDoc ist not able to parse these files because of >> the "<" and ">". Therefore, the whole file is not included in the >> documentation. All that is needed is to treat "<" and ">" as part of >> the class-name. > > You're welcome to provide the according grammar, so that the parser can > be updated accordingly. Then we should agree about the usage of the new > items, so that the generators can be updated. > >> Hopefully, this will be fixed soon. > > This depends... > > D2009 has more extensions to the grammar (local types...), for which a > grammar is required. PasDoc2 already has provisions to handle such > extensions, but any implementation deserves a grammar in the first > place, followed by a decision about the representation of the added > elements. > > DoDi > Indeed, contributions to Delphi 2009 syntax are welcome. I don't own any Delphi now, so I can only offer applying the patch if someone will submit one :) For starters, just to make it basically parsed, I would even accept a patch that parses it dumbly and places class name = "TObjectList<MyClass>". That is, the simplest approach to just treat whole "TObjectList<MyClass>" as a single identifier, without linking it to the generic TObjectList. Of course, a better patch would be most welcome ---I'm just saying that any crude solution will be accepted in the meantime (as long as it doesn't break any normal parsing of course). DoDi: remember that bug submitters do not have to be subscribed to mailing list, so it's best to answer by adding a comment to the bug. (In this case Thomas is subscribed, just mentioning...). Michalis |
|
From: Hans-Peter D. <DrD...@ao...> - 2009-01-15 23:08:55
|
Michalis Kamburelis schrieb: >> D2009 has more extensions to the grammar (local types...), for which a >> grammar is required. PasDoc2 already has provisions to handle such >> extensions, but any implementation deserves a grammar in the first >> place, followed by a decision about the representation of the added >> elements. >> >> DoDi >> > > Indeed, contributions to Delphi 2009 syntax are welcome. I don't own any > Delphi now, so I can only offer applying the patch if someone will > submit one :) We also can wait for the FPC parser/grammar, compatible with D2009. I'd prefer to use the FPC parser immediately, as seems to be done in FPDoc, but I'm not sure where that parser resides, and how it can be used outside of FPC. > For starters, just to make it basically parsed, I would even accept a > patch that parses it dumbly and places class name = > "TObjectList<MyClass>". That is, the simplest approach to just treat > whole "TObjectList<MyClass>" as a single identifier, without linking it > to the generic TObjectList. Of course, a better patch would be most > welcome ---I'm just saying that any crude solution will be accepted in > the meantime (as long as it doesn't break any normal parsing of course). More extensions to the parser are required, new keywords like "generic" and the related syntax, etc. > DoDi: remember that bug submitters do not have to be subscribed to > mailing list, so it's best to answer by adding a comment to the bug. (In > this case Thomas is subscribed, just mentioning...). Thanks for the hint :-) DoDi |
|
From: Thomas H. <tho...@gm...> - 2009-01-16 07:02:03
|
-------- Original-Nachricht -------- > Datum: Thu, 15 Jan 2009 23:02:11 +0100 > Von: Hans-Peter Diettrich <DrD...@ao...> > An: "Discussion, announcements, questions concerning pasdoc" <pas...@li...> > Betreff: Re: [Pasdoc-main] [ pasdoc-Bugs-2500102 ] Error when parsing Delphi 2009 files with generics > Michalis Kamburelis schrieb: > > >> D2009 has more extensions to the grammar (local types...), for which a > >> grammar is required. PasDoc2 already has provisions to handle such > >> extensions, but any implementation deserves a grammar in the first > >> place, followed by a decision about the representation of the added > >> elements. > >> > >> DoDi > >> > > > > Indeed, contributions to Delphi 2009 syntax are welcome. I don't own any > > Delphi now, so I can only offer applying the patch if someone will > > submit one :) > > We also can wait for the FPC parser/grammar, compatible with D2009. > > I'd prefer to use the FPC parser immediately, as seems to be done in > FPDoc, but I'm not sure where that parser resides, and how it can be > used outside of FPC. > > > For starters, just to make it basically parsed, I would even accept a > > patch that parses it dumbly and places class name = > > "TObjectList<MyClass>". That is, the simplest approach to just treat > > whole "TObjectList<MyClass>" as a single identifier, without linking it > > to the generic TObjectList. Of course, a better patch would be most > > welcome ---I'm just saying that any crude solution will be accepted in > > the meantime (as long as it doesn't break any normal parsing of course). > > More extensions to the parser are required, new keywords like "generic" > and the related syntax, etc. This is not really correct. To use e.g. a generic TObjectList you need to include the unit "Generics.Collections" and may then write something like: type TMyList = TObjectList<TStringList>; This creates a generic descendant of TObjectList containing TStringLists. Michalis "dirty" solution isy at least be a solution for the most used new feature of Delphi 2009. Of course for other new things like anonymous methods, writing own generics (which needs a type called <T> as Placeholder for the later used class), a correct complete grammar ist needed - which I cannot provide, since I don't really understand how PasDoc works and how changes like these need to be planned and implemented. > > > DoDi: remember that bug submitters do not have to be subscribed to > > mailing list, so it's best to answer by adding a comment to the bug. (In > > this case Thomas is subscribed, just mentioning...). > > Thanks for the hint :-) > > DoDi > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Pasdoc-main mailing list > Pas...@li... > https://lists.sourceforge.net/lists/listinfo/pasdoc-main -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger |
|
From: Hans-Peter D. <DrD...@ao...> - 2009-01-16 19:52:59
|
Thomas Hummes schrieb: >> More extensions to the parser are required, new keywords like >> "generic" and the related syntax, etc. > > This is not really correct. To use e.g. a generic TObjectList you > need to include the unit "Generics.Collections" and may then write > something like: > > type TMyList = TObjectList<TStringList>; > > This creates a generic descendant of TObjectList containing > TStringLists. I.e. TObjectList<TStringList> sould be treated as something like a qualified typename? If so, of what type class? Should it become a CIO, or some unspecific type like "integer"? A CIO with ancestor TObjectList IMO were the closest internal representation. From the viewpoint of a user: where should the typename occur in the generated documentation, as TYPE or as CIO-TYPE? > Michalis "dirty" solution isy at least be a solution > for the most used new feature of Delphi 2009. Okay, I'll look into that. Can somebody provide an test unit? > Of course for other new > things like anonymous methods, writing own generics (which needs a > type called <T> as Placeholder for the later used class), a correct > complete grammar ist needed - which I cannot provide, since I don't > really understand how PasDoc works and how changes like these need to > be planned and implemented. A grammar snippet would be very helpful. Can such names only occur in type definitions, i.e.: TypeID ::= ident [ "<" ident ">" ] . TypeDef ::= "type" ident "=" TypeID ";" or also in variable definitions Declaration ::= "var" ident [...] ":" TypeID ";" DoDi |
|
From: Thomas H. <Tho...@gm...> - 2009-01-16 23:05:10
|
unit GenericExample;
interface
{ Unit to include for Generics }
uses Generics.Collections;
type
{ A simple Test-Object }
TMyObject = class(TObject);
TMyGenericList = class(TObjectList<TMyObject>)
public
// To Something here
end;
{ Sample for a generic with more than one type. TPair is a Key-Value-Relation }
TAnotherGenericType = class(TDictionary<TObject,TObject>);
{ All standard Generics:
TArray = class
TEnumerator<T> = class abstract
TEnumerable<T> = class abstract
TList<T> = class(TEnumerable<T>)
TQueue<T> = class(TEnumerable<T>)
TStack<T> = class(TEnumerable<T>)
TPair<TKey,TValue> = record
TDictionary<TKey,TValue> = class(TEnumerable<TPair<TKey,TValue>>)
TObjectList<T: class> = class(TList<T>)
TObjectQueue<T: class> = class(TQueue<T>)
TObjectStack<T: class> = class(TStack<T>)
TObjectDictionary<TKey,TValue> = class(TDictionary<TKey,TValue>)
The placeholder <T> is only necessary when designing own generics. Specializing existing
types replace <T> with <DesiredType>.
Quick and usable solution would be: Let the class name of TMyGenericList be
"TObjectList<TMyObject>" and just reference to TObjectList.
}
implementation
uses Classes;
procedure SampleProc();
var
TestList: TMyGenericList;
TestList2: TObjectList<TStringList>; // also allowed for vars
begin
TestList:=TMyGenericList.Create();
TestList2:=TObjectList<TStringList>.Create();
TestList.Free;
TestList2.Free;
end;
end.
|
|
From: Hans-Peter D. <DrD...@ao...> - 2009-01-17 08:38:13
|
Thomas Hummes schrieb: >>> This is not really correct. To use e.g. a generic TObjectList you >>> need to include the unit "Generics.Collections" and may then write >>> something like: >>> >>> type TMyList = TObjectList<TStringList>; >>> >>> This creates a generic descendant of TObjectList containing >>> TStringLists. Is this really correct? I've added this construct to the test unit. > I attached a test unit with all basic samples needed to use existing > generics. Thanks :-) I've updated the parser, and added your unit to the test directory (everything only in the PasDoc2 branch). The <...> part is added to the declaration, but not to the ancestor list. BTW, I had some hardware problems (rapidly extending disk failures), and have moved my PasDoc VM to another drive. This problem prevented me from finishing a distribution of PasDoc2 for Christmas. Today SVN found some conflicts, which I hope to have fixed now. I'm also familiarizing with Lazarus, perhaps I can port the D7 GUI to Lazarus in the next time (months). DoDi |
|
From: Thomas H. <Tho...@gm...> - 2009-01-17 10:01:49
|
Hans-Peter Diettrich schrieb: > Thomas Hummes schrieb: > > >>>> This is not really correct. To use e.g. a generic TObjectList you >>>> need to include the unit "Generics.Collections" and may then write >>>> something like: >>>> >>>> type TMyList = TObjectList<TStringList>; >>>> >>>> This creates a generic descendant of TObjectList containing >>>> TStringLists. >>>> > > Is this really correct? > I've added this construct to the test unit. > Not really, I forgot the class(...). :-[ Correct would be type TMyList = class(TObjectList<TStringList>); > > >> I attached a test unit with all basic samples needed to use existing >> generics. >> > > Thanks :-) > > I've updated the parser, and added your unit to the test directory > (everything only in the PasDoc2 branch). > Since I cannot compile PasDoc2 or PasDoc with Delphi 2009 (Problems with Unicode-String), is there any directory in the SVN with compiled versions (pasdoc.exe)? > The <...> part is added to the declaration, but not to the ancestor list. > > > BTW, I had some hardware problems (rapidly extending disk failures), and > have moved my PasDoc VM to another drive. This problem prevented me from > finishing a distribution of PasDoc2 for Christmas. Today SVN found some > conflicts, which I hope to have fixed now. > > I'm also familiarizing with Lazarus, perhaps I can port the D7 GUI to > Lazarus in the next time (months). > > DoDi > Some time ago, I started to develop myself a gui because the pasdoc-gui was not able to produce several output formats and call HTML Help Workshop afterwards, automatically. It will definetly not compile with Lazarus, but if you are interested, I can review and comment it and you could put it in the SVN as well. > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Pasdoc-main mailing list > Pas...@li... > https://lists.sourceforge.net/lists/listinfo/pasdoc-main > > |
|
From: Hans-Peter D. <DrD...@ao...> - 2009-01-17 19:53:35
|
Thomas Hummes schrieb: >>>>> type TMyList = TObjectList<TStringList>; >>>>> >>>>> This creates a generic descendant of TObjectList containing >>>>> TStringLists. >>>>> >> >> Is this really correct? >> I've added this construct to the test unit. >> > Not really, I forgot the class(...). :-[ > Correct would be > type TMyList = class(TObjectList<TStringList>); Okay, I'll remove that part from the parser. Not a big deal :-) >> I've updated the parser, and added your unit to the test directory >> (everything only in the PasDoc2 branch). >> > Since I cannot compile PasDoc2 or PasDoc with Delphi 2009 (Problems with > Unicode-String), is there any directory > in the SVN with compiled versions (pasdoc.exe)? I'm not familiar with the current distribution policies and procedures, of SourcForge and FreePascal. Perhaps Michalis can do that? Why don't you use FPC/Lazarus for building the executables? Doesn't D2009 come together with an older Delphi version? AFAIR D1 was shipped together with D2 and D3, and D7 with D8. > Some time ago, I started to develop myself a gui because the pasdoc-gui > was not able to produce several output formats and call HTML Help > Workshop afterwards, automatically. It will definetly not compile with > Lazarus, but if you are interested, I can review and comment it and you > could put it in the SVN as well. Okay, please send me the commented version. Compatible with D7, if possible, because I don't have access to D2009. DoDi |
|
From: Michalis K. <mic...@gm...> - 2009-01-17 20:27:51
|
Hans-Peter Diettrich wrote: > > I'm not familiar with the current distribution policies and procedures, > of SourcForge and FreePascal. Perhaps Michalis can do that? I can't compile for Windows right now (I don't have any Windows available at home, and didn't set up crosscompiling...). So I can only prepare Linux / Mac OS X binaries right now. DoDi: you can upload your own compiled pasdoc.exe to our webspace. Open SSH connection to ssh://username,pa...@we.../home/groups/p/pa/pasdoc/htdocs/snapshots, create directory named 2009-01-17 there, and basically upload whatever you like there, like pasdoc.exe testing binary. This is the place for sharing testing pasdoc binaries, archives of whatever pasdoc versions (PasDoc2 or current trunk), basically just anything related to pasdoc. As a pasdoc developer, you should have full access there. See SourceForge docs for other methods to upload files to webspace. Alternatively, just send me through email whatever you want to place there, and I'll upload it there for you :) Thomas (or anyone else, for that matter) can then download it by going to appropriate http://pasdoc.sourceforge.net/snapshots/ subdirectory. Michalis |
|
From: Hans-Peter D. <DrD...@ao...> - 2009-01-18 17:19:34
|
Michalis Kamburelis schrieb: > DoDi: you can upload your own compiled pasdoc.exe to our webspace. Open > SSH connection to > ssh://username,pa...@we.../home/groups/p/pa/pasdoc/htdocs/snapshots, > create directory named 2009-01-17 there, and basically upload whatever > you like there, like pasdoc.exe testing binary. This is the place for > sharing testing pasdoc binaries, archives of whatever pasdoc versions > (PasDoc2 or current trunk), basically just anything related to pasdoc. > As a pasdoc developer, you should have full access there. > > See SourceForge docs for other methods to upload files to webspace. The docs have not been very helpful :-( > Alternatively, just send me through email whatever you want to place > there, and I'll upload it there for you :) The zipped exe was rejected (illegal attachment). Should I try 7zip instead? DoDi |
|
From: Michalis K. <mic...@gm...> - 2009-01-18 17:43:09
|
Hans-Peter Diettrich wrote: [...] > > The docs have not been very helpful :-( See e.g. https://sourceforge.net/community/forum/topic.php?id=3518 . There's not much left to add there. > >> Alternatively, just send me through email whatever you want to place >> there, and I'll upload it there for you :) > > The zipped exe was rejected (illegal attachment). Should I try 7zip instead? > That did the trick, uploaded pasdoc2_gui.exe to http://pasdoc.sourceforge.net/snapshots/2009-01-18/ Michalis |
|
From: Hans-Peter D. <DrD...@ao...> - 2009-01-19 00:23:10
|
Michalis Kamburelis schrieb: >> The zipped exe was rejected (illegal attachment). Should I try 7zip instead? > > That did the trick, uploaded pasdoc2_gui.exe to > http://pasdoc.sourceforge.net/snapshots/2009-01-18/ Thanks :-) DoDi |