Skip to content

Commit

Permalink
Release 0.9.22
Browse files Browse the repository at this point in the history
added bootstrap.sh and Travis-CI continuous integration
  • Loading branch information
Robert-van-Engelen committed Apr 11, 2017
1 parent 10518eb commit 1a2940a
Show file tree
Hide file tree
Showing 36 changed files with 663 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: cpp

compiler:
- clang
- gcc
21 changes: 15 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ following files:
| |__ reflex.1
|
|__ examples/
| |__ Makefile
| |__ Make
| |__ Makefile.am
| |__ Makefile.in
| |__ ...
|
|__ include/
Expand All @@ -135,7 +137,9 @@ following files:
| |__ utf8.h
|
|__ lib/
| |__ Makefile
| |__ Make
| |__ Makefile.am
| |__ Makefile.in
| |__ convert.cpp
| |__ debug.cpp
| |__ error.cpp
Expand All @@ -147,16 +151,21 @@ following files:
| |__ utf8.cpp
|
|__ src/
| |__ Makefile
| |__ Make
| |__ Makefile.am
| |__ Makefile.in
| |__ reflex.cpp
| |__ reflex.h
|
|__ test/
| |__ Makefile
|__ tests/
| |__ Make
| |__ Makefile.am
| |__ Makefile.in
| |__ rtest.cpp
| |__ ...
|
|__ unicode/
|__ Makefile
|__ Make
|__ Scripts.txt
|__ UnicodeData.txt
|__ language_scripts.cpp
Expand Down
5 changes: 5 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ install-data-hook:
@echo "| https://github.com/Genivia/RE-flex |"; \
@echo "| https://sourceforge.net/projects/re-flex |"; \
@echo "|______________________________________________________|";

.PHONY: test

test: $(abs_top_builddir)/src/reflex
-cd tests; $(MAKE) && ./rtest
5 changes: 5 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,11 @@ install-data-hook:
@echo "| https://sourceforge.net/projects/re-flex |"; \
@echo "|______________________________________________________|";

.PHONY: test

test: $(abs_top_builddir)/src/reflex
-cd tests; $(MAKE) && ./rtest

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
14 changes: 14 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
echo
echo "Bootstrapping reflex Unicode scripts"
./build.sh || exit 1
mv -f unicode/language_scripts.cpp unicode/language_scripts.cpp.bak
mv -f unicode/letter_scripts.cpp unicode/letter_scripts.cpp.bak
cd unicode
make -f Make || exit 1
cd ..
./build.sh || exit 1
rm -f unicode/language_scripts.cpp.bak
rm -f unicode/letter_scripts.cpp.bak


