ElementFrequenciesVisitor: override stringRef(TerminalAST ref) for correct processing of arrays of string literals
This commit is contained in:
parent
d3745c7b93
commit
70e3e5de70
|
@ -149,6 +149,16 @@ public class ElementFrequenciesVisitor extends GrammarTreeVisitor {
|
|||
minFrequencies.peek().add(ref.getText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stringRef(TerminalAST ref) {
|
||||
String tokenName = ref.g.getTokenName(ref.getText());
|
||||
|
||||
if (tokenName != null && !tokenName.startsWith("T__")) {
|
||||
frequencies.peek().add(tokenName);
|
||||
minFrequencies.peek().add(tokenName);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Parser rules
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue