55 |
|
|
56 |
res->number = NUMBER_UNDEFINED; |
res->number = NUMBER_UNDEFINED; |
57 |
res->prec = 0; |
res->prec = 0; |
58 |
res->assoc = right_assoc; |
res->assoc = undef_assoc; |
59 |
res->user_token_number = USER_NUMBER_UNDEFINED; |
res->user_token_number = USER_NUMBER_UNDEFINED; |
60 |
|
|
61 |
res->alias = NULL; |
res->alias = NULL; |
129 |
|
|
130 |
void |
void |
131 |
symbol_precedence_set (symbol_t *symbol, |
symbol_precedence_set (symbol_t *symbol, |
132 |
int prec, associativity assoc, location_t location) |
int prec, assoc_t assoc, location_t location) |
133 |
{ |
{ |
134 |
if (assoc != undef_assoc) |
if (assoc != undef_assoc) |
135 |
{ |
{ |
288 |
|
|
289 |
if (this->assoc != this->alias->assoc) |
if (this->assoc != this->alias->assoc) |
290 |
{ |
{ |
291 |
/* FIXME: For some reason (probably the S/R => keep the S), |
if (this->assoc != undef_assoc && this->alias->assoc != undef_assoc) |
|
the right assoc is chosen has the ``not set''. This is |
|
|
not nice, fix this! */ |
|
|
if (this->assoc != right_assoc |
|
|
&& this->alias->assoc != right_assoc) |
|
292 |
complain_at (this->alias->location, |
complain_at (this->alias->location, |
293 |
_("conflicting associativities for %s and %s"), |
_("conflicting associativities for %s (%s) and %s (%s)"), |
294 |
this->tag, this->alias->tag); |
this->tag, assoc_to_string (this->assoc), |
295 |
if (this->assoc != 0) |
this->alias->tag, assoc_to_string (this->alias->assoc)); |
296 |
|
if (this->assoc != undef_assoc) |
297 |
this->alias->assoc = this->assoc; |
this->alias->assoc = this->assoc; |
298 |
else |
else |
299 |
this->assoc = this->alias->assoc; |
this->assoc = this->alias->assoc; |