Csound Csound-dev Csound-tekno Search About

[Cs-dev] Can we do something about the spaces before '('?

Date2013-11-08 00:38
FromAndres Cabrera
Subject[Cs-dev] Can we do something about the spaces before '('?
AttachmentsNone  None  
Hi,

I want to take another stab at looking whether we can do better at solving the space and '(' issue in Csound6.

The problem is:
aaa bbb (ccc)

is ambiguous because you don't know whether opcode aaa is taking bbb(ccc) as argument or whether opcode bbb is outputing aaa and takes argument (ccc).

I don't know enough about the parser and its phases, but I think that in most cases ambiguity can be resolved through additional knowledge of the tokens.

For example, if we know aaa is an opcode, then bbb(ccc) is its argument, but if aaa is not an opcode and bbb is then aaa is the output. So the question is, can we check at that stage of parsing whether tokens are opcodes to try to disambiguate the syntax?

Would there still be ambiguities if we can check this?

If this is hard, there are other things that can help disambiguating, to help solve some of the previous usages:

* If there is an "equal" token ( = ) followed by a token and a parenthesis, then the token is an opcode.
* If there are commas within the parenthesis, then the contents are parameters to the previous token.
* If there are three tokens separated by spaces, followed by parenthesis, then the third token is a function, e.g.:

aaa bbb ccc (ddd)

In other words, the only current ambiguity (that I can think of) occurs when the first token is an opcode without outputs. It seems to me other cases are not ambiguous.

Thoughts? Can this be improved?

Cheers,
Andrés

Date2013-11-10 17:49
FromAndres Cabrera
SubjectRe: [Cs-dev] Can we do something about the spaces before '('?
AttachmentsNone  None  
bump!


On Thu, Nov 7, 2013 at 4:38 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
Hi,

I want to take another stab at looking whether we can do better at solving the space and '(' issue in Csound6.

The problem is:
aaa bbb (ccc)

is ambiguous because you don't know whether opcode aaa is taking bbb(ccc) as argument or whether opcode bbb is outputing aaa and takes argument (ccc).

I don't know enough about the parser and its phases, but I think that in most cases ambiguity can be resolved through additional knowledge of the tokens.

For example, if we know aaa is an opcode, then bbb(ccc) is its argument, but if aaa is not an opcode and bbb is then aaa is the output. So the question is, can we check at that stage of parsing whether tokens are opcodes to try to disambiguate the syntax?

Would there still be ambiguities if we can check this?

If this is hard, there are other things that can help disambiguating, to help solve some of the previous usages:

* If there is an "equal" token ( = ) followed by a token and a parenthesis, then the token is an opcode.
* If there are commas within the parenthesis, then the contents are parameters to the previous token.
* If there are three tokens separated by spaces, followed by parenthesis, then the third token is a function, e.g.:

aaa bbb ccc (ddd)

In other words, the only current ambiguity (that I can think of) occurs when the first token is an opcode without outputs. It seems to me other cases are not ambiguous.

Thoughts? Can this be improved?

Cheers,
Andrés


Date2013-11-10 19:56
FromRory Walsh
SubjectRe: [Cs-dev] Can we do something about the spaces before '('?
I'm also eager to hear any thoughts on this!

