Re: How to handle operator of undefined associativity

"BGB / cr88192" <cr88192@hotmail.com>
Sat, 1 May 2010 17:24:08 -0700

          From comp.compilers

Related articles
How to handle operator of undefined associativity singh.pallav@gmail.com (Pallav singh) (2010-04-29)
Re: How to handle operator of undefined associativity bear@sonic.net (Ray) (2010-05-01)
Re: How to handle operator of undefined associativity bartc@freeuk.com (bart.c) (2010-05-01)
Re: How to handle operator of undefined associativity cr88192@hotmail.com (BGB / cr88192) (2010-05-01)
Re: How to handle operator of undefined associativity cfc@shell01.TheWorld.com (Chris F Clark) (2010-05-02)
Re: How to handle operator of undefined associativity gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-05-03)
Re: How to handle operator of undefined associativity cr88192@hotmail.com (BGB / cr88192) (2010-05-05)
Re: How to handle operator of undefined associativity gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-05-05)
Re: How to handle operator of undefined associativity cfc@shell01.TheWorld.com (Chris F Clark) (2010-05-06)
Re: How to handle operator of undefined associativity sh006d3592@blueyonder.co.uk (Stephen Horne) (2010-05-07)
[3 later articles]
| List of all articles for this month |
From: "BGB / cr88192" <cr88192@hotmail.com>
Newsgroups: comp.compilers
Date: Sat, 1 May 2010 17:24:08 -0700
Organization: albasani.net
References: 10-04-073
Keywords: parse, syntax
Posted-Date: 02 May 2010 22:22:27 EDT

"Pallav singh" <singh.pallav@gmail.com> wrote in message


> we have a unary opeator ( not ) in system verilog assertion.
> the associativity of operator not is undefined.


> should user be allowed to write multiple not


> not not not ( expr );
> not not ( expr );


> [How does associativity matter here? Those examples may be redundant, but
> they're not ambiguous. -John]


yeah.


I guess I will add here that associativity only really makes sense when
binary operators are in use:
"3+4*5" => "(3+4)*5" or "3+(4*5)", ...


but, with a unary operator, there is only a single possible parsing:
the operator and the expression it operates on.


one can't have associativity directly between the operators, as this would
not make sense:
"! ! ! x" => "(! !) ! x;"? nope...


however, precedence ordering may still effect things:
"!x+3" => "(!x)+3" or "!(x+3)".



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.