()
| 2101 | } |
| 2102 | |
| 2103 | func (p *SqlBaseParser) SortItem() (localctx ISortItemContext) { |
| 2104 | localctx = NewSortItemContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2105 | p.EnterRule(localctx, 12, SqlBaseParserRULE_sortItem) |
| 2106 | var _la int |
| 2107 | |
| 2108 | defer func() { |
| 2109 | p.ExitRule() |
| 2110 | }() |
| 2111 | |
| 2112 | defer func() { |
| 2113 | if err := recover(); err != nil { |
| 2114 | if v, ok := err.(antlr.RecognitionException); ok { |
| 2115 | localctx.SetException(v) |
| 2116 | p.GetErrorHandler().ReportError(p, v) |
| 2117 | p.GetErrorHandler().Recover(p, v) |
| 2118 | } else { |
| 2119 | panic(err) |
| 2120 | } |
| 2121 | } |
| 2122 | }() |
| 2123 | |
| 2124 | p.EnterOuterAlt(localctx, 1) |
| 2125 | { |
| 2126 | p.SetState(164) |
| 2127 | p.Expression() |
| 2128 | } |
| 2129 | p.SetState(166) |
| 2130 | p.GetErrorHandler().Sync(p) |
| 2131 | _la = p.GetTokenStream().LA(1) |
| 2132 | |
| 2133 | if _la == SqlBaseParserASC || _la == SqlBaseParserDESC { |
| 2134 | { |
| 2135 | p.SetState(165) |
| 2136 | |
| 2137 | var _lt = p.GetTokenStream().LT(1) |
| 2138 | |
| 2139 | localctx.(*SortItemContext).ordering = _lt |
| 2140 | |
| 2141 | _la = p.GetTokenStream().LA(1) |
| 2142 | |
| 2143 | if !(_la == SqlBaseParserASC || _la == SqlBaseParserDESC) { |
| 2144 | var _ri = p.GetErrorHandler().RecoverInline(p) |
| 2145 | |
| 2146 | localctx.(*SortItemContext).ordering = _ri |
| 2147 | } else { |
| 2148 | p.GetErrorHandler().ReportMatch(p) |
| 2149 | p.Consume() |
| 2150 | } |
| 2151 | } |
| 2152 | |
| 2153 | } |
| 2154 | p.SetState(170) |
| 2155 | p.GetErrorHandler().Sync(p) |
| 2156 | _la = p.GetTokenStream().LA(1) |
| 2157 | |
| 2158 | if _la == SqlBaseParserNULLS { |
| 2159 | { |
| 2160 | p.SetState(168) |
no test coverage detected