mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
note: this depends on - a suitable flex version in PATH (currently 2.6.4) - a suitable version of 'sed' in PATH (e.g. GNU sed) Signed-off-by: Matthias Maennich <matthias@maennich.net>
34 lines
1.2 KiB
Bash
Executable File
34 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
pushd "${BASH_SOURCE%/*}/../../Source/LexerParser" > /dev/null
|
|
|
|
for lexer in \
|
|
CommandArgument \
|
|
DependsJava \
|
|
Expr \
|
|
Fortran
|
|
do
|
|
echo "Generating Lexer ${lexer}"
|
|
flex --nounistd -DFLEXINT_H --noline --header-file=cm${lexer}Lexer.h -ocm${lexer}Lexer.cxx cm${lexer}Lexer.in.l
|
|
sed -i 's/\s*$//' cm${lexer}Lexer.h cm${lexer}Lexer.cxx # remove trailing whitespaces
|
|
sed -i '${/^$/d;}' cm${lexer}Lexer.h cm${lexer}Lexer.cxx # remove blank line at the end
|
|
sed -i '1i#include "cmStandardLexer.h"' cm${lexer}Lexer.cxx # add cmStandardLexer.h include
|
|
done
|
|
|
|
|
|
# these lexers (at the moment only the ListFileLexer) are compiled as C and do not generate a header
|
|
for lexer in ListFile
|
|
do
|
|
|
|
echo "Generating Lexer ${lexer}"
|
|
flex --nounistd -DFLEXINT_H --noline -ocm${lexer}Lexer.c cm${lexer}Lexer.in.l
|
|
sed -i 's/\s*$//' cm${lexer}Lexer.c # remove trailing whitespaces
|
|
sed -i '${/^$/d;}' cm${lexer}Lexer.c # remove blank line at the end
|
|
sed -i '1i#include "cmStandardLexer.h"' cm${lexer}Lexer.c # add cmStandardLexer.h include
|
|
|
|
done
|
|
|
|
popd > /dev/null
|