public override void EnterWhenSearchConditionClause(ProgramClassParser.WhenSearchConditionClauseContext context) { var terminal = context.WhenSearchCondition(); var condition = terminal != null? (WhenSearchCondition)terminal.Symbol : null; Enter(new WhenSearch(condition), context); if (context.NextSentenceStatement() != null) { Enter(new NextSentence((NextSentenceStatement)context.NextSentenceStatement().Symbol)); Exit(); } }