Пример #1
0
 public void WriteSqlServerVariable(Segment sqlVarSegment, ICurrentKeyPress actionKey)
 {
     if (sqlVarSegment.Value.Trim() != string.Empty)
     {
         patternSegments.Add(sqlVarSegment);
     }
 }
Пример #2
0
 public void WriteSarbId(Segment sarbIdSegment, ICurrentKeyPress actionKey)
 {
     if (sarbIdSegment.Value.Trim() != string.Empty)
     {
         patternSegments.Add(sarbIdSegment);
     }
 }
Пример #3
0
 public void WriteNumericConstant(Segment numericConstantSegment, ICurrentKeyPress actionKey)
 {
     if (numericConstantSegment.Value.Trim() != string.Empty)
     {
         patternSegments.Add(numericConstantSegment);
     }
 }
Пример #4
0
 public void WriteField(Segment varSegment, ICurrentKeyPress actionKey)
 {
     if (varSegment.Value.Trim() != string.Empty)
     {
         patternSegments.Add(varSegment);
     }
 }
Пример #5
0
        public bool Next(ICurrentKeyPress currentKey)
        {
            foreach (KeywordMatch keywordMatch in keywordMatchList)
            {
                keywordMatch.NextCharacter(currentKey);
            }

            bool match = keywordMatchList.Any(keywordMatch => keywordMatch.MatchesSoFar);

            return(match);
        }
Пример #6
0
        private void setEscapedStatus(ICurrentKeyPress currentKey)
        {
            if (currentKey.Value == '[')
            {
                withinSquareBrackets = true;
            }

            else if (currentKey.Value == ']')
            {
                withinSquareBrackets = false;
            }
        }
Пример #7
0
 private bool matches(ICurrentKeyPress currentKey)
 {
     if (position <= keyword.CharacterCount - 1)
     {
         return((keyword.CharacterAt(position) == currentKey.UppercaseValue) &&
                matchesSoFar && !withinSquareBrackets && position != -1);
     }
     else
     {
         return(false);
     }
 }
Пример #8
0
        public bool NextCharacter(ICurrentKeyPress currentKey)
        {
            if (currentKey.PreviousCharacterKeyFamily == KeyFamilyEnum.ActionKey)
            {
                Reset();
            }

            if (currentKey.KeyFamily != KeyFamilyEnum.ActionKey)
            {
                position++;
                setEscapedStatus(currentKey);
                this.matchesSoFar  = matches(currentKey);
                this.completeMatch = completelyMatches();
            }
            return(matchesSoFar);
        }
Пример #9
0
        public void WriteOperator(Segment operatorSegment, ICurrentKeyPress actionKey)
        {
            if (patternSegments.Count >= 1)
            {
                string combineTest = "";
                combineTest = patternSegments[patternSegments.Count - 1].Value + actionKey.Value.ToString();

                // check for operators consisting of more than 1 character (<>, !=, etc.)

                if (functionLibrary.IsValidOperator(combineTest))
                {
                    patternSegments[patternSegments.Count - 1].Value = combineTest;
                    return;
                }
            }

            patternSegments.Add(operatorSegment);
        }
Пример #10
0
        public void Next(ICurrentKeyPress currentKey)
        {
            if (currentKey.Value == '"' || currentKey.Value == '\'')
            {
                if (!within)
                {
                    openBracketChar = currentKey.Value;
                }

                if (openBracketChar == currentKey.Value)
                {
                    within = !within;
                }

                if (!within)
                {
                    openBracketChar = '\0';
                }
            }
        }
Пример #11
0
 public BaseEngine(IFunctionLibrary functionLibrary)
 {
     this.EngineCurrentKeyPress = new CurrentKeyPress(functionLibrary);
     this.EngineBuffer          = new Buffer(functionLibrary);
     this.EnginePatternWriter   = new PatternWriter(functionLibrary);
 }
Пример #12
0
 public void Next(ICurrentKeyPress currentKey)
 {
     this.CurrentKey = currentKey;
     KeywordMatchService.Next(currentKey);
     BufferBuilder.Append(currentKey.Value);
 }
Пример #13
0
 public Buffer(IFunctionLibrary functionLibrary)
 {
     this.functionLibrary     = functionLibrary;
     this.CurrentKey          = new CurrentKeyPress(functionLibrary);
     this.KeywordMatchService = new KeywordMatchService(functionLibrary);
 }
Пример #14
0
 public void WriteKeyword(Segment keywordSegment, ICurrentKeyPress actionKey)
 {
     patternSegments.Add(keywordSegment);
 }
Пример #15
0
 public void WriteActionKey(Segment actionSegment, ICurrentKeyPress actionKey)
 {
     patternSegments.Add(actionSegment);
 }