/// <summary> /// Binds an <see cref="InNode"/> to create a LINQ <see cref="Expression"/> that /// represents the semantics of the <see cref="InNode"/>. /// </summary> /// <param name="inNode">The node to bind.</param> /// <returns>The LINQ <see cref="Expression"/> created.</returns> public virtual Expression BindInNode(InNode inNode) { if (inNode == null) { throw Error.ArgumentNull(nameof(inNode)); } Expression singleValue = Bind(inNode.Left); Expression collection = Bind(inNode.Right); Type collectionItemType = collection.Type.GetElementType(); if (collectionItemType == null) { Type[] genericArgs = collection.Type.GetGenericArguments(); // The model builder does not support non-generic collections like ArrayList // or generic collections with generic arguments > 1 like IDictionary<,> Contract.Assert(genericArgs.Length == 1); collectionItemType = genericArgs[0]; } if (IsIQueryable(collection.Type)) { Expression containsExpression = singleValue.Type != collectionItemType?Expression.Call(null, ExpressionHelperMethods.QueryableCastGeneric.MakeGenericMethod(singleValue.Type), collection) : collection; return(Expression.Call(null, ExpressionHelperMethods.QueryableContainsGeneric.MakeGenericMethod(singleValue.Type), containsExpression, singleValue)); } else { Expression containsExpression = singleValue.Type != collectionItemType?Expression.Call(null, ExpressionHelperMethods.EnumerableCastGeneric.MakeGenericMethod(singleValue.Type), collection) : collection; return(Expression.Call(null, ExpressionHelperMethods.EnumerableContainsGeneric.MakeGenericMethod(singleValue.Type), containsExpression, singleValue)); } }
/// <summary> /// Add a new node to the build-end of of the branch. /// New nodes automatically become the new InNode unless the NODE_DIRECTION /// passed is a multi-direction. In this case the branch is "closed" and no /// more nodes can be added. /// </summary> /// <param name="direction"></param> public NODE_DIRECTION[] Add(NODE_DIRECTION direction) { if (Open) { if (direction.IsMulti()) { // close the branch Open = false; InNode.InDirection = direction; return(direction.GetDirections().ToArray()); } else { Vector2Int newLocation = InNode.Next(direction); Node nextNode = new Node(newLocation.x, newLocation.y, this); InNode.InNode = nextNode; nextNode.OutNode = InNode; InNode = nextNode; _nodeDirectory.Add(nextNode.VectorLocation, nextNode); if (Parent != null) { Parent.SetNodeDirectoryData(nextNode); } return(new NODE_DIRECTION[] { direction }); } } else { throw new BranchException(BRANCH_EXCEPTION_TYPE.BRANCH_NOT_OPEN); } }
void BuildWhere(InNode node, ValueNode valueNode, ExpressionType op) { bool flag = Convert.ToBoolean(valueNode.Value); node.Type = flag ? SqlInType.IN : SqlInType.NOTIN; BuildWhere(node); }
public override QueryNode Visit(InNode nodeIn) { var left = (SingleValueNode)Visit(nodeIn.Left); var right = (CollectionNode)Visit(nodeIn.Right); return(new InNode(left, right)); }
/// <summary> /// Visit an InNode /// </summary> /// <param name="nodeIn">the node to visit</param> /// <returns>true, indicating that the node has been visited.</returns> public override bool Visit(InNode nodeIn) { validate(nodeIn); ValidateNode(nodeIn.Left); ValidateNode(nodeIn.Right); return(true); }
public override int Visit(InNode nodeIn) { var propertyNode = (SingleValuePropertyAccessNode)nodeIn.Left; var constantNodes = (CollectionConstantNode)nodeIn.Right; return(CombineHashCodes(propertyNode.Property.Name.GetHashCode(), constantNodes.Collection.Count)); }
public void Visit(InNode node) { var right = Nodes.Pop(); var left = Nodes.Pop(); Nodes.Push(new InNode(left, (ArgsListNode)right)); }
/// <summary> /// Bind $it to the <see cref="QueryNode"/> translated string. /// </summary> /// <param name="node">node to bind.</param> /// <param name="filterClauseRangeVariable">The <see cref="FilterClause"/> range variable.</param> /// <returns>The translated string with $it binding.</returns> private string BindNode(QueryNode node, ResourceRangeVariable filterClauseRangeVariable) { BinaryOperatorNode binaryNode = node as BinaryOperatorNode; InNode inNode = node as InNode; AnyNode anyNode = node as AnyNode; SingleValueFunctionCallNode singleValueFunctionCallNode = node as SingleValueFunctionCallNode; SingleValueOpenPropertyAccessNode singleValueOpenPropertyAccessNode = node as SingleValueOpenPropertyAccessNode; if (binaryNode != null) { return(BindBinaryOperatorNode(binaryNode, filterClauseRangeVariable)); } else if (inNode != null) { return(BindInNode(inNode, filterClauseRangeVariable)); } else if (anyNode != null) { return(BindAnyNode(anyNode, filterClauseRangeVariable)); } else if (singleValueFunctionCallNode != null) { return(BindSingleValueFunctionCallNode(singleValueFunctionCallNode, filterClauseRangeVariable)); } else if (singleValueOpenPropertyAccessNode != null) { return(BindSingleValueOpenPropertyAccess(singleValueOpenPropertyAccessNode, filterClauseRangeVariable)); } else { return(this.TranslateNode(node)); } }
public override void Visit(InNode node) { try { var dstType = node.Left.ReturnType.GetUnderlyingNullable(); var hasMixedTypes = false; foreach (var desc in node.Right.Descendants) { if ((dstType == desc.ReturnType || CanBeGeneralized(node.Left, desc)) || RdlMetadata.IsTypePossibleToConvert(dstType, desc.ReturnType)) { continue; } hasMixedTypes = true; break; } if (hasMixedTypes) { ReportHasMixedTypes(node); } } catch (Exception e) { _criticalErrors.Add(e); } }
/// <summary> /// Translate an InNode. /// </summary> /// <param name="nodeIn">The node to be translated.</param> /// <returns>The translated node.</returns> public override QueryNode Visit(InNode nodeIn) { Contract.Assert(nodeIn != null); return(new InNode( (SingleValueNode)nodeIn.Left.Accept(this), (CollectionNode)nodeIn.Right.Accept(this))); }
public void RightShouldBeSetCorrectly() { ConstantNode left = new ConstantNode("YungPupper"); CollectionPropertyAccessNode right = new CollectionPropertyAccessNode(this.fakeDogSource, HardCodedTestModel.GetDogNicknamesProperty()); InNode inNode = new InNode(left, right); Assert.Same(right, inNode.Right); }
public void TypeReferenceIsSetCorrectlyFromOperands() { ConstantNode left = new ConstantNode("Cat"); CollectionPropertyAccessNode right = new CollectionPropertyAccessNode(this.fakeDogSource, HardCodedTestModel.GetDogNicknamesProperty()); InNode inNode = new InNode(left, right); Assert.Equal("Edm.Boolean", inNode.TypeReference.FullName()); }
public void KindIsBinaryOperatorNode() { ConstantNode left = new ConstantNode("Scooby"); CollectionPropertyAccessNode right = new CollectionPropertyAccessNode(this.fakeDogSource, HardCodedTestModel.GetDogNicknamesProperty()); InNode inNode = new InNode(left, right); Assert.Equal(InternalQueryNodeKind.In, inNode.InternalKind); }
public void LeftShouldBeSetCorrectly() { ConstantNode left = new ConstantNode("Doggo"); CollectionPropertyAccessNode right = new CollectionPropertyAccessNode(this.fakeDogSource, HardCodedTestModel.GetDogNicknamesProperty()); InNode inNode = new InNode(left, right); inNode.Left.Should().Be(left); }
/// <summary> /// Translates a <see cref="InNode"/> into a corresponding <see cref="String"/>. /// </summary> /// <param name="node">The node to translate.</param> /// <returns>The translated String.</returns> public override String Visit(InNode node) { ExceptionUtils.CheckArgumentNotNull(node, "node"); string left = this.TranslateNode(node.Left); string right = this.TranslateNode(node.Right); return(String.Concat(left, ' ', ExpressionConstants.KeywordIn, ' ', right)); }
/// <summary> /// Translate an InNode. /// </summary> /// <param name="nodeIn">The node to be translated.</param> /// <returns>The translated node.</returns> public override QueryNode Visit(InNode nodeIn) { if (nodeIn == null) { throw Error.ArgumentNull(nameof(nodeIn)); } return(new InNode( (SingleValueNode)nodeIn.Left.Accept(this), (CollectionNode)nodeIn.Right.Accept(this))); }
public void Visit(InNode node) { var right = (ArgsListNode)Nodes.Pop(); var left = Nodes.Pop(); Node exp = new EqualityNode(left, right.Args[0]); for (var i = 1; i < right.Args.Length; i++) { exp = new OrNode(exp, new EqualityNode(left, right.Args[i])); } Nodes.Push(exp); }
/// <summary> /// Binds an <see cref="InNode"/> to create a LINQ <see cref="Expression"/> that /// represents the semantics of the <see cref="InNode"/>. /// </summary> /// <param name="inNode">The node to bind.</param> /// <returns>The LINQ <see cref="Expression"/> created.</returns> public virtual Expression BindInNode(InNode inNode) { Expression singleValue = Bind(inNode.Left); Expression collection = Bind(inNode.Right); if (IsIQueryable(collection.Type)) { return(Expression.Call(null, ExpressionHelperMethods.QueryableContainsGeneric.MakeGenericMethod(singleValue.Type), collection, singleValue)); } else { return(Expression.Call(null, ExpressionHelperMethods.EnumerableContainsGeneric.MakeGenericMethod(singleValue.Type), collection, singleValue)); } }
/// <summary> /// Performs "In" specific operations. /// </summary> /// <param name="node">The "In" node.</param> public virtual void Visit(InNode node) { switch (node.Left.ReturnType.GetTypeName()) { case nameof(Int64): case nameof(Int32): case nameof(Int16): ExpressionGenerateIn <InInstructionNumeric>(); break; case nameof(DateTimeOffset): ExpressionGenerateIn <InInstructionDatetime>(); break; } }
public virtual double GetWeightedError(int index, LinkDirection direction) { var val = 0.0; switch (direction) { case LinkDirection.Input: val = Values[WeightIndex] * InNode.GetNodeError(index); break; case LinkDirection.Output: val = Values[WeightIndex] * OutNode.GetNodeError(index); break; } return(val); }
public void BuildWhere(InNode node) { var values = node.Values; if (values != null && values.Count() > 0) { int index = 0; var paramIds = values.Select(m => { string p = this.GetParameter(node.Node.FieldName, ++index); this.AddParameter(p, m); return(p); }); string fieldName = this.GetFieldName(node.Node.TableName, node.Node.FieldName); string op = node.Type == SqlInType.IN ? InSymbol : NotInSymbol; var condition = string.Format("{0} {1} ({2})", fieldName, op, string.Join(",", paramIds)); this.AppendCondition(condition); } }
public void ResolveWhereIn <T, TKey>(SqlInType type, Expression <Func <T, TKey> > expression, IEnumerable <object> values, bool andOr) { builder.PartType = SqlPartType.Where; var member = ExpressionHelper.GetMemberExpression(expression.Body); if (member != null) { if (andOr) { builder.And(); } else { builder.Or(); } InNode node = new InNode(type, new MemberNode(member), values); builder.BuildWhere(node); } }
/// <summary> /// Bind $it to the <see cref="InNode"/> translated string. /// </summary> /// <param name="node">node to bind.</param> /// <param name="filterClauseRangeVariable">The <see cref="FilterClause"/> range variable.</param> /// <returns>The translated string with $it binding.</returns> private string BindInNode(InNode node, ResourceRangeVariable filterClauseRangeVariable) { string translatedNode = this.TranslateNode(node); ResourceRangeVariableReferenceNode leftRangeVariableNode = GetResourceRangeVariableReferenceNode(node.Left); string inOperator = ExpressionConstants.KeywordIn; string[] inSeparator = { inOperator }; string[] substrings = translatedNode.Trim().Split(inSeparator, StringSplitOptions.RemoveEmptyEntries); string leftIn = substrings[0]; string rightIn = substrings[1]; if (leftRangeVariableNode != null && IsDifferentSource(filterClauseRangeVariable, leftRangeVariableNode)) { leftIn = ExpressionConstants.It + ExpressionConstants.SymbolForwardSlash + leftIn; translatedNode = leftIn + inOperator + rightIn; } return(translatedNode); }
/// <summary> /// Binds an <see cref="InNode"/> to create a LINQ <see cref="Expression"/> that /// represents the semantics of the <see cref="InNode"/>. /// </summary> /// <param name="inNode">The node to bind.</param> /// <returns>The LINQ <see cref="Expression"/> created.</returns> public virtual Expression BindInNode(InNode inNode) { if (inNode == null) { throw Error.ArgumentNull(nameof(inNode)); } Expression singleValue = Bind(inNode.Left); Expression collection = Bind(inNode.Right); if (IsIQueryable(collection.Type)) { Expression containsExpression = singleValue.Type != collection.Type.GetGenericArguments()[0] ? Expression.Call(null, ExpressionHelperMethods.QueryableCastGeneric.MakeGenericMethod(singleValue.Type), collection) : collection; return(Expression.Call(null, ExpressionHelperMethods.QueryableContainsGeneric.MakeGenericMethod(singleValue.Type), containsExpression, singleValue)); } else { Expression containsExpression = singleValue.Type != collection.Type.GetGenericArguments()[0] ? Expression.Call(null, ExpressionHelperMethods.EnumerableCastGeneric.MakeGenericMethod(singleValue.Type), collection) : collection; return(Expression.Call(null, ExpressionHelperMethods.EnumerableContainsGeneric.MakeGenericMethod(singleValue.Type), containsExpression, singleValue)); } }
public override Expression Visit(InNode nodeIn) { var propertyExpression = (MemberExpression)Visit((SingleValuePropertyAccessNode)nodeIn.Left); var constantNodes = (CollectionConstantNode)nodeIn.Right; BinaryExpression inExpression = null; for (int i = 0; i < constantNodes.Collection.Count; i++) { var constantExpression = (ConstantExpression)Visit(constantNodes.Collection[i]); ConstantExpression coercedConstanExpression = OeExpressionHelper.ConstantChangeType(constantExpression, propertyExpression.Type); if (coercedConstanExpression != constantExpression) { ReplaceConstant(constantExpression, coercedConstanExpression); } BinaryExpression equalExpression = Expression.Equal(propertyExpression, coercedConstanExpression); inExpression = inExpression == null ? equalExpression : Expression.OrElse(inExpression, equalExpression); } return(inExpression); }
public void Visit(InNode node) { node.Left.Accept(this); node.Right.Accept(this); node.Accept(_visitor); }
// $ANTLR start "relationalExpression" // JavaScript.g:281:1: relationalExpression : shiftExpression ( ( LT )* ( '<' ( LT )* shiftExpression | '>' ( LT )* shiftExpression | '<=' ( LT )* shiftExpression | '>=' ( LT )* shiftExpression | 'instanceof' ( LT )* shiftExpression | 'in' ( LT )* shiftExpression ) )* ; public JavaScriptParser.relationalExpression_return relationalExpression() // throws RecognitionException [1] { JavaScriptParser.relationalExpression_return retval = new JavaScriptParser.relationalExpression_return(); retval.Start = input.LT(1); object root_0 = null; IToken LT326 = null; IToken char_literal327 = null; IToken LT328 = null; IToken char_literal330 = null; IToken LT331 = null; IToken string_literal333 = null; IToken LT334 = null; IToken string_literal336 = null; IToken LT337 = null; IToken string_literal339 = null; IToken LT340 = null; IToken string_literal342 = null; IToken LT343 = null; JavaScriptParser.shiftExpression_return shiftExpression325 = default(JavaScriptParser.shiftExpression_return); JavaScriptParser.shiftExpression_return shiftExpression329 = default(JavaScriptParser.shiftExpression_return); JavaScriptParser.shiftExpression_return shiftExpression332 = default(JavaScriptParser.shiftExpression_return); JavaScriptParser.shiftExpression_return shiftExpression335 = default(JavaScriptParser.shiftExpression_return); JavaScriptParser.shiftExpression_return shiftExpression338 = default(JavaScriptParser.shiftExpression_return); JavaScriptParser.shiftExpression_return shiftExpression341 = default(JavaScriptParser.shiftExpression_return); JavaScriptParser.shiftExpression_return shiftExpression344 = default(JavaScriptParser.shiftExpression_return); object LT326_tree=null; object char_literal327_tree=null; object LT328_tree=null; object char_literal330_tree=null; object LT331_tree=null; object string_literal333_tree=null; object LT334_tree=null; object string_literal336_tree=null; object LT337_tree=null; object string_literal339_tree=null; object LT340_tree=null; object string_literal342_tree=null; object LT343_tree=null; try { // JavaScript.g:282:2: ( shiftExpression ( ( LT )* ( '<' ( LT )* shiftExpression | '>' ( LT )* shiftExpression | '<=' ( LT )* shiftExpression | '>=' ( LT )* shiftExpression | 'instanceof' ( LT )* shiftExpression | 'in' ( LT )* shiftExpression ) )* ) // JavaScript.g:282:4: shiftExpression ( ( LT )* ( '<' ( LT )* shiftExpression | '>' ( LT )* shiftExpression | '<=' ( LT )* shiftExpression | '>=' ( LT )* shiftExpression | 'instanceof' ( LT )* shiftExpression | 'in' ( LT )* shiftExpression ) )* { root_0 = (object)adaptor.GetNilNode(); PushFollow(FOLLOW_shiftExpression_in_relationalExpression2501); shiftExpression325 = shiftExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, shiftExpression325.Tree); // JavaScript.g:283:4: ( ( LT )* ( '<' ( LT )* shiftExpression | '>' ( LT )* shiftExpression | '<=' ( LT )* shiftExpression | '>=' ( LT )* shiftExpression | 'instanceof' ( LT )* shiftExpression | 'in' ( LT )* shiftExpression ) )* do { int alt178 = 2; alt178 = dfa178.Predict(input); switch (alt178) { case 1 : // JavaScript.g:283:5: ( LT )* ( '<' ( LT )* shiftExpression | '>' ( LT )* shiftExpression | '<=' ( LT )* shiftExpression | '>=' ( LT )* shiftExpression | 'instanceof' ( LT )* shiftExpression | 'in' ( LT )* shiftExpression ) { // JavaScript.g:283:7: ( LT )* do { int alt170 = 2; int LA170_0 = input.LA(1); if ( (LA170_0 == LT) ) { alt170 = 1; } switch (alt170) { case 1 : // JavaScript.g:283:7: LT { LT326=(IToken)Match(input,LT,FOLLOW_LT_in_relationalExpression2509); if (state.failed) return retval; } break; default: goto loop170; } } while (true); loop170: ; // Stops C# compiler whining that label 'loop170' has no statements // JavaScript.g:283:10: ( '<' ( LT )* shiftExpression | '>' ( LT )* shiftExpression | '<=' ( LT )* shiftExpression | '>=' ( LT )* shiftExpression | 'instanceof' ( LT )* shiftExpression | 'in' ( LT )* shiftExpression ) int alt177 = 6; switch ( input.LA(1) ) { case 91: { alt177 = 1; } break; case 92: { alt177 = 2; } break; case 93: { alt177 = 3; } break; case 94: { alt177 = 4; } break; case 95: { alt177 = 5; } break; case 53: { alt177 = 6; } break; default: if ( state.backtracking > 0 ) {state.failed = true; return retval;} NoViableAltException nvae_d177s0 = new NoViableAltException("", 177, 0, input); throw nvae_d177s0; } switch (alt177) { case 1 : // JavaScript.g:284:6: '<' ( LT )* shiftExpression { char_literal327=(IToken)Match(input,91,FOLLOW_91_in_relationalExpression2520); if (state.failed) return retval; if ( state.backtracking == 0 ) {char_literal327_tree = new LessThanNode(char_literal327) ; root_0 = (object)adaptor.BecomeRoot(char_literal327_tree, root_0); } // JavaScript.g:284:27: ( LT )* do { int alt171 = 2; int LA171_0 = input.LA(1); if ( (LA171_0 == LT) ) { alt171 = 1; } switch (alt171) { case 1 : // JavaScript.g:284:27: LT { LT328=(IToken)Match(input,LT,FOLLOW_LT_in_relationalExpression2526); if (state.failed) return retval; } break; default: goto loop171; } } while (true); loop171: ; // Stops C# compiler whining that label 'loop171' has no statements PushFollow(FOLLOW_shiftExpression_in_relationalExpression2530); shiftExpression329 = shiftExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, shiftExpression329.Tree); } break; case 2 : // JavaScript.g:285:6: '>' ( LT )* shiftExpression { char_literal330=(IToken)Match(input,92,FOLLOW_92_in_relationalExpression2538); if (state.failed) return retval; if ( state.backtracking == 0 ) {char_literal330_tree = new GreaterThanNode(char_literal330) ; root_0 = (object)adaptor.BecomeRoot(char_literal330_tree, root_0); } // JavaScript.g:285:30: ( LT )* do { int alt172 = 2; int LA172_0 = input.LA(1); if ( (LA172_0 == LT) ) { alt172 = 1; } switch (alt172) { case 1 : // JavaScript.g:285:30: LT { LT331=(IToken)Match(input,LT,FOLLOW_LT_in_relationalExpression2544); if (state.failed) return retval; } break; default: goto loop172; } } while (true); loop172: ; // Stops C# compiler whining that label 'loop172' has no statements PushFollow(FOLLOW_shiftExpression_in_relationalExpression2548); shiftExpression332 = shiftExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, shiftExpression332.Tree); } break; case 3 : // JavaScript.g:286:6: '<=' ( LT )* shiftExpression { string_literal333=(IToken)Match(input,93,FOLLOW_93_in_relationalExpression2556); if (state.failed) return retval; if ( state.backtracking == 0 ) {string_literal333_tree = new LessThanEqNode(string_literal333) ; root_0 = (object)adaptor.BecomeRoot(string_literal333_tree, root_0); } // JavaScript.g:286:30: ( LT )* do { int alt173 = 2; int LA173_0 = input.LA(1); if ( (LA173_0 == LT) ) { alt173 = 1; } switch (alt173) { case 1 : // JavaScript.g:286:30: LT { LT334=(IToken)Match(input,LT,FOLLOW_LT_in_relationalExpression2562); if (state.failed) return retval; } break; default: goto loop173; } } while (true); loop173: ; // Stops C# compiler whining that label 'loop173' has no statements PushFollow(FOLLOW_shiftExpression_in_relationalExpression2566); shiftExpression335 = shiftExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, shiftExpression335.Tree); } break; case 4 : // JavaScript.g:287:6: '>=' ( LT )* shiftExpression { string_literal336=(IToken)Match(input,94,FOLLOW_94_in_relationalExpression2574); if (state.failed) return retval; if ( state.backtracking == 0 ) {string_literal336_tree = new GreaterThanEqNode(string_literal336) ; root_0 = (object)adaptor.BecomeRoot(string_literal336_tree, root_0); } // JavaScript.g:287:33: ( LT )* do { int alt174 = 2; int LA174_0 = input.LA(1); if ( (LA174_0 == LT) ) { alt174 = 1; } switch (alt174) { case 1 : // JavaScript.g:287:33: LT { LT337=(IToken)Match(input,LT,FOLLOW_LT_in_relationalExpression2580); if (state.failed) return retval; } break; default: goto loop174; } } while (true); loop174: ; // Stops C# compiler whining that label 'loop174' has no statements PushFollow(FOLLOW_shiftExpression_in_relationalExpression2584); shiftExpression338 = shiftExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, shiftExpression338.Tree); } break; case 5 : // JavaScript.g:288:6: 'instanceof' ( LT )* shiftExpression { string_literal339=(IToken)Match(input,95,FOLLOW_95_in_relationalExpression2592); if (state.failed) return retval; if ( state.backtracking == 0 ) {string_literal339_tree = new InstanceOfNode(string_literal339) ; root_0 = (object)adaptor.BecomeRoot(string_literal339_tree, root_0); } // JavaScript.g:288:38: ( LT )* do { int alt175 = 2; int LA175_0 = input.LA(1); if ( (LA175_0 == LT) ) { alt175 = 1; } switch (alt175) { case 1 : // JavaScript.g:288:38: LT { LT340=(IToken)Match(input,LT,FOLLOW_LT_in_relationalExpression2598); if (state.failed) return retval; } break; default: goto loop175; } } while (true); loop175: ; // Stops C# compiler whining that label 'loop175' has no statements PushFollow(FOLLOW_shiftExpression_in_relationalExpression2602); shiftExpression341 = shiftExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, shiftExpression341.Tree); } break; case 6 : // JavaScript.g:289:6: 'in' ( LT )* shiftExpression { string_literal342=(IToken)Match(input,53,FOLLOW_53_in_relationalExpression2610); if (state.failed) return retval; if ( state.backtracking == 0 ) {string_literal342_tree = new InNode(string_literal342) ; root_0 = (object)adaptor.BecomeRoot(string_literal342_tree, root_0); } // JavaScript.g:289:22: ( LT )* do { int alt176 = 2; int LA176_0 = input.LA(1); if ( (LA176_0 == LT) ) { alt176 = 1; } switch (alt176) { case 1 : // JavaScript.g:289:22: LT { LT343=(IToken)Match(input,LT,FOLLOW_LT_in_relationalExpression2616); if (state.failed) return retval; } break; default: goto loop176; } } while (true); loop176: ; // Stops C# compiler whining that label 'loop176' has no statements PushFollow(FOLLOW_shiftExpression_in_relationalExpression2620); shiftExpression344 = shiftExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, shiftExpression344.Tree); } break; } } break; default: goto loop178; } } while (true); loop178: ; // Stops C# compiler whining that label 'loop178' has no statements } retval.Stop = input.LT(-1); if ( (state.backtracking==0) ) { retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);} } catch (RecognitionException re) { ReportError(re); Recover(input,re); // Conversion of the second argument necessary, but harmless retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re); } finally { } return retval; }
public virtual void Visit(InNode node) { node.Left.Accept(this); node.Right.Accept(this); node.Accept(Visitor); }
public void Visit(InNode node) { }
/// <summary> /// Translate an InNode. /// </summary> /// <param name="nodeIn">The node to be translated.</param> /// <returns>The translated node.</returns> public override QueryNode Visit(InNode nodeIn) { return(new InNode( (SingleValueNode)nodeIn.Left.Accept(this), (CollectionNode)nodeIn.Right.Accept(this))); }
public virtual double GetInValue(int index) { return(InNode.GetNodeValue(index)); }