From: Baptiste L. <gai...@fr...> - 2002-12-21 10:35:08
|
----- Original Message ----- From: "Andre Baresel" <and...@gm...> To: "Baptiste Lepilleur" <gai...@fr...>; "CppTool Mailing List" <Cpp...@li...> Sent: Saturday, December 21, 2002 8:46 AM Subject: Re: [Cpptool-develop] Next things .. > Baptiste Lepilleur wrote: > [...] > >>But I will check the Dev-C++ IDE and think about parsing full files, > >>which need to be discussed isn't it ? > >> > >> > > > >Yes. I already have some ideas concerning this. The difficult part will > >probably be dealing with unknown macros which do not end with a semi-colon. > >It will be fairly import that the full parser has good fault tolerance. > > > what about adding first: > - support of parsing functions/methods with there header > - support of parsing class declarations > - parse full files including macro definitions and think about fault > tolerance > Some strategy on beeing fault tollerant could be to introduce AST-Nodes > for not parsable code-parts > and also for not known type information for symbols. > -- Andre The parser does not know anything about types. It only see identifiers: it is a context less parser. This makes the parser a lot more tolerant, which is a reason why we can get away without a preprocessing step. The parser only care about identifier, and don't know weither a type is 'known' or not. More complex information about type will be provided by the code analysis layer which analyse the AST, much like was done for locale variables with IdentifierResolver. Because of the nature of the parser we are writing (level of detail aspect), it is easier to go by increasing the level of detail. The first step would be being able to parse (even at a gross level of detail) a full file. At the top of my head, this includes the following structure: - namespace keyword - using keyword - template keyword - export keyword (don't know much about that one, but there is a small article on CUJ: http://cuj.com/webonly/2003/0302/web0302b/web0302b.htm) - class and struct keyword - enum keyword - extern keyword - function declaration/implementation - global variable declaration - macro usage The initial implementation of those parser can be fairly simplistic (much like the current class and struct parser). We should probably begin by implementing fault tolerance for the existing Statementsparser to see how this can be done.. I've added a page on the Wiki: http://cpptool.sourceforge.net/cgi-bin/wiki.pl?FullParser Baptiste. |