def accept(self, stack: Stack):
for name, pattern in self.PATTERNS.items():<EOL><INDENT>if stack.match_exp(pattern):<EOL><INDENT>stack.annotation = name<EOL>return True<EOL><DEDENT><DEDENT>return False<EOL>
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.