On 10 November 2013 17:49, Andres Cabrera  wrote:
> bump!
>
>
> On Thu, Nov 7, 2013 at 4:38 PM, Andres Cabrera 
> wrote:
>>
>> Hi,
>>
>> I want to take another stab at looking whether we can do better at solving
>> the space and '(' issue in Csound6.
>>
>> The problem is:
>> aaa bbb (ccc)
>>
>> is ambiguous because you don't know whether opcode aaa is taking bbb(ccc)
>> as argument or whether opcode bbb is outputing aaa and takes argument (ccc).
>>
>> I don't know enough about the parser and its phases, but I think that in
>> most cases ambiguity can be resolved through additional knowledge of the
>> tokens.
>>
>> For example, if we know aaa is an opcode, then bbb(ccc) is its argument,
>> but if aaa is not an opcode and bbb is then aaa is the output. So the
>> question is, can we check at that stage of parsing whether tokens are
>> opcodes to try to disambiguate the syntax?
>>
>> Would there still be ambiguities if we can check this?
>>
>> If this is hard, there are other things that can help disambiguating, to
>> help solve some of the previous usages:
>>
>> * If there is an "equal" token ( = ) followed by a token and a
>> parenthesis, then the token is an opcode.
>> * If there are commas within the parenthesis, then the contents are
>> parameters to the previous token.
>> * If there are three tokens separated by spaces, followed by parenthesis,
>> then the third token is a function, e.g.:
>>
>> aaa bbb ccc (ddd)
>>
>> In other words, the only current ambiguity (that I can think of) occurs
>> when the first token is an opcode without outputs. It seems to me other
>> cases are not ambiguous.
>>
>> Thoughts? Can this be improved?
>>
>> Cheers,
>> Andrés
>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-11-10 20:14
Frompeiman khosravi
SubjectRe: [Cs-dev] Can we do something about the spaces before '('?
AttachmentsNone  None  
I can't help obviously but it would be a welcome effort. It's a bit annoying that some old code has broken because of this.  

Best,
Peiman



On 10 November 2013 19:56, Rory Walsh <rorywalsh@ear.ie> wrote:
I'm also eager to hear any thoughts on this!

On 10 November 2013 17:49, Andres Cabrera <mantaraya36@gmail.com> wrote:
> bump!
>
>
> On Thu, Nov 7, 2013 at 4:38 PM, Andres Cabrera <mantaraya36@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I want to take another stab at looking whether we can do better at solving
>> the space and '(' issue in Csound6.
>>
>> The problem is:
>> aaa bbb (ccc)
>>
>> is ambiguous because you don't know whether opcode aaa is taking bbb(ccc)
>> as argument or whether opcode bbb is outputing aaa and takes argument (ccc).
>>
>> I don't know enough about the parser and its phases, but I think that in
>> most cases ambiguity can be resolved through additional knowledge of the
>> tokens.
>>
>> For example, if we know aaa is an opcode, then bbb(ccc) is its argument,
>> but if aaa is not an opcode and bbb is then aaa is the output. So the
>> question is, can we check at that stage of parsing whether tokens are
>> opcodes to try to disambiguate the syntax?
>>
>> Would there still be ambiguities if we can check this?
>>
>> If this is hard, there are other things that can help disambiguating, to
>> help solve some of the previous usages:
>>
>> * If there is an "equal" token ( = ) followed by a token and a
>> parenthesis, then the token is an opcode.
>> * If there are commas within the parenthesis, then the contents are
>> parameters to the previous token.
>> * If there are three tokens separated by spaces, followed by parenthesis,
>> then the third token is a function, e.g.:
>>
>> aaa bbb ccc (ddd)
>>
>> In other words, the only current ambiguity (that I can think of) occurs
>> when the first token is an opcode without outputs. It seems to me other
>> cases are not ambiguous.
>>
>> Thoughts? Can this be improved?
>>
>> Cheers,
>> Andrés
>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2013-11-12 18:20
FromSteven Yi
SubjectRe: [Cs-dev] Can we do something about the spaces before '('?
AttachmentsNone  None  
I chatted with Victor and John about this a week or two ago on IRC.  Just FYI, I've had in mind to do some exploratory work on a new parser/compiler (I've been calling it parser3, instead of new-new-parser :P). The idea is that it will know even less that what the current parser knows and try to move more of the work to the semantic analyzer.  Within that is the plan to figure out how to remove the parentheses ambiguity.  

I'm still getting reorganized after being in Pittsburgh, but would like to start a branch for this soon.  I may do some preliminary work with ANTLR for my own experimentation though before doing the branch and figuring out what changes would be necessary for Flex/Bison.  


On Sun, Nov 10, 2013 at 3:14 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
I can't help obviously but it would be a welcome effort. It's a bit annoying that some old code has broken because of this.  

Best,
Peiman



On 10 November 2013 19:56, Rory Walsh <rorywalsh@ear.ie> wrote:
I'm also eager to hear any thoughts on this!

