code: def func(self):
      localctx = LaTeXParser.FuncContext(self, self._ctx, self.state)
      self.enterRule(localctx, 64, self.RULE_func)
      self._la = 0  # Token type
      try:
          self.state = 460
          self._errHandler.sync(self)
          token = self._input.LA(1)
          if token in [
              37,
              38,
              39,
              40,
              41,
              42,
              43,
              44,
              45,
              46,
              47,
              48,
              49,
              50,
              51,
              52,
              53,
              54,
              55,
              56,
              57,
              58,
          ]:
              self.enterOuterAlt(localctx, 1)
              self.state = 371
              self.func_normal()
              self.state = 384
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(
                  self._input, 40, self._ctx
              )
              if la_ == 1:
                  self.state = 373
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 73:
                      self.state = 372
                      self.subexpr()
  
                  self.state = 376
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 74:
                      self.state = 375
                      self.supexpr()
  
                  pass
  
              elif la_ == 2:
                  self.state = 379
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 74:
                      self.state = 378
                      self.supexpr()
  
                  self.state = 382
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 73:
                      self.state = 381
                      self.subexpr()
  
                  pass
  
              self.state = 391
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(
                  self._input, 41, self._ctx
              )
              if la_ == 1:
                  self.state = 386
                  self.match(LaTeXParser.L_PAREN)
                  self.state = 387
                  self.func_arg()
                  self.state = 388
                  self.match(LaTeXParser.R_PAREN)
                  pass
  
              elif la_ == 2:
                  self.state = 390
                  self.func_arg_noparens()
                  pass
  
              pass
          elif token in [77, 91]:
              self.enterOuterAlt(localctx, 2)
              self.state = 393
              _la = self._input.LA(1)
              if not (_la == 77 or _la == 91):
                  self._errHandler.recoverInline(self)
              else:
                  self._errHandler.reportMatch(self)
                  self.consume()
              self.state = 406
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(
                  self._input, 46, self._ctx
              )
              if la_ == 1:
                  self.state = 395
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 73:
                      self.state = 394
                      self.subexpr()
  
                  self.state = 398
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 90:
                      self.state = 397
                      self.match(LaTeXParser.SINGLE_QUOTES)
  
                  pass
  
              elif la_ == 2:
                  self.state = 401
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 90:
                      self.state = 400
                      self.match(LaTeXParser.SINGLE_QUOTES)
  
                  self.state = 404
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la == 73:
                      self.state = 403
                      self.subexpr()
  
                  pass
  
              self.state = 408
              self.match(LaTeXParser.L_PAREN)
              self.state = 409
              self.args()
              self.state = 410
              self.match(LaTeXParser.R_PAREN)
              pass
          elif token in [34]:
              self.enterOuterAlt(localctx, 3)
              self.state = 412
              self.match(LaTeXParser.FUNC_INT)
              self.state = 419
              self._errHandler.sync(self)
              token = self._input.LA(1)
              if token in [73]:
                  self.state = 413
                  self.subexpr()
                  self.state = 414
                  self.supexpr()
                  pass
              elif token in [74]:
                  self.state = 416
                  self.supexpr()
                  self.state = 417
                  self.subexpr()
                  pass
              elif token in [
                  15,
                  16,
                  19,
                  21,
                  23,
                  25,
                  27,
                  29,
                  30,
                  32,
                  34,
                  35,
                  36,
                  37,
                  38,
                  39,
                  40,
                  41,
                  42,
                  43,
                  44,
                  45,
                  46,
                  47,
                  48,
                  49,
                  50,
                  51,
                  52,
                  53,
                  54,
                  55,
                  56,
                  57,
                  58,
                  59,
                  61,
                  63,
                  64,
                  68,
                  69,
                  70,
                  71,
                  72,
                  76,
                  77,
                  78,
                  91,
              ]:
                  pass
              else:
                  pass
              self.state = 427
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(
                  self._input, 49, self._ctx
              )
              if la_ == 1:
                  self.state = 422
                  self._errHandler.sync(self)
                  la_ = self._interp.adaptivePredict(
                      self._input, 48, self._ctx
                  )
                  if la_ == 1:
                      self.state = 421
                      self.additive(0)
  
                  self.state = 424
                  self.match(LaTeXParser.DIFFERENTIAL)
                  pass
  
              elif la_ == 2:
                  self.state = 425
                  self.frac()
                  pass
  
              elif la_ == 3:
                  self.state = 426
                  self.additive(0)
                  pass
  
              pass
          elif token in [63]:
              self.enterOuterAlt(localctx, 4)
              self.state = 429
              self.match(LaTeXParser.FUNC_SQRT)
              self.state = 434
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if _la == 25:
                  self.state = 430
                  self.match(LaTeXParser.L_BRACKET)
                  self.state = 431
                  localctx.root = self.expr()
                  self.state = 432
                  self.match(LaTeXParser.R_BRACKET)
  
              self.state = 436
              self.match(LaTeXParser.L_BRACE)
              self.state = 437
              localctx.base = self.expr()
              self.state = 438
              self.match(LaTeXParser.R_BRACE)
              pass
          elif token in [64]:
              self.enterOuterAlt(localctx, 5)
              self.state = 440
              self.match(LaTeXParser.FUNC_OVERLINE)
              self.state = 441
              self.match(LaTeXParser.L_BRACE)
              self.state = 442
              localctx.base = self.expr()
              self.state = 443
              self.match(LaTeXParser.R_BRACE)
              pass
          elif token in [35, 36]:
              self.enterOuterAlt(localctx, 6)
              self.state = 445
              _la = self._input.LA(1)
              if not (_la == 35 or _la == 36):
                  self._errHandler.recoverInline(self)
              else:
                  self._errHandler.reportMatch(self)
                  self.consume()
              self.state = 452
              self._errHandler.sync(self)
              token = self._input.LA(1)
              if token in [73]:
                  self.state = 446
                  self.subeq()
                  self.state = 447
                  self.supexpr()
                  pass
              elif token in [74]:
                  self.state = 449
                  self.supexpr()
                  self.state = 450
                  self.subeq()
                  pass
              else:
                  raise NoViableAltException(self)
  
              self.state = 454
              self.mp(0)
              pass
          elif token in [32]:
              self.enterOuterAlt(localctx, 7)
              self.state = 456
              self.match(LaTeXParser.FUNC_LIM)
              self.state = 457
              self.limit_sub()
              self.state = 458
              self.mp(0)
              pass
          else:
              raise NoViableAltException(self)
  
      except RecognitionException as re:
          localctx.exception = re
          self._errHandler.reportError(self, re)
          self._errHandler.recover(self, re)
      finally:
          self.exitRule()
      return localctx
  
imports: from antlr4 import *
  from io import StringIO
  import sys
label_desc: Use image node_id 34 for calling the LaTeXParser obj's underlying member method code with example usage: obj.func() and returns: localctx