public SqlQualificator(SqlIdentifierOrExprSymbol ident, SymbolPosition dotpos) { Ident = ident; DotPos = dotpos; if (Ident != null) { Ident.Parent = this; } }
public SqlQualifiedName(IEnumerable <SqlQualificator> qualificators, SqlIdentifierOrExprSymbol name) { Qualificators = new List <SqlQualificator>(qualificators); Name = name; foreach (var qal in Qualificators) { qal.Parent = this; } Name.Parent = this; }
protected SqlNameExpression ParseName() { //bool quoted = Current == SqlTokenType.QuotedIdent; //string first = CurrentData; List <SqlQualificator> quals = new List <SqlQualificator>(); SqlIdentifierOrExprSymbol ident = ParseIdentifier(); while (IsSymbol(".")) { SymbolPosition dotpos = CurrentOriginal; NextToken(); SqlIdentifierOrExprSymbol nextid = null; if (Current == TokenType.IdentOrKeyword || Current == TokenType.QuotedIdent) { nextid = ParseIdentifier(); } else if (IsSymbol("*")) { nextid = new SqlStarSymbol(SkipSymbol("*")); } quals.Add(new SqlQualificator(ident, dotpos)); ident = nextid; } SqlNameExpression name; if (quals.Count > 0) { name = new SqlQualifiedName(quals, ident); } else { name = ident; } return(name); }