diff --git a/doc/reference.rst b/doc/reference.rst
index bbdb77d1054b18d8b308578abbf7b34006759421..a39faa20b1a7a5141fe695dc6707b1c4a2ba7ebe 100644
--- a/doc/reference.rst
+++ b/doc/reference.rst
@@ -131,6 +131,14 @@ Symbolic Constants
     :members:
     :undoc-members:
 
+.. autoclass:: format
+    :members:
+    :undoc-members:
+
+.. autoclass:: yaml_style
+    :members:
+    :undoc-members:
+
 Basic Building Blocks
 ^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/gen_wrap.py b/gen_wrap.py
index bf14fa041cd74bfd0090a1465509f0729c1180d3..fce2083645ea9ccc97454f0cd3485ecf236f3be7 100644
--- a/gen_wrap.py
+++ b/gen_wrap.py
@@ -277,10 +277,27 @@ ENUMS = {
         isl_fold_min,
         isl_fold_max,
         isl_fold_list,
-    """
+    """,
+
+    # printer.h
+    "isl_format": """
+        ISL_FORMAT_ISL,
+        ISL_FORMAT_POLYLIB,
+        ISL_FORMAT_POLYLIB_CONSTRAINTS,
+        ISL_FORMAT_OMEGA,
+        ISL_FORMAT_C,
+        ISL_FORMAT_LATEX,
+        ISL_FORMAT_EXT_POLYLIB,
+    """,
+
+    "isl_yaml_style": """
+        ISL_YAML_STYLE_BLOCK,
+        ISL_YAML_STYLE_FLOW,
+    """,
     }
 
 TYPEDEFD_ENUMS = ["isl_stat", "isl_bool"]
+MACRO_ENUMS = ["isl_format", "isl_yaml_style"]
 
 HEADER_PREAMBLE = """
 // flow.h
@@ -773,15 +790,19 @@ def write_enums_to_header(header_f):
     for enum_name, value_str in ENUMS.items():
         values = [v.strip() for v in value_str.split(",") if v.strip()]
 
-        if enum_name in TYPEDEFD_ENUMS:
-            pattern = "typedef enum {{ {values}, ... }} {name};\n"
-        else:
-            pattern = "enum {name} {{ {values}, ... }};\n"
+        if enum_name not in MACRO_ENUMS:
+            if enum_name in TYPEDEFD_ENUMS:
+                pattern = "typedef enum {{ {values}, ... }} {name};\n"
+            else:
+                pattern = "enum {name} {{ {values}, ... }};\n"
 
-        header_f.write(
-                pattern.format(
-                    name=enum_name,
-                    values=", ".join(values)))
+            header_f.write(
+                    pattern.format(
+                        name=enum_name,
+                        values=", ".join(values)))
+        else:
+            for v in values:
+                header_f.write("static const int {name};".format(name=v))
 
 
 def write_classes_to_header(header_f):
diff --git a/islpy/__init__.py b/islpy/__init__.py
index 7b3c8ce5ac73c71e827d93ce7603e7c2285f4369..2d05572602b40d1633986c68c262fe311a104796 100644
--- a/islpy/__init__.py
+++ b/islpy/__init__.py
@@ -104,6 +104,8 @@ ast_expr_type = _isl.ast_expr_type
 ast_loop_type = _isl.ast_loop_type
 ast_node_type = _isl.ast_node_type
 ast_op_type = _isl.ast_op_type
+format = _isl.format
+yaml_style = _isl.yaml_style
 
 ALL_CLASSES = [Options, Context, IdList, ValList, BasicSetList, BasicMapList,
         SetList, MapList, UnionSetList, ConstraintList, AffList, PwAffList,