void Primary(DimensionExpression sel, bool? isAsOptional) { if (la.kind == 3 || la.kind == 4 || la.kind == 31) { var identifier = new IdentifierExpression(); Identifier(identifier); sel.Source = identifier.LastPart; sel.SourceType = typeof(string); sel.IsQuoted = identifier.IsQuoted; if (la.kind == 7) { sel.Function = sel.Source; sel.Source = null; Get(); if (StartOf(4)) { var argList = new ArgumentListExpression(); argList.SetParent(sel); sel.IsFunctionCall = true; SelectField(argList); while (la.kind == 18) { Get(); SelectField(argList); } sel.AddArguments(argList.GetChildren()); } Expect(8); } } else if (la.kind == 9) { Get(); Expect(11); Primary(sel, null); Expect(10); } else if (la.kind == 1) { Get(); sel.Source = t.val; sel.SourceType = typeof(long); } else if (la.kind == 2) { Get(); sel.Source = t.val; sel.SourceType = typeof(double); } else if (la.kind == 4) { Get(); sel.Source = t.val.Substring(1, t.val.Length - 2); sel.SourceType = typeof(string); sel.IsQuoted = true; } else SynErr(47); }
void SelectClause(GetExpression expression) { Expect(29); if (la.kind == 24) { Get(); Expect(1); expression.Take = Int32.Parse(t.val); } if (StartOf(7)) { if (StartOf(4)) { var argList = new ArgumentListExpression(); argList.SetParent(expression); SelectField(argList); while (la.kind == 18) { Get(); SelectField(argList); } expression.AddSelects(argList.GetChildren()); } if (la.kind == 32) { FromClause(expression); } if (la.kind == 30) { GroupByClause(expression); } } }