code: def visitLexerTerminal(self, ctx: jsgParser.LexerTerminalContext):
          
          if ctx.LEXER_ID():
              # Substitute LEXER_ID with its string equivalent - "{LEXER_ID}".format(LEXER_ID=LEXER_ID.pattern)
              idtoken = as_token(ctx)
              self._rulePattern += '({' + idtoken + '})'
              self._ruleTokens.add(idtoken)
          else:
              self.add_string(ctx.getText()[1:-1], False)
docs: terminal: LEXER_ID | STRING