On 10 November 2013 17:49, Andres Cabrera <mantaraya36@gmail.com> wrote:
> bump!
>
>
> On Thu, Nov 7, 2013 at 4:38 PM, Andres Cabrera <mantaraya36@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I want to take another stab at looking whether we can do better at solving
>> the space and '(' issue in Csound6.
>>
>> The problem is:
>> aaa bbb (ccc)
>>
>> is ambiguous because you don't know whether opcode aaa is taking bbb(ccc)
>> as argument or whether opcode bbb is outputing aaa and takes argument (ccc).
>>
>> I don't know enough about the parser and its phases, but I think that in
>> most cases ambiguity can be resolved through additional knowledge of the
>> tokens.
>>
>> For example, if we know aaa is an opcode, then bbb(ccc) is its argument,
>> but if aaa is not an opcode and bbb is then aaa is the output. So the
>> question is, can we check at that stage of parsing whether tokens are
>> opcodes to try to disambiguate the syntax?
>>
>> Would there still be ambiguities if we can check this?
>>
>> If this is hard, there are other things that can help disambiguating, to
>> help solve some of the previous usages:
>>
>> * If there is an "equal" token ( = ) followed by a token and a
>> parenthesis, then the token is an opcode.
>> * If there are commas within the parenthesis, then the contents are
>> parameters to the previous token.
>> * If there are three tokens separated by spaces, followed by parenthesis,
>> then the third token is a function, e.g.:
>>
>> aaa bbb ccc (ddd)
>>
>> In other words, the only current ambiguity (that I can think of) occurs
>> when the first token is an opcode without outputs. It seems to me other
>> cases are not ambiguous.
>>
>> Thoughts? Can this be improved?
>>
>> Cheers,
>> Andrés
>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-11-12 20:26
FromAndres Cabrera
SubjectRe: [Cs-dev] Can we do something about the spaces before '('?
AttachmentsNone  None  
Hi Steven,

Thanks for the info. Wow, what an interesting project. Would there be other advantages with this new parser (apart from hours of brain twisting fun :) ) ? Does it open up other possibilities?

Cheers,
Andrés


On Tue, Nov 12, 2013 at 10:20 AM, Steven Yi <stevenyi@gmail.com> wrote:
I chatted with Victor and John about this a week or two ago on IRC.  Just FYI, I've had in mind to do some exploratory work on a new parser/compiler (I've been calling it parser3, instead of new-new-parser :P). The idea is that it will know even less that what the current parser knows and try to move more of the work to the semantic analyzer.  Within that is the plan to figure out how to remove the parentheses ambiguity.  

I'm still getting reorganized after being in Pittsburgh, but would like to start a branch for this soon.  I may do some preliminary work with ANTLR for my own experimentation though before doing the branch and figuring out what changes would be necessary for Flex/Bison.  


On Sun, Nov 10, 2013 at 3:14 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
I can't help obviously but it would be a welcome effort. It's a bit annoying that some old code has broken because of this.  

Best,
Peiman



On 10 November 2013 19:56, Rory Walsh <rorywalsh@ear.ie> wrote:
I'm also eager to hear any thoughts on this!

