}
VALA_CODE_NODE (current_symbol)->attributes = $2;
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL (current_symbol), $3);
}
if (($4 & VALA_MODIFIER_ABSTRACT) == VALA_MODIFIER_ABSTRACT) {
opt_access_modifier
: /* empty */
{
- $$ = 0;
+ $$ = -1;
}
| access_modifier
;
g_object_unref (src);
g_object_unref ($5);
g_object_unref ($6);
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL ($$), $3);
}
VALA_CODE_NODE($$)->attributes = $2;
$$ = vala_code_context_create_field (context, vala_symbol_get_name (VALA_SYMBOL ($6)), $5, vala_variable_declarator_get_initializer ($6), src);
g_object_unref (src);
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL ($$), $3);
}
if (($4 & VALA_MODIFIER_STATIC) == VALA_MODIFIER_STATIC) {
$$ = vala_code_context_create_method (context, $6, $5, src);
g_object_unref (src);
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL ($$), $3);
}
if (($4 & VALA_MODIFIER_STATIC) == VALA_MODIFIER_STATIC) {
g_free ($6);
g_object_unref (src);
vala_method_set_instance ($$, FALSE);
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL ($$), $3);
}
VALA_CODE_NODE($$)->attributes = $2;
VALA_CODE_NODE($$)->attributes = $2;
- vala_symbol_set_access (VALA_SYMBOL ($$), $3);
+ if ($3 != -1) {
+ vala_symbol_set_access (VALA_SYMBOL ($$), $3);
+ }
g_object_unref ($5);
g_free ($6);
VALA_CODE_NODE($$)->attributes = $2;
- vala_symbol_set_access (VALA_SYMBOL ($$), $3);
+ if ($3 != -1) {
+ vala_symbol_set_access (VALA_SYMBOL ($$), $3);
+ }
g_object_unref ($5);
g_free ($6);
;
get_accessor_declaration
- : opt_attributes GET method_body
+ : opt_attributes opt_access_modifier GET method_body
{
- ValaSourceReference *src = src(@2);
- $$ = vala_code_context_create_property_accessor (context, TRUE, FALSE, FALSE, $3, src);
+ ValaSourceReference *src = src(@3);
+ $$ = vala_code_context_create_property_accessor (context, TRUE, FALSE, FALSE, $4, src);
g_object_unref (src);
+ if ($4 != NULL) {
+ g_object_unref ($4);
+ }
- if ($3 != NULL) {
- g_object_unref ($3);
+ if ($2 != -1) {
+ vala_property_accessor_set_access ($$, $2);
+ } else {
+ vala_property_accessor_set_access ($$, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
}
}
;
;
set_accessor_declaration
- : opt_attributes SET method_body
+ : opt_attributes opt_access_modifier SET method_body
{
- ValaSourceReference *src = src(@2);
- $$ = vala_code_context_create_property_accessor (context, FALSE, TRUE, FALSE, $3, src);
- g_object_unref (src);
- if ($3 != NULL) {
- g_object_unref ($3);
- }
- }
- | opt_attributes SET CONSTRUCT method_body
- {
- ValaSourceReference *src = src(@2);
- $$ = vala_code_context_create_property_accessor (context, FALSE, TRUE, TRUE, $4, src);
+ ValaSourceReference *src = src(@3);
+ $$ = vala_code_context_create_property_accessor (context, FALSE, TRUE, FALSE, $4, src);
g_object_unref (src);
if ($4 != NULL) {
g_object_unref ($4);
}
+
+ if ($2 != -1) {
+ vala_property_accessor_set_access ($$, $2);
+ } else {
+ vala_property_accessor_set_access ($$, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
+ }
}
- | opt_attributes CONSTRUCT method_body
+ | opt_attributes opt_access_modifier SET CONSTRUCT method_body
{
- ValaSourceReference *src = src(@2);
- $$ = vala_code_context_create_property_accessor (context, FALSE, FALSE, TRUE, $3, src);
+ ValaSourceReference *src = src(@3);
+ $$ = vala_code_context_create_property_accessor (context, FALSE, TRUE, TRUE, $5, src);
g_object_unref (src);
- if ($3 != NULL) {
- g_object_unref ($3);
+ if ($5 != NULL) {
+ g_object_unref ($5);
+ }
+
+ if ($2 != -1) {
+ vala_property_accessor_set_access ($$, $2);
+ } else {
+ vala_property_accessor_set_access ($$, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
}
}
- | opt_attributes CONSTRUCT SET method_body
+ | opt_attributes opt_access_modifier CONSTRUCT method_body
{
- ValaSourceReference *src = src(@2);
- $$ = vala_code_context_create_property_accessor (context, FALSE, TRUE, TRUE, $4, src);
+ ValaSourceReference *src = src(@3);
+ $$ = vala_code_context_create_property_accessor (context, FALSE, FALSE, TRUE, $4, src);
g_object_unref (src);
if ($4 != NULL) {
g_object_unref ($4);
}
+
+ if ($2 != -1) {
+ vala_property_accessor_set_access ($$, $2);
+ } else {
+ vala_property_accessor_set_access ($$, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
+ }
+ }
+ | opt_attributes opt_access_modifier CONSTRUCT SET method_body
+ {
+ ValaSourceReference *src = src(@3);
+ $$ = vala_code_context_create_property_accessor (context, FALSE, TRUE, TRUE, $5, src);
+ g_object_unref (src);
+ if ($5 != NULL) {
+ g_object_unref ($5);
+ }
+
+ if ($2 != -1) {
+ vala_property_accessor_set_access ($$, $2);
+ } else {
+ vala_property_accessor_set_access ($$, VALA_SYMBOL_ACCESSIBILITY_PUBLIC);
+ }
}
;
ValaSourceReference *src = src_com(@6, $1);
$$ = vala_code_context_create_signal (context, $6, $5, src);
g_object_unref (src);
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL ($$), $3);
}
VALA_CODE_NODE($$)->attributes = $2;
vala_struct_add_type_parameter (VALA_STRUCT (current_symbol), l->data);
}
VALA_CODE_NODE(current_symbol)->attributes = $2;
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL (current_symbol), $3);
}
if ($8 != NULL) {
g_object_unref (parent_symbol);
VALA_CODE_NODE (iface)->attributes = $2;
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL (iface), $3);
}
if (($4 & VALA_MODIFIER_STATIC) == VALA_MODIFIER_STATIC) {
VALA_CODE_NODE (en)->attributes = $2;
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL (en), $3);
}
vala_source_file_add_node (current_source_file, VALA_CODE_NODE (cb));
g_object_unref (parent_symbol);
- if ($3 != 0) {
+ if ($3 != -1) {
vala_symbol_set_access (VALA_SYMBOL (cb), $3);
}
VALA_CODE_NODE (cb)->attributes = $2;