public virtual Rule resolveToRule(string x)
{
if (x.Equals(this.name))
return this;
LabelElementPair anyLabelDef = GetAnyLabelDef(x);
if (anyLabelDef != null && anyLabelDef.type == LabelType.RULE_LABEL)
{
return g.GetRule(anyLabelDef.element.Text);
}
return g.GetRule(x);
}