Revision: 77568
http://sourceforge.net/p/brlcad/code/77568
Author: starseeker
Date: 2020-10-23 02:05:19 +0000 (Fri, 23 Oct 2020)
Log Message:
-----------
Import the stripped down, self contained lemon/re2c/perplex setup from
thirdparty_rework.
Modified Paths:
--------------
brlcad/branches/extbuild/src/other/ext/perplex/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/perplex/perplex/perplex.h
brlcad/branches/extbuild/src/other/ext/perplex/re2c/code.cc
brlcad/branches/extbuild/src/other/ext/perplex/re2c/config.h.in
brlcad/branches/extbuild/src/other/ext/perplex/re2c/main.cc
brlcad/branches/extbuild/src/other/ext/perplex/re2c/parser.yy
brlcad/branches/extbuild/src/other/ext/perplex/re2c/scanner.re
Added Paths:
-----------
brlcad/branches/extbuild/src/other/ext/perplex/README.lemon
brlcad/branches/extbuild/src/other/ext/perplex/README.re2c
Removed Paths:
-------------
brlcad/branches/extbuild/src/other/ext/perplex/README
brlcad/branches/extbuild/src/other/ext/perplex/perplex/CHANGELOG.txt
brlcad/branches/extbuild/src/other/ext/perplex/perplex/CMake/
brlcad/branches/extbuild/src/other/ext/perplex/perplex/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/perplex/perplex/README.txt
brlcad/branches/extbuild/src/other/ext/perplex/re2c/CMake/
brlcad/branches/extbuild/src/other/ext/perplex/re2c/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/perplex/re2c/README.in
brlcad/branches/extbuild/src/other/ext/perplex/re2c/config_w32.h.in
brlcad/branches/extbuild/src/other/ext/perplex/re2c/configure.in
brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.1.in
brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.spec.in
Modified: brlcad/branches/extbuild/src/other/ext/perplex/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/CMakeLists.txt
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,30 +1,204 @@
cmake_minimum_required(VERSION 3.14)
# set project name
-PROJECT(LEMON)
+project(CITRUS)
-# build the lemon binary
-add_executable(lemon lemon.c)
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ )
-# install the binary
if (NOT BIN_DIR)
set (BIN_DIR bin)
endif (NOT BIN_DIR)
-if (NOT LEMON_SKIP_INSTALL)
- install(TARGETS lemon DESTINATION ${BIN_DIR})
-endif (NOT LEMON_SKIP_INSTALL)
-
-# install the template
if (NOT DATA_DIR)
- set (DATA_DIR share)
+ set (DATA_DIR share)
endif (NOT DATA_DIR)
-if (NOT LEMON_SKIP_INSTALL)
- install(FILES lempar.c DESTINATION ${DATA_DIR}/lemon)
-endif (NOT LEMON_SKIP_INSTALL)
-configure_file(lempar.c ${CMAKE_BINARY_DIR}/${DATA_DIR}/lemon COPYONLY)
-DISTCLEAN(${CMAKE_BINARY_DIR}/${DATA_DIR}/lemon)
+include(CheckIncludeFile)
+CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
+CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
+CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
+CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
+CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
+CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
+CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
+CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
+CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
+CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+include(CheckFunctionExists)
+CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
+CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
+CHECK_FUNCTION_EXISTS(munmap HAVE_MUNMAP)
+CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
+CHECK_FUNCTION_EXISTS(strndup HAVE_STRNDUP)
+include(CheckTypeSize)
+CHECK_TYPE_SIZE(char SIZEOF_CHAR)
+CHECK_TYPE_SIZE(int SIZEOF_INT)
+CHECK_TYPE_SIZE(long SIZEOF_LONG)
+CHECK_TYPE_SIZE(short SIZEOF_SHORT)
+configure_file(re2c/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+add_definitions(-DHAVE_CONFIG_H)
+
+# build the lemon binary
+add_executable(lemon lemon.c)
+
+
+set(re2c_common_SRCS
+ re2c/code.cc
+ re2c/dfa.cc
+ re2c/main.cc
+ re2c/actions.cc
+ re2c/substr.cc
+ re2c/translate.cc
+ re2c/mbo_getopt.cc
+ )
+
+set(re2c_HDRS
+ re2c/basics.h
+ re2c/dfa.h
+ re2c/globals.h
+ re2c/ins.h
+ re2c/re2c_parser.h
+ re2c/re.h
+ re2c/scanner.h
+ re2c/substr.h
+ re2c/token.h
+ re2c/mbo_getopt.h
+ re2c/code.h
+ re2c/stream_lc.h
+ re2c/code_names.h
+ )
+
+set(WD "${CMAKE_CURRENT_BINARY_DIR}/bootstrap_parser")
+file(MAKE_DIRECTORY "${WD}")
+add_custom_command(
+ OUTPUT ${WD}/parser.out ${WD}/parser.c ${WD}/parser.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/re2c/parser.yy
${WD}/parser.yy
+ COMMAND lemon -T${CMAKE_CURRENT_SOURCE_DIR}/lempar.c ${WD}/parser.yy
+ DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/re2c/parser.yy
+ WORKING_DIRECTORY ${WD}
+ COMMENT "[LEMON][re2c] Building bootstrap parser with lemon"
+ )
+
+add_custom_command(
+ OUTPUT bootstrap_parser.cc bootstrap_parser_tokens.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${WD}/parser.c bootstrap_parser.cc
+ COMMAND ${CMAKE_COMMAND} -E copy ${WD}/parser.h bootstrap_parser_tokens.h
+ DEPENDS ${WD}/parser.c ${WD}/parser.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+set(re2c_bootstrap_SRCS
+ ${re2c_common_SRCS}
+ re2c/bootstrap/scanner.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/bootstrap_parser.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/bootstrap_parser_tokens.h
+ )
+add_executable(re2c_bootstrap ${re2c_bootstrap_SRCS})
+set_property(TARGET re2c_bootstrap APPEND PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/re2c;${CMAKE_CURRENT_BINARY_DIR};${WD}")
+add_dependencies(re2c_bootstrap lemon)
+# Need to link against stl library with some compilers.
+target_link_libraries(re2c_bootstrap "${STDCXX_LIBRARIES}")
+
+if(TARGET_RUNTIME_OUTPUT_DIRECTORY)
+ set_target_properties(re2c_bootstrap PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${TARGET_RUNTIME_OUTPUT_DIRECTORY}")
+ foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
+ string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
+ set_target_properties(re2c_bootstrap PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER} "${TARGET_RUNTIME_OUTPUT_DIRECTORY}")
+ endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
+endif(TARGET_RUNTIME_OUTPUT_DIRECTORY)
+
+set(WD "${CMAKE_CURRENT_BINARY_DIR}/re2c_parser")
+file(MAKE_DIRECTORY "${WD}")
+add_custom_command(
+ OUTPUT ${WD}/parser.out ${WD}/parser.c ${WD}/parser.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/re2c/parser.yy
${WD}/parser.yy
+ COMMAND lemon -T${CMAKE_CURRENT_SOURCE_DIR}/lempar.c ${WD}/parser.yy
+ DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/re2c/parser.yy
+ WORKING_DIRECTORY ${WD}
+ COMMENT "[LEMON][re2c] Building parser with lemon"
+ )
+
+add_custom_command(
+ OUTPUT re2c_parser.cc re2c_parser_tokens.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${WD}/parser.c re2c_parser.cc
+ COMMAND ${CMAKE_COMMAND} -E copy ${WD}/parser.h re2c_parser_tokens.h
+ DEPENDS ${WD}/parser.c ${WD}/parser.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+add_custom_command(
+ OUTPUT re2c_scanner.cc
+ COMMAND re2c_bootstrap -bi -o re2c_scanner.cc
${CMAKE_CURRENT_SOURCE_DIR}/re2c/scanner.re
+ DEPENDS re2c_bootstrap ${CMAKE_CURRENT_SOURCE_DIR}/re2c/scanner.re
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+set(re2c_SRCS
+ ${re2c_common_SRCS}
+ ${CMAKE_CURRENT_BINARY_DIR}/re2c_parser.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/re2c_parser_tokens.h
+ ${CMAKE_CURRENT_BINARY_DIR}/re2c_scanner.cc
+ )
+
+add_executable(re2c ${re2c_SRCS})
+set_property(TARGET re2c APPEND PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/re2c;${CMAKE_CURRENT_BINARY_DIR};${WD}")
+# Need to link against stl library with some compilers.
+target_link_libraries(re2c "${STDCXX_LIBRARIES}")
+
+
+
+set(WD "${CMAKE_CURRENT_BINARY_DIR}/perplex_wd")
+file(MAKE_DIRECTORY "${WD}")
+add_custom_command(
+ OUTPUT ${WD}/parser.out ${WD}/parser.c ${WD}/parser.h
+ COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/perplex/parser.y ${WD}/parser.y
+ COMMAND lemon -T${CMAKE_CURRENT_SOURCE_DIR}/lempar.c ${WD}/parser.y
+ DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/perplex/parser.y
+ WORKING_DIRECTORY ${WD}
+ COMMENT "[LEMON][perplex] Building parser with lemon"
+ )
+add_custom_command(
+ OUTPUT perplex_parser.c perplex_parser.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${WD}/parser.c perplex_parser.c
+ COMMAND ${CMAKE_COMMAND} -E copy ${WD}/parser.h perplex_parser.h
+ DEPENDS ${WD}/parser.c ${WD}/parser.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/perplex_scanner.c
+ COMMAND re2c -c -o ${CMAKE_CURRENT_BINARY_DIR}/perplex_scanner.c
${CMAKE_CURRENT_SOURCE_DIR}/perplex/scanner.re
+ DEPENDS re2c ${CMAKE_CURRENT_SOURCE_DIR}/perplex/scanner.re perplex_parser.c
perplex_parser.h
+ WORKING_DIRECTORY ${WD}
+ COMMENT "[RE2C][perplex] Building scanner with re2c"
+ )
+
+set(perplex_sources
+ ${CMAKE_CURRENT_BINARY_DIR}/perplex_parser.c
+ ${CMAKE_CURRENT_BINARY_DIR}/perplex_scanner.c
+ perplex/mbo_getopt.cpp
+ perplex/perplex.cpp
+ )
+
+add_executable(perplex ${perplex_sources})
+set_property(TARGET perplex APPEND PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/perplex")
+
+
+
+# install the binaries
+install(TARGETS lemon DESTINATION ${BIN_DIR})
+install(TARGETS re2c DESTINATION ${BIN_DIR})
+install(TARGETS perplex DESTINATION ${BIN_DIR})
+
+# install the templates
+install(FILES lempar.c DESTINATION ${DATA_DIR}/lemon)
+install(FILES perplex/perplex_template.c DESTINATION ${DATA_DIR}/perplex)
+
+
+
# Local Variables:
# tab-width: 8
# mode: cmake
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/README
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/README 2020-10-23
02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/README 2020-10-23
02:05:19 UTC (rev 77568)
@@ -1,33 +0,0 @@
- The LEMON Parser Generator
-
-The Lemon program is an LALR(1) parser generator. It takes
-a context free grammar and converts it into a subroutine
-that will parse a file using that grammar.
-
-Lemon is similar to the much more famous programs "YACC"
-and "BISON". But lemon is not compatible with either yacc
-or bison. There are several important differences:
-
- * Lemon using a different grammar syntax which is less
- prone to programming errors.
-
- * The parser generated by Lemon is both re-entrant and
- thread-safe.
-
- * Lemon includes the concept of a non-terminal destructor,
- which makes it much easier to write a parser that does
- not leak memory.
-
-The complete source code to the lemon parser generator is
-contained in two files. The file lemon.c is the parser
-generator program itself. A separate file lempar.c is the
-template for the parser subroutine that lemon generates.
-Documentation on lemon is also available at:
-http://www.hwaci.com/sw/lemon/lemon.html
-
-Both the source code to lemon itself and the code that
-lemon generates are in the public domain.
-
-To see an example of how to use lemon, see the source code
-to the SQLite database engine. Lemon is maintained as part
-of the SQLite project.
Added: brlcad/branches/extbuild/src/other/ext/perplex/README.lemon
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/README.lemon
(rev 0)
+++ brlcad/branches/extbuild/src/other/ext/perplex/README.lemon 2020-10-23
02:05:19 UTC (rev 77568)
@@ -0,0 +1,33 @@
+ The LEMON Parser Generator
+
+The Lemon program is an LALR(1) parser generator. It takes
+a context free grammar and converts it into a subroutine
+that will parse a file using that grammar.
+
+Lemon is similar to the much more famous programs "YACC"
+and "BISON". But lemon is not compatible with either yacc
+or bison. There are several important differences:
+
+ * Lemon using a different grammar syntax which is less
+ prone to programming errors.
+
+ * The parser generated by Lemon is both re-entrant and
+ thread-safe.
+
+ * Lemon includes the concept of a non-terminal destructor,
+ which makes it much easier to write a parser that does
+ not leak memory.
+
+The complete source code to the lemon parser generator is
+contained in two files. The file lemon.c is the parser
+generator program itself. A separate file lempar.c is the
+template for the parser subroutine that lemon generates.
+Documentation on lemon is also available at:
+http://www.hwaci.com/sw/lemon/lemon.html
+
+Both the source code to lemon itself and the code that
+lemon generates are in the public domain.
+
+To see an example of how to use lemon, see the source code
+to the SQLite database engine. Lemon is maintained as part
+of the SQLite project.
Property changes on: brlcad/branches/extbuild/src/other/ext/perplex/README.lemon
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: brlcad/branches/extbuild/src/other/ext/perplex/README.re2c
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/README.re2c
(rev 0)
+++ brlcad/branches/extbuild/src/other/ext/perplex/README.re2c 2020-10-23
02:05:19 UTC (rev 77568)
@@ -0,0 +1,201 @@
+re2c Version 0.13.5
+------------------
+
+Originally written by Peter Bumbulis ([email protected])
+
+Currently maintained by:
+ Dan Nuffer <nuffer at users.sourceforge.net>
+ Marcus Boerger <helly at users.sourceforge.net>
+ Hartmut Kaiser <hkaiser at users.sourceforge.net>
+
+The re2c distribution can be found at:
+
+ http://sourceforge.net/projects/re2c/
+
+re2c has been developed and tested with the following compilers on various
+platforms in 32 bit and 64 bit mode:
+- GCC 3.3 ... 4.1
+- Microsoft VC 7, 7.1, 8
+- Intel 9.0
+- Sun C++ 5.8 (CXXFLAGS='-library=stlport4')
+- MIPSpro Compilers: Version 7.4.4m
+
+GCC 2.x and Microsoft VC 6 are not capable of compiling re2c.
+
+Building re2c on unix like platforms requires autoconf 2.57 and bison (tested
+with 1.875 and later). Under windows you don't need autoconf or bison
+and can use the pregenerated files.
+
+You can build this software by simply typing the following commands:
+ ./configure
+ make
+
+The above version will be based on the pregenerated scanner.cc file.
+If you want to build that file yourself (recommended when installing
+re2c) you need the following steps:
+ ./configure
+ make
+ rm -f scanner.cc
+ make install
+
+Or you can create a rpm package and install it by the following commands:
+ ./configure
+ make rpm
+ rpm -Uhv <packagedir>/re2c-@PACKAGE_VERSION@-@[email protected]
+
+If you want to build from CVS then the first thing you should do is
+regenerating all build files using the following command:
+ ./autogen.sh
+and then continue with one of the above described build methods. Or if you
+need to generate RPM packages for cvs builds use these commands:
+ ./autogen.sh
+ ./configure
+ ./makerpm <release>
+ rpm -Uhv <packagedir>/re2c-@PACKAGE_VERSION@-<release>.rpm
+
+Here <realease> should be a number like 1. And <packagedir> must equal
+the directory where the makerpm step has written the generated rpm to.
+
+If you are on a debian system you can use the tool 'alien' to convert rpms
+to debian packages.
+
+When building with native SUN compilers you need to set the following compiler
+flags: CXXFLAGS='-g -compat5 -library=stlport4'.
+
+If you want to build re2c on a windows system you can either use cygwin and one
+of the methods described above or use Microsoft Visual C .NET 2002 or later
+with the solution files provided (re2c.sln for 2002/2003 and re2c-2005.sln for
+version 2005). re2c cannot be built with Microsoft Visual C 6.0 or earlier.
+
+Using Visual Studio 2005 you can automate handling of .re files by adding the
+custom build rules file (re2c.rules) to your project. Just load your Visual
+C++ project in Visual Studio, select "Custom Build Rules..." from its context
+menu, and add re2c.rules to the list with the "Find Existing..." button.
+Activate the check mark, and you are done! Any .re files you add to the project
+will now automatically be built with re2c. Of course, re2c.exe also has to be
+available in your environment for this to work. With the rules active Visual
+Studio will automatically recognize .re files and compile then with re2c. The
+output file has the same name as the input file but with the .cpp extension.
+This, and all other re2c compiler settings, are fully configurable from within
+the Visual Studio IDE. Just right-click on the .re file in Visual Studio, go
+to the properties dialog, and pick your options.
+
+re2c is a great tool for writing fast and flexible lexers. It has
+served many people well for many years. re2c is on the order of 2-3
+times faster than a flex based scanner, and its input model is much
+more flexible.
+
+For an introduction to re2c refer to the lessons sub directory.
+
+Peter's original version 0.5 ANNOUNCE and README follows.
+
+--
+
+re2c is a tool for generating C-based recognizers from regular
+expressions. re2c-based scanners are efficient: for programming
+languages, given similar specifications, an re2c-based scanner is
+typically almost twice as fast as a flex-based scanner with little or no
+increase in size (possibly a decrease on cisc architectures). Indeed,
+re2c-based scanners are quite competitive with hand-crafted ones.
+
+Unlike flex, re2c does not generate complete scanners: the user must
+supply some interface code. While this code is not bulky (about 50-100
+lines for a flex-like scanner; see the man page and examples in the
+distribution) careful coding is required for efficiency (and
+correctness). One advantage of this arrangement is that the generated
+code is not tied to any particular input model. For example, re2c
+generated code can be used to scan data from a null-byte terminated
+buffer as illustrated below.
+
+Given the following source
+
+ #define NULL ((char*) 0)
+ char *scan(char *p)
+ {
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT p
+ #define YYFILL(n)
+ /*!re2c
+ [0-9]+ {return YYCURSOR;}
+ [\000-\377] {return NULL;}
+ */
+ }
+
+re2c will generate
+
+ /* Generated by re2c on Sat Apr 16 11:40:58 1994 */
+ #line 1 "simple.re"
+ #define NULL ((char*) 0)
+ char *scan(char *p)
+ {
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT p
+ #define YYFILL(n)
+ {
+ YYCTYPE yych;
+ unsigned int yyaccept;
+
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '/') goto yy4;
+ if(yych >= ':') goto yy4;
+ yy2: yych = *++YYCURSOR;
+ goto yy7;
+ yy3:
+ #line 9
+ {return YYCURSOR;}
+ yy4: yych = *++YYCURSOR;
+ yy5:
+ #line 10
+ {return NULL;}
+ yy6: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ yy7: if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy6;
+ goto yy3;
+ }
+ #line 11
+
+ }
+
+Note that most compilers will perform dead-code elimination to remove
+all YYCURSOR, YYLIMIT comparisions.
+
+re2c was developed for a particular project (constructing a fast REXX
+scanner of all things!) and so while it has some rough edges, it should
+be quite usable. More information about re2c can be found in the
+(admittedly skimpy) man page; the algorithms and heuristics used are
+described in an upcoming LOPLAS article (included in the distribution).
+Probably the best way to find out more about re2c is to try the supplied
+examples. re2c is written in C++, and is currently being developed
+under Linux using gcc 2.5.8.
+
+Peter
+
+--
+
+re2c is distributed with no warranty whatever. The code is certain to
+contain errors. Neither the author nor any contributor takes
+responsibility for any consequences of its use.
+
+re2c is in the public domain. The data structures and algorithms used
+in re2c are all either taken from documents available to the general
+public or are inventions of the author. Programs generated by re2c may
+be distributed freely. re2c itself may be distributed freely, in source
+or binary, unchanged or modified. Distributors may charge whatever fees
+they can obtain for re2c.
+
+If you do make use of re2c, or incorporate it into a larger project an
+acknowledgement somewhere (documentation, research report, etc.) would
+be appreciated.
+
+Please send bug reports and feedback (including suggestions for
+improving the distribution) to
+
+ [email protected]
+
+Include a small example and the banner from parser.y with bug reports.
+
Property changes on: brlcad/branches/extbuild/src/other/ext/perplex/README.re2c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/perplex/CHANGELOG.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/perplex/CHANGELOG.txt
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/perplex/CHANGELOG.txt
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,4 +0,0 @@
-Version 1.0.1 (2014-06-24)
---------------------------
-* Fixed a casting bug in perplex_template.c. Benign on most systems, but
- triggered a warning from some compilers.
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/perplex/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/perplex/CMakeLists.txt
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/perplex/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,112 +0,0 @@
-# C M A K E L I S T S . T X T
-#
-# Perplex - re2c scanner input generator
-#
-# Copyright (c) 2012-2020 United States Government as represented by
-# the U.S. Army Research Laboratory.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-#
-# 3. The name of the author may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-###
-cmake_minimum_required(VERSION 3.14)
-
-project(PERPLEX)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
-set(PERPLEX_CMAKE_DIR "${PERPLEX_SOURCE_DIR}/CMake")
-if(PERPLEX_IS_SUBBUILD)
- set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PERPLEX_CMAKE_DIR}")
-else(PERPLEX_IS_SUBBUILD)
- set(CMAKE_MODULE_PATH "${PERPLEX_CMAKE_DIR};${CMAKE_MODULE_PATH}")
-endif(PERPLEX_IS_SUBBUILD)
-
-FIND_PACKAGE(LEMON)
-FIND_PACKAGE(RE2C)
-
-if(NOT LEMON_EXECUTABLE OR NOT RE2C_EXECUTABLE)
- message(FATAL_ERROR "Perplex requires the LEMON Parser Generator and the
re2c scanner generator.")
-endif(NOT LEMON_EXECUTABLE OR NOT RE2C_EXECUTABLE)
-
-RE2C_TARGET(PERPLEX scanner.re ${CMAKE_CURRENT_BINARY_DIR}/scanner.c
COMPILE_FLAGS "-c")
-LEMON_TARGET(PERPLEX parser.y)
-ADD_RE2C_LEMON_DEPENDENCY(PERPLEX PERPLEX)
-
-set(perplex_sources
- ${LEMON_PERPLEX_SRC}
- ${RE2C_PERPLEX_OUTPUTS}
- mbo_getopt.cpp
- perplex.cpp
- )
-
-add_executable(perplex ${perplex_sources})
-set_property(TARGET perplex APPEND PROPERTY INCLUDE_DIRECTORIES
"${LEMON_PERPLEX_INCLUDE_DIR}")
-
-# Need to link against stl library with some compilers.
-target_link_libraries(perplex "${STDCXX_LIBRARIES}")
-
-# Install
-if(NOT BIN_DIR)
- set(BIN_DIR bin)
-endif(NOT BIN_DIR)
-if(NOT PERPLEX_SKIP_INSTALL)
- install(TARGETS perplex DESTINATION ${BIN_DIR})
-endif(NOT PERPLEX_SKIP_INSTALL)
-
-# Handle Perplex template
-if(NOT DATA_DIR)
- set(DATA_DIR share)
-endif(NOT DATA_DIR)
-
-if(NOT CMAKE_CONFIGURATION_TYPES)
- set(PERPLEX_TEMPLATE_DIR ${CMAKE_BINARY_DIR}/${DATA_DIR}/perplex)
-else(NOT CMAKE_CONFIGURATION_TYPES)
- set(PERPLEX_TEMPLATE_DIR
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${DATA_DIR}/perplex)
-endif(NOT CMAKE_CONFIGURATION_TYPES)
-add_custom_command(
- OUTPUT ${PERPLEX_TEMPLATE_DIR}/perplex_template.c
- COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/perplex_template.c
${PERPLEX_TEMPLATE_DIR}/perplex_template.c
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/perplex_template.c
- )
-add_custom_target(perplex_template_cp ALL DEPENDS
${PERPLEX_TEMPLATE_DIR}/perplex_template.c)
-add_dependencies(perplex perplex_template_cp)
-
-if(NOT PERPLEX_SKIP_INSTALL)
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/perplex_template.c DESTINATION
${DATA_DIR})
-endif(NOT PERPLEX_SKIP_INSTALL)
-
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/perplex/README.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/perplex/README.txt
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/perplex/README.txt
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,276 +0,0 @@
-==========
- Overview
-==========
-Perplex is a simple tool to simplify the creation of scanners using re2c. It
-generates an input for the re2c tool from a perplex input file.
-
-Main Sources
--------------
-mbo_getopt.cpp and mbo_getopt.h
- Option parser, taken from the re2c project.
-
-perplex.cpp
- main for perplex.
-
-scanner.re and parser.y
- Inputs for re2c scanner-generator and lemon parser-generator respectively.
- These files implement the perplex input file parser.
-
-perplex_template.c
- Template file with a basic re2c scanner implementation.
- Used as the basis for generated scanner sources.
-
-Licensing and Copyrights
--------------------------
-mbo_getopt.cpp and mbo_getopt.h are in the Public Domain, written by
-Marcus Boerger.
-
-scanner.re and perplex_template.c include code taken from the flex project,
-and are released under a BSD License with joint copyright held by the U.S.
-Government and The Regents of the University of California.
-
-All other source files are released under a BSD License with U.S. Government
-copyright.
-
-=====
- API
-=====
-All scanner data is stored in a perplex_t object.
-
-The template implements the following public functions:
-
-perplex_t perplexFileScanner(FILE *input)
- Creates a perplex_t object initialized to scan input from the specified
- file stream. The scanner will stop scanning when EOF is encountered.
-
-perplex_t perplexStringScanner(char *firstChar, size_t numChars)
- Creates a perplex_t object initialized to scan input from the specified
- string. The scanner will stop scanning when numChars characters have
- been scanned.
-
-void perplexFree(perplex_t scanner)
- Frees all memory associated with the given perplex_t object, except for
- any memory referenced by scanner->extra, which must be freed by the user.
-
-int yylex(perplex_t scanner)
- Returns the value of the next recognized token, or YYEOF when the end of
- the input has been reached. The name of this routine can be changed by
- defining the pre-processor symbol PERPLEX_LEXER in section 1 of the
- perplex input file.
-
-void perplexSetExtra(perplex_t scanner, void *extra)
- Set scanner's application data.
-
-void *perplexGetExtra(perplex_t scanner)
- Get scanner's application data.
-
-void perplexUnput(peprlex_t scanner, char c)
- Inserts a character on the specified scanner's input buffer so that it
- is the next character scanned.
-
-Configuration Macros
----------------------
-These macros can be defined in section 1 of the perplex input file:
-
-PERPLEX_LEXER
- Set this symbol to specify an alternate name for the generated lexer.
- Default is yylex.
-
-PERPLEX_ON_ENTER
- Use this symbol to specify code to run at the beginning of each call to
- the lexer. A common use is to simplify access to application data:
-
- #define PERPLEX_ON_ENTER appData_t *appData = (appData_t*)yyextra;
-
-Macros Available Inside Rule Code Blocks
------------------------------------------
-These macros can only be used inside rule code blocks:
-
-YYGETCONDITION and YYSETCONDITION(condition)
- Get or set the current start conditions, (requires running perplex and
- re2c with '-c' option flag).
-
-yytext
- A dynamically allocated null-terminated string holding the input which
- was matched. yytext is guaranteed to exist until the end of the code
- block it is used in, but will be automatically freed afterwards. If
- you need to store the token text, you'll need to make a copy.
-
-yyextra
- Application data (void*).
-
-===============
- Using Perplex
-===============
-1) Write a perplex input file (see Perplex Input Format).
-
-2) Run perplex on the input to generate an re2c input file.
-
- perplex -t /path/to/perplex_template.c -h header.h -o output.re input.l
-
-* Input defaults to stdin and output defaults to stdout.
-
-* The generated header contains the perplex_t definition and public function
- prototypes. This header should be manually included in input.l. If no
- output header path is specified, the definitions/declarations will appear
- at the top of the output source.
-
-3) Run re2c on the re2c input to generate the final scanner source.
-
- re2c -o /path/to/output.c /path/to/output.re
-
-4) Scan input.
-
- int tokenID;
- perplex_t scanner = perplexFileScanner(inFile);
-
- perplexSetExtra(scanner, (void*)appData);
-
- while ((tokenID = yylex(scanner)) != YYEOF) {
- ...
- }
-
- /* do something with appData */
-
- perplexFree(scanner);
-
-======================
- Perplex Input Format
-======================
-Perplex takes a three-section file as input:
-
- /* section 1 - code copied to output */
- %%
-
- /* section 2 - scanner rules (see Perplex Rule Section Syntax) */
- <regular-expression> { <code> }
- <regular-expression> { <code> }
-
- %%
- /* section 3 (optional) - code copied to output */
-
-Sections are separated by "%%" appearing on a line by itself, with no leading
-or trailing whitespace. The second "%%" separator and following code section
-are optional.
-
-=============================
- Perplex Rule Section Syntax
-=============================
-The basic form of the rule section is a series of regular expressions followed
-by C/C++ code to be executed when the current input string matches the
-expression:
-
- <regular-expression> { <code> }
- <regular-expression> { <code> }
-
-The code block spans between { and }, not including C-braces or braces
-appearing within strings or comments. The code-block is optional. If missing,
-the default behavior is to ignore the matched input string and continue
-scanning.
-
-* See the re2c documentation for a list of valid regular expressions.
-
-Named Definitions
-------------------
-Regular expressions can be given aliases using re2c's named definition syntax.
-All named definitions should appear before the first rule.
-
- %%
- /* named definitions */
-
- alpha = [A-Za-z];
- num = [0-9];
-
- /* rules */
-
- alpha { /* code */ }
- num { /* code */ }
-
- /* to match something like "A1" */
- alpha(num) { /* code */ }
-
-Exiting From Code Blocks
--------------------------
-When the end of a code block is reached, the default behavior is to advance
-past the matched input, and continue scanning:
-
- [ \t]+ { /* ignore and continue scanning */ }
-
-If you have matched a token, you will probably return a token identifier rather
-than immediately resume scanning:
-
- [A-Za-z_]+ { return TOKEN_NAME; }
-
-It is also possible that you will match part of a token, and need to continue
-scanning to find the end of it. Use the continue keyword to avoid throwing out
-the text matched so far:
-
- /* start of list */
- '{' { continue; }
-
- /* intermediate list item */
- [^,}]',' { continue; }
-
- /* end of list */
- [^,}]'}' { return TOKEN_LIST; }
-
-==================
- Start Conditions
-==================
-Start conditions allow you to specify that certain rules only be applied in
-certain states. Using start conditions requires that perplex and re2c are
-run with the '-c' option flag.
-
-Conditions are simply ints, defined in whatever manner is convenient
-(e.g. in an enum).
-
-When using conditions, all rules must either be prefixed with a
-comma-separated list of conditions appearing between < and >, or must be
-specified inside a condition scope (a condition list followed by rules
-in between { and }):
-
- enum {conditionOne, conditionTwo, conditionThree};
- %%
- /* condition scope */
- <conditionOne> {
- "center" { /* code */ }
- "view" { /* code */ }
- }
-
- /* simple condition-prefixed rules */
- <conditionOne,conditionTwo>[a-zA-Z]+ { /* code */ }
-
- <conditionThree>'v' { /* code */ }
-
-0 is the initial condition, and can be referrenced as the empty list "<>" in
-the rule section. "<*>" is the shorthand for specifying all conditions.
-
-The current condition can be determined by calling YYGETCONDITION(). A new
-condition can be set by calling YYSETCONDITION(<condition>), or by using one of
-the re2c transition operators: "=>" or ":=>". Take the example of changing from
-a "code" condition to a "comment" condition:
-
- enum {INITIAL, code, comment};
- %%
- /* scanner's first order of business is to change from "INITIAL"
- * to "code" condition
- */
- <> => code
-
- /* this... */
- <code>"/*" => comment { /* code */ }
-
- /* ...is equivalent to this */
- <code>"/*" {
- YYSETCONDITION(comment);
- /* code */
- }
-
- /* and this... */
- <code>"/*" :=> comment
-
- /* ...is equivalent to this */
- <code>"/*" :=> comment {
- YYSETCONDITION(comment);
- continue;
- }
Modified: brlcad/branches/extbuild/src/other/ext/perplex/perplex/perplex.h
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/perplex/perplex.h
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/perplex/perplex.h
2020-10-23 02:05:19 UTC (rev 77568)
@@ -42,7 +42,7 @@
#define PERPLEX_H
#include <stdio.h>
-#include "parser.h"
+#include "perplex_parser.h"
#include "token_type.h"
/* tokens are typically ints defined starting from 0,
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/re2c/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/CMakeLists.txt
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,141 +0,0 @@
-# Minimum required version of CMake
-cmake_minimum_required(VERSION 3.14)
-
-# Set CMake project name
-project(RE2C)
-
-# Set project information
-set(PACKAGE re2c)
-set(VERSION 0.13.5)
-set(PACKAGE_NAME ${PACKAGE})
-set(PACKAGE_BUGREPORT "[email protected]")
-set(PACKAGE_STRING "${PACKAGE} ${VERSION}")
-set(PACKAGE_TARNAME ${PACKAGE})
-set(PACKAGE_VERSION ${VERSION})
-set(PACKAGE_RELEASE 1)
-
-include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
-set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
-find_package(LEMON)
-
-
-set(STDC_HEADERS 1)
-include(CheckIncludeFile)
-CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
-CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
-include(CheckFunctionExists)
-CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
-CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
-CHECK_FUNCTION_EXISTS(munmap HAVE_MUNMAP)
-CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
-CHECK_FUNCTION_EXISTS(strndup HAVE_STRNDUP)
-include(CheckTypeSize)
-CHECK_TYPE_SIZE(char SIZEOF_CHAR)
-CHECK_TYPE_SIZE(int SIZEOF_INT)
-CHECK_TYPE_SIZE(long SIZEOF_LONG)
-CHECK_TYPE_SIZE(short SIZEOF_SHORT)
-
-configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/config.h")
-add_definitions(-DHAVE_CONFIG_H)
-
-set(re2c_common_SRCS
- code.cc
- dfa.cc
- main.cc
- actions.cc
- substr.cc
- translate.cc
- mbo_getopt.cc
- )
-
-set(re2c_HDRS
- basics.h
- dfa.h
- globals.h
- ins.h
- re2c_parser.h
- re.h
- scanner.h
- substr.h
- token.h
- mbo_getopt.h
- code.h
- stream_lc.h
- code_names.h
- )
-
-set(parser_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}/bootstrap_parser")
-LEMON_TARGET(re2cParse_bootstrap parser.yy OUT_SRC_FILE bootstrap_parser.cc
OUT_HDR_FILE bootstrap_parser_tokens.h)
-set(re2c_bootstrap_SRCS
- ${re2c_common_SRCS}
- ${LEMON_re2cParse_bootstrap_SRC}
- ${LEMON_re2cParse_bootstrap_HDR}
- bootstrap/scanner.cc
- )
-add_executable(re2c_bootstrap ${re2c_bootstrap_SRCS})
-set_property(TARGET re2c_bootstrap APPEND PROPERTY INCLUDE_DIRECTORIES
"${LEMON_re2cParse_bootstrap_INCLUDE_DIR}")
-
-# Need to link against stl library with some compilers.
-target_link_libraries(re2c_bootstrap "${STDCXX_LIBRARIES}")
-
-if(TARGET_RUNTIME_OUTPUT_DIRECTORY)
- set_target_properties(re2c_bootstrap PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${TARGET_RUNTIME_OUTPUT_DIRECTORY}")
- foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
- string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
- set_target_properties(re2c_bootstrap PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER} "${TARGET_RUNTIME_OUTPUT_DIRECTORY}")
- endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
-endif(TARGET_RUNTIME_OUTPUT_DIRECTORY)
-if(${LEMON_EXECUTABLE_TARGET})
- add_dependencies(re2c_bootstrap ${LEMON_EXECUTABLE_TARGET})
-endif(${LEMON_EXECUTABLE_TARGET})
-
-set(parser_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}/re2c_parser")
-LEMON_TARGET(re2cParse parser.yy OUT_SRC_FILE parser.cc OUT_HDR_FILE
parser_tokens.h)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/scanner.cc
- COMMAND re2c_bootstrap -bi -o ${CMAKE_CURRENT_BINARY_DIR}/scanner.cc
${CMAKE_CURRENT_SOURCE_DIR}/scanner.re
- DEPENDS re2c_bootstrap
- )
-set(re2c_SRCS
- ${re2c_common_SRCS}
- ${LEMON_re2cParse_SRC}
- ${LEMON_re2cParse_HDR}
- ${CMAKE_CURRENT_BINARY_DIR}/scanner.cc
- )
-
-add_executable(re2c ${re2c_SRCS})
-set_property(TARGET re2c APPEND PROPERTY INCLUDE_DIRECTORIES
"${LEMON_re2cParse_INCLUDE_DIR}")
-
-# Need to link against stl library with some compilers.
-target_link_libraries(re2c "${STDCXX_LIBRARIES}")
-
-# Install
-if(NOT BIN_DIR)
- set(BIN_DIR bin)
-endif(NOT BIN_DIR)
-if(NOT RE2C_SKIP_INSTALL)
- install(TARGETS re2c DESTINATION ${BIN_DIR})
-endif(NOT RE2C_SKIP_INSTALL)
-
-configure_file(README.in ${CMAKE_CURRENT_BINARY_DIR}/README)
-DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/README")
-
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/re2c/README.in
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/README.in
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/README.in
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,201 +0,0 @@
-re2c Version @PACKAGE_VERSION@
-------------------
-
-Originally written by Peter Bumbulis ([email protected])
-
-Currently maintained by:
- Dan Nuffer <nuffer at users.sourceforge.net>
- Marcus Boerger <helly at users.sourceforge.net>
- Hartmut Kaiser <hkaiser at users.sourceforge.net>
-
-The re2c distribution can be found at:
-
- http://sourceforge.net/projects/re2c/
-
-re2c has been developed and tested with the following compilers on various
-platforms in 32 bit and 64 bit mode:
-- GCC 3.3 ... 4.1
-- Microsoft VC 7, 7.1, 8
-- Intel 9.0
-- Sun C++ 5.8 (CXXFLAGS='-library=stlport4')
-- MIPSpro Compilers: Version 7.4.4m
-
-GCC 2.x and Microsoft VC 6 are not capable of compiling re2c.
-
-Building re2c on unix like platforms requires autoconf 2.57 and bison (tested
-with 1.875 and later). Under windows you don't need autoconf or bison
-and can use the pregenerated files.
-
-You can build this software by simply typing the following commands:
- ./configure
- make
-
-The above version will be based on the pregenerated scanner.cc file.
-If you want to build that file yourself (recommended when installing
-re2c) you need the following steps:
- ./configure
- make
- rm -f scanner.cc
- make install
-
-Or you can create a rpm package and install it by the following commands:
- ./configure
- make rpm
- rpm -Uhv <packagedir>/re2c-@PACKAGE_VERSION@-@[email protected]
-
-If you want to build from CVS then the first thing you should do is
-regenerating all build files using the following command:
- ./autogen.sh
-and then continue with one of the above described build methods. Or if you
-need to generate RPM packages for cvs builds use these commands:
- ./autogen.sh
- ./configure
- ./makerpm <release>
- rpm -Uhv <packagedir>/re2c-@PACKAGE_VERSION@-<release>.rpm
-
-Here <realease> should be a number like 1. And <packagedir> must equal
-the directory where the makerpm step has written the generated rpm to.
-
-If you are on a debian system you can use the tool 'alien' to convert rpms
-to debian packages.
-
-When building with native SUN compilers you need to set the following compiler
-flags: CXXFLAGS='-g -compat5 -library=stlport4'.
-
-If you want to build re2c on a windows system you can either use cygwin and one
-of the methods described above or use Microsoft Visual C .NET 2002 or later
-with the solution files provided (re2c.sln for 2002/2003 and re2c-2005.sln for
-version 2005). re2c cannot be built with Microsoft Visual C 6.0 or earlier.
-
-Using Visual Studio 2005 you can automate handling of .re files by adding the
-custom build rules file (re2c.rules) to your project. Just load your Visual
-C++ project in Visual Studio, select "Custom Build Rules..." from its context
-menu, and add re2c.rules to the list with the "Find Existing..." button.
-Activate the check mark, and you are done! Any .re files you add to the project
-will now automatically be built with re2c. Of course, re2c.exe also has to be
-available in your environment for this to work. With the rules active Visual
-Studio will automatically recognize .re files and compile then with re2c. The
-output file has the same name as the input file but with the .cpp extension.
-This, and all other re2c compiler settings, are fully configurable from within
-the Visual Studio IDE. Just right-click on the .re file in Visual Studio, go
-to the properties dialog, and pick your options.
-
-re2c is a great tool for writing fast and flexible lexers. It has
-served many people well for many years. re2c is on the order of 2-3
-times faster than a flex based scanner, and its input model is much
-more flexible.
-
-For an introduction to re2c refer to the lessons sub directory.
-
-Peter's original version 0.5 ANNOUNCE and README follows.
-
---
-
-re2c is a tool for generating C-based recognizers from regular
-expressions. re2c-based scanners are efficient: for programming
-languages, given similar specifications, an re2c-based scanner is
-typically almost twice as fast as a flex-based scanner with little or no
-increase in size (possibly a decrease on cisc architectures). Indeed,
-re2c-based scanners are quite competitive with hand-crafted ones.
-
-Unlike flex, re2c does not generate complete scanners: the user must
-supply some interface code. While this code is not bulky (about 50-100
-lines for a flex-like scanner; see the man page and examples in the
-distribution) careful coding is required for efficiency (and
-correctness). One advantage of this arrangement is that the generated
-code is not tied to any particular input model. For example, re2c
-generated code can be used to scan data from a null-byte terminated
-buffer as illustrated below.
-
-Given the following source
-
- #define NULL ((char*) 0)
- char *scan(char *p)
- {
- #define YYCTYPE char
- #define YYCURSOR p
- #define YYLIMIT p
- #define YYFILL(n)
- /*!re2c
- [0-9]+ {return YYCURSOR;}
- [\000-\377] {return NULL;}
- */
- }
-
-re2c will generate
-
- /* Generated by re2c on Sat Apr 16 11:40:58 1994 */
- #line 1 "simple.re"
- #define NULL ((char*) 0)
- char *scan(char *p)
- {
- #define YYCTYPE char
- #define YYCURSOR p
- #define YYLIMIT p
- #define YYFILL(n)
- {
- YYCTYPE yych;
- unsigned int yyaccept;
-
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- if(yych <= '/') goto yy4;
- if(yych >= ':') goto yy4;
- yy2: yych = *++YYCURSOR;
- goto yy7;
- yy3:
- #line 9
- {return YYCURSOR;}
- yy4: yych = *++YYCURSOR;
- yy5:
- #line 10
- {return NULL;}
- yy6: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- yy7: if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy6;
- goto yy3;
- }
- #line 11
-
- }
-
-Note that most compilers will perform dead-code elimination to remove
-all YYCURSOR, YYLIMIT comparisions.
-
-re2c was developed for a particular project (constructing a fast REXX
-scanner of all things!) and so while it has some rough edges, it should
-be quite usable. More information about re2c can be found in the
-(admittedly skimpy) man page; the algorithms and heuristics used are
-described in an upcoming LOPLAS article (included in the distribution).
-Probably the best way to find out more about re2c is to try the supplied
-examples. re2c is written in C++, and is currently being developed
-under Linux using gcc 2.5.8.
-
-Peter
-
---
-
-re2c is distributed with no warranty whatever. The code is certain to
-contain errors. Neither the author nor any contributor takes
-responsibility for any consequences of its use.
-
-re2c is in the public domain. The data structures and algorithms used
-in re2c are all either taken from documents available to the general
-public or are inventions of the author. Programs generated by re2c may
-be distributed freely. re2c itself may be distributed freely, in source
-or binary, unchanged or modified. Distributors may charge whatever fees
-they can obtain for re2c.
-
-If you do make use of re2c, or incorporate it into a larger project an
-acknowledgement somewhere (documentation, research report, etc.) would
-be appreciated.
-
-Please send bug reports and feedback (including suggestions for
-improving the distribution) to
-
- [email protected]
-
-Include a small example and the banner from parser.y with bug reports.
-
Modified: brlcad/branches/extbuild/src/other/ext/perplex/re2c/code.cc
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/code.cc 2020-10-23
02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/code.cc 2020-10-23
02:05:19 UTC (rev 77568)
@@ -2063,7 +2063,7 @@
void genHeader(std::ostream &o, uint ind, const RegExpMap& specMap)
{
- o << "/* Generated by re2c " PACKAGE_VERSION;
+ o << "/* Generated by re2c 0.13.5, BRL-CAD";
if (!bNoGenerationDate)
{
o << " on ";
Modified: brlcad/branches/extbuild/src/other/ext/perplex/re2c/config.h.in
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/config.h.in
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/config.h.in
2020-10-23 02:05:19 UTC (rev 77568)
@@ -52,24 +52,6 @@
/* Define to 1 if the system has the type `_Bool'. */
#cmakedefine HAVE__BOOL 1
-/* Name of package */
-#cmakedefine PACKAGE "@PACKAGE@"
-
-/* Define to the address where bug reports for this package should be sent. */
-#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
-
-/* Define to the full name of this package. */
-#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
-
-/* Define to the full name and version of this package. */
-#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
-
-/* Define to the one symbol short name of this package. */
-#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
-
-/* Define to the version of this package. */
-#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
-
/* The size of `char', as computed by sizeof. */
#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@
@@ -83,11 +65,8 @@
#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@
/* Define to 1 if you have the ANSI C header files. */
-#cmakedefine STDC_HEADERS 1
+#define STDC_HEADERS 1
-/* Version number of package */
-#cmakedefine VERSION "@VERSION@"
-
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
#cmakedefine volatile
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/re2c/config_w32.h.in
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/config_w32.h.in
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/config_w32.h.in
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,102 +0,0 @@
-/* config.h. Generated by configure. */
-/* config.h.in. Generated from configure.in by autoheader. */
-
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `memset' function. */
-#define HAVE_MEMSET 1
-
-/* Define to 1 if you have a working `mmap' system call. */
-/* #undef HAVE_MMAP */
-
-/* Define to 1 if you have the `munmap' function. */
-#define HAVE_MUNMAP 1
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#define HAVE_STDBOOL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strdup' function. */
-#define HAVE_STRDUP 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if the system has the type `_Bool'. */
-#define HAVE__BOOL 1
-
-/* Name of package */
-#define PACKAGE "re2c"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "[email protected]"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "re2c"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "re2c @PACKAGE_VERSION@"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "re2c"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "@PACKAGE_VERSION@"
-
-/* The size of a `char', as computed by sizeof. */
-#define SIZEOF_CHAR 1
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of a `long', as computed by sizeof. */
-#define SIZEOF_LONG 4
-
-/* The size of a `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "@PACKAGE_VERSION@"
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define to empty if the keyword `volatile' does not work. Warning: valid
- code using `volatile' can become incorrect without. Disable with care. */
-/* #undef volatile */
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/re2c/configure.in
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/configure.in
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/configure.in
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,66 +0,0 @@
-AC_PREREQ([2.57])
-AC_INIT(re2c, 0.13.5, [email protected])
-AM_INIT_AUTOMAKE(re2c, $PACKAGE_VERSION)
-AC_CONFIG_SRCDIR(actions.cc)
-AM_CONFIG_HEADER(config.h)
-
-AC_SUBST(PACKAGE_DATE, `date +'%d %b %Y'`)
-AC_SUBST(PACKAGE_VERSION)
-AC_SUBST(PACKAGE_NAME)
-AC_SUBST(PACKAGE_TARNAME)
-AC_SUBST(PACKAGE_RELEASE, ${PACKAGE_RELEASE:-1})
-AC_SUBST(WINBUILDDIR, Release-2005)
-
-# Checks for programs.
-AC_PROG_YACC
-AC_PROG_CXX
-AC_PROG_CC
-AC_PROG_INSTALL
-
-if test "$GCC" = "yes"; then
- AC_MSG_CHECKING([Testing GCC version])
- GCCVERSION=`$CXX -dumpversion 2>/dev/null`
- if test -z "$GCCVERSION"; then
- AC_MSG_ERROR([GCC version 3 or above required])
- fi
- AC_MSG_RESULT([found version $GCCVERSION])
-fi
-
-# Checks for libraries.
-
-# Checks for header files.
-AC_HEADER_STDC
-
-# We only rely on standard C/C++ headers. If we ever have a pressing need
-# for something non-standard, we should add a check for it here.
-# AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_HEADER_STDBOOL
-AC_C_CONST
-AC_C_INLINE
-AC_TYPE_SIZE_T
-AC_C_VOLATILE
-
-# Checks for library functions.
-AC_FUNC_MEMCMP
-AC_FUNC_MMAP
-AC_CHECK_FUNCS([memset munmap strdup strndup])
-
-AC_CHECK_SIZEOF([char])
-AC_CHECK_SIZEOF([short])
-AC_CHECK_SIZEOF([int])
-AC_CHECK_SIZEOF([long])
-
-AC_CONFIG_FILES([\
-Makefile \
-README \
-makerpm \
-re2c.1 \
-re2c.spec \
-run_tests.sh \
-config_w32.h \
-htdocs/manual.html \
-])
-AC_OUTPUT_COMMANDS([chmod +x makerpm run_tests.sh])
-AC_OUTPUT
Modified: brlcad/branches/extbuild/src/other/ext/perplex/re2c/main.cc
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/main.cc 2020-10-23
02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/main.cc 2020-10-23
02:05:19 UTC (rev 77568)
@@ -285,31 +285,9 @@
break;
case 'v':
- cout << "re2c " << PACKAGE_VERSION << "\n";
+ cout << "re2c 0.13.5 BRL-CAD\n";
return 2;
- case 'V': {
- string vernum(PACKAGE_VERSION);
-
- if (vernum[1] == '.')
- {
- vernum.insert(0, "0");
- }
- vernum.erase(2, 1);
- if (vernum[3] == '.')
- {
- vernum.insert(2, "0");
- }
- vernum.erase(4, 1);
- if (vernum.length() < 6 || vernum[5] < '0' ||
vernum[5] > '9')
- {
- vernum.insert(4, "0");
- }
- vernum.resize(6);
- cout << vernum << endl;
- return 2;
- }
-
case 'w':
nRealChars = (1<<16); /* 0x10000 */
sFlag = true;
Modified: brlcad/branches/extbuild/src/other/ext/perplex/re2c/parser.yy
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/parser.yy
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/parser.yy
2020-10-23 02:05:19 UTC (rev 77568)
@@ -451,7 +451,7 @@
in = &i;
- o << "/* Generated by re2c " PACKAGE_VERSION;
+ o << "/* Generated by re2c 0.13.5 BRL-CAD";
if (!bNoGenerationDate)
{
o << " on ";
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.1.in
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.1.in
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.1.in
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,829 +0,0 @@
-./"
-./" $Id: re2c.1.in 862 2008-05-25 14:30:45Z helly $
-./"
-.TH RE2C 1 "@PACKAGE_DATE@" "Version @PACKAGE_VERSION@"
-.ds re \fBre2c\fP
-.ds le \fBlex\fP
-.ds rx regular-expression
-.ds rxs regular-expressions
-.ds lx \fIl\fP-expression
-.SH NAME
-\*(re \- convert \*(rxs to C/C++
-
-.SH SYNOPSIS
-\*(re [\fB-bdDefFghisuvVw1\fP] [\fB-o output\fP] [\fB-c\fP [\fB-t header\fP]]
\fBfile\fP
-
-.SH DESCRIPTION
-\*(re is a preprocessor that generates C-based recognizers from regular
-expressions.
-The input to \*(re consists of C/C++ source interleaved with
-comments of the form \fC/*!re2c\fP ... \fC*/\fP which contain
-scanner specifications.
-In the output these comments are replaced with code that, when
-executed, will find the next input token and then execute
-some user-supplied token-specific code.
-
-For example, given the following code
-
-.in +3
-.nf
-char *scan(char *p)
-{
-/*!re2c
- re2c:define:YYCTYPE = "unsigned char";
- re2c:define:YYCURSOR = p;
- re2c:yyfill:enable = 0;
- re2c:yych:conversion = 1;
- re2c:indent:top = 1;
- [0-9]+ {return p;}
- [^] {return (char*)0;}
-*/
-}
-.fi
-.in -3
-
-\*(re -is will generate
-
-.in +3
-.nf
-/* Generated by re2c on Sat Apr 16 11:40:58 1994 */
-char *scan(char *p)
-{
- {
- unsigned char yych;
-
- yych = (unsigned char)*p;
- if(yych <= '/') goto yy4;
- if(yych >= ':') goto yy4;
- ++p;
- yych = (unsigned char)*p;
- goto yy7;
-yy3:
- {return p;}
-yy4:
- ++p;
- yych = (unsigned char)*p;
- {return char*)0;}
-yy6:
- ++p;
- yych = (unsigned char)*p;
-yy7:
- if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy6;
- goto yy3;
- }
-
-}
-.fi
-.in -3
-
-You can place one \fC/*!max:re2c */\fP comment that will output a "#define
-\fCYYMAXFILL\fP <n>" line that holds the maximum number of characters
-required to parse the input. That is the maximum value \fCYYFILL\fP(n)
-will receive. If -1 is in effect then YYMAXFILL can only be triggered once
-after the last \fC/*!re2c */\fP.
-
-You can also use \fC/*!ignore:re2c */\fP blocks that allows to document the
-scanner code and will not be part of the output.
-
-.SH OPTIONS
-\*(re provides the following options:
-.TP
-\fB-?\fP
-\fB-h\fP
-Invoke a short help.
-.TP
-\fB-b\fP
-Implies \fB-s\fP. Use bit vectors as well in the attempt to coax better
-code out of the compiler. Most useful for specifications with more than a
-few keywords (e.g. for most programming languages).
-.TP
-\fB-c\fP
-Used to support (f)lex-like condition support.
-.TP
-\fB-d\fP
-Creates a parser that dumps information about the current position and in
-which state the parser is while parsing the input. This is useful to debug
-parser issues and states. If you use this switch you need to define a macro
-\fIYYDEBUG\fP that is called like a function with two parameters:
-\fIvoid YYDEBUG(int state, char current)\fP. The first parameter receives the
-state or -1 and the second parameter receives the input at the current cursor.
-.TP
-\fB-D\fP
-Emit Graphviz dot data. It can then be processed with e.g.
-"dot -Tpng input.dot > output.png". Please note that scanners with many states
-may crash dot.
-.TP
-\fB-e\fP
-Cross-compile from an ASCII platform to an EBCDIC one.
-.TP
-\fB-f\fP
-Generate a scanner with support for storable state.
-For details see below at \fBSCANNER WITH STORABLE STATES\fP.
-.TP
-\fB-F\fP
-Partial support for flex syntax. When this flag is active then named
-definitions must be surrounded by curly braces and can be defined without an
-equal sign and the terminating semi colon. Instead names are treated as direct
-double quoted strings.
-.TP
-\fB-g\fP
-Generate a scanner that utilizes GCC's computed goto feature. That is \*(re
-generates jump tables whenever a decision is of a certain complexity (e.g. a
-lot of if conditions are otherwise necessary). This is only useable with GCC
-and produces output that cannot be compiled with any other compiler. Note that
-this implies -b and that the complexity threshold can be configured using the
-inplace configuration "cgoto:threshold".
-.TP
-\fB-i\fP
-Do not output #line information. This is useful when you want use a CMS tool
-with the \*(re output which you might want if you do not require your users to
-have \*(re themselves when building from your source.
-\fB-o output\fP
-Specify the output file.
-.TP
-\fB-r\fP
-Allows reuse of scanner definitions with '\fB/*!use:re2c\fP' after
-'\fB/*!rules:re2c\fP'. In this mode no '\fB/*!re2c\fP' block and exactly one
-'\fB/*!rules:re2c\fP' must be present. The rules are being saved and used by
-every '\fB/*!use:re2c\fP' block that follows. These blocks can contain
-inplace configurations, especially '\fBre2c:flags:w\fP' and
'\fBre2c:flags:u\fP'.
-That way it is possible to create the same scanner multiple times for different
-character types, different input mechanisms or different output mechanisms.
-The '\fB/*!use:re2c\fP' blocks can also contain additional rules that will be
-appended to the set of rules in '\fB/*!rules:re2c\fP'.
-.TP
-\fB-s\fP
-Generate nested \fCif\fPs for some \fCswitch\fPes. Many compilers need this
-assist to generate better code.
-.TP
-\fB-t\fP
-Create a header file that contains types for the (f)lex-like condition support.
-This can only be activated when \fB-c\fP is in use.
-.TP
-\fB-u\fP
-Generate a parser that supports Unicode chars (UTF-32). This means the
-generated code can deal with any valid Unicode character up to 0x10FFFF. When
-UTF-8 or UTF-16 needs to be supported you need to convert the incoming stream
-to UTF-32 upon input yourself.
-.TP
-\fB-v\fP
-Show version information.
-.TP
-\fB-V\fP
-Show the version as a number XXYYZZ.
-.TP
-\fB-w\fP
-Create a parser that supports wide chars (UCS-2). This implies \fB-s\fP and
-cannot be used together with \fB-e\fP switch.
-.TP
-\fB-1\fP
-Force single pass generation, this cannot be combined with -f and disables
-YYMAXFILL generation prior to last \*(re block.
-.TP
-\fB--no-generation-date\fP
-Suppress date output in the generated output so that it only shows the re2c
-version.
-.TP
-\fb--case-insensitive\fP
-All strings are case insensitive, so all "-expressions are treated
-in the same way '-expressions are.
-.TP
-\fB--case-inverted\fP
-Invert the meaning of single and double quoted strings.
-With this switch single quotes are case sensitive and
-double quotes are case insensitive.
-
-.SH "INTERFACE CODE"
-Unlike other scanner generators, \*(re does not generate complete scanners:
-the user must supply some interface code.
-In particular, the user must define the following macros or use the
-corresponding inplace configurations:
-.TP
-\fCYYCONDTYPE\fP
-In \fB-c\fP mode you can use \fB-t\fP to generate a file that contains the
-enumeration used as conditions. Each of the values refers to a condition of
-a rule set.
-.TP
-\fCYYCTXMARKER\fP
-\*(lx of type \fC*YYCTYPE\fP.
-The generated code saves trailing context backtracking information in
\fCYYCTXMARKER\fP.
-The user only needs to define this macro if a scanner specification uses
trailing
-context in one or more of its \*(rxs.
-.TP
-\fCYYCTYPE\fP
-Type used to hold an input symbol.
-Usually \fCchar\fP or \fCunsigned char\fP.
-.TP
-\fCYYCURSOR\fP
-\*(lx of type \fC*YYCTYPE\fP that points to the current input symbol.
-The generated code advances \fCYYCURSOR\fP as symbols are matched.
-On entry, \fCYYCURSOR\fP is assumed to point to the first character of the
-current token. On exit, \fCYYCURSOR\fP will point to the first character of
-the following token.
-.TP
-\fCYYDEBUG(\fP\fIstate\fP,\fIcurrent\fC)\fP
-This is only needed if the \fB-d\fP flag was specified. It allows to easily
debug
-the generated parser by calling a user defined function for every state. The
function
-should have the following signature: \fIvoid YYDEBUG(int state, char
current)\fP.
-The first parameter receives the state or -1 and the second parameter receives
the
-input at the current cursor.
-.TP
-\fCYYFILL\fP(\fIn\fP\fC\fP)
-The generated code "calls" \fCYYFILL\fP(n) when the buffer needs
-(re)filling: at least \fIn\fP additional characters should
-be provided. \fCYYFILL\fP(n) should adjust \fCYYCURSOR\fP, \fCYYLIMIT\fP,
-\fCYYMARKER\fP and \fCYYCTXMARKER\fP as needed. Note that for typical
-programming languages \fIn\fP will be the length of the longest keyword plus
one.
-The user can place a comment of the form \fC/*!max:re2c */\fP once to insert
-a \fCYYMAXFILL\fP(n) definition that is set to the maximum length value. If -1
-switch is used then \fCYYMAXFILL\fP can be triggered only once after the
-last \fC/*!re2c */\fP
-block.
-.TP
-\fCYYGETCONDITION\fP()
-This define is used to get the condition prior to entering the scanner code
-when using \fB-c\fP switch. The value must be initialized with a value from
-the enumeration \fCYYCONDTYPE\fP type.
-.TP
-\fCYYGETSTATE\fP()
-The user only needs to define this macro if the \fB-f\fP flag was specified.
-In that case, the generated code "calls" \fCYYGETSTATE\fP() at the very
beginning
-of the scanner in order to obtain the saved state. \fCYYGETSTATE\fP() must
return a signed
-integer. The value must be either -1, indicating that the scanner is entered
for the
-first time, or a value previously saved by \fCYYSETSTATE\fP(s). In the second
case, the
-scanner will resume operations right after where the last \fCYYFILL\fP(n) was
called.
-.TP
-\fCYYLIMIT\fP
-Expression of type \fC*YYCTYPE\fP that marks the end of the buffer
-(\fCYYLIMIT[-1]\fP is the last character in the buffer).
-The generated code repeatedly compares \fCYYCURSOR\fP to \fCYYLIMIT\fP
-to determine when the buffer needs (re)filling.
-.TP
-\fCYYMARKER\fP
-\*(lx of type \fC*YYCTYPE\fP.
-The generated code saves backtracking information in \fCYYMARKER\fP. Some easy
-scanners might not use this.
-.TP
-\fCYYMAXFILL
-This will be automatically defined by \fC/*!max:re2c */\fP blocks as explained
above.
-.TP
-\fCYYSETCONDITION(\fP\fIc\fP\fC)\fP
-This define is used to set the condition in transition rules. This is only
-being used when \fB-c\fP is active and transition rules are being used.
-.TP
-\fCYYSETSTATE(\fP\fIs\fP\fC)\fP
-The user only needs to define this macro if the \fB-f\fP flag was specified.
-In that case, the generated code "calls" \fCYYSETSTATE\fP just before calling
-\fCYYFILL\fP(n). The parameter to \fCYYSETSTATE\fP is a signed integer that
uniquely
-identifies the specific instance of \fCYYFILL\fP(n) that is about to be called.
-Should the user wish to save the state of the scanner and have \fCYYFILL\fP(n)
return
-to the caller, all he has to do is store that unique identifier in a variable.
-Later, when the scannered is called again, it will call \fCYYGETSTATE()\fP and
-resume execution right where it left off. The generated code will contain
-both \fCYYSETSTATE\fP(s) and \fCYYGETSTATE\fP even if \fCYYFILL\fP(n) is being
-disabled.
-
-.SH "SCANNER WITH STORABLE STATES"
-When the \fB-f\fP flag is specified, \*(re generates a scanner that
-can store its current state, return to the caller, and later resume
-operations exactly where it left off.
-
-The default operation of \*(re is a "pull" model, where the scanner asks
-for extra input whenever it needs it. However, this mode of operation
-assumes that the scanner is the "owner" the parsing loop, and that may
-not always be convenient.
-
-Typically, if there is a preprocessor ahead of the scanner in the stream,
-or for that matter any other procedural source of data, the scanner cannot
-"ask" for more data unless both scanner and source live in a separate threads.
-
-The \fB-f\fP flag is useful for just this situation : it lets users design
-scanners that work in a "push" model, i.e. where data is fed to the scanner
-chunk by chunk. When the scanner runs out of data to consume, it just stores
-its state, and return to the caller. When more input data is fed to the
scanner,
-it resumes operations exactly where it left off.
-
-When using the -f option \*(re does not accept stdin because it has to do the
-full generation process twice which means it has to read the input twice. That
-means \*(re would fail in case it cannot open the input twice or reading the
-input for the first time influences the second read attempt.
-
-Changes needed compared to the "pull" model.
-
-1. User has to supply macros YYSETSTATE() and YYGETSTATE(state)
-
-2. The \fB-f\fP option inhibits declaration of \fIyych\fP and
-\fIyyaccept\fP. So the user has to declare these. Also the user has
-to save and restore these. In the example \fIexamples/push.re\fP these
-are declared as fields of the (C++) class of which the scanner is a
-method, so they do not need to be saved/restored explicitly. For C
-they could e.g. be made macros that select fields from a structure
-passed in as parameter. Alternatively, they could be declared as local
-variables, saved with YYFILL(n) when it decides to return and restored
-at entry to the function. Also, it could be more efficient to save the
-state from YYFILL(n) because YYSETSTATE(state) is called
-unconditionally. YYFILL(n) however does not get \fIstate\fP as
-parameter, so we would have to store state in a local variable by
-YYSETSTATE(state).
-
-3. Modify YYFILL(n) to return (from the function calling it) if more
-input is needed.
-
-4. Modify caller to recognise "more input is needed" and respond
-appropriately.
-
-5. The generated code will contain a switch block that is used to restores
-the last state by jumping behind the corresponding YYFILL(n) call. This code is
-automatically generated in the epilog of the first "\fC/*!re2c */\fP" block.
-It is possible to trigger generation of the YYGETSTATE() block earlier by
-placing a "\fC/*!getstate:re2c */\fP" comment. This is especially useful when
-the scanner code should be wrapped inside a loop.
-
-Please see examples/push.re for push-model scanner. The generated code can be
-tweaked using inplace configurations "\fBstate:abort\fP" and
"\fBstate:nextlabel\fP".
-
-.SH "SCANNER WITH CONDITION SUPPORT"
-You can precede \*(rxs with a list of condition names when using the \fB-c\fP
-switch. In this case \*(re generates scanner blocks for each condition. Where
each of the
-generated blocks has its own precondition. The precondition is given by the
-interface define \fBYYGETCONDITION\fP and must be of type \fBYYCONDTYPE\fP.
-.LP
-There are two special rule types. First, the rules of the condition '*' are
-merged to all conditions. And second the empty condition list allows to
-provide a code block that does not have a scanner part. Meaning it does not
-allow any regular expression. The condition value referring to this special
-block is always the one with the enumeration value 0. This way the code of this
-special rule can be used to initialize a scanner. It is in no way necessary to
-have these rules: but sometimes it is helpful to have a dedicated uninitialized
-condition state.
-.LP
-Non empty rules allow to specify the new condition, which makes them
-transition rules. Besides generating calls for the define \fBYYSETCONDITION\fP
-no other special code is generated.
-.LP
-There is another kind of special rules that allow to prepend code to any code
-block of all rules of a certain set of conditions or to all code blocks to all
-rules. This can be helpful when some operation is common among rules. For
-instance this can be used to store the length of the scanned string. These
-special setup rules start with an exclamation mark followed by either a list
-of conditions \fB<! condition, ... >\fP or a star \fB<!*>\fP.
-When \*(re generates the code for a rule whose state does not have a
-setup rule and a star'd setup rule is present, than that code will be used
-as setup code.
-
-.SH "SCANNER SPECIFICATIONS"
-Each scanner specification consists of a set of \fIrules\fP, \fInamed
-definitions\fP and \fIconfigurations\fP.
-.LP
-\fIRules\fP consist of a \*(rx along with a block of C/C++ code that
-is to be executed when the associated \fI\*(rx\fP is matched. You can either
-start the code with an opening curly brace or the sequence '\fB:=\fP'. When
-the code with a curly brace then \*(re counts the brace depth and stops looking
-for code automatically. Otherwise curly braces are not allowed and \*(re stops
-looking for code at the first line that does not begin with whitespace.
-.P
-.RS
-\fI\*(rx\fP \fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fI\*(rx\fP \fC:=\fP \fIC/C++ code\fP
-.RE
-.P
-If \fB-c\fP is active then each \*(rx is preceded by a list of
-comma separated condition names. Besides normal naming rules there are two
-special cases. A rule may contain the single condition name '*' and no
condition
-name at all. In the latter case the rule cannot have a \*(rx. Non
-empty rules may further more specify the new condition. In that case \*(re will
-generated the necessary code to change the condition automatically. Just as
above
-code can be started with a curly brace of the sequence '\fB:=\fP'. Further more
-rules can use ':=>' as a shortcut to automatically generate code that not only
-sets the new condition state but also continues execution with the new state. A
-shortcut rule should not be used in a loop where there is code between the
start
-of the loop and the \*(re block unless \fIre2c:cond:goto\fP is changed
-to '\fIcontinue;\fP'. If code is necessary before all rule (though not simple
-jumps) you can do so by using <! pseudo-rules.
-.P
-.RS
-\fC<\fP\fIcondition-list\fP\fC>\fP \fI\*(rx\fP \fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fC<\fP\fIcondition-list\fP\fC>\fP \fI\*(rx\fP \fC:=\fP \fIC/C++ code\fP
-.P
-\fC<\fP\fIcondition-list\fP\fC>\fP \fI\*(rx\fP \fC=>\fP \fP\fIcondition\fP
\fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fC<\fP\fIcondition-list\fP\fC>\fP \fI\*(rx\fP \fC=>\fP \fP\fIcondition\fP
\fC:=\fP \fIC/C++ code\fP
-.P
-\fC<\fP\fIcondition-list\fP\fC>\fP \fI\*(rx\fP \fC:=>\fP \fP\fIcondition\fP
-.P
-\fC<\fP\fI*\fP\fC>\fP \fI\*(rx\fP \fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fC<\fP\fI*\fP\fC>\fP \fI\*(rx\fP \fC:=\fP \fIC/C++ code\fP
-.P
-\fC<\fP\fI*\fP\fC>\fP \fI\*(rx\fP \fC=>\fP \fP\fIcondition\fP \fC{\fP \fIC/C++
code\fP \fC}\fP
-.P
-\fC<\fP\fI*\fP\fC>\fP \fI\*(rx\fP \fC=>\fP \fP\fIcondition\fP \fC:=\fP
\fIC/C++ code\fP
-.P
-\fC<\fP\fI*\fP\fC>\fP \fI\*(rx\fP \fC:=>\fP \fP\fIcondition\fP
-.P
-\fC<>\fP \fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fC<>\fP \fC:=\fP \fIC/C++ code\fP
-.P
-\fC<>\fP \fC=>\fP \fP\fIcondition\fP \fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fC<>\fP \fC=>\fP \fP\fIcondition\fP \fC:=\fP \fIC/C++ code\fP
-.P
-\fC<>\fP \fC:=>\fP \fP\fIcondition\fP
-.P
-\fC<!\fIcondition-list\fP\fC>\fP \fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fC<!\fIcondition-list\fP\fC>\fP \fC:=\fP \fIC/C++ code\fP
-.P
-\fC<!*>\fP \fC{\fP \fIC/C++ code\fP \fC}\fP
-.P
-\fC<!*>\fP \fC:=\fP \fIC/C++ code\fP
-.RE
-.LP
-Named definitions are of the form:
-.P
-.RS
-\fIname\fP \fC=\fP \fI\*(rx\fP\fC;\fP
-.RE
-.LP
-\fB-F\fP is active, then named definitions are also of the form:
-.P
-.RS
-\fIname\fP \fI\*(rx\fP
-.RE
-.LP
-Configurations look like named definitions whose names start
-with "\fBre2c:\fP":
-.P
-.RS
-\fCre2c:\fP\fIname\fP \fC=\fP \fIvalue\fP\fC;\fP
-.RE
-.RS
-\fCre2c:\fP\fIname\fP \fC=\fP \fB"\fP\fIvalue\fP\fB"\fP\fC;\fP
-.RE
-
-.SH "SUMMARY OF RE2C REGULAR-EXPRESSIONS"
-.TP
-\fC"foo"\fP
-the literal string \fCfoo\fP.
-ANSI-C escape sequences can be used.
-.TP
-\fC'foo'\fP
-the literal string \fCfoo\fP (characters [a-zA-Z] treated case-insensitive).
-ANSI-C escape sequences can be used.
-.TP
-\fC[xyz]\fP
-a "character class"; in this case,
-the \*(rx matches either an '\fCx\fP', a '\fCy\fP', or a '\fCz\fP'.
-.TP
-\fC[abj-oZ]\fP
-a "character class" with a range in it;
-matches an '\fCa\fP', a '\fCb\fP', any letter from '\fCj\fP' through '\fCo\fP',
-or a '\fCZ\fP'.
-.TP
-\fC[^\fIclass\fP\fC]\fP
-an inverted "character class".
-.TP
-\fIr\fP\fC\e\fP\fIs\fP
-match any \fIr\fP which isn't an \fIs\fP. \fIr\fP and \fIs\fP must be \*(rxs
-which can be expressed as character classes.
-.TP
-\fIr\fP\fC*\fP
-zero or more \fIr\fP's, where \fIr\fP is any \*(rx
-.TP
-\fC\fIr\fP\fC+\fP
-one or more \fIr\fP's
-.TP
-\fC\fIr\fP\fC?\fP
-zero or one \fIr\fP's (that is, "an optional \fIr\fP")
-.TP
-name
-the expansion of the "named definition" (see above)
-.TP
-\fC(\fP\fIr\fP\fC)\fP
-an \fIr\fP; parentheses are used to override precedence
-(see below)
-.TP
-\fIrs\fP
-an \fIr\fP followed by an \fIs\fP ("concatenation")
-.TP
-\fIr\fP\fC|\fP\fIs\fP
-either an \fIr\fP or an \fIs\fP
-.TP
-\fIr\fP\fC/\fP\fIs\fP
-an \fIr\fP but only if it is followed by an \fIs\fP. The \fIs\fP is not part of
-the matched text. This type of \*(rx is called "trailing context". A trailing
-context can only be the end of a rule and not part of a named definition.
-.TP
-\fIr\fP\fC{\fP\fIn\fP\fC}\fP
-matches \fIr\fP exactly \fIn\fP times.
-.TP
-\fIr\fP\fC{\fP\fIn\fP\fC,}\fP
-matches \fIr\fP at least \fIn\fP times.
-.TP
-\fIr\fP\fC{\fP\fIn\fP\fC,\fP\fIm\fP\fC}\fP
-matches \fIr\fP at least \fIn\fP but not more than \fIm\fP times.
-.TP
-\fC.\fP
-match any character except newline (\\n).
-.TP
-\fIdef\fP
-matches named definition as specified by \fIdef\fP only if \fB-F\fP is
-off. If the switch \fB-F\fP is active then this behaves like it was enclosed
-in double quotes and matches the string \fIdef\fP.
-.LP
-Character classes and string literals may contain octal or hexadecimal
-character definitions and the following set of escape sequences (\fB\\n\fP,
- \fB\\t\fP, \fB\\v\fP, \fB\\b\fP, \fB\\r\fP, \fB\\f\fP, \fB\\a\fP, \fB\\\\\fP).
-An octal character is defined by a backslash followed by its three octal digits
-and a hexadecimal character is defined by backslash, a lower cased '\fBx\fP'
-and its two hexadecimal digits or a backslash, an upper cased \fBX\fP and its
-four hexadecimal digits.
-.LP
-\*(re further more supports the c/c++ unicode notation. That is a backslash
followed
-by either a lowercased \fBu\fP and its four hexadecimal digits or an uppercased
-\fBU\fP and its eight hexadecimal digits. However only in \fB-u\fP mode the
-generated code can deal with any valid Unicode character up to 0x10FFFF.
-.LP
-Since characters greater \fB\\X00FF\fP are not allowed in non unicode mode, the
-only portable "\fBany\fP" rules are \fB(.|"\\n")\fP and \fB[^]\fP.
-.LP
-The \*(rxs listed above are grouped according to
-precedence, from highest precedence at the top to lowest at the bottom.
-Those grouped together have equal precedence.
-
-.SH "INPLACE CONFIGURATION"
-.LP
-It is possible to configure code generation inside \*(re blocks. The following
-lists the available configurations:
-.TP
-\fIre2c:condprefix\fP \fB=\fP yyc_ \fB;\fP
-Allows to specify the prefix used for condition labels. That is this text is
-prepended to any condition label in the generated output file.
-.TP
-\fIre2c:condenumprefix\fP \fB=\fP yyc \fB;\fP
-Allows to specify the prefix used for condition values. That is this text is
-prepended to any condition enum value in the generated output file.
-.TP
-\fIre2c:cond:divider\fP \fB=\fP "/* *********************************** */"
\fB;\fP
-Allows customizing of the divider for condition blocks. You can use '@@' to
-put the name of the condition or customize the placeholder
-using \fIre2c:cond:divider@cond\fP.
-.TP
-\fIre2c:cond:divider@cond\fP \fB=\fP @@ \fB;\fP
-Specifies the placeholder that will be replaced with the condition name
-in \fIre2c:cond:divider\fP.
-.TP
-\fIre2c:cond:goto\fP \fB=\fP "goto @@;" \fB;\fP
-Allows customizing of the conditional goto statements used with ':=>' style
rules.
-You can use '@@' to put the name of the condition or customize the placeholder
-using \fIre2c:cond:goto@cond\fP. You can also change this to 'continue;',
-which would allow you to continue with the next loop cycle including any code
-between loop start and re2c block.
-.TP
-\fIre2c:cond:goto@cond\fP \fB=\fP @@ \fB;\fP
-Specifies the placeholder that will be replaced with the condition label
-in \fIre2c:cond:goto\fP.
-.TP
-\fIre2c:indent:top\fP \fB=\fP 0 \fB;\fP
-Specifies the minimum number of indentation to use. Requires a numeric value
-greater than or equal zero.
-.TP
-\fIre2c:indent:string\fP \fB=\fP "\\t" \fB;\fP
-Specifies the string to use for indentation. Requires a string that should
-contain only whitespace unless you need this for external tools. The easiest
-way to specify spaces is to include them in single or double quotes. If you do
-not want any indentation at all you can simply set this to \fB""\fP.
-.TP
-\fIre2c:yych:conversion\fP \fB=\fP 0 \fB;\fP
-When this setting is non zero, then \*(re automatically generates conversion
-code whenever yych gets read. In this case the type must be defined using
-\fBre2c:define:YYCTYPE\fP.
-.TP
-\fIre2c:yych:emit\fP \fB=\fP 1 \fB;\fP
-Generation of \fByych\fP can be suppressed by setting this to 0.
-.TP
-\fIre2c:yybm:hex\fP \fB=\fP 0 \fB;\fP
-If set to zero then a decimal table is being used else a hexadecimal table
-will be generated.
-.TP
-\fIre2c:yyfill:enable\fP \fB=\fP 1 \fB;\fP
-Set this to zero to suppress generation of YYFILL(n). When using this be sure
-to verify that the generated scanner does not read behind input. Allowing
-this behavior might introduce sever security issues to you programs.
-.TP
-\fIre2c:yyfill:check\fP \fB=\fP 1 \fB;\fP
-This can be set 0 to suppress output of the pre condition using YYCURSOR and
-YYLIMIT which becomes useful when YYLIMIT + max(YYFILL) is always accessible.
-.TP
-\fIre2c:yyfill:parameter\fP \fB=\fP 1 \fB;\fP
-Allows to suppress parameter passing to \fBYYFILL\fP calls. If set to zero
-then no parameter is passed to \fBYYFILL\fP. However \fBdefine:YYFILL@LEN\fP
-allows to specify a replacement string for the actual length value. If set to
-a non zero value then \fBYYFILL\fP usage will be followed by the number of
-requested characters in braces unless \fBre2c:define:YYFILL:naked\fP is set.
-Also look at \fBre2c:define:YYFILL:naked\fP and \fBre2c:define:YYFILL@LEN\fP.
-.TP
-\fIre2c:startlabel\fP \fB=\fP 0 \fB;\fP
-If set to a non zero integer then the start label of the next scanner blocks
-will be generated even if not used by the scanner itself. Otherwise the normal
-\fByy0\fP like start label is only being generated if needed. If set to a text
-value then a label with that text will be generated regardless of whether the
-normal start label is being used or not. This setting is being reset to \fB0\fP
-after a start label has been generated.
-.TP
-\fIre2c:labelprefix\fP \fB=\fP yy \fB;\fP
-Allows to change the prefix of numbered labels. The default is \fByy\fP and
-can be set any string that is a valid label.
-.TP
-\fIre2c:state:abort\fP \fB=\fP 0 \fB;\fP
-When not zero and switch -f is active then the \fCYYGETSTATE\fP block will
-contain a default case that aborts and a -1 case is used for initialization.
-.TP
-\fIre2c:state:nextlabel\fP \fB=\fP 0 \fB;\fP
-Used when -f is active to control whether the \fCYYGETSTATE\fP block is
-followed by a \fCyyNext:\fP label line. Instead of using \fCyyNext\fP you can
-usually also use configuration \fIstartlabel\fP to force a specific start label
-or default to \fCyy0\fP as start label. Instead of using a dedicated label it
-is often better to separate the YYGETSTATE code from the actual scanner code by
-placing a "\fC/*!getstate:re2c */\fP" comment.
-.TP
-\fIre2c:cgoto:threshold\fP \fB=\fP 9 \fB;\fP
-When -g is active this value specifies the complexity threshold that triggers
-generation of jump tables rather than using nested if's and decision bitfields.
-The threshold is compared against a calculated estimation of if-s needed where
-every used bitmap divides the threshold by 2.
-.TP
-\fIre2c:yych:conversion\fP \fB=\fP 0 \fB;\fP
-When the input uses signed characters and \fB-s\fP or \fB-b\fP switches are
-in effect re2c allows to automatically convert to the unsigned character type
-that is then necessary for its internal single character. When this setting
-is zero or an empty string the conversion is disabled. Using a non zero number
-the conversion is taken from \fBYYCTYPE\fP. If that is given by an inplace
-configuration that value is being used. Otherwise it will be \fB(YYCTYPE)\fP
-and changes to that configuration are no longer possible. When this setting is
-a string the braces must be specified. Now assuming your input is a \fBchar*\fP
-buffer and you are using above mentioned switches you can set \fBYYCTYPE\fP to
-\fBunsigned char\fP and this setting to either \fB1\fP or \fB"(unsigned
char)"\fP.
-.TP
-\fIre2c:define:define:YYCONDTYPE\fP \fB=\fP YYCONDTYPE \fB;\fP
-Enumeration used for condition support with \fB-c\fP mode.
-.TP
-\fIre2c:define:YYCTXMARKER\fP \fB=\fP YYCTXMARKER \fB;\fP
-Allows to overwrite the define YYCTXMARKER and thus avoiding it by setting the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYCTYPE\fP \fB=\fP YYCTYPE \fB;\fP
-Allows to overwrite the define YYCTYPE and thus avoiding it by setting the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYCURSOR\fP \fB=\fP YYCURSOR \fB;\fP
-Allows to overwrite the define YYCURSOR and thus avoiding it by setting the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYDEBUG\fP \fB=\fP YYDEBUG \fB;\fP
-Allows to overwrite the define \fBYYDEBUG\fP and thus avoiding it by setting
the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYFILL\fP \fB=\fP YYFILL \fB;\fP
-Allows to overwrite the define \fBYYFILL\fP and thus avoiding it by setting the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYFILL:naked\fP \fB=\fP 0 \fB;\fP
-When set to 1 neither braces, parameter nor semicolon gets emitted.
-.TP
-\fIre2c:define:YYFILL@len\fP \fB=\fP @@ \fB;\fP
-When using \fIre2c:define:YYFILL\fP and \fIre2c:yyfill:parameter\fP is 0 then
-any occurrence of this text inside \fBYYFILL\fP will be replaced with the
actual
-length value.
-.TP
-\fIre2c:define:YYGETCONDITION\fP \fB=\fP YYGETCONDITION \fB;\fP
-Allows to overwrite the define \fBYYGETCONDITION\fP.
-.TP
-\fIre2c:define:YYGETCONDITION:naked\fP \fB=\fP \fB;\fP
-When set to 1 neither braces, parameter nor semicolon gets emitted.
-.TP
-\fIre2c:define:YYGETSTATE\fP \fB=\fP YYGETSTATE \fB;\fP
-Allows to overwrite the define \fBYYGETSTATE\fP and thus avoiding it by
setting the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYGETSTATE:naked\fP \fB=\fP 0 \fB;\fP
-When set to 1 neither braces, parameter nor semicolon gets emitted.
-.TP
-\fIre2c:define:YYLIMIT\fP \fB=\fP YYLIMIT \fB;\fP
-Allows to overwrite the define \fBYYLIMIT\fP and thus avoiding it by setting
the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYMARKER\fP \fB=\fP YYMARKER \fB;\fP
-Allows to overwrite the define \fBYYMARKER\fP and thus avoiding it by setting
the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYSETCONDITION\fP \fB=\fP YYSETCONDITION \fB;\fP
-Allows to overwrite the define \fBYYSETCONDITION\fP.
-.TP
-\fIre2c:define:YYSETCONDITION@cond\fP \fB=\fP @@ \fB;\fP
-When using \fIre2c:define:YYSETCONDITION\fP then any occurrence of this text
-inside \fBYYSETCONDITION\fP will be replaced with the actual new condition
value.
-.TP
-\fIre2c:define:YYSETSTATE\fP \fB=\fP YYSETSTATE \fB;\fP
-Allows to overwrite the define \fBYYSETSTATE\fP and thus avoiding it by
setting the
-value to the actual code needed.
-.TP
-\fIre2c:define:YYSETSTATE:naked\fP \fB=\fP 0 \fB;\fP
-When set to 1 neither braces, parameter nor semicolon gets emitted.
-.TP
-\fIre2c:define:YYSETSTATE@state\fP \fB=\fP @@ \fB;\fP
-When using \fIre2c:define:YYSETSTATE\fP then any occurrence of this text
-inside \fBYYSETSTATE\fP will be replaced with the actual new state value.
-.TP
-\fIre2c:label:yyFillLabel\fP \fB=\fP yyFillLabel \fB;\fP
-Allows to overwrite the name of the label yyFillLabel.
-.TP
-\fIre2c:label:yyNext\fP \fB=\fP yyNext \fB;\fP
-Allows to overwrite the name of the label yyNext.
-.TP
-\fIre2c:variable:yyaccept\fP \fB=\fP yyaccept \fB;\fP
-Allows to overwrite the name of the variable yyaccept.
-.TP
-\fIre2c:variable:yybm\fP \fB=\fP yybm \fB;\fP
-Allows to overwrite the name of the variable yybm.
-.TP
-\fIre2c:variable:yych\fP \fB=\fP yych \fB;\fP
-Allows to overwrite the name of the variable yych.
-.TP
-\fIre2c:variable:yyctable\fP \fB=\fP yyctable \fB;\fP
-When both \fB-c\fP and \fB-g\fP are active then \*(re uses this variable to
-generate a static jump table for YYGETCONDITION.
-.TP
-\fIre2c:variable:yystable\fP \fB=\fP yystable \fB;\fP
-When both \fB-f\fP and \fB-g\fP are active then \*(re uses this variable to
-generate a static jump table for YYGETSTATE.
-.TP
-\fIre2c:variable:yytarget\fP \fB=\fP yytarget \fB;\fP
-Allows to overwrite the name of the variable yytarget.
-
-.SH "UNDERSTANDING RE2C"
-.LP
-The subdirectory lessons of the \*(re distribution contains a few step by step
-lessons to get you started with \*(re. All examples in the lessons subdirectory
-can be compiled and actually work.
-
-.SH FEATURES
-.LP
-\*(re does not provide a default action:
-the generated code assumes that the input
-will consist of a sequence of tokens.
-Typically this can be dealt with by adding a rule such as the one for
-unexpected characters in the example above.
-.LP
-The user must arrange for a sentinel token to appear at the end of input
-(and provide a rule for matching it):
-\*(re does not provide an \fC<<EOF>>\fP expression.
-If the source is from a null-byte terminated string, a
-rule matching a null character will suffice. If the source is from a
-file then you could pad the input with a newline (or some other character that
-cannot appear within another token); upon recognizing such a character check
-to see if it is the sentinel and act accordingly. And you can also use
YYFILL(n)
-to end the scanner in case not enough characters are available which is nothing
-else then e detection of end of data/file.
-
-.SH BUGS
-.LP
-Difference only works for character sets.
-.LP
-The \*(re internal algorithms need documentation.
-
-.SH "SEE ALSO"
-.LP
-flex(1), lex(1).
-.P
-More information on \*(re can be found here:
-.PD 0
-.P
-.B http://re2c.org/
-.PD 1
-
-.SH AUTHORS
-.PD 0
-.P
-Peter Bumbulis <[email protected]>
-.P
-Brian Young <[email protected]>
-.P
-Dan Nuffer <[email protected]>
-.P
-Marcus Boerger <[email protected]>
-.P
-Hartmut Kaiser <[email protected]>
-.P
-Emmanuel Mogenet <[email protected]> added storable state
-.P
-.PD 1
-
-.SH VERSION INFORMATION
-This manpage describes \*(re, version @PACKAGE_VERSION@.
-
-.fi
Deleted: brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.spec.in
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.spec.in
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/re2c.spec.in
2020-10-23 02:05:19 UTC (rev 77568)
@@ -1,52 +0,0 @@
-Summary: A tool for generating C-based recognizers from regular
expressions
-Name: @PACKAGE_NAME@
-Version: @PACKAGE_VERSION@
-Release: @PACKAGE_RELEASE@
-License: Public Domain
-Group: Development/Tools
-URL: http://re2c.org/
-Source0: http://prdownloads.sourceforge.net/re2c/re2c-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
-
-%description
-re2c is a great tool for writing fast and flexible lexers. It has
-served many people well for many years and it deserves to be
-maintained more actively. re2c is on the order of 2-3 times faster
-than a flex based scanner, and its input model is much more
-flexible.
-
-%prep
-
-%setup -q
-
-%build
-./configure \
- --prefix=%{_prefix}
-make re2c
-#regenerate file scanner.cc
-rm -f scanner.cc
-./re2c -b scanner.re > scanner.cc
-rm -f re2c scanner.o
-make
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{_bindir}
-install -m 0755 re2c $RPM_BUILD_ROOT%{_bindir}
-
-mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
-install -m 0755 re2c.1 $RPM_BUILD_ROOT%{_mandir}/man1
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%changelog
-* Sun Jan 04 2003 Marcus Boerger <[email protected]>
-- Initial version.
-
-%files
-%defattr(-,root,root)
-%{_bindir}/re2c
-%{_mandir}/man1/re2c.1*
-
-%doc README examples doc/* lessons
Modified: brlcad/branches/extbuild/src/other/ext/perplex/re2c/scanner.re
===================================================================
--- brlcad/branches/extbuild/src/other/ext/perplex/re2c/scanner.re
2020-10-23 02:01:32 UTC (rev 77567)
+++ brlcad/branches/extbuild/src/other/ext/perplex/re2c/scanner.re
2020-10-23 02:05:19 UTC (rev 77568)
@@ -4,7 +4,7 @@
#include <sstream>
#include "scanner.h"
#include "re2c_parser.h"
-#include "parser_tokens.h"
+#include "re2c_parser_tokens.h"
#include "globals.h"
#include "dfa.h"
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits