Exemplo n.º 1
0
 void FlushAll()
 {
     FlushForUnfinishedGroup();
     groupState = GroupingState.None;
     phaseState = PhaseState.None;
     field      = null;
 }
Exemplo n.º 2
0
        void BoundaryValues()
        {
            if (groupState == GroupingState.Finished && phase == string.Empty)
            {
                groupState = GroupingState.None;
                phase      = settings.GroupModificator.ToString() + settings.GroupModificator;
            }
            if (field != null && phase == string.Empty)
            {
                phase = field + settings.SpecificFieldModificator;
                field = null;
            }
            if (phase != string.Empty)
            {
                return;
            }
            switch (phaseState)
            {
            case PhaseState.Include:
                phase += settings.IncludeModificator;
                break;

            case PhaseState.Exclude:
                phase += settings.ExcludeModificator;
                break;
            }
            phaseState = PhaseState.None;
        }
Exemplo n.º 3
0
 SearchStringParseState Add(char c)
 {
     if (c == settings.PhaseSeparator)
     {
         if (IsPhaseEnded())
         {
             hasSpace = true;
             return(SearchStringParseState.Completed);
         }
     }
     if (phase == string.Empty && groupState == GroupingState.None)
     {
         if (phaseState == PhaseState.None && field == null)
         {
             if (c == settings.IncludeModificator)
             {
                 phaseState = PhaseState.Include;
                 return(GetState());
             }
             if (c == settings.ExcludeModificator)
             {
                 phaseState = PhaseState.Exclude;
                 return(GetState());
             }
         }
         if (c == settings.GroupModificator && groupState == GroupingState.None)
         {
             groupState = GroupingState.Started;
             state.SaveIndex();
             return(GetState());
         }
     }
     if (c == settings.GroupModificator && groupState == GroupingState.Started)
     {
         if (!state.NextChar.HasValue || state.NextChar.Value == settings.PhaseSeparator)
         {
             groupState = GroupingState.Finished;
             return(SearchStringParseState.Completed);
         }
     }
     if (c == settings.SpecificFieldModificator && field == null && phase != string.Empty && groupState == GroupingState.None)
     {
         field = phase;
         phase = string.Empty;
         return(GetState());
     }
     phase += c;
     return(GetState());
 }
Exemplo n.º 4
0
 void FlushForUnfinishedGroup()
 {
     phase      = string.Empty;
     hasSpace   = false;
     groupState = GroupingState.Invalid;
 }