Re: Re: Ranking of OO refactorings
J Arrizza <[email protected]> Sun, 14 Jul 2013 18:56:51 -0700
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <CAEyOLyBvX-LNWyrFoZfqq4niadCzMkT8m3rAcrpNJpanf30X1A@mail.gmail.com> |
On Sun, Jul 14, 2013 at 11:16 AM, Richard <[email protected]> wrote: > ** > > > > Unfortunately, C++ is a very complex language syntactically and > > semantically. That has really made it hard for the vendors to automate > the > > refactorings. > > One of the problems facing the C and C++ parsers in refactoring tools (and in pretty printers too) is the preprocessor. In short, you can, within limits, change the grammar of C++ using the preprocessor. For example: #define while for #define forever (;;) #define always printf #define swirly2(s) #s " " #define swirly1 swirly2(goodbye) swirly2(cruel) swirly2(world) #define swirl printf(swirly1) .... while forever swirl; .... The "while forever swirl" is not valid C/C++ but the generated output from the preprocessor, *is* valid C/C++. As far as I know, it is not possible to define a grammar of the combined preprocessor and compiler. Second, there are many, many compilers that introduce slight variants of the standard grammar: new keywords, slight changes to where some things are allowed, etc. John [Non-text portions of this message have been removed] ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/refactoring/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/refactoring/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/