// AcceptArithmetic implements Visitor
188278
func (s *EmptyTransformer) AcceptArithmetic(v Arithmetic) {
	s.Result = Arithmetic{
		Op:    v.Op,
		Left:  s.Transform(v.Left),
		Right: s.Transform(v.Right),
	}
}
979097
func (t *typeChecker) AcceptArithmetic(v tree.Arithmetic) {
	if t.expectBoolean {
		t.result = fmt.Errorf("expected boolean expression but found: %s", tree.ExpressionString(v))
		return
	}

	res := either(
		typeCheckExpectingNumeric(v.Left),
		typeCheckExpectingNumeric(v.Right))
	if res != nil {
		t.result = res
	}
}
612165
func (l *gceRateLimiter) Accept(ctx context.Context, key *cloud.RateLimitKey) error {
	if key.Operation == "Get" && key.Service == "Operations" {
		// Wait a minimum amount of time regardless of rate limiter.
		rl := &cloud.MinimumRateLimiter{
			// Convert flowcontrol.RateLimiter into cloud.RateLimiter
			RateLimiter: &cloud.AcceptRateLimiter{
				Acceptor: l.gce.operationPollRateLimiter,
			},
			Minimum: operationPollInterval,
		}
		return rl.Accept(ctx, key)
	}
	return nil
}
301346
func (s *EmptyTransformer) AcceptInclusion(v Inclusion) {
	result := make([]Numeric, len(v.Rights))
	for ix, v2 := range v.Rights {
		result[ix] = s.Transform(v2)
	}
	s.Result = Inclusion{
		Positive: v.Positive,
		Left:     s.Transform(v.Left),
		Rights:   result}
}
1301471
func (accept AcceptSlice) Accepts(ctype string) bool {
	t, err := accept.Negotiate(ctype)
	if t == "" || err != nil {
		return false
	}
	return true
}
567932
func (s *booleanCompilerVisitor) AcceptBooleanLiteral(v tree.BooleanLiteral) {
	if s.topLevel {
		s.ctx.unconditionalJumpTo(s.jt)
	} else {
		s.err = errors.New("a boolean literal was found in an expression - this is likely a programmer error")
	}
}
1068857
func (s *booleanSimplifier) AcceptAnd(a tree.And) {
	l := s.Transform(a.Left)
	r := s.Transform(a.Right)
	pl, ok1 := potentialExtractBooleanValue(l)
	pr, ok2 := potentialExtractBooleanValue(r)
	// First branch is possible to calculate at compile time
	if ok1 {
		if pl {
			// If the first branch is always true, we are determined by the second branch
			if ok2 {
				s.Result = tree.BooleanLiteral{pr}
			} else {
				s.Result = r
			}
		} else {
			// If the first branch is always false, we can never succeed
			s.Result = tree.BooleanLiteral{false}
		}
	} else {
		// Second branch is possible to calculate at compile time
		if ok2 {
			if pr {
				// If the second branch statically evaluates to true, the and expression is determined by the left arm
				s.Result = l
			} else {
				// And if the second branch is false, it doesn't matter what the first branch is
				s.Result = tree.BooleanLiteral{false}
			}
		} else {
			s.Result = tree.And{l, r}
		}
	}
}
88038
func acceptCallback(a *C.utp_callback_arguments) C.uint64 {
	if logCallbacks {
		log.Printf("accept callback: %#v", *a)
	}
	s := getSocketForLibContext(a.context)
	c := s.newConn(a.socket)
	c.setRemoteAddr()
	c.inited = true
	s.pushBacklog(c)
	return 0
}
976151
func (s *acceptFirst) Accept(from interface{}) bool {
	if _, ok := s.handled[from]; ok {
		return false
	}
	s.handled[from] = struct{}{}
	return true
}
465383
func (acceptNew) Accept(from interface{}) bool {
	_, meta, err := objectMetaData(from)
	if err != nil {
		return false
	}
	if len(meta.GetResourceVersion()) > 0 {
		return false
	}
	return true
}
181592
func (s *EmptyTransformer) AcceptNegation(v Negation) {
	s.Result = Negation{s.Transform(v.Operand)}
}
244555
func (n *negotiator) Accepts(ctype string) float64 {
	return accepts(n.r.Header.Get("Accept"), ctype)
}
1177661
func (v *KeyType) Accept(value interface{}) error {
	var tmp KeyType
	switch x := value.(type) {
	case string:
		tmp = KeyType(x)
	case KeyType:
		tmp = x
	default:
		return errors.Errorf(`invalid type for jwa.KeyType: %T`, value)
	}
	switch tmp {
	case EC, OctetSeq, RSA:
	default:
		return errors.Errorf(`invalid jwa.KeyType value`)
	}

	*v = tmp
	return nil
}
558630
func (s *fullArgumentSplitterSimplifier) AcceptComparison(a tree.Comparison) {
	l := s.Transform(a.Left)
	r := s.Transform(a.Right)

	pral, okal := potentialExtractFullArgument(l)
	prnlLow, prnlHi, oknl := potentialExtractValueParts(l)

	prar, okar := potentialExtractFullArgument(r)
	prnrLow, prnrHi, oknr := potentialExtractValueParts(r)

	if okal && oknr {
		switch a.Op {
		case tree.EQL:
			s.Result = tree.And{
				Left:  tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.NumericLiteral{prnrLow}},
				Right: tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.NumericLiteral{prnrHi}},
			}
		case tree.BITSET:
			s.Result = tree.And{
				Left: tree.Comparison{Op: tree.EQL, Left: tree.Arithmetic{Op: tree.BINAND, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.NumericLiteral{prnrLow}}, Right: tree.NumericLiteral{prnrLow}},

				Right: tree.Comparison{Op: tree.EQL, Left: tree.Arithmetic{Op: tree.BINAND, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.NumericLiteral{prnrHi}}, Right: tree.NumericLiteral{prnrHi}},
			}
		case tree.NEQL:
			s.Result = tree.Or{
				Left:  tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.NumericLiteral{prnrLow}},
				Right: tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.NumericLiteral{prnrHi}},
			}
		case tree.GT, tree.GTE:
			s.Result = tree.Or{
				Left: tree.Comparison{Op: tree.GT, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.NumericLiteral{prnrHi}},
				Right: tree.And{
					Left:  tree.Comparison{Op: tree.EQL, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.NumericLiteral{prnrHi}},
					Right: tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.NumericLiteral{prnrLow}},
				},
			}
		default:
			panic("shouldn't happen")
		}
	} else if okar && oknl {
		switch a.Op {
		case tree.EQL:
			s.Result = tree.And{
				Left:  tree.Comparison{Op: a.Op, Left: tree.NumericLiteral{prnlLow}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				Right: tree.Comparison{Op: a.Op, Left: tree.NumericLiteral{prnlHi}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
			}
		case tree.BITSET:
			s.Result = tree.And{
				Left:  tree.Comparison{Op: tree.EQL, Left: tree.Arithmetic{Op: tree.BINAND, Left: tree.NumericLiteral{prnlLow}, Right: tree.Argument{Type: tree.Low, Index: prar}}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				Right: tree.Comparison{Op: tree.EQL, Left: tree.Arithmetic{Op: tree.BINAND, Left: tree.NumericLiteral{prnlHi}, Right: tree.Argument{Type: tree.Hi, Index: prar}}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
			}
		case tree.NEQL:
			s.Result = tree.Or{
				Left:  tree.Comparison{Op: a.Op, Left: tree.NumericLiteral{prnlLow}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				Right: tree.Comparison{Op: a.Op, Left: tree.NumericLiteral{prnlHi}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
			}
		case tree.GT, tree.GTE:
			s.Result = tree.Or{
				Left: tree.Comparison{Op: tree.GT, Left: tree.NumericLiteral{prnlHi}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
				Right: tree.And{
					Left:  tree.Comparison{Op: tree.EQL, Left: tree.NumericLiteral{prnlHi}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
					Right: tree.Comparison{Op: a.Op, Left: tree.NumericLiteral{prnlLow}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				},
			}
		default:
			panic("shouldn't happen")
		}
	} else if okal && okar {
		switch a.Op {
		case tree.EQL:
			s.Result = tree.And{
				Left:  tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				Right: tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
			}
		case tree.BITSET:
			s.Result = tree.And{
				Left:  tree.Comparison{Op: tree.EQL, Left: tree.Arithmetic{Op: tree.BINAND, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.Argument{Type: tree.Low, Index: prar}}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				Right: tree.Comparison{Op: tree.EQL, Left: tree.Arithmetic{Op: tree.BINAND, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.Argument{Type: tree.Hi, Index: prar}}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
			}

		case tree.NEQL:
			s.Result = tree.Or{
				Left:  tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				Right: tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
			}
		case tree.GT, tree.GTE:
			s.Result = tree.Or{
				Left: tree.Comparison{Op: tree.GT, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
				Right: tree.And{
					Left:  tree.Comparison{Op: tree.EQL, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.Argument{Type: tree.Hi, Index: prar}},
					Right: tree.Comparison{Op: a.Op, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: tree.Argument{Type: tree.Low, Index: prar}},
				},
			}
		default:
			panic("shouldn't happen")
		}
	} else if okal && a.Op == tree.BITSET {
		s.Result = tree.And{
			Left:  tree.Comparison{Op: tree.EQL, Left: tree.Argument{Type: tree.Hi, Index: pral}, Right: tree.NumericLiteral{0}},
			Right: tree.Comparison{Op: tree.NEQL, Left: tree.Arithmetic{Op: tree.BINAND, Left: tree.Argument{Type: tree.Low, Index: pral}, Right: a.Right}, Right: tree.NumericLiteral{0}},
		}
	} else {
		s.Result = tree.Comparison{Op: a.Op, Left: l, Right: r}
	}
}
431605
func (t *typeChecker) AcceptNegation(v tree.Negation) {
	if !t.expectBoolean {
		t.result = fmt.Errorf("expected numeric expression but found: %s", tree.ExpressionString(v))
		return
	}

	res := typeCheckExpectingBoolean(v.Operand)
	if res != nil {
		t.result = res
	}
}
890585
func (s *ltExpressionsSimplifier) AcceptComparison(a tree.Comparison) {
	l := s.Transform(a.Left)
	r := s.Transform(a.Right)

	newOp := a.Op

	switch a.Op {
	case tree.LT:
		newOp = tree.GTE
		l, r = r, l
	case tree.LTE:
		newOp = tree.GT
		l, r = r, l
	}

	s.Result = tree.Comparison{Op: newOp, Left: l, Right: r}

}
887224
func (t *typeChecker) AcceptBooleanLiteral(v tree.BooleanLiteral) {
	if !t.expectBoolean {
		t.result = fmt.Errorf("expected numeric expression but found: %s", tree.ExpressionString(v))
	}
}