RoseZhang03 | 57d3d07 | 2024-06-26 20:06:21 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # |
| 3 | # ====-- Enumeration class for libc function headers ----------*- python -*--==# |
| 4 | # |
| 5 | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 6 | # See https://llvm.org/LICENSE.txt for license information. |
| 7 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 8 | # |
| 9 | # ==-------------------------------------------------------------------------==# |
| 10 | |
| 11 | |
| 12 | class Enumeration: |
aaryanshukla | 6aed0d5 | 2024-07-03 14:29:51 -0700 | [diff] [blame] | 13 | def __init__(self, name, value): |
RoseZhang03 | 57d3d07 | 2024-06-26 20:06:21 +0000 | [diff] [blame] | 14 | self.name = name |
| 15 | self.value = value |
| 16 | |
| 17 | def __str__(self): |
| 18 | if self.value != None: |
| 19 | return f"{self.name} = {self.value}" |
| 20 | else: |
| 21 | return f"{self.name}" |