// AcceptComparison implements Visitor
426772
func (s *comparisonSimplifier) AcceptComparison(a tree.Comparison) {
	l := s.Transform(a.Left)
	r := s.Transform(a.Right)

	pl, ok1 := potentialExtractValue(l)
	pr, ok2 := potentialExtractValue(r)

	if ok1 && ok2 {
		switch a.Op {
		case tree.EQL:
			s.Result = tree.BooleanLiteral{pl == pr}
			return
		case tree.NEQL:
			s.Result = tree.BooleanLiteral{pl != pr}
			return
		case tree.GT:
			s.Result = tree.BooleanLiteral{pl > pr}
			return
		case tree.GTE:
			s.Result = tree.BooleanLiteral{pl >= pr}
			return
		case tree.LT:
			s.Result = tree.BooleanLiteral{pl < pr}
			return
		case tree.LTE:
			s.Result = tree.BooleanLiteral{pl <= pr}
			return
		case tree.BITSET:
			s.Result = tree.BooleanLiteral{pl&pr != 0}
			return
		}
	}
	s.Result = tree.Comparison{Op: a.Op, Left: l, Right: r}
}
807028
func (s *Condition) SetComparisonOperator(v string) *Condition {
	s.ComparisonOperator = &v
	return s
}
1026313
func (sv *EvaluatorVisitor) AcceptComparison(v Comparison) {
	v.Left.Accept(sv)
	v.Right.Accept(sv)

	right := sv.popNumeric()
	left := sv.popNumeric()

	switch v.Op {
	case EQL:
		sv.pushBoolean(left == right)
	case NEQL:
		sv.pushBoolean(left != right)
	case GT:
		sv.pushBoolean(left > right)
	case GTE:
		sv.pushBoolean(left >= right)
	case LT:
		sv.pushBoolean(left < right)
	case LTE:
		sv.pushBoolean(left <= right)
	}
}
1018252
func (nz *normalizer) convertComparison(node *ComparisonExpr) {
	if node.Operator != InStr && node.Operator != NotInStr {
		return
	}
	tupleVals, ok := node.Right.(ValTuple)
	if !ok {
		return
	}
	// The RHS is a tuple of values.
	// Make a list bindvar.
	bvals := &querypb.BindVariable{
		Type: querypb.Type_TUPLE,
	}
	for _, val := range tupleVals {
		bval := nz.sqlToBindvar(val)
		if bval == nil {
			return
		}
		bvals.Values = append(bvals.Values, &querypb.Value{
			Type:  bval.Type,
			Value: bval.Value,
		})
	}
	bvname := nz.newName()
	nz.bindVars[bvname] = bvals
	// Modify RHS to be a list bindvar.
	node.Right = ListArg(append([]byte("::"), bvname...))
}
600501
func (l *Listener) Accept() (c net.Conn, err error) {
	c, err = l.Listener.Accept()
	if err != nil {
		return
	}
	server := Server(c, l.config)
	err = server.Handshake()
	if err == AlertNoAlert {
		err = nil
	}
	c = server
	return
}
188278
func (s *EmptyTransformer) AcceptArithmetic(v Arithmetic) {
	s.Result = Arithmetic{
		Op:    v.Op,
		Left:  s.Transform(v.Left),
		Right: s.Transform(v.Right),
	}
}
662756
func (s *Threshold) SetComparison(v string) *Threshold {
	s.Comparison = &v
	return s
}
640943
func (a *acceptBuildConfigs) Accept(from interface{}) bool {
	obj, _, err := objectMetaData(from)
	if err != nil {
		return false
	}
	gvk, _, err := a.typer.ObjectKinds(obj)
	if err != nil {
		return false
	}
	gk := gvk[0].GroupKind()
	return build.Kind("BuildConfig") == gk || image.Kind("ImageStream") == gk
}
811302
func (s *MapFilter) SetComparison(v string) *MapFilter {
	s.Comparison = &v
	return s
}
488498
func (l *CountingListener) Accept() (c net.Conn, err error) {
	conn, err := l.Listener.Accept()
	if err != nil {
		return nil, err
	}
	l.ConnCount.Add(1)
	l.ConnAccept.Add(1)
	return &countingConnection{conn, l}, nil
}
314491
func (ve *SignerValidatorEndpoint) acceptConnection() (net.Conn, error) {
	conn, err := ve.listener.Accept()
	if err != nil {
		if !ve.IsRunning() {
			return nil, nil // Ignore error from listener closing.
		}
		return nil, err
	}
	return conn, nil
}
951406
func (s *booleanCompilerVisitor) AcceptComparison(v tree.Comparison) {
	// At this point in the cycle, only EQL, NEQL, GT and GTE are valid comparisons
	if err := compileNumeric(s.ctx, v.Right); err != nil {
		s.err = err
		return
	}

	if err := s.ctx.pushAToStack(); err != nil {
		s.err = err
		return
	}

	if err := compileNumeric(s.ctx, v.Left); err != nil {
		s.err = err
		return
	}

	if err := s.ctx.popStackToX(); err != nil {
		s.err = err
		return
	}

	compOp, ok := compOps[v.Op]
	if !ok {
		s.err = fmt.Errorf("this comparison type is not allowed - this is probably a programmer error: %s", tree.ExpressionString(v))
		return
	}

	jt, jf := s.jt, s.jf
	if v.Op == tree.NEQL {
		jt, jf = jf, jt
	}

	s.ctx.opWithJumps(compOp, 0, jt, jf)
}
1153648
func (sv *EvaluatorVisitor) AcceptNegation(v Negation) {
	v.Operand.Accept(sv)
	sv.pushBoolean(!sv.popBoolean())
}
905179
func (t *precompilationTypeChecker) AcceptNumericLiteral(v tree.NumericLiteral) {
	if v.Value > 0xFFFFFFFF {
		t.result = fmt.Errorf("no literals larger than 0xFFFFFFFF allowed - this is probably a programmer error: 0x%X", v.Value)
	}
}
1353482
func (s *inclusionRemoverSimplifier) AcceptInclusion(a tree.Inclusion) {
	l := s.Transform(a.Left)
	op := tree.EQL
	combiner := combineAsOrs

	if !a.Positive {
		op = tree.NEQL
		combiner = combineAsAnds
	}

	result := make([]tree.Expression, len(a.Rights))
	for ix, v := range a.Rights {
		result[ix] = tree.Comparison{Op: op, Left: l, Right: s.Transform(v)}
	}

	s.Result = combiner(result)
}
181592
func (s *EmptyTransformer) AcceptNegation(v Negation) {
	s.Result = Negation{s.Transform(v.Operand)}
}
896956
func (aa Acceptors) Accept(from interface{}) bool {
	for _, a := range aa {
		if !a.Accept(from) {
			return false
		}
	}
	return true
}