docs: def accept(self, stack: Stack):
          """
          Checks that the stack can be accepted according to the `PATTERNS`.
  
          If the pattern is found, then its name is stored in the `annotation`
          attribute of the stack.
          """
  
          for name, pattern in self.PATTERNS.items():
              if stack.match_exp(pattern):
                  stack.annotation = name
                  return True
          return False