コード例 #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);
 }