2 changes: 1 addition & 1 deletion clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ echo "Cleaning reflex"
cd lib; make -f Make distclean; cd -
cd src; make -f Make distclean; cd -
cd unicode; make -f Make clean; cd -
cd tests; make -f Make clean; cd -
cd examples; make -f Make clean; cd -
cd test; make -f Make clean; cd -
23 changes: 12 additions & 11 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for reflex 0.9.21.
# Generated by GNU Autoconf 2.69 for reflex 0.9.22.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='reflex'
PACKAGE_TARNAME='reflex'
PACKAGE_VERSION='0.9.21'
PACKAGE_STRING='reflex 0.9.21'
PACKAGE_VERSION='0.9.22'
PACKAGE_STRING='reflex 0.9.22'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1287,7 +1287,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures reflex 0.9.21 to adapt to many kinds of systems.
\`configure' configures reflex 0.9.22 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1357,7 +1357,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of reflex 0.9.21:";;
short | recursive ) echo "Configuration of reflex 0.9.22:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1456,7 +1456,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
reflex configure 0.9.21
reflex configure 0.9.22
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1767,7 +1767,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by reflex $as_me 0.9.21, which was
It was created by reflex $as_me 0.9.22, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2630,7 +2630,7 @@ fi

# Define the identity of the package.
PACKAGE='reflex'
VERSION='0.9.21'
VERSION='0.9.22'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -5019,7 +5019,7 @@ fi
done
test -n "$YACC" || YACC="yacc"

ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile examples/Makefile"
ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile tests/Makefile examples/Makefile"

PLATFORM=${host}

Expand Down Expand Up @@ -5593,7 +5593,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by reflex $as_me 0.9.21, which was
This file was extended by reflex $as_me 0.9.22, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5650,7 +5650,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
reflex config.status 0.9.21
reflex config.status 0.9.22
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down Expand Up @@ -5772,6 +5772,7 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT(reflex,0.9.21)
AC_INIT(reflex,0.9.22)
AM_INIT_AUTOMAKE([-Wall foreign])
AC_CANONICAL_HOST
AC_HEADER_TIME
Expand All @@ -11,7 +11,7 @@ AC_PROG_CXX
AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_YACC
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile examples/Makefile])
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile tests/Makefile examples/Makefile])
PLATFORM=${host}
AC_SUBST(PLATFORM)
AC_OUTPUT
12 changes: 6 additions & 6 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ scanner. The scanner reports the performance statistics on `std::cerr` when
EOF is reached. If your scanner does not reach EOF, then invoke the lexer's
`perf_report()` method explicitly in your code. Invoking this method also
resets the statistics and timers, meaning that this method will report the
statistics collected since its last call.
statistics collected since it was last called.

#### `-s`, `−−nodefault`

Expand Down Expand Up @@ -1968,7 +1968,7 @@ compilers will warn about trigraph translation before causing trouble.
### Character classes {#reflex-pattern-class}
Character classes in bracket lists are sets of characters. Sets can be
Character classes in bracket lists represent sets of characters. Sets can be
inverted, subtracted, intersected, and merged:
Pattern | Matches
Expand All @@ -1984,18 +1984,18 @@ first character after the bracket is always part of the list. So `[][]` is a
list that matches a `]` and a `[`, `[^][]` is a list that matches anything but
`]` and `[`, and `[-^]` is a list that matches a `-` and a `^`.
The character class sets may be Unicode character sets. In that case
\ref reflex-pattern-unicode should be enabled.
Bracket lists may contain ASCII and Unicode \ref reflex-patterns-cat.
Shorthands for character classes are character categories, discussed next.
To add Unicode character categories and UTF-8 characters to bracket lists
\ref reflex-pattern-unicode should be enabled.
🔝 [Back to table of contents](#)
### Character categories {#reflex-patterns-cat}
The 7-bit ASCII character categories are:
Category | List form | Matches
Category | POSIX form | Matches
------------ | -------------- | ---------------------------------------------
`\p{Space}` | `[[:space:]]` | matches a white space character `[ \t\n\v\f\r]` same as `\s`
`\p{Xdigit}` | `[[:xdigit:]]` | matches a hex digit `[0-9A-Fa-f]`
Expand Down
2 changes: 1 addition & 1 deletion doc/man/reflex.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH REFLEX "1" "April 10, 2017" "reflex 0.9.21" "User Commands"
.TH REFLEX "1" "April 10, 2017" "reflex 0.9.22" "User Commands"
.SH NAME
reflex \- the regex\-centric fast and flexible lexical analyzer generator
.SH SYNOPSIS
Expand Down
6 changes: 3 additions & 3 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ lib_LIBRARIES = libreflex.a
libreflex_a_CPPFLAGS = -I$(top_srcdir)/include
libreflex_a_SOURCES = convert.cpp debug.cpp error.cpp input.cpp matcher.cpp pattern.cpp posix.cpp unicode.cpp utf8.cpp $(top_srcdir)/unicode/language_scripts.cpp $(top_srcdir)/unicode/letter_scripts.cpp

lib_LTLIBRARIES = libreflex.la
libreflex_la_CPPFLAGS = -I$(top_srcdir)/include
libreflex_la_SOURCES = convert.cpp debug.cpp error.cpp input.cpp matcher.cpp pattern.cpp posix.cpp unicode.cpp utf8.cpp $(top_srcdir)/unicode/language_scripts.cpp $(top_srcdir)/unicode/letter_scripts.cpp
# lib_LTLIBRARIES = libreflex.la
# libreflex_la_CPPFLAGS = -I$(top_srcdir)/include
# libreflex_la_SOURCES = convert.cpp debug.cpp error.cpp input.cpp matcher.cpp pattern.cpp posix.cpp unicode.cpp utf8.cpp $(top_srcdir)/unicode/language_scripts.cpp $(top_srcdir)/unicode/letter_scripts.cpp
9 changes: 8 additions & 1 deletion lib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ am__uninstall_files_from_dir = { \
}
am__installdirs = "$(DESTDIR)$(libdir)"
LIBRARIES = $(lib_LIBRARIES)
AR = ar
ARFLAGS = cru
AM_V_AR = $(am__v_AR_@AM_V@)
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
Expand Down Expand Up @@ -206,6 +205,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
Expand Down Expand Up @@ -253,10 +253,13 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
Expand Down Expand Up @@ -769,6 +772,10 @@ uninstall-am: uninstall-libLIBRARIES
.PRECIOUS: Makefile


# lib_LTLIBRARIES = libreflex.la
# libreflex_la_CPPFLAGS = -I$(top_srcdir)/include
# libreflex_la_SOURCES = convert.cpp debug.cpp error.cpp input.cpp matcher.cpp pattern.cpp posix.cpp unicode.cpp utf8.cpp $(top_srcdir)/unicode/language_scripts.cpp $(top_srcdir)/unicode/letter_scripts.cpp

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
18 changes: 17 additions & 1 deletion lib/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,23 @@ static void convert_escape_char(const char *pattern, size_t& loc, size_t& pos, c
}
else if (!supports_escape(escapes, c))
{
if (c == 'Z')
if (c == 'A')
{
if (!supports_escape(escapes, '`'))
throw regex_error(regex_error::invalid_anchor, pattern, pos);
// translate \A to \`
regex.append(&pattern[loc], pos - loc - 1).append("\\`");
loc = pos + 1;
}
else if (c == 'z')
{
if (!supports_escape(escapes, '\''))
throw regex_error(regex_error::invalid_anchor, pattern, pos);
// translate \z to \'
regex.append(&pattern[loc], pos - loc - 1).append("\\'");
loc = pos + 1;
}
else if (c == 'Z')
{
if (!supports_escape(escapes, 'z') || !supports_modifier(mod, '='))
throw regex_error(regex_error::invalid_anchor, pattern, pos);
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
Expand Down Expand Up @@ -214,10 +215,13 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
Expand Down
7 changes: 4 additions & 3 deletions src/reflex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,8 @@ std::string Reflex::get_regex(size_t& pos)
// eat [...]
if (pos < linelen && line.at(pos) == '^')
++pos;
++pos;
if (line.at(pos) != '\\')
++pos;
while (pos < linelen && line.at(pos) != ']')
pos += 1 + (line.at(pos) == '\\');
++pos;
Expand Down Expand Up @@ -1870,7 +1871,7 @@ void Reflex::write_perf_report()
}
if (options["nodefault"].empty())
*out <<
"\n \" default rule matched \" << perf_report_" << conditions[start] << "_default << \" time(s)\\n\"";
"\n \" default rule accepted \" << perf_report_" << conditions[start] << "_default << \" times\\n\"";
*out <<
";\n";
}
Expand Down Expand Up @@ -2316,7 +2317,7 @@ void Reflex::write_lexer()
*out <<
" if (debug()) std::cerr << \"--" <<
SGR("\\033[1;35m") << "accepting rule at line " << rule->code.lineno << SGR("\\033[0m") <<
" (\\\"\" << matcher().text() << \"\\\")\\n\";\n";
" (\\\"" << SGR("\\033[1m") << "\" << matcher().text() << \"" << SGR("\\033[0m") << "\\\")\\n\";\n";
if (!options["flex"].empty())
*out <<
" YY_USER_ACTION\n";
Expand Down
2 changes: 1 addition & 1 deletion src/reflex.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#endif

// DO NOT ALTER THIS LINE: the makemake.sh script updates the version
#define REFLEX_VERSION "0.9.21"
#define REFLEX_VERSION "0.9.22"

/// RE/flex scanner generator class, a variation of the classic "lex" tool to generate scanners.
/**
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
noinst_PROGRAMS = rtest
rtest_CPPFLAGS = -I$(top_srcdir)/include
rtest_SOURCES = rtest.cpp
rtest_LDADD = $(top_builddir)/lib/libreflex.a
Loading

0 comments on commit 1a2940a

Please sign in to comment.