Ejemplo n.º 1
0
        private static string GetTargetPath(SelectorExpression s)
        {
            if (string.IsNullOrWhiteSpace(s.Target))
            {
                var dimChild = s.Child as DimensionExpression;
                if (dimChild != null)
                {
                    var result = GetTargetPath(dimChild);
                    return(result);
                }
            }

            return(s.Target);
        }
Ejemplo n.º 2
0
	void Condition(SingleNodeTree parent, SelectorExpression parentSelector, bool? isAsOptional) {
		SelectorTypes selectorType = SelectorTypes.Unspecified; 
		ModifierTypes modifierType; 
		DimensionExpression dim; 
		ModifierTypes modifierResult; 
		
		SelectorExpression selector = new SelectorExpression(); MultiAdd(parent, selector); 
		if(parentSelector != null) 
		{
		selector.SetNodeType(parentSelector.NodeType);
		selector.SetModifierType(parentSelector.Modifier);
		selector.SetLeft(parentSelector.Left);
		}
		
		if (la.kind == 7) {
			ComplexCondition(parent, selector, false);
		} else if (StartOf(8)) {
			dim = new DimensionExpression(); selector.SetRight(dim); 
			Primary(dim, false);
		} else if (StartOf(9)) {
			ExpressionTreeBase expr = null;  
			LiteralExpression(ref expr);
			selector.SetRight(expr); 
		} else SynErr(48);
		if (StartOf(10)) {
			Modifier(out modifierResult);
			selector.SetLeft(selector.Right); selector.SetRight(null); modifierType = modifierResult; selector.SetModifierType(modifierType); selector.SetNodeType(SelectorTypes.Unknown); 
			if (la.kind == 7) {
				ComplexCondition(parent, selector, false);
			} else if (StartOf(8)) {
				dim = new DimensionExpression(); selector.SetRight(dim); 
				Primary(dim, false);
			} else if (StartOf(9)) {
				ExpressionTreeBase expr = null;  
				LiteralExpression(ref expr);
				selector.SetRight(expr); 
			} else SynErr(49);
		}
		if(isAsOptional == true){	 
		if (la.kind == 3 || la.kind == 4 || la.kind == 28) {
			if (la.kind == 28) {
				Get();
			}
			string alias = null; 
			AliasClause(ref alias);
			selector.Target = alias; 
		}
		}else if(isAsOptional == false){ 
		if (la.kind == 28) {
			Get();
			string alias = null; 
			AliasClause(ref alias);
			selector.Target = alias; 
		}
		} 
	}
Ejemplo n.º 3
0
	void ComplexCondition(SingleNodeTree parent, SelectorExpression selector, bool? isAsOptional) {
		ConditionGroup group = new ConditionGroup(); parent.SetChild(group); ExpressionTreeBase addTo = group; SingleNodeTree condition = null; ConditionalExpression lastOperation = null; 
		Expect(7);
		while (StartOf(4)) {
			lastOperation = lastOperation ?? new AndCondition();
			MultiAdd(addTo, lastOperation);
			addTo = lastOperation;
			var nestedselector = new SelectorExpression(selector.NodeType, selector.Modifier, selector.Left);
			
			if (la.kind == 6 || la.kind == 36) {
				if (la.kind == 6) {
					Get();
				} else {
					Get();
				}
				if (la.kind == 17) {
					Get();
				}
				NotCondition not = new NotCondition(); lastOperation.SetChild(not); lastOperation = not; 
			}
			if (la.kind == 7) {
				ComplexCondition(lastOperation, nestedselector, isAsOptional);
			} else if (StartOf(6)) {
				Condition(lastOperation, nestedselector, isAsOptional);
			} else SynErr(56);
			if (la.kind == 13 || la.kind == 14) {
				Operation(out lastOperation);
			}
			else { lastOperation = null; } 
		}
		Expect(8);
	}
Ejemplo n.º 4
0
 public LogicalSelector(SelectorExpression selector)
 {
     Selector = selector;
     SingleSelector = selector.NodeType;
 }
Ejemplo n.º 5
0
 public LogicalSelector(SelectorExpression selector)
 {
     Selector       = selector;
     SingleSelector = selector.NodeType;
 }