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

Method Simple

repl/parser/commands_parser.go:2386–2470  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2384}
2385
2386func (p *CommandsParser) Simple() (localctx ISimpleContext) {
2387 localctx = NewSimpleContext(p, p.GetParserRuleContext(), p.GetState())
2388 p.EnterRule(localctx, 18, CommandsParserRULE_simple)
2389 var _la int
2390
2391 p.EnterOuterAlt(localctx, 1)
2392 {
2393 p.SetState(136)
2394
2395 var _m = p.Match(CommandsParserCOMMAND)
2396
2397 localctx.(*SimpleContext).cmd = _m
2398 if p.HasError() {
2399 // Recognition error - abort rule
2400 goto errorExit
2401 }
2402 }
2403 p.SetState(141)
2404 p.GetErrorHandler().Sync(p)
2405 if p.HasError() {
2406 goto errorExit
2407 }
2408 _la = p.GetTokenStream().LA(1)
2409
2410 for _la == CommandsParserFLAG || _la == CommandsParserSTRING {
2411 p.SetState(139)
2412 p.GetErrorHandler().Sync(p)
2413 if p.HasError() {
2414 goto errorExit
2415 }
2416
2417 switch p.GetTokenStream().LA(1) {
2418 case CommandsParserFLAG:
2419 {
2420 p.SetState(137)
2421
2422 var _m = p.Match(CommandsParserFLAG)
2423
2424 localctx.(*SimpleContext)._FLAG = _m
2425 if p.HasError() {
2426 // Recognition error - abort rule
2427 goto errorExit
2428 }
2429 }
2430 localctx.(*SimpleContext).args = append(localctx.(*SimpleContext).args, localctx.(*SimpleContext)._FLAG)
2431
2432 case CommandsParserSTRING:
2433 {
2434 p.SetState(138)
2435
2436 var _m = p.Match(CommandsParserSTRING)
2437
2438 localctx.(*SimpleContext)._STRING = _m
2439 if p.HasError() {
2440 // Recognition error - abort rule
2441 goto errorExit
2442 }
2443 }

Callers 1

CommandMethod · 0.95

Calls 8

NewSimpleContextFunction · 0.85
LAMethod · 0.80
ReportErrorMethod · 0.80
RecoverMethod · 0.80
GetStateMethod · 0.65
MatchMethod · 0.65
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected