public override void ExitRule(IParseTreeListener listener) { ICalcListener typedListener = listener as ICalcListener; if (typedListener != null) { typedListener.ExitExpression(this); } }