thoni56 / c-xrefactory

A refactoring tool for C/Yacc and Emacs. The first tool to cross Refactory Rubicon. Initial work, and released under GPL in 2009, by Marián Vittek.
https://thoni56.github.io/c-xrefactory/
GNU General Public License v2.0
23 stars 4 forks source link

Parsing C code does not always work inside a yacc grammar #53

Closed thoni56 closed 4 years ago

thoni56 commented 4 years ago

Although "extract function" is presented as an alternative when refactoring having selected a few lines in a semantic action in a yacc file, the actual refactoring does not happen.

To re-create:

Either the choice should not be available (easier) or c-xrefactory should be able to extract a function in a yacc file (much, much harder since there are the semantic attribute references ($$.x) and there is no "natural" place to put the extracted function.

thoni56 commented 4 years ago

I think c-xref actually misses parsing C code in Yacc files under certain circumstances. E.g. a rename might miss some occurrences.

Look at java_parser.y:1935:

 mh->u.type->u.m.signature = ....

F6 gives "no symbol"...