code: def t_binaryValue(t):
      r'[+-]?[0-9]+[bB]'
      # We must match [0-9], and then check the validity of the binary number.
      # If we match [0-1], the invalid binary number "2b" would match
      # 'decimalValue' 2 and 'IDENTIFIER 'b'.
      if re.search(r'[2-9]', t.value) is not None:
          msg = _format("Invalid binary number {0!A}", t.value)
          t.lexer.last_msg = msg
          t.type = 'error'
          # Setting error causes the value to be automatically skipped
      else:
          t.value = int(t.value[0:-1], 2)
      return f t_binaryValue(t):
      r'[+-]?[0-9]+[bB]'
      # We must match [0-9], and then check the validity of the binary number.
      # If we match [0-1], the invalid binary number "2b" would match
      # 'decimalValue' 2 and 'IDENTIFIER 'b'.
      if re.search(r'[2-9]', t.value) is not None:
          msg = _format("Invalid binary number {0!A}", t.value)
          t.lexer.last_msg = msg
          t.type = 'error'
          # Setting error causes the value to be automatically skipped
      else:
          t.value = int(t.value[0:-1], 2)
      return t
docs: r'[+-]?[0-9]+[bB]