MCPcopy Create free account
hub / github.com/cel-expr/cel-go / relation

Method relation

parser/gen/cel_parser.go:1347–1436  ·  view source on GitHub ↗
(_p int)

Source from the content-addressed store, hash-verified

1345}
1346
1347func (p *CELParser) relation(_p int) (localctx IRelationContext) {
1348 var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
1349
1350 _parentState := p.GetState()
1351 localctx = NewRelationContext(p, p.GetParserRuleContext(), _parentState)
1352 var _prevctx IRelationContext = localctx
1353 var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning.
1354 _startState := 8
1355 p.EnterRecursionRule(localctx, 8, CELParserRULE_relation, _p)
1356 var _la int
1357
1358 var _alt int
1359
1360 p.EnterOuterAlt(localctx, 1)
1361 {
1362 p.SetState(62)
1363 p.calc(0)
1364 }
1365
1366 p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
1367 p.SetState(69)
1368 p.GetErrorHandler().Sync(p)
1369 if p.HasError() {
1370 goto errorExit
1371 }
1372 _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext())
1373 if p.HasError() {
1374 goto errorExit
1375 }
1376 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
1377 if _alt == 1 {
1378 if p.GetParseListeners() != nil {
1379 p.TriggerExitRuleEvent()
1380 }
1381 _prevctx = localctx
1382 localctx = NewRelationContext(p, _parentctx, _parentState)
1383 p.PushNewRecursionContext(localctx, _startState, CELParserRULE_relation)
1384 p.SetState(64)
1385
1386 if !(p.Precpred(p.GetParserRuleContext(), 1)) {
1387 p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
1388 goto errorExit
1389 }
1390 {
1391 p.SetState(65)
1392
1393 var _lt = p.GetTokenStream().LT(1)
1394
1395 localctx.(*RelationContext).op = _lt
1396
1397 _la = p.GetTokenStream().LA(1)
1398
1399 if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&254) != 0) {
1400 var _ri = p.GetErrorHandler().RecoverInline(p)
1401
1402 localctx.(*RelationContext).op = _ri
1403 } else {
1404 p.GetErrorHandler().ReportMatch(p)

Callers 2

ConditionalAndMethod · 0.95
RelationMethod · 0.95

Calls 9

calcMethod · 0.95
LTMethod · 0.80
LAMethod · 0.80
RecoverInlineMethod · 0.80
ReportErrorMethod · 0.80
RecoverMethod · 0.80
NewRelationContextFunction · 0.70
GetStateMethod · 0.65
ConsumeMethod · 0.45

Tested by

no test coverage detected