Пример #1
0
 void SelectBlock(SelectExpression expression)
 {
     Expect(28);
     if (la.kind == 2)
     {
         SelectPart(expression);
         while (la.kind == 16)
         {
             Get();
             SelectPart(expression);
         }
     }
     else if (la.kind == 29)
     {
         Get();
         var sel = new ExpressionGeneration.SelectDescriptor(); sel.Star = true;
     }
     else
     {
         SynErr(41);
     }
     Expect(27);
     if (la.kind == 2)
     {
         FromSource(expression);
     }
     else if (la.kind == 28)
     {
         var subexpression = new SelectExpression();
         SelectBlock(subexpression);
         expression.SetFrom(subexpression);
     }
     else
     {
         SynErr(42);
     }
     if (la.kind == 14 || la.kind == 17 || la.kind == 31)
     {
         OrderLimitClause(expression);
     }
     if (la.kind == 14)
     {
         Get();
         ConditionGroup conditions = new ConditionGroup(); expression.SetChild(conditions);
         Conditional(conditions);
         while (StartOf(1))
         {
             Conditional(conditions);
         }
     }
     if (la.kind == 17 || la.kind == 31)
     {
         OrderLimitClause(expression);
     }
     if (la.kind == 31)
     {
         Get();
         Expect(19);
         Expect(2);
         expression.AddDimension(t.val);
         while (la.kind == 16)
         {
             Get();
             Expect(2);
             expression.AddDimension(t.val);
         }
         OrderLimitClause(expression);
     }
 }
Пример #2
0
	void SelectBlock(SelectExpression expression) {
		Expect(28);
		if (la.kind == 2) {
			SelectPart(expression);
			while (la.kind == 16) {
				Get();
				SelectPart(expression);
			}
		} else if (la.kind == 29) {
			Get();
			var sel = new ExpressionGeneration.SelectDescriptor(); sel.Star = true; 
		} else SynErr(41);
		Expect(27);
		if (la.kind == 2) {
			FromSource(expression);
		} else if (la.kind == 28) {
			var subexpression = new SelectExpression(); 
			SelectBlock(subexpression);
			expression.SetFrom(subexpression); 
		} else SynErr(42);
		if (la.kind == 14 || la.kind == 17 || la.kind == 31) {
			OrderLimitClause(expression);
		}
		if (la.kind == 14) {
			Get();
			ConditionGroup conditions = new ConditionGroup(); expression.SetChild(conditions); 
			Conditional(conditions);
			while (StartOf(1)) {
				Conditional(conditions);
			}
		}
		if (la.kind == 17 || la.kind == 31) {
			OrderLimitClause(expression);
		}
		if (la.kind == 31) {
			Get();
			Expect(19);
			Expect(2);
			expression.AddDimension(t.val); 
			while (la.kind == 16) {
				Get();
				Expect(2);
				expression.AddDimension(t.val); 
			}
			OrderLimitClause(expression);
		}
	}