def eval_hook(self, name: str, ctx: list) -> Node:
if name not in self.__class__._hooks:<EOL><INDENT>self.diagnostic.notify(<EOL>error.Severity.ERROR,<EOL>"<STR_LIT>" % name,<EOL>error.LocationInfo.from_stream(self._stream, is_error=True)<EOL>)<EOL>raise self.diagnostic<EOL><DEDENT>self._lastRule = '<STR_LIT:#>' + name<EOL>res = self.__class__._hooks[name](self, *ctx)<EOL>if type(res) is not bool:<EOL><INDENT>raise TypeError("<STR_LIT>" % name)<EOL><DEDENT>return res<EOL>
Evaluate the hook by its name