internal override OperatorBuilder InternalBuild()
 {
     var dayInMonth = new DayInMonth(_day, _time);
     return new OperatorBuilder(
         x =>
             {
                 dayInMonth.AddConstraints(x);
                 return dayInMonth;
             });
 }
        public override void ExitNumbereddayinmonth(GoldenFoxLanguageParser.NumbereddayinmonthContext context)
        {
            var index = 0;
            if (context.numberedDay() != null)
            {
                index = context.numberedDay().INT().AsInt();
                if (context.Last() != null)
                {
                    index = -index + 1;
                }
            }

            var constraints = new List<IConstraint>();
            while (Current.Constraints.Any())
            {
                constraints.Add(Current.Constraints.Pop());
            }

            while (Current.Timestamps.Any())
            {
                var interval = new DayInMonth(index, Current.Timestamps.Pop());
                interval.AddConstraints(constraints);
                _stack.Push(interval);
            }
        }