On 10 November 2013 17:49, Andres Cabrera <mantaraya36@gmail.com> wrote:
> bump!
>
>
> On Thu, Nov 7, 2013 at 4:38 PM, Andres Cabrera <mantaraya36@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I want to take another stab at looking whether we can do better at solving
>> the space and '(' issue in Csound6.
>>
>> The problem is:
>> aaa bbb (ccc)
>>
>> is ambiguous because you don't know whether opcode aaa is taking bbb(ccc)
>> as argument or whether opcode bbb is outputing aaa and takes argument (ccc).
>>
>> I don't know enough about the parser and its phases, but I think that in
>> most cases ambiguity can be resolved through additional knowledge of the
>> tokens.
>>
>> For example, if we know aaa is an opcode, then bbb(ccc) is its argument,
>> but if aaa is not an opcode and bbb is then aaa is the output. So the
>> question is, can we check at that stage of parsing whether tokens are
>> opcodes to try to disambiguate the syntax?
>>
>> Would there still be ambiguities if we can check this?
>>
>> If this is hard, there are other things that can help disambiguating, to
>> help solve some of the previous usages:
>>
>> * If there is an "equal" token ( = ) followed by a token and a
>> parenthesis, then the token is an opcode.
>> * If there are commas within the parenthesis, then the contents are
>> parameters to the previous token.
>> * If there are three tokens separated by spaces, followed by parenthesis,
>> then the third token is a function, e.g.:
>>
>> aaa bbb ccc (ddd)
>>
>> In other words, the only current ambiguity (that I can think of) occurs
>> when the first token is an opcode without outputs. It seems to me other
>> cases are not ambiguous.
>>
>> Thoughts? Can this be improved?
>>
>> Cheers,
>> Andrés
>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-11-12 20:38
FromSteven Yi
SubjectRe: [Cs-dev] Can we do something about the spaces before '('?
AttachmentsNone  None  
Well, I see user-defined types and type specifiers as being part of this as well.  Moving some of this code around may also help to implement type inference, and also might remove some quirky things like pre-defining UDO's without first being verified.  There's also some the issue with labels in the current parser that has proven tricky, and I think a re-design would help with that.  This is a bit speculative at the moment though and I'm acting on hunches; I really need to just put some time into it to try it out to proceed.


On Tue, Nov 12, 2013 at 3:26 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
Hi Steven,

Thanks for the info. Wow, what an interesting project. Would there be other advantages with this new parser (apart from hours of brain twisting fun :) ) ? Does it open up other possibilities?

Cheers,
Andrés


On Tue, Nov 12, 2013 at 10:20 AM, Steven Yi <stevenyi@gmail.com> wrote:
I chatted with Victor and John about this a week or two ago on IRC.  Just FYI, I've had in mind to do some exploratory work on a new parser/compiler (I've been calling it parser3, instead of new-new-parser :P). The idea is that it will know even less that what the current parser knows and try to move more of the work to the semantic analyzer.  Within that is the plan to figure out how to remove the parentheses ambiguity.  

I'm still getting reorganized after being in Pittsburgh, but would like to start a branch for this soon.  I may do some preliminary work with ANTLR for my own experimentation though before doing the branch and figuring out what changes would be necessary for Flex/Bison.  


On Sun, Nov 10, 2013 at 3:14 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
I can't help obviously but it would be a welcome effort. It's a bit annoying that some old code has broken because of this.  

Best,
Peiman



On 10 November 2013 19:56, Rory Walsh <rorywalsh@ear.ie> wrote:
I'm also eager to hear any thoughts on this!

On 10 November 2013 17:49, Andres Cabrera <mantaraya36@gmail.com> wrote:
> bump!
>
>
> On Thu, Nov 7, 2013 at 4:38 PM, Andres Cabrera <mantaraya36@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I want to take another stab at looking whether we can do better at solving
>> the space and '(' issue in Csound6.
>>
>> The problem is:
>> aaa bbb (ccc)
>>
>> is ambiguous because you don't know whether opcode aaa is taking bbb(ccc)
>> as argument or whether opcode bbb is outputing aaa and takes argument (ccc).
>>
>> I don't know enough about the parser and its phases, but I think that in
>> most cases ambiguity can be resolved through additional knowledge of the
>> tokens.
>>
>> For example, if we know aaa is an opcode, then bbb(ccc) is its argument,
>> but if aaa is not an opcode and bbb is then aaa is the output. So the
>> question is, can we check at that stage of parsing whether tokens are
>> opcodes to try to disambiguate the syntax?
>>
>> Would there still be ambiguities if we can check this?
>>
>> If this is hard, there are other things that can help disambiguating, to
>> help solve some of the previous usages:
>>
>> * If there is an "equal" token ( = ) followed by a token and a
>> parenthesis, then the token is an opcode.
>> * If there are commas within the parenthesis, then the contents are
>> parameters to the previous token.
>> * If there are three tokens separated by spaces, followed by parenthesis,
>> then the third token is a function, e.g.:
>>
>> aaa bbb ccc (ddd)
>>
>> In other words, the only current ambiguity (that I can think of) occurs
>> when the first token is an opcode without outputs. It seems to me other
>> cases are not ambiguous.
>>
>> Thoughts? Can this be improved?
>>
>> Cheers,
>> Andrés
>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-11-13 00:45
FromAndres Cabrera
SubjectRe: [Cs-dev] Can we do something about the spaces before '('?
AttachmentsNone  None  
Thanks for the details. Sounds very useful.

