(&mut self)
| 3755 | I: TokenStream<'input, TF = LocalTokenFactory<'input>> + TidAble<'input>, |
| 3756 | { |
| 3757 | pub fn primary(&mut self) -> Result<Rc<PrimaryContextAll<'input>>, ANTLRError> { |
| 3758 | let mut recog = self; |
| 3759 | let _parentctx = recog.ctx.take(); |
| 3760 | let mut _localctx = PrimaryContextExt::new(_parentctx.clone(), recog.base.get_state()); |
| 3761 | recog.base.enter_rule(_localctx.clone(), 16, RULE_primary); |
| 3762 | let mut _localctx: Rc<PrimaryContextAll> = _localctx; |
| 3763 | let mut _la: i32 = -1; |
| 3764 | let result: Result<(), ANTLRError> = (|| { |
| 3765 | recog.base.set_state(184); |
| 3766 | recog.err_handler.sync(&mut recog.base)?; |
| 3767 | match recog.interpreter.adaptive_predict(25, &mut recog.base)? { |
| 3768 | 1 => { |
| 3769 | let tmp = IdentContextExt::new(&**_localctx); |
| 3770 | recog.base.enter_outer_alt(Some(tmp.clone()), 1)?; |
| 3771 | _localctx = tmp; |
| 3772 | { |
| 3773 | recog.base.set_state(132); |
| 3774 | recog.err_handler.sync(&mut recog.base)?; |
| 3775 | _la = recog.base.input.la(1); |
| 3776 | if _la == CEL_DOT { |
| 3777 | { |
| 3778 | recog.base.set_state(131); |
| 3779 | let tmp = |
| 3780 | recog.base.match_token(CEL_DOT, &mut recog.err_handler)?; |
| 3781 | if let PrimaryContextAll::IdentContext(ctx) = |
| 3782 | cast_mut::<_, PrimaryContextAll>(&mut _localctx) |
| 3783 | { |
| 3784 | ctx.leadingDot = Some(tmp.clone()); |
| 3785 | } else { |
| 3786 | unreachable!("cant cast"); |
| 3787 | } |
| 3788 | } |
| 3789 | } |
| 3790 | |
| 3791 | recog.base.set_state(134); |
| 3792 | let tmp = recog |
| 3793 | .base |
| 3794 | .match_token(CEL_IDENTIFIER, &mut recog.err_handler)?; |
| 3795 | if let PrimaryContextAll::IdentContext(ctx) = |
| 3796 | cast_mut::<_, PrimaryContextAll>(&mut _localctx) |
| 3797 | { |
| 3798 | ctx.id = Some(tmp.clone()); |
| 3799 | } else { |
| 3800 | unreachable!("cant cast"); |
| 3801 | } |
| 3802 | } |
| 3803 | } |
| 3804 | 2 => { |
| 3805 | let tmp = GlobalCallContextExt::new(&**_localctx); |
| 3806 | recog.base.enter_outer_alt(Some(tmp.clone()), 2)?; |
| 3807 | _localctx = tmp; |
| 3808 | { |
| 3809 | recog.base.set_state(136); |
| 3810 | recog.err_handler.sync(&mut recog.base)?; |
| 3811 | _la = recog.base.input.la(1); |
| 3812 | if _la == CEL_DOT { |
| 3813 | { |
| 3814 | recog.base.set_state(135); |
no test coverage detected