yacc/bison help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thomas

    yacc/bison help

    hello I m writing a simple parser using bison. I just used someone's else
    c++ grammar, to produce a code beutifier. The thing is , most of the actions
    for productions would have form
    {$$ = $1 + $2 + $3} and so forth depending on number of terminals in
    production. Is it possible to set default action for all the productions
    like the one above ? It is something strange to type this formula for over
    200 productions.


  • Walter Roberson

    #2
    Re: yacc/bison help

    In article <fpfc8b$6bb$1@i news.gazeta.pl> , thomas <arabel9@o2.plw rote:
    >hello I m writing a simple parser using bison. I just used someone's else
    >c++ grammar, to produce a code beutifier. The thing is , most of the actions
    >for productions would have form
    >{$$ = $1 + $2 + $3} and so forth depending on number of terminals in
    >production. Is it possible to set default action for all the productions
    >like the one above ? It is something strange to type this formula for over
    >200 productions.
    In a spot-welding newsgroup, would you expect to be able to get
    answers about how to drive your lawn-mower, just because the
    lawn-mower happened to have some spot-welds?

    There is a google group devoted to Lex and Yacc,

    or you could try comp.compilers or comp.unix.progr ammer

    --
    "There is nothing so bad but it can masquerade as moral."
    -- Walter Lippmann

    Comment

    • thomas

      #3
      Re: yacc/bison help


      U¿ytkownik "Walter Roberson" <roberson@ibd.n rc-cnrc.gc.canapis a³ w
      wiadomo¶ci news:fpfd1i$kt9 $1@canopus.cc.u manitoba.ca...
      In article <fpfc8b$6bb$1@i news.gazeta.pl> , thomas <arabel9@o2.plw rote:
      >>hello I m writing a simple parser using bison. I just used someone's else
      >>c++ grammar, to produce a code beutifier. The thing is , most of the
      >>actions
      >>for productions would have form
      >>{$$ = $1 + $2 + $3} and so forth depending on number of terminals in
      >>production. Is it possible to set default action for all the productions
      >>like the one above ? It is something strange to type this formula for
      >>over
      >>200 productions.
      >
      In a spot-welding newsgroup, would you expect to be able to get
      answers about how to drive your lawn-mower, just because the
      lawn-mower happened to have some spot-welds?
      >
      Yeah you got right, but the group for lawn-mower is moderated, so the answer
      about driving would be hard to get, but seriously lex/yacc are realy basis
      of computer programing, so I think I will get an answer here.
      There is a google group devoted to Lex and Yacc,

      or you could try comp.compilers or comp.unix.progr ammer
      >
      --
      "There is nothing so bad but it can masquerade as moral."
      -- Walter Lippmann

      Comment

      • Flash Gordon

        #4
        Re: yacc/bison help

        thomas wrote, On 19/02/08 19:55:
        hello I m writing a simple parser using bison. I just used someone's else
        <snip>

        Neither yacc nor bison are C, you might find comp.compilers a better
        place to ask for help, but check their FAQ and a weeks worth of posting
        first.
        --
        Flash Gordon

        Comment

        • Christopher Benson-Manica

          #5
          Re: yacc/bison help

          [comp.lang.c] thomas <arabel9@o2.plw rote:
          Yeah you got right, but the group for lawn-mower is moderated, so the answer
          about driving would be hard to get, but seriously lex/yacc are realy basis
          of computer programing, so I think I will get an answer here.
          One could argue that keyboards, monitors, and hard drives are also
          basic to computer programming, but no one asks about THEM here and
          gets an answer. How about electrons? Pretty tough to program without
          those, indeed, but yet again, they aren't discussed here.

          Really, just head to the resources you were directed to.

          --
          C. Benson Manica | I appreciate all corrections, polite or otherwise.
          cbmanica(at)gma il.com |
          ----------------------| I do not currently read any posts posted through
          sdf.lonestar.or g | Google groups, due to rampant unchecked spam.

          Comment

          • CBFalconer

            #6
            Re: yacc/bison help

            thomas wrote:
            "Walter Roberson" <roberson@ibd.n rc-cnrc.gc.cawrote :
            >
            .... snip ...
            >
            >In a spot-welding newsgroup, would you expect to be able to get
            >answers about how to drive your lawn-mower, just because the
            >lawn-mower happened to have some spot-welds?
            >
            Yeah you got right, but the group for lawn-mower is moderated,
            so the answer about driving would be hard to get, but seriously
            lex/yacc are realy basis of computer programing, so I think I
            will get an answer here.
            No you won't. lexx and yacc are not mentioned in any of the ISO
            standards for C, and this newsgroup deals with the standard C
            language, as defined in those standards. Thus you question is
            off-topic. Now look at the groups previously recommended, repeated
            below.
            >
            >There is a google group devoted to Lex and Yacc,
            >http://groups.google.ca/group/compcompilerslex-and-yacc
            >or you could try comp.compilers or comp.unix.progr ammer
            --
            [mail]: Chuck F (cbfalconer at maineline dot net)
            [page]: <http://cbfalconer.home .att.net>
            Try the download section.


            --
            Posted via a free Usenet account from http://www.teranews.com

            Comment

            Working...