X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fc_client.py;h=21359b53f7ee1633f7b59e36e90893613f150832;hb=18ff453edd42712ea4d1e7218bbe8829f9f4caba;hp=409054b12e470d89bd1e9bfd691940d78bef6030;hpb=17f6e04493c93014beaf3a704c8cc4d050cb13bf;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/c_client.py b/src/c_client.py index 409054b..21359b5 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -552,18 +552,22 @@ def _c_field_is_member_of_case_or_bitcase(field): def _c_helper_fieldaccess_expr(prefix, field=None): """ turn prefix, which is a list of tuples (name, separator, Type obj) into a string - representing a valid name in C (based on the context) - if field is not None, append the field name as well + representing a valid field-access-expression in C (based on the context) + if field is not None, append access to the field as well. + + "separator" is one of the C-operators "." or "->". + + A field access expression can consist of the following components: + * struct/union member access from a value with the "."-operator + * struct/union member access from a pointer with "->"-operator + * function-call of an accessor function: + This is used when a xcb-field is not contained in a struct. + This can, e.g., happen for fields after var-sized fields, etc. """ prefix_str = '' last_sep ='' for name, sep, obj in prefix: prefix_str += last_sep + name - if '' == sep: - sep = '->' - if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase - (obj.is_switch and len(obj.parents)>1)): - sep = '.' last_sep = sep if field is None: