Friday, October 15, 2010

lex and yacc for Ubuntu

Ubuntu by default does not have lex and yacc installed. Here is the simplest way to install lex and yacc in Ubuntu. This method uses the following packages

flex (for lex)
bison (for yacc)

Open a terminal and type the following command

sudo apt-get install flex bison

After the installation type the following two commands on the console.

which lex
which yacc

They should return /usr/bin/lex and /usr/bin/yacc respectively if lex and yacc
installed properly

2 comments :

  1. HI PAVITHRA.......
    THOUGH I TRIED THE STEP WHICH YOU MENTIONED........IAM NOT ABLE TO DOWNLOAD FLEX......
    IT SHOWS THE FOLLOWING ERROR
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package flex is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package flex has no installation candidate
    PLEASE HELP.......TELL ME HOW TO PROCEED

    ReplyDelete