public void WriteSqlServerVariable(Segment sqlVarSegment, ICurrentKeyPress actionKey) { if (sqlVarSegment.Value.Trim() != string.Empty) { patternSegments.Add(sqlVarSegment); } }
public void WriteSarbId(Segment sarbIdSegment, ICurrentKeyPress actionKey) { if (sarbIdSegment.Value.Trim() != string.Empty) { patternSegments.Add(sarbIdSegment); } }
public void WriteNumericConstant(Segment numericConstantSegment, ICurrentKeyPress actionKey) { if (numericConstantSegment.Value.Trim() != string.Empty) { patternSegments.Add(numericConstantSegment); } }
public void WriteField(Segment varSegment, ICurrentKeyPress actionKey) { if (varSegment.Value.Trim() != string.Empty) { patternSegments.Add(varSegment); } }
public bool Next(ICurrentKeyPress currentKey) { foreach (KeywordMatch keywordMatch in keywordMatchList) { keywordMatch.NextCharacter(currentKey); } bool match = keywordMatchList.Any(keywordMatch => keywordMatch.MatchesSoFar); return(match); }
private void setEscapedStatus(ICurrentKeyPress currentKey) { if (currentKey.Value == '[') { withinSquareBrackets = true; } else if (currentKey.Value == ']') { withinSquareBrackets = false; } }
private bool matches(ICurrentKeyPress currentKey) { if (position <= keyword.CharacterCount - 1) { return((keyword.CharacterAt(position) == currentKey.UppercaseValue) && matchesSoFar && !withinSquareBrackets && position != -1); } else { return(false); } }
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); }
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); }
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'; } } }
public BaseEngine(IFunctionLibrary functionLibrary) { this.EngineCurrentKeyPress = new CurrentKeyPress(functionLibrary); this.EngineBuffer = new Buffer(functionLibrary); this.EnginePatternWriter = new PatternWriter(functionLibrary); }
public void Next(ICurrentKeyPress currentKey) { this.CurrentKey = currentKey; KeywordMatchService.Next(currentKey); BufferBuilder.Append(currentKey.Value); }
public Buffer(IFunctionLibrary functionLibrary) { this.functionLibrary = functionLibrary; this.CurrentKey = new CurrentKeyPress(functionLibrary); this.KeywordMatchService = new KeywordMatchService(functionLibrary); }
public void WriteKeyword(Segment keywordSegment, ICurrentKeyPress actionKey) { patternSegments.Add(keywordSegment); }
public void WriteActionKey(Segment actionSegment, ICurrentKeyPress actionKey) { patternSegments.Add(actionSegment); }