Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#3 yacc version mismatch

Ingo Assenmacher

System: SuSe7.3 distro, i386, fox-1.0.7,

yacc version, according to kpackage: 91.7.30-379

configure goes through without any problem, then
during make:

oskar:/opt/manually_installed/ReZound-0.1.1alpha #
Making all in src
make[1]: Entering directory
Making all in misc
make[2]: Entering directory
Making all in CNestedDataFile
make[3]: Entering directory

*************** FAILS **********************
yacc -pcfg_ -bcfg_
../../../src/misc/CNestedDataFile/cfg.y -o cfg.tab.cc
usage: yacc [-dlrtv] [-b file_prefix] [-p symbol_prefix]


make[3]: *** [cfg.tab.cc] Error 1
make[3]: Leaving directory
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
make: *** [all-recursive] Error 1

(I entered the line with the atserisks ;)

obviously, I have not the correct version of yacc
installed on my system.

There should be the possibility to either change the
yacc configuration OR a statement in the docs would
be nice ;)

Regards, Ingo.


  • Davy Durham
    Davy Durham

    Logged In: YES

    Well, actually I was expecting everyone to be using bison
    (I thought wrong) which is the gnu version of yacc, but it
    looks like you're using some other kind of yacc clone...

    One thing you could try is: edit the
    src/misc/CNestedDataFile/Makefile and change the '-pcfg_' to
    '-p cfg_' and change '-bcfg_' to '-b cfg_' and that may
    solve the problem, I think bison just doesn't care if you
    put the space or not. Let me know if that fixes it. The
    usage message that you received above seems to indicate that
    this change may fix it.


  • Logged In: YES

    Hi David

    putting in spaces does no solve it

    * option "-o" is not known to this yacc
    * ommiting "-o" gives:

    @> yacc -p cfg_ -b cfg_ src/misc/CNestedDataFile/cfg.y

    yacc: e - line 74 of "src/misc/CNestedDataFile/cfg.y",
    syntax error
    %expect 1

    so even if the parameters in the maikefiles could be
    adjusted I am afraid that it will not wotk with my version of

    To make a long story short: this is a failure on MY side ;)

    which version of yacc/bison do you recommend?
    I will try to get it and install this on my machine as there is
    no particular reason for me sticking to the current version of
    yacc (I remember I had some trouble with this one some
    months ago... but I forgot about it, so maybe it will be
    valuable to replace it anyway).

    Thanks for your efforts,

    kind regards, Ingo.

  • Davy Durham
    Davy Durham

    Logged In: YES

    Ok.. well could you try one more thing... Just remove
    line 74 in the .y file .. the '%expect' directive to bison
    just tells it how many errors to expect so that it doesn't
    complain loudly about them. It's not really an error, its
    simply an ambiguity in the way grammars are described.
    So, just remove that line and try it again, and let me
    know how that works..
    The -o tells it what filename to write instead of the
    default one, which could also be worked around by a 'mv'
    command after running yacc.

    Well, if these 2 things don't fix it, then really any
    recent version of bison should do (I hope).

    Thanks again,

  • Davy Durham
    Davy Durham

    Logged In: YES

    Well, I checked some changes into CVS to make ReZound's
    yacc code more yacc compatible, and solaris's yacc will
    convert the .y file into a .c file now, except the .c file
    will not compile because I am using some bison specific
    features and it would take a good bit of work to make it
    totally yacc compatible. So, maybe someday when I'm trying
    to port ReZound to solaris this will all get fixed, but for
    now: yes, I would recommend installing bison.

    -- Davy

  • Davy Durham
    Davy Durham

    • status: open --> closed
  • Davy Durham
    Davy Durham

    Logged In: YES

    [pasted from email]
    >Hi David!
    >I removed the %expect statment, but "my yacc" shows up an
    >shitf/reduce error,
    >which, AFAIK a sign that the grammar given is miinterpreted
    by "my yacc" ;)

    Actually, this is not an error at all. I don't know if
    you've ever heard of the if-then-else syntax problem in
    grammars. (If you have: "if then if then else" which 'if'
    does the 'else' match? It either should match the furthest
    'if' or the nearest 'if'. it's ambiguous in the grammar
    specification, but yacc/bison goes ahead and says the
    nearest one [I think] even tho the grammar hasn't specified)
    The %expect directive to bison tells bison not to complain
    even though that shift/reduce so-called-error exists.

    >I simply installed bison, re-ran configure and now it does
    >Maybe there should be a statement about the yacc issue in
    the docs?

    Yes, perhaps I should mention that

    -- Davy

  • Davy Durham
    Davy Durham

    • status: closed --> closed-invalid