Flex Build Documentation
XQilla uses a patched version of Flex for supporting unicode. If the lexer is modified (xqilla/src/lexer/XQLexer.l) then you will need the modified flex so that you can rebuild the lexer.
Simple Instructions for Flex
- Download the 2.5.4a version of Flex from the Flex project page∞.
- Decompress the Flex archive
- Save the flex unicode patch∞ into the directory where Flex was decompressed to
- Run the patch by typing (from the decompressed Flex dir):
patch -p1 < flex-2.5.4a-unicode-patch
- Build Flex folowing the instructions found in the INSTALL file:
- You now have two options. The first option is to install the modified Flex into your path and then use the makefile to rebuild the lexer (recommended). The second option is to manually run Flex.
Option 1 (Use Makefile)
- Install the modified Flex:
- Rebuild the lexer using the makefile:
cd ~/xqilla
make src/lexer/XQLexer.cpp
Option 2 (Run Manually)
- Change into the directory that contains the XQLexer.l file:
- Run the modified version of Flex and not a Flex that may be in your path:
../../../flex*/flex -BUs -Pxq -Sflex.skl -oXQLexer.cpp XQLexer.l
- Flex should take anywhere from 5 to 20 minutes to complete depending on the speed of your computer
- Replace XQLexer.cpp with the file you just produced
Building Flex on Windows
If you are building flex 2.5.4a on Windows, you will first need the Cygwin package first, which you can get
here∞. During the installation process, make sure you download the developer tools you will need (bison, flex, gcc, patch, maketools, etc.) to perform the
./configure and
./make processes.
After you download extract the flex source code and install the patch, run
./configure. Once that is finished, open the
Makefile and edit the
FLAGS line to look like the following:
CFLAGS = -g -Wl,--heap,20000000,--stack,8000000 -O
This modification should give you sufficient stack and heap memory to run flex. Otherwise, you may experience
StackOverFlowExceptions and/or segfaults. If you modify the
Makefile and are still seeing exceptions, you may have to rebuild Cygwin -- see
the Cygwin FAQ∞ for instructions.
Simple Instructions for Bison
bison -d -v -o src/parser/XQParser.cpp src/parser/XQParser.y
CategoryDocumentation
There are 2 comments on this page. [Display comments]