@staticmethod<EOL><INDENT>def _stmt_check(self, req: set, legal: set, stmt: dict) -> dict:<DEDENT>
<EOL>if self.logger.level == <NUM_LIT:10>:<EOL><INDENT>for k, v in stmt.items():<EOL><INDENT>print("<STR_LIT>" + k + "<STR_LIT>" + str(v) + "<STR_LIT>" + str(type(v)))<EOL><DEDENT><DEDENT>reqSet = req<EOL>if len(reqSet):<EOL><INDENT>self.logger.debug("<STR_LIT>".format(reqSet))<EOL>missing_set = reqSet.difference(set(stmt.keys()))<EOL>if missing_set:<EOL><INDENT>if not stmt.get(<EOL>'<STR_LIT>'):  <EOL><INDENT>raise SyntaxError(<EOL>"<STR_LIT>" % (len(missing_set), str(missing_set)))<EOL><DEDENT><DEDENT><DEDENT>legalSet = legal<EOL>if len(legalSet):<EOL><INDENT>self.logger.debug("<STR_LIT>".format(legalSet))<EOL>if len(reqSet):<EOL><INDENT>totSet = legalSet | reqSet<EOL><DEDENT>else:<EOL><INDENT>totSet = legalSet<EOL><DEDENT>generalSet = {'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'}<EOL>extraSet = set(stmt.keys() - generalSet).difference(totSet)  <EOL>if extraSet:<EOL><INDENT>self.logger.debug("<STR_LIT>".format(extraSet))<EOL>for item in extraSet:<EOL><INDENT>stmt.pop(item, None)<EOL><DEDENT>warnings.warn(<EOL>"<STR_LIT>".format(len(extraSet), extraSet))<EOL><DEDENT><DEDENT>self.logger.debug("<STR_LIT>".format(stmt))<EOL>return stmt<EOL>
This method checks to make sure that the proc has all required statements and removes any statements
aren't valid. Missing required statements is an error. Extra statements are not.
:param req: set
:param legal: set
:param stmt: dict
:return: dictionary of verified statements