diff options
author | Matthew Sackman <matthew@lshift.net> | 2010-02-17 15:56:38 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@lshift.net> | 2010-02-17 15:56:38 +0000 |
commit | 7fc3228a0ede49b24ec8b1ce90433e05577c701b (patch) | |
tree | 8d18b06be0acbe541ec92636c34dede2b5491068 /codegen.py | |
parent | 756aef9f9f8b4995352bbe62a57b44e0284a9448 (diff) | |
download | rabbitmq-server-7fc3228a0ede49b24ec8b1ce90433e05577c701b.tar.gz |
Add support for extracting field names for class properties
Diffstat (limited to 'codegen.py')
-rw-r--r-- | codegen.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -291,6 +291,9 @@ def genErl(spec): print 'amqp_exception(?%s) -> %s;' % \ (n, n.lower()) + def genClassPropsFieldnames(cls): + print "class_properties_fieldnames('P_%s') -> %s;" % (erlangize(cls.name), fieldNameList(cls.fields)) + methods = spec.allMethods() printFileHeader() @@ -310,6 +313,7 @@ def genErl(spec): -export([encode_properties/1]). -export([lookup_amqp_exception/1]). -export([amqp_exception/1]). +-export([class_properties_fieldnames/1]). bitvalue(true) -> 1; bitvalue(false) -> 0; @@ -354,6 +358,9 @@ bitvalue(undefined) -> 0. for(c,v,cls) in spec.constants: genAmqpException(c,v,cls) print "amqp_exception(_Code) -> undefined." + for c in spec.allClasses(): genClassPropsFieldnames(c) + print "class_properties_fieldnames(PropName) -> exit({unknown_class_properties_name, PropName})." + def genHrl(spec): def erlType(domain): return erlangTypeMap[spec.resolveDomain(domain)] |