72

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

swegi
  • 4,046
  • 1
  • 26
  • 45
  • Better suited on http://ubuntu.stackexchange.com – Oded Oct 06 '10 at 10:12
  • ...or to [Super User](http://superuser.com), but more or less off topic here. – dmckee --- ex-moderator kitten Oct 07 '10 at 01:06
  • 4
    the question is important. if it is felt to be of-topic then it should be migrated to the suitable SE with all the points.. oh my bad. we can't do that because then its short permalink will have to be changed. well then may be the short permalink can be redirected to the new short permalink – MycrofD Mar 08 '17 at 13:33

1 Answers1

113

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.

Amith KK
  • 555
  • 2
  • 8
  • 20
halfdan
  • 33,545
  • 8
  • 78
  • 87
  • 1
    I don't think that the packages are actually called `yacc` and `lex`. Not sure about `lex` but `yacc` is in `byacc`. – Šimon Tóth Oct 06 '10 at 10:13
  • 40
    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 Oct 06 '10 at 10:14
  • 2
    yes, you're right. `bison` is a compiler-generator compatible with `Yacc`. But I couldn't find `gyacc` in the repositories... – Bart Kiers Oct 06 '10 at 10:19
  • 2
    @BartKiers is right. `sudo apt install flex bison` works to get `yacc-like`. `byacc` has to be replaced by `bison` – MycrofD Mar 08 '17 at 13:30