How To Install Flex Forks
Installing Flex (The fast lexical analyzer) on Ubuntu Linux
NOTE: Yous have to install m4 (general purpose macro processor) before installing Flex. Click here.
This short tutorial shows you how to install Flex (The fast lexical analyzer) on Ubuntu Linux Server. The procedure is very simple. For this tutorial, I'll be installing flex version ii.5.33. Linux kernel is 2.6.15-26-powerpc. I have used a Mac Mini (powerpc/ppc architecture). GCC version number is 4.0.three. Your configuration may be unlike from mine only the installation steps below should work fine for most configurations with little or no change at all (including other Linux distributions and fifty-fifty unixes due east.grand. MacOS Ten).
Flex (The fast lexical analyzer):
According to flex.sourceforge.net,
"Flex is a tool for generating scanners. A scanner, sometimes chosen a tokenizer, is a plan which recognizes lexical patterns in text. The flex program reads user-specified input files, or its standard input if no file names are given, for a description of a scanner to generate. The description is in the class of pairs of regular expressions and C code, called rules. Flex generates a C source file named, "lex.yy.c", which defines the function yylex(). The file "lex.yy.c" can be compiled and linked to produce an executable. When the executable is run, information technology analyzes its input for occurrences of text matching the regular expressions for each rule. Whenever it finds a match, it executes the respective C code."
Before starting, please check to see if there is a latest version available to download. Visit http://flex.sourceforge.net/ to find out virtually the available versions. Of import: Encounter "Configuring Ubuntu Linux After Installation" to install the development tools required to compile and install flex from source code.
Steps to download, compile, and install are as follows. Notation: Replace 2.5.33 with your version number:
-
Downloading Flex (The fast lexical analyzer):
Run the command below,wget http://prdownloads.sourceforge.internet/flex/flex-two.5.33.tar.gz?download
-
Extracting files from the downloaded package:
tar -xvzf flex-ii.5.33.tar.gz
At present, enter the directory where the package is extracted.cd flex-2.v.33
-
Configuring flex before installation:
If you haven't installed m4 yet and so please do so. Click hither to read about the installation instructions for m4. Run the commands below to include m4 in your PATH variable.
PATH=$PATH:/usr/local/m4/bin/
Annotation: Supplant '/usr/local/m4/bin' with the location of m4 binary. At present, configure the source code before installation.
./configure --prefix=/usr/local/flex
Supplant "/usr/local/flex" higher up with the directory path where you want to copy the files and folders. Note: check for any error message.
-
Compiling flex:
make
Note: cheque for whatsoever error message.
-
Installing flex:
As root (for privileges on destination directory), run the following.
With sudo,sudo make install
Without sudo,brand install
Notation: check for any error letters.
That'southward information technology. Flex has been successfully installed.
Did this tutorial help a piddling? How about buy me a cup of coffee?
Delight experience free to use the comments form below if you have whatsoever questions or need more caption on anything. I recommend thoroughy testing on a product-like examination system first before moving to production.
Source: https://geeksww.com/tutorials/operating_systems/linux/installation/installing_flex_fast_lexical_analyzer_ubuntu_linux.php
Posted by: michaudhimentrapsed00.blogspot.com

0 Response to "How To Install Flex Forks"
Post a Comment