code: def statement(self) -> Statement:
          
          pref, kw = self.keyword()
          pres = self.opt_separator()
          next = self.peek()
          if next == ";":
              arg = None
              sub = False  # type: bool
          elif next == "{":
              arg = None
              sub = True
          elif not pres:
              raise UnexpectedInput(self, "separator")
          else:
              self._arg = ""
              sub = self.argument()
              arg = self._arg
          self.offset += 1
          res = Statement(kw, arg, pref=pref)
          if sub:
              res.substatements = self.substatements()
              for sub in res.substatements:
                  sub.superstmt = res
          return res
docs: Parse YANG statement.
  
          Raises:
              EndOfInput: If past the end of input.
              UnexpectedInput: If no syntactically correct statement is found.