[Asterisk-Dev] Asterisk-Dev] ast_expr.y compiliation failures with RH7.2

Steve Murphy murf at e-tools.com
Mon May 3 16:09:45 MST 2004


>> Thanks, I saw it come across the cvs-digest but I still do not know
>> the
>> particulars of the changes. I don't even know who Murf is :-)

Hi, I'm  "murf", aka Steve Murphy.

**I** did the evil thing.

I submitted the patch to upgrade the ast_expr.y.

Now, my machine is a RH9 machine, running bison 1.35. And all is well in
this situation.

I don't know why a RH7.2 machine with a bison 1.35 will not handle the
"location" feature. The only thing I can think of is that the patches
applied by RH to any release usually only apply the necc. security
patches, and usually do not upgrade any functionality or new
features...?

I suggest in this case, obtaining a fresh bison release from maybe
ftp.gnu.org or somesuch, and building and installing it under 7.2.  This
will surely solve the problem. If it doesn't, send me your results, and
we'll work it out.

=============================

Along this line, I've gotten (spotted) one complaint that has had me
hopping today. That is, one user reports that this kind of expression is
no longer working, but has been till now:

(from Tais M. Hansen:)

        Hi,
        
        Has the expression parser logic changed in some way? Latest
        changes breaks a 
        simple expression such as:
        
        exten => _XX.,1,GotoIf($["${calledid}" != ""]?3)
        
        Here's the error:
        
        May  3 13:07:50 WARNING[524295]: ast_expr.y:431 ast_yyerror:
        ast_yyerror(): 
        syntax error: parse error; Input:
        "12345678" != ""
        ^^^^^^^^^                ^
        
My reaction to this is that maybe I should modify the code to NOT strip 
the ""'s from around a string token.

Well, I thought for a bit that maybe this MIGHT conflict with the WIKI,
which advises the detection of a null string in a different way...

http://www.voip-info.org/wiki-Asterisk+cmd+GotoIf :

        Hint
        You can test for an empty value, but instead of using "" you'd
        do this: 
          GotoIf($[foo${CALLERIDNUM} = foo]?3:2)
        
        If the variable (here CALLERIDNUM) has not been set you'll see
        an error like the one below unless you apply the "foo" trick: 
          WARNING65553: ast_expr.y:346 ast_yyerror: ast_yyerror(): syntax error: parse error
        
Now, Tais has been successfully able to use the "" as a null string test
because his "{calledid}" is wrapped in double quotes. When it's empty,
the double quotes remain, and "" = ""... So, why not?

So, I am busily making the tweak to NOT strip the double quotes. That
way, both Tais's method, and the WIKI method will both work. I'll submit
this as a new bug + patch, as soon as I run a few more tests to make
sure it's ok.

As an aside, you know, I could upgrade the expr code to not NEED a space
to break tokens up. I'm really tempted! That way, 

exten => _XX.,1,GotoIf($["${calledid}" != ""]?3)

Could just as well be:

exten => _XX.,1,GotoIf($["${calledid}"!=""]?3)

and be OK.

but, well, ... I'd use lex, and right at the moment, looks like just
using a late model bison is creating heat, I tend to wonder what a new
tool requirement might do...!

murf









More information about the asterisk-dev mailing list