Csound Csound-dev Csound-tekno Search About

[Cs-dev] precedence

Date2011-12-24 10:35
FromTito Latini
Subject[Cs-dev] precedence
AttachmentsNone  

Date2011-12-24 10:54
FromVictor Lazzarini
SubjectRe: [Cs-dev] precedence
Thanks, Tito, and a happy christmas to you and everyone here.

Victor
On 24 Dec 2011, at 10:35, Tito Latini wrote:

> The example of the manual `pconvolve.csd' doesn't work
> with the new parser. The cause is in this line:
> 
>  kmix = (kmix < 0 || kmix > 1 ? .5 : kmix)
> 
> There is a problem of precedence with the '?' operator.
> The precedences in `csound_orc.y' are confused for me,
> and they doesn't follow the rules of the C language.
> However, I have fixed only the bug. A possible reorganization of the
> precedences for the operators (ala C) is
> 
> %left '?'
> %left S_OR
> %left S_AND
> %left '|'
> %left '&'
> %left S_EQ S_NEQ
> %left S_LT S_GT S_LEQ S_GEQ
> %left S_BITSHIFT_LEFT S_BITSHIFT_RIGHT
> %left '+' '-'
> %left '*' '/' '%'
> %right '~' S_UNOT S_UMINUS
> 
> Merry Xmas at All
> 
> The Grinch
> 
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create 
> new or port existing apps to sell to consumers worldwide. Explore the 
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-12-27 12:02
Fromjohn ffitch
SubjectRe: [Cs-dev] precedence
The precedence cannot (necessarily) be changed like this.  It must be
the same as the old parser which is not (necessarily) the same as C.
I am very happy for you to work on it -- never been that good at
precedence

==John ffitch

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-12-28 04:51
FromSteven Yi
SubjectRe: [Cs-dev] precedence
AttachmentsNone  None  
I'm curious, what are the exact differences between what is in the old parser and what is in C?  Also, it seems to me that the general precedence rules for this area are pretty much standardized amongst various languages.  Could someone provide an example of something that would work in the old parser but not in C?  Also, might we consider moving over to the C-style for precedence and consider the old parser implementation a bug?

Thanks!
steven

On Tue, Dec 27, 2011 at 7:02 AM, john ffitch <jpff@codemist.co.uk> wrote:
The precedence cannot (necessarily) be changed like this.  It must be
the same as the old parser which is not (necessarily) the same as C.
I am very happy for you to work on it -- never been that good at
precedence

==John ffitch

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2011-12-28 10:48
FromTito Latini
SubjectRe: [Cs-dev] precedence
AttachmentsNone  

Date2011-12-31 00:49
FromSteven Yi
SubjectRe: [Cs-dev] precedence
Well, we've been mostly following that we need to preserve semantics
with the old parser.  This looks like it is a case where the new
parser is incorrect, if the old parser is following C semantics.  So
any move to fix that would be awesome, IMO.

Thanks!
steven

On Wed, Dec 28, 2011 at 5:48 AM, Tito Latini  wrote:
> The old parser seems c-like, but the new is not always complatible
> with the old, mostly with the bitwise operators. Here is an example
>
> |----------------------------+---+------------+------------|
> | op                         | C | old parser | new parser |
> |----------------------------+---+------------+------------|
> | 1 + 1 & 1                  | 0 |          0 |          2 |
> | 1 + 1 | 1                  | 3 |          3 |          2 |
> | 1 + 1 << 1                 | 4 |          4 |          3 |
> | 2 + 2 >> 1                 | 2 |          2 |          3 |
> |----------------------------+---+------------+------------|
>
> It isn't enough to modify only the precedence in yacc, it is also
> probably necessary to see the rule for `expr' again. The simplest
> solution is to recommend the use of the parentheses.
>
> (tito)
>
> On Tue, Dec 27, 2011 at 11:51:56PM -0500, Steven Yi wrote:
>> I'm curious, what are the exact differences between what is in the old
>> parser and what is in C?  Also, it seems to me that the general precedence
>> rules for this area are pretty much standardized amongst various languages.
>>  Could someone provide an example of something that would work in the old
>> parser but not in C?  Also, might we consider moving over to the C-style
>> for precedence and consider the old parser implementation a bug?
>>
>> Thanks!
>> steven
>>
>> On Tue, Dec 27, 2011 at 7:02 AM, john ffitch wrote:
>>
>> > The precedence cannot (necessarily) be changed like this.  It must be
>> > the same as the old parser which is not (necessarily) the same as C.
>> > I am very happy for you to work on it -- never been that good at
>> > precedence
>> >
>> > ==John ffitch
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-12-31 17:17
FromJohn ffitch
SubjectRe: [Cs-dev] precedence
AttachmentsNone  None  
Tito -- do make the changes.  I think that the new parser implemnets what 
I think is correct and C is mathematically wrong -- based on a problem in 
BCPL I seem to remember.  But compatability is everything here.  Shame 
though
==John ff


On Fri, 30 Dec 2011, Steven Yi wrote:

> Well, we've been mostly following that we need to preserve semantics
> with the old parser.  This looks like it is a case where the new
> parser is incorrect, if the old parser is following C semantics.  So
> any move to fix that would be awesome, IMO.
>
> Thanks!
> steven
>
> On Wed, Dec 28, 2011 at 5:48 AM, Tito Latini  wrote:
>> The old parser seems c-like, but the new is not always complatible
>> with the old, mostly with the bitwise operators. Here is an example
>>
>> |----------------------------+---+------------+------------|
>> | op                         | C | old parser | new parser |
>> |----------------------------+---+------------+------------|
>> | 1 + 1 & 1                  | 0 |          0 |          2 |
>> | 1 + 1 | 1                  | 3 |          3 |          2 |
>> | 1 + 1 << 1                 | 4 |          4 |          3 |
>> | 2 + 2 >> 1                 | 2 |          2 |          3 |
>> |----------------------------+---+------------+------------|
>>
>> It isn't enough to modify only the precedence in yacc, it is also
>> probably necessary to see the rule for `expr' again. The simplest
>> solution is to recommend the use of the parentheses.
>>
>> (tito)
>>

Date2012-01-01 16:19
FromTito Latini
SubjectRe: [Cs-dev] precedence
AttachmentsNone  

Date2012-01-01 17:45
FromTito Latini
SubjectRe: [Cs-dev] precedence
AttachmentsNone  

Date2012-01-01 18:05
FromTito Latini
SubjectRe: [Cs-dev] precedence
AttachmentsNone  

Date2012-01-01 19:18
FromVictor Lazzarini
SubjectRe: [Cs-dev] precedence
well done.
On 1 Jan 2012, at 18:05, Tito Latini wrote:

> good news
> 
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual 
> desktops for less than the cost of PCs and save 60% on VDI infrastructure 
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net