// TODO test this logic to aggergate restrictions //put_restriction : 'put' 'your'? body_part relative_direction body_part; public override Wrapper VisitPut_restriction(PreposeGesturesParser.Put_restrictionContext context) { var target = (JointGroup)this.Visit(context.body_part()[context.body_part().Count - 1]); var direction = (RelativeDirection)this.Visit(context.relative_direction()); CompositeBodyRestriction restriction = new CompositeBodyRestriction(); for (int i = 0; i < context.body_part().Count - 1; ++i) { var joint = (JointGroup)this.Visit(context.body_part()[i]); restriction = restriction.And( target.Aggregate(j2 => joint.Aggregate(j1 => new PutBodyRestriction(j1, j2, direction, dont)))); } return(new Wrapper(restriction)); }
/// <summary> /// Exit a parse tree produced by <see cref="PreposeGesturesParser.put_restriction"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitPut_restriction([NotNull] PreposeGesturesParser.Put_restrictionContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="PreposeGesturesParser.put_restriction"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitPut_restriction([NotNull] PreposeGesturesParser.Put_restrictionContext context) { return(VisitChildren(context)); }