Csound Csound-dev Csound-tekno Search About

[Cs-dev] Yet another new parser problem

Date2011-05-31 16:45
FromJohn ff
Subject[Cs-dev] Yet another new parser problem
Discovered this trying to find a bass drum sound.

The expression (kshaper1 < 0 ? kshaper1:-kshaper1) 
causes problems as it thinks kshaper1: is a label
A space solves it but thi sis an incompatibility I am not sure how to
fix yet

PS Any good-ish bass drum instruments?
==John ffitch

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-05-31 17:11
FromSteven Yi
SubjectRe: [Cs-dev] Yet another new parser problem
I had introduced a context dependency when parsing integers to get
around a similar problem when parsing UDO Args:

{INTGR}         {
                    if(udoflag == 0) {
                        *lvalp = lookup_token(csound, yytext);
                    } else if(udoflag == 1) {
                        *lvalp = lookup_token(csound, yytext);
                        (*lvalp)->type = T_UDO_ARGS;
                    } else {
                        *lvalp = make_int(csound, yytext); return (T_INTGR);
                    }

                    csound->Message(csound,"%d\n", (*lvalp)->type);
                    return ((*lvalp)->type);
                }

I think what we could do is do another flag if parsing a tertiary
expression, and then the lexing rule for labels could check that flag
and if true, return the name part of the label and push back the :
onto the stack to get lexed again as a colon (assuming that the
:-kshaper1 would then be read as a colon, then variable name).  Not
sure if there are better ways to do this.

steven

On Tue, May 31, 2011 at 11:45 AM, John ff  wrote:
> Discovered this trying to find a bass drum sound.
>
> The expression (kshaper1 < 0 ? kshaper1:-kshaper1)
> causes problems as it thinks kshaper1: is a label
> A space solves it but thi sis an incompatibility I am not sure how to
> fix yet
>
> PS Any good-ish bass drum instruments?
> ==John ffitch
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger.
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Data protection magic?
> Nope - It's vRanger. Get your free trial download today.
> http://p.sf.net/sfu/quest-sfdev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net