Example #1
0
 internal override void ConfigureGenerator(OperationGenerator attrb)
 {
     switch (attrb.CurrentMode)
     {
         case ContextType.STARTTIME:
             Logger.Info("currentMode is STARTTIME", "ConfigureGenerator::TokenDate");
             attrb.StartDateOnly = date;
             attrb.IsSpecific.StartDate = isSpecific;
             Logger.Info("Updated StartDateOnly and its specificity.", "ConfigureGenerator::TokenDate");
             // @ivan-todo: WarnUser if already determined startDate
             break;
         case ContextType.ENDTIME:
             Logger.Info("currentMode is ENDTIME", "ConfigureGenerator::TokenDate");
             attrb.SetConditionalEndDate(date, isSpecific);
             Logger.Info("Successfully set conditional end date.", "ConfigureGenerator::TokenDate");
             break;
         case ContextType.DEADLINE:
             Logger.Info("currentMode is DEADLINE", "ConfigureGenerator::TokenDate");
             attrb.EndDateOnly = date;
             attrb.IsSpecific.EndDate = isSpecific;
             Logger.Info("Updated EndDateOnly and its specificity.", "ConfigureGenerator::TokenDate");
             break;
         default:
             Logger.Error("Fell through currentMode switch statement.", "ConfigureGenerator::TokenDate");
             Debug.Assert(false, "Fell through switch statement in ConfigureGenerator, TokenDate!");
             break;
     }
 }
Example #2
0
 internal override void ConfigureGenerator(OperationGenerator attrb)
 {
     if (attrb.CommandType != CommandType.INVALID)
     {
         if (Value == CommandType.DONE)
         {
             attrb.SearchType = SearchType.DONE;
         }
         else if (Value == CommandType.UNDONE)
         {
             attrb.SearchType = SearchType.UNDONE;
         }
         else if (attrb.CommandType == CommandType.SORT)
         {
             attrb.CommandType = Value;
             Logger.Info("Resolved multiple commands to not use Sort as command (lower priority)", "ConfigureGenerator::TokenCommand");
         }
         else if (Value == CommandType.SORT)
         {
             Logger.Info("Resolved multiple commands to not use Sort as command (lower priority)", "ConfigureGenerator::TokenCommand");
         }
         else
         {
             Logger.Warning("Multiple commands detected", "ConfigureGenerator::TokenCommand");
             throw new MultipleCommandsException();
         }
     }
     else
     {
         attrb.CommandType = Value;
         Logger.Warning("commandType is INVALID", "ConfigureGenerator::TokenCommand");
     }
 }
Example #3
0
 internal override void ConfigureGenerator(OperationGenerator attrb)
 {
     switch (attrb.CurrentMode)
     {
         case ContextType.STARTTIME:
             attrb.StartDayOfWeekSet = true;
             attrb.StartDateOnly = GetDateFromDay(attrb.CurrentSpecifier, dayOfWeek);
             break;
         case ContextType.ENDTIME:
             attrb.EndDayOfWeekSet = true;
             attrb.SetConditionalEndDate(GetDateFromDay(attrb.CurrentSpecifier, dayOfWeek), new Specificity());
             break;
         case ContextType.DEADLINE:
             attrb.EndDayOfWeekSet = true;
             attrb.EndDateOnly = GetDateFromDay(attrb.CurrentSpecifier, dayOfWeek);
             break;
         default:
             Logger.Error("Fell through currentMode switch statement.", "ConfigureGenerator::TokenDay");
             Debug.Assert(false, "Fell through switch statement in GenerateOperation, TokenDay case!");
             break;
     }
 }
Example #4
0
 internal override void ConfigureGenerator(OperationGenerator attrb)
 {
     switch (attrb.CurrentMode)
     {
         case ContextType.STARTTIME:
             attrb.StartTimeOnly = time;
             attrb.IsSpecific.StartTime = specific;
             break;
         case ContextType.ENDTIME:
             attrb.SetConditionalEndTime(time, specific);
             Logger.Info("Successfully set conditional end time.", "ConfigureGenerator::TokenTime");
             break;
         case ContextType.DEADLINE:
             attrb.EndTimeOnly = time;
             attrb.IsSpecific.EndTime = specific;
             break;
         default:
             Logger.Error("Fell through switch statement.", "ConfigureGenerator::TokenTime");
             Debug.Assert(false, "Fell through switch statement in ConfigureGenerator, TokenTime!");
             break;
     }
 }
Example #5
0
 /// <summary>
 /// Constructor for the CommandParser class.
 /// </summary>
 public CommandParser()
 {
     this.stringParser = new StringParser();
     this.tokenFactory = new TokenGenerator();
     this.operationFactory = new OperationGenerator();
 }