pyloxi: generate instruction classes
diff --git a/py_gen/codegen.py b/py_gen/codegen.py
index dc6b999..e552d61 100644
--- a/py_gen/codegen.py
+++ b/py_gen/codegen.py
@@ -93,6 +93,8 @@
type_values['type'] = 1
elif utils.class_is_meter_band(cls):
type_values['type'] = util.constant_for_value(version, "ofp_meter_band_type", util.primary_wire_type(cls, version))
+ elif utils.class_is_instruction(cls):
+ type_values['type'] = util.constant_for_value(version, "ofp_instruction_type", util.primary_wire_type(cls, version))
return type_values
@@ -117,6 +119,8 @@
pyname = cls[7:]
elif utils.class_is_meter_band(cls):
pyname = cls[14:]
+ elif utils.class_is_instruction(cls):
+ pyname = cls[15:]
else:
pyname = cls[3:]
@@ -176,6 +180,7 @@
ofclasses = [x for x in build_ofclasses(version)
if not utils.class_is_message(x.name)
and not utils.class_is_action(x.name)
+ and not utils.class_is_instruction(x.name)
and not utils.class_is_meter_band(x.name)
and not utils.class_is_oxm(x.name)
and not utils.class_is_list(x.name)]
@@ -193,6 +198,11 @@
groups[group] = items
util.render_template(out, 'const.py', version=version, groups=groups)
+def generate_instruction(out, name, version):
+ ofclasses = [x for x in build_ofclasses(version)
+ if utils.class_is_instruction(x.name)]
+ util.render_template(out, 'instruction.py', ofclasses=ofclasses, version=version)
+
def generate_message(out, name, version):
ofclasses = [x for x in build_ofclasses(version)
if utils.class_is_message(x.name)]