| 1779 | } |
| 1780 | |
| 1781 | func (p *CommandsParser) FnDecl() (localctx IFnDeclContext) { |
| 1782 | localctx = NewFnDeclContext(p, p.GetParserRuleContext(), p.GetState()) |
| 1783 | p.EnterRule(localctx, 12, CommandsParserRULE_fnDecl) |
| 1784 | var _la int |
| 1785 | |
| 1786 | p.EnterOuterAlt(localctx, 1) |
| 1787 | { |
| 1788 | p.SetState(111) |
| 1789 | |
| 1790 | var _x = p.QualId() |
| 1791 | |
| 1792 | localctx.(*FnDeclContext).id = _x |
| 1793 | } |
| 1794 | { |
| 1795 | p.SetState(112) |
| 1796 | p.Match(CommandsParserLPAREN) |
| 1797 | if p.HasError() { |
| 1798 | // Recognition error - abort rule |
| 1799 | goto errorExit |
| 1800 | } |
| 1801 | } |
| 1802 | p.SetState(121) |
| 1803 | p.GetErrorHandler().Sync(p) |
| 1804 | if p.HasError() { |
| 1805 | goto errorExit |
| 1806 | } |
| 1807 | _la = p.GetTokenStream().LA(1) |
| 1808 | |
| 1809 | if _la == CommandsParserIDENTIFIER { |
| 1810 | { |
| 1811 | p.SetState(113) |
| 1812 | |
| 1813 | var _x = p.Param() |
| 1814 | |
| 1815 | localctx.(*FnDeclContext)._param = _x |
| 1816 | } |
| 1817 | localctx.(*FnDeclContext).params = append(localctx.(*FnDeclContext).params, localctx.(*FnDeclContext)._param) |
| 1818 | p.SetState(118) |
| 1819 | p.GetErrorHandler().Sync(p) |
| 1820 | if p.HasError() { |
| 1821 | goto errorExit |
| 1822 | } |
| 1823 | _la = p.GetTokenStream().LA(1) |
| 1824 | |
| 1825 | for _la == CommandsParserCOMMA { |
| 1826 | { |
| 1827 | p.SetState(114) |
| 1828 | p.Match(CommandsParserCOMMA) |
| 1829 | if p.HasError() { |
| 1830 | // Recognition error - abort rule |
| 1831 | goto errorExit |
| 1832 | } |
| 1833 | } |
| 1834 | { |
| 1835 | p.SetState(115) |
| 1836 | |
| 1837 | var _x = p.Param() |
| 1838 | |