Cheers,
Andrés


On Tue, Nov 12, 2013 at 12:38 PM, Steven Yi <stevenyi@gmail.com> wrote:
Well, I see user-defined types and type specifiers as being part of this as well.  Moving some of this code around may also help to implement type inference, and also might remove some quirky things like pre-defining UDO's without first being verified.  There's also some the issue with labels in the current parser that has proven tricky, and I think a re-design would help with that.  This is a bit speculative at the moment though and I'm acting on hunches; I really need to just put some time into it to try it out to proceed.


On Tue, Nov 12, 2013 at 3:26 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
Hi Steven,

Thanks for the info. Wow, what an interesting project. Would there be other advantages with this new parser (apart from hours of brain twisting fun :) ) ? Does it open up other possibilities?

Cheers,
Andrés


On Tue, Nov 12, 2013 at 10:20 AM, Steven Yi <stevenyi@gmail.com> wrote:
I chatted with Victor and John about this a week or two ago on IRC.  Just FYI, I've had in mind to do some exploratory work on a new parser/compiler (I've been calling it parser3, instead of new-new-parser :P). The idea is that it will know even less that what the current parser knows and try to move more of the work to the semantic analyzer.  Within that is the plan to figure out how to remove the parentheses ambiguity.  

I'm still getting reorganized after being in Pittsburgh, but would like to start a branch for this soon.  I may do some preliminary work with ANTLR for my own experimentation though before doing the branch and figuring out what changes would be necessary for Flex/Bison.  


On Sun, Nov 10, 2013 at 3:14 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:
I can't help obviously but it would be a welcome effort. It's a bit annoying that some old code has broken because of this.  

Best,
Peiman



On 10 November 2013 19:56, Rory Walsh <rorywalsh@ear.ie> wrote:
I'm also eager to hear any thoughts on this!

On 10 November 2013 17:49, Andres Cabrera <mantaraya36@gmail.com> wrote:
> bump!
>
>
> On Thu, Nov 7, 2013 at 4:38 PM, Andres Cabrera <mantaraya36@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I want to take another stab at looking whether we can do better at solving
>> the space and '(' issue in Csound6.
>>
>> The problem is:
>> aaa bbb (ccc)
>>
>> is ambiguous because you don't know whether opcode aaa is taking bbb(ccc)
>> as argument or whether opcode bbb is outputing aaa and takes argument (ccc).
>>
>> I don't know enough about the parser and its phases, but I think that in
>> most cases ambiguity can be resolved through additional knowledge of the
>> tokens.
>>
>> For example, if we know aaa is an opcode, then bbb(ccc) is its argument,
>> but if aaa is not an opcode and bbb is then aaa is the output. So the
>> question is, can we check at that stage of parsing whether tokens are
>> opcodes to try to disambiguate the syntax?
>>
>> Would there still be ambiguities if we can check this?
>>
>> If this is hard, there are other things that can help disambiguating, to
>> help solve some of the previous usages:
>>
>> * If there is an "equal" token ( = ) followed by a token and a
>> parenthesis, then the token is an opcode.
>> * If there are commas within the parenthesis, then the contents are
>> parameters to the previous token.
>> * If there are three tokens separated by spaces, followed by parenthesis,
>> then the third token is a function, e.g.:
>>
>> aaa bbb ccc (ddd)
>>
>> In other words, the only current ambiguity (that I can think of) occurs
>> when the first token is an opcode without outputs. It seems to me other
>> cases are not ambiguous.
>>
>> Thoughts? Can this be improved?
>>
>> Cheers,
>> Andrés
>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk

_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel