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 | 316f49c3fd57a0e987dcf7ff896cb04bb3a28294 (patch) | |
| tree | 8d18b06be0acbe541ec92636c34dede2b5491068 /codegen.py | |
| parent | e1b9ba49aec2722af1d71a4e4e107a733169ee6b (diff) | |
| download | rabbitmq-server-git-316f49c3fd57a0e987dcf7ff896cb04bb3a28294.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
diff --git a/codegen.py b/codegen.py index 91c70e8196..d3b70d6c46 100644 --- a/codegen.py +++ b/codegen.py @@ -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)] |
