how to install Lex and Yacc in Ubuntu?

185,634

Use the synaptic packet manager in order to install yacc / lex. If you are feeling more comfortable doing this on the console just do:

sudo apt-get install bison flex

There are some very nice articles on the net on how to get started with those tools. I found the article from CodeProject to be quite good and helpful (see here). But you should just try and search for "introduction to lex", there are plenty of good articles showing up.

Share:
185,634
Admin
Author by

Admin

Updated on July 05, 2022

Comments

  • Admin
    Admin almost 2 years

    I am doing project in SENSE, for that i have to install Lex and Yacc. If you can help me how to install in Ubuntu. I very new to this area. So can you help me. Any website to study the basic of Lex and Yacc

  • Šimon Tóth
    Šimon Tóth over 13 years
    I don't think that the packages are actually called yacc and lex. Not sure about lex but yacc is in byacc.
  • Bart Kiers
    Bart Kiers over 13 years
    Both yacc and lex don't exist. Lex is in flex and Yacc in bison. So it should be sudo apt-get install flex bison
  • Bart Kiers
    Bart Kiers over 13 years
    yes, you're right. bison is a compiler-generator compatible with Yacc. But I couldn't find gyacc in the repositories...
  • MycrofD
    MycrofD about 7 years
    @BartKiers is right. sudo apt install flex bison works to get yacc-like. byacc has to be replaced by bison