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();
     }
 }
 public override void EnterElseClause(ProgramClassParser.ElseClauseContext context)
 {
     Exit();// we want ELSE to be child of IF, not THEN, so exit THEN
     var terminal = context.ElseCondition();
     var condition = terminal != null? (ElseCondition)terminal.Symbol : null;
     Enter(new Else(condition), context);// ELSE
     if (context.NextSentenceStatement() != null) {
         Enter(new NextSentence((NextSentenceStatement)context.NextSentenceStatement().Symbol));
         Exit();
     }
 }