*/
public bool is_volatile { get; set; }
- /**
- * Specifies whether an array length field should implicitly be created
- * if the field type is an array.
- */
- public bool no_array_length { get; set; }
-
- /**
- * Specifies whether a delegate target field should implicitly be created
- * if the field type is a delegate.
- */
- public bool no_delegate_target { get; set; }
-
- /**
- * Specifies whether the array is null terminated.
- */
- public bool array_null_terminated { get; set; }
-
- /**
- * Specifies whether the array length field uses a custom name in C.
- */
- public bool has_array_length_cname {
- get { return (array_length_cname != null); }
- }
-
- /**
- * Specifies whether the array uses a custom C expression as length.
- */
- public bool has_array_length_cexpr {
- get { return (array_length_cexpr != null); }
- }
-
- /**
- * Specifies a custom type for the array length.
- */
- public string? array_length_type { get; set; default = null; }
-
- private string? array_length_cname;
-
- private string? array_length_cexpr;
-
private string cname;
private bool lock_used = false;
}
}
- /**
- * Returns the name of the array length field as it is used in C code
- *
- * @return the name of the array length field to be used in C code
- */
- public string? get_array_length_cname () {
- return this.array_length_cname;
- }
-
- /**
- * Sets the name of the array length field as it is used in C code
- *
- * @param array_length_cname the name of the array length field to be
- * used in C code
- */
- public void set_array_length_cname (string? array_length_cname) {
- this.array_length_cname = array_length_cname;
- }
-
- /**
- * Returns the array length expression as it is used in C code
- *
- * @return the array length expression to be used in C code
- */
- public string? get_array_length_cexpr () {
- return this.array_length_cexpr;
- }
-
-
- /**
- * Sets the array length expression as it is used in C code
- *
- * @param array_length_cexpr the array length expression to be used in C
- * code
- */
- public void set_array_length_cexpr (string? array_length_cexpr) {
- this.array_length_cexpr = array_length_cexpr;
- }
-
private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("cname")) {
set_cname (a.get_string ("cname"));
/**
* Process all associated attributes.
*/
- public void process_attributes () {
+ public override void process_attributes () {
+ base.process_attributes ();
+
foreach (Attribute a in attributes) {
if (a.name == "CCode") {
process_ccode_attribute (a);
*/
public bool params_array { get; set; }
- /**
- * Specifies whether the array length should be passed implicitly
- * if the parameter type is an array.
- */
- public bool no_array_length { get; set; }
-
- /**
- * Specifies whether the array is null terminated.
- */
- public bool array_null_terminated { get; set; }
-
- /**
- * Specifies whether the array length parameter uses a custom name in C.
- */
- public bool has_array_length_cname {
- get { return (array_length_cname != null); }
- }
-
- /**
- * Specifies a custom type for the array length.
- */
- public string? array_length_type { get; set; default = null; }
-
/**
* Specifies the position of the parameter in the C function.
*/
public bool captured { get; set; }
- private string? array_length_cname;
-
/**
* Creates a new formal parameter.
*
}
}
- /**
- * Returns the name of the array length parameter as it is used in C code
- *
- * @return the name of the array length parameter to be used in C code
- */
- public string? get_array_length_cname () {
- return this.array_length_cname;
- }
-
- /**
- * Sets the name of the array length parameter as it is used in C code
- *
- * @param array_length_cname the name of the array length parameter to be
- * used in C code
- */
- public void set_array_length_cname (string? array_length_cname) {
- this.array_length_cname = array_length_cname;
- }
-
private void process_ccode_attribute (Attribute a) {
if (a.has_argument ("type")) {
ctype = a.get_string ("type");
if (a.has_argument ("pos")) {
cparameter_position = a.get_double ("pos");
}
- if (a.has_argument ("array_length")) {
- no_array_length = !a.get_bool ("array_length");
- }
- if (a.has_argument ("array_length_type")) {
- array_length_type = a.get_string ("array_length_type");
- }
- if (a.has_argument ("array_null_terminated")) {
- array_null_terminated = a.get_bool ("array_null_terminated");
- }
if (a.has_argument ("array_length_pos")) {
carray_length_parameter_position = a.get_double ("array_length_pos");
}
- if (a.has_argument ("array_length_cname")) {
- set_array_length_cname (a.get_string ("array_length_cname"));
- }
if (a.has_argument ("delegate_target_pos")) {
cdelegate_target_parameter_position = a.get_double ("delegate_target_pos");
}
/**
* Process all associated attributes.
*/
- public void process_attributes () {
+ public override void process_attributes () {
+ base.process_attributes ();
+
foreach (Attribute a in attributes) {
if (a.name == "CCode") {
process_ccode_attribute (a);
}
}
+ /**
+ * Specifies whether an array length field should implicitly be created
+ * if the field type is an array.
+ */
+ public bool no_array_length { get; set; }
+
+ /**
+ * Specifies whether a delegate target field should implicitly be created
+ * if the field type is a delegate.
+ */
+ public bool no_delegate_target { get; set; }
+
+ /**
+ * Specifies whether the array is null terminated.
+ */
+ public bool array_null_terminated { get; set; }
+
+ /**
+ * Specifies whether the array length field uses a custom name in C.
+ */
+ public bool has_array_length_cname {
+ get { return (array_length_cname != null); }
+ }
+
+ /**
+ * Specifies whether the array uses a custom C expression as length.
+ */
+ public bool has_array_length_cexpr {
+ get { return (array_length_cexpr != null); }
+ }
+
+ /**
+ * Specifies a custom type for the array length.
+ */
+ public string? array_length_type { get; set; default = null; }
+
Expression? _initializer;
DataType? _variable_type;
+ private string? array_length_cname;
+
+ private string? array_length_cexpr;
+
public Variable (DataType? variable_type, string? name, Expression? initializer = null, SourceReference? source_reference = null, Comment? comment = null) {
base (name, source_reference, comment);
this.variable_type = variable_type;
this.initializer = initializer;
}
+
+ /**
+ * Returns the name of the array length variable as it is used in C code
+ *
+ * @return the name of the array length variable to be used in C code
+ */
+ public string? get_array_length_cname () {
+ return this.array_length_cname;
+ }
+
+ /**
+ * Sets the name of the array length variable as it is used in C code
+ *
+ * @param array_length_cname the name of the array length variable to be
+ * used in C code
+ */
+ public void set_array_length_cname (string? array_length_cname) {
+ this.array_length_cname = array_length_cname;
+ }
+
+ /**
+ * Returns the array length expression as it is used in C code
+ *
+ * @return the array length expression to be used in C code
+ */
+ public string? get_array_length_cexpr () {
+ return this.array_length_cexpr;
+ }
+
+
+ /**
+ * Sets the array length expression as it is used in C code
+ *
+ * @param array_length_cexpr the array length expression to be used in C
+ * code
+ */
+ public void set_array_length_cexpr (string? array_length_cexpr) {
+ this.array_length_cexpr = array_length_cexpr;
+ }
+
+ void process_ccode_attribute (Attribute a) {
+ if (a.has_argument ("array_length")) {
+ no_array_length = !a.get_bool ("array_length");
+ }
+ if (a.has_argument ("array_null_terminated")) {
+ array_null_terminated = a.get_bool ("array_null_terminated");
+ }
+ if (a.has_argument ("array_length_cname")) {
+ set_array_length_cname (a.get_string ("array_length_cname"));
+ }
+ if (a.has_argument ("array_length_cexpr")) {
+ set_array_length_cexpr (a.get_string ("array_length_cexpr"));
+ }
+ if (a.has_argument ("array_length_type")) {
+ array_length_type = a.get_string ("array_length_type");
+ }
+ if (a.has_argument ("delegate_target")) {
+ no_delegate_target = !a.get_bool ("delegate_target");
+ }
+ }
+
+ /**
+ * Process all associated attributes.
+ */
+ public virtual void process_attributes () {
+ foreach (Attribute a in attributes) {
+ if (a.name == "CCode") {
+ process_ccode_attribute (a);
+ }
+ }
+ }
}