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

Handle %token variable references in Yacc grammars #52

Open thoni56 opened 4 years ago

thoni56 commented 4 years ago

A yacc grammar may have the following

%union {
  int integer;
}

%type <integer> rule

The integer is a field in the semantic stack, and the %type indicates that the listed rule "returns" that field.

c-xrefactory doesn't understand the %type declaration so a rename of the field will miss that occurrence.