public static GetLabelName ( |
||
g | ||
t | ||
return | string |
public static string GetLabelName(Grammar g, GrammarAST t)
{
string labelName = t.Text;
Rule referencedRule;
if (g.rules.TryGetValue(labelName, out referencedRule) && referencedRule != null)
{
labelName = referencedRule.GetBaseContext();
}
return labelName;
}
public override void RuleRef(GrammarAST @ref, ActionAST arg) { if (@ref is GrammarASTWithOptions) { GrammarASTWithOptions grammarASTWithOptions = (GrammarASTWithOptions)@ref; if (bool.Parse(grammarASTWithOptions.GetOptionString(LeftFactoringRuleTransformer.SUPPRESS_ACCESSOR) ?? "false")) { return; } } frequencies.Peek().Add(RuleFunction.GetLabelName(grammar, @ref)); minFrequencies.Peek().Add(RuleFunction.GetLabelName(grammar, @ref)); }