private void Parse() { string sql = this.ValidateStrings(); if (string.IsNullOrEmpty(sql)) { return; } sql = ValidateBrackets(sql); this.QueryTree = this.CreateQueryTree(sql); //quebrar em espaços //identificar statements }
private QueryTree TextToQueryTree(string validSQL, int lastOpenBracket, int closeBracketIndex) { string sql = validSQL.Substring(lastOpenBracket + 1, closeBracketIndex); QueryTree qTree = new QueryTree { Query = sql, StartIndex = lastOpenBracket, EndIndex = closeBracketIndex }; return(qTree); }
private QueryTree CreateQueryTree(string validSQL) { QueryTree queryTree = new QueryTree(); if (this.charDictionary.TryGetValue('(', out _)) { queryTree = this.CreateQueryTreeRecursivaly(validSQL, new List <QueryTree>(), 0); } else { QueryTree.Query = validSQL; } return(queryTree); }
public bool IsInsideMyInterval(QueryTree queryTree) { //vai dar errado pq o intervalo mudou quando eu removi o texto anterior return(this.StartIndex < queryTree.StartIndex && this.EndIndex > queryTree.EndIndex); }
public QueryTree(QueryTree parent) { this.Parent = parent; this.Height = this.Parent.Height + 1; }