Compare commits
10 Commits
02454f5f7a
...
11a5942610
Author | SHA1 | Date |
---|---|---|
|
11a5942610 | |
|
50d472a8f2 | |
|
a309103c79 | |
|
f9da651925 | |
|
3f18453312 | |
|
f1398ed261 | |
|
94d2a3ff9f | |
|
ffb6e8e0b5 | |
|
f0aa9a4f64 | |
|
1b54354d09 |
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.2.2)
|
cmake_minimum_required(VERSION 3.2.2)
|
||||||
project(Lexesis VERSION 1.0)
|
project(Lexesis VERSION 1.0)
|
||||||
|
|
||||||
|
@ -45,8 +66,6 @@ if(DOXYGEN_FOUND)
|
||||||
add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation" VERBATIM)
|
add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation" VERBATIM)
|
||||||
endif(DOXYGEN_FOUND)
|
endif(DOXYGEN_FOUND)
|
||||||
|
|
||||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}")
|
|
||||||
|
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_dependencies(Lexesis ext-optparse)
|
add_dependencies(Lexesis ext-optparse)
|
||||||
|
@ -55,4 +74,11 @@ install(DIRECTORY templates
|
||||||
DESTINATION share/Lexesis
|
DESTINATION share/Lexesis
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(DIRECTORY include/Lexesis
|
||||||
|
DESTINATION include)
|
||||||
|
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
|
|
||||||
|
install(EXPORT LexesisTargets DESTINATION lib/cmake/Lexesis)
|
||||||
|
install(FILES LexesisConfig.cmake DESTINATION lib/cmake/Lexesis)
|
||||||
|
install(DIRECTORY man/man1 man/man5 DESTINATION man)
|
||||||
|
|
22
Doxyfile.in
22
Doxyfile.in
|
@ -1,3 +1,25 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
# Doxyfile 1.8.9.1
|
# Doxyfile 1.8.9.1
|
||||||
|
|
||||||
# This file describes the settings to be used by the documentation system
|
# This file describes the settings to be used by the documentation system
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
include(${SELF_DIR}/LexesisTargets.cmake)
|
||||||
|
get_filename_component(LEXESIS_INCLUDE_DIRS "${SELF_DIR}/../../../include/" ABSOLUTE)
|
||||||
|
get_filename_component(LEXESIS_EXE "${SELF_DIR}/../../../bin/Lexesis" ABSOLUTE)
|
||||||
|
set(LEXESIS_FOUND TRUE)
|
14
README.md
14
README.md
|
@ -5,11 +5,13 @@ A language agnostic lexical analyser generator
|
||||||
## Table Of Contents
|
## Table Of Contents
|
||||||
* [Introduction](#introduction)
|
* [Introduction](#introduction)
|
||||||
* [Requirements](#requirements)
|
* [Requirements](#requirements)
|
||||||
|
* [Used dependencies](#used-dependencies)
|
||||||
* [Building](#building)
|
* [Building](#building)
|
||||||
* [Getting started](#getting-started)
|
* [Getting started](#getting-started)
|
||||||
* [More examples](#more-examples)
|
* [More examples](#more-examples)
|
||||||
* [Tested with](#tested-with)
|
* [Tested with](#tested-with)
|
||||||
* [Authors](#authors)
|
* [Authors](#authors)
|
||||||
|
* [License](#license)
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
Lexesis is a language agnostic lexical analyser generator. Which means that it uses a description of *tokens* in the form of regular expressions, and outputs source files for a lexer/scanner (which can be in any language for which a backend has been built, currently only c++), which can be used in building a larger application.
|
Lexesis is a language agnostic lexical analyser generator. Which means that it uses a description of *tokens* in the form of regular expressions, and outputs source files for a lexer/scanner (which can be in any language for which a backend has been built, currently only c++), which can be used in building a larger application.
|
||||||
|
@ -50,10 +52,9 @@ Get your terminal in the source tree and run the following commands:
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
make
|
make
|
||||||
make install
|
sudo make install
|
||||||
|
|
||||||
This will place the Lexesis executable in the `build/bin` folder, with some extra needed data for Lexesis in `build/share`
|
You can now run `Lexesis`
|
||||||
You can now simply run `./bin/Lexesis` with the arguments you like (see below and in the man pages for an overview).
|
|
||||||
|
|
||||||
If you want to build the documentation as well, simply run
|
If you want to build the documentation as well, simply run
|
||||||
|
|
||||||
|
@ -64,9 +65,9 @@ The output should be located in `build/doc`, with the main *html* page in `build
|
||||||
### Running tests
|
### Running tests
|
||||||
First, build Lexesis in debug mode. The first difference with the normal building, is the line where you call cmake. That line should read
|
First, build Lexesis in debug mode. The first difference with the normal building, is the line where you call cmake. That line should read
|
||||||
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=.
|
||||||
|
|
||||||
instead. Afterwards, after calling `make install`, build all the examples as well with
|
instead. Afterwards, after calling `make install` (which now install locally in the build folder, so you don't need the sudo), build all the examples as well with
|
||||||
|
|
||||||
cmake .
|
cmake .
|
||||||
make examples
|
make examples
|
||||||
|
@ -138,3 +139,6 @@ The *keywords* example simply prints the lexed token type, along with its conten
|
||||||
## Authors
|
## Authors
|
||||||
* Thomas Avé
|
* Thomas Avé
|
||||||
* Robin Jadoul
|
* Robin Jadoul
|
||||||
|
|
||||||
|
## License
|
||||||
|
This program is distributed under the terms of the MIT license. The generated code falls under the permissive zlib/libpng license.
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
add_subdirectory(keywords)
|
add_subdirectory(keywords)
|
||||||
add_subdirectory(SyntaxHighlighter)
|
add_subdirectory(SyntaxHighlighter)
|
||||||
add_subdirectory(leopard)
|
add_subdirectory(leopard)
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../build/bin")
|
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../build/bin")
|
||||||
|
|
||||||
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/xmllexer.lxs"
|
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/xmllexer.lxs"
|
||||||
|
|
|
@ -1,4 +1,26 @@
|
||||||
#pragma once
|
/*
|
||||||
|
* Lexesis - A language agnostic lexical analyser generator
|
||||||
|
* Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#pragma once
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef HIGHLIGHTER_H
|
#ifndef HIGHLIGHTER_H
|
||||||
#define HIGHLIGHTER_H
|
#define HIGHLIGHTER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyrightb/libpng License Copyright (c) © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#pragma once
|
||||||
|
|
||||||
ELEMENT = </?[ ]*[a-zA-Z0-9-]*
|
ELEMENT = </?[ ]*[a-zA-Z0-9-]*
|
||||||
WHITESPACE = [ ]*
|
WHITESPACE = [ ]*
|
||||||
ATTRIBUTE = [a-zA-Z0-9-]*[ ]*=?
|
ATTRIBUTE = [a-zA-Z0-9-]*[ ]*=?
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Lexesis - A language agnostic lexical analyser generator
|
||||||
|
* Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#pragma once
|
||||||
|
*/
|
||||||
|
|
||||||
#include "highlighter.h"
|
#include "highlighter.h"
|
||||||
#include "AttributeLexer.h"
|
#include "AttributeLexer.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Lexesis - A language agnostic lexical analyser generator
|
||||||
|
* Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#pragma once
|
||||||
|
*/
|
||||||
|
|
||||||
#include "highlighter.h"
|
#include "highlighter.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#pragma once
|
||||||
|
|
||||||
COMMENT = <!--.*-->
|
COMMENT = <!--.*-->
|
||||||
TAG = </?[^<>]*>
|
TAG = </?[^<>]*>
|
||||||
CONTENT = [^<>]*
|
CONTENT = [^<>]*
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../build/bin")
|
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../build/bin")
|
||||||
|
|
||||||
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/keywordsLexer.lxs"
|
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/keywordsLexer.lxs"
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
MODULE = (M|m)odule
|
MODULE = (M|m)odule
|
||||||
END = [Ee]nd
|
END = [Ee]nd
|
||||||
IF = if|If
|
IF = if|If
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "KeywordsLexer.h"
|
#include "KeywordsLexer.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../build/bin")
|
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../build/bin")
|
||||||
|
|
||||||
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lexer.lxs"
|
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lexer.lxs"
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
# https://xkcd.com/1031/
|
# https://xkcd.com/1031/
|
||||||
KEYBOARD_CAP = Keyboard
|
KEYBOARD_CAP = Keyboard
|
||||||
KEYBOARD = [kK][eE][yY][bB][oO][aA][rR][dD]
|
KEYBOARD = [kK][eE][yY][bB][oO][aA][rR][dD]
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Lexesis - A language agnostic lexical analyser generator
|
||||||
|
* Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexer.h"
|
#include "Lexer.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,435 @@
|
||||||
|
/*
|
||||||
|
* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||||
|
*
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||||
|
*
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#ifndef PARSODUS_PARSER_RegexParser_H
|
||||||
|
#define PARSODUS_PARSER_RegexParser_H
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
#include <cstdint>
|
||||||
|
#include <deque>
|
||||||
|
#include <stack>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the type of the symbol (both terminals and nonterminals)
|
||||||
|
*/
|
||||||
|
enum class RegexParser_Symbol : std::uint64_t {
|
||||||
|
T_EOF,
|
||||||
|
T_BACKSLASH,
|
||||||
|
T_BACKSPACE,
|
||||||
|
T_BELL,
|
||||||
|
T_CARRIAGE_RETURN,
|
||||||
|
T_CHAR,
|
||||||
|
T_CHAR_CLASS,
|
||||||
|
T_DOT,
|
||||||
|
T_ERROR,
|
||||||
|
T_ESCAPED_DOT,
|
||||||
|
T_ESCAPED_LBRACKET,
|
||||||
|
T_ESCAPED_LPAREN,
|
||||||
|
T_ESCAPED_PIPE,
|
||||||
|
T_ESCAPED_PLUS,
|
||||||
|
T_ESCAPED_QUESTIONMARK,
|
||||||
|
T_ESCAPED_RBRACKET,
|
||||||
|
T_ESCAPED_RPAREN,
|
||||||
|
T_ESCAPED_STAR,
|
||||||
|
T_FORMFEED,
|
||||||
|
T_LPAREN,
|
||||||
|
T_NEWLINE,
|
||||||
|
T_PIPE,
|
||||||
|
T_PLUS,
|
||||||
|
T_QUESTIONMARK,
|
||||||
|
T_RPAREN,
|
||||||
|
T_SPACE,
|
||||||
|
T_STAR,
|
||||||
|
T_TAB,
|
||||||
|
T_VTAB,
|
||||||
|
V_error,
|
||||||
|
V_re,
|
||||||
|
};
|
||||||
|
|
||||||
|
class SyntaxError : public std::runtime_error {
|
||||||
|
public:
|
||||||
|
SyntaxError(const char* c) : std::runtime_error(c) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename Value>
|
||||||
|
class RegexParser {
|
||||||
|
public:
|
||||||
|
RegexParser() {}
|
||||||
|
virtual ~RegexParser() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse it
|
||||||
|
*/
|
||||||
|
Value parse();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* A token, consisting of a Symbol type (should be a terminal) and a Value
|
||||||
|
*/
|
||||||
|
struct Token {
|
||||||
|
Token(const RegexParser_Symbol& sym, const Value& val) : symbol(sym), value(val) {}
|
||||||
|
Token(const RegexParser_Symbol& sym, Value&& val) : symbol(sym), value(std::move(val)) {}
|
||||||
|
RegexParser_Symbol symbol;
|
||||||
|
Value value;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************
|
||||||
|
* Functions to be supplied by the user *
|
||||||
|
******************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle an error
|
||||||
|
* current is the current Token, one that has no action associated in the current state
|
||||||
|
* expected is a listing of all terminals that do have an action
|
||||||
|
*
|
||||||
|
* By default throws an error
|
||||||
|
*/
|
||||||
|
virtual Value error(Token current, const std::vector<RegexParser_Symbol>& expected);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the next token from the lexer
|
||||||
|
*/
|
||||||
|
virtual Token lex() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply a reduction (a grammar rule in reverse)
|
||||||
|
*/
|
||||||
|
virtual Value reduce_char(std::deque<Token> subparts) = 0;
|
||||||
|
virtual Value reduce_concat(std::deque<Token> subparts) = 0;
|
||||||
|
virtual Value reduce_optional(std::deque<Token> subparts) = 0;
|
||||||
|
virtual Value reduce_or(std::deque<Token> subparts) = 0;
|
||||||
|
virtual Value reduce_paren(std::deque<Token> subparts) = 0;
|
||||||
|
virtual Value reduce_plus(std::deque<Token> subparts) = 0;
|
||||||
|
virtual Value reduce_star(std::deque<Token> subparts) = 0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class RegexParser<bool> {
|
||||||
|
public:
|
||||||
|
RegexParser() {}
|
||||||
|
virtual ~RegexParser() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse it
|
||||||
|
*/
|
||||||
|
bool parse();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/******************************************
|
||||||
|
* Functions to be supplied by the user *
|
||||||
|
******************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the next token from the lexer
|
||||||
|
*/
|
||||||
|
virtual RegexParser_Symbol lex() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define TABLE RegexParser___Table___RegexParser
|
||||||
|
#define REDUCE_COUNT RegexParser___Num_Reduces___RegexParser
|
||||||
|
// Not a static member because the table should not be replicated for different instantiations of the parser
|
||||||
|
extern const std::uint64_t TABLE[32][31];
|
||||||
|
extern const unsigned char REDUCE_COUNT[27];
|
||||||
|
|
||||||
|
enum Action {
|
||||||
|
ERROR = 0,
|
||||||
|
SHIFT = 1,
|
||||||
|
REDUCE = 2,
|
||||||
|
ACCEPT = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*********************************************
|
||||||
|
* Translate a Symbol to a readable string *
|
||||||
|
*********************************************/
|
||||||
|
inline std::string to_string(RegexParser_Symbol s) {
|
||||||
|
switch (s) {
|
||||||
|
case RegexParser_Symbol::T_EOF:
|
||||||
|
return "T_EOF";
|
||||||
|
case RegexParser_Symbol::T_BACKSLASH:
|
||||||
|
return "T_BACKSLASH";
|
||||||
|
case RegexParser_Symbol::T_BACKSPACE:
|
||||||
|
return "T_BACKSPACE";
|
||||||
|
case RegexParser_Symbol::T_BELL:
|
||||||
|
return "T_BELL";
|
||||||
|
case RegexParser_Symbol::T_CARRIAGE_RETURN:
|
||||||
|
return "T_CARRIAGE_RETURN";
|
||||||
|
case RegexParser_Symbol::T_CHAR:
|
||||||
|
return "T_CHAR";
|
||||||
|
case RegexParser_Symbol::T_CHAR_CLASS:
|
||||||
|
return "T_CHAR_CLASS";
|
||||||
|
case RegexParser_Symbol::T_DOT:
|
||||||
|
return "T_DOT";
|
||||||
|
case RegexParser_Symbol::T_ERROR:
|
||||||
|
return "T_ERROR";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_DOT:
|
||||||
|
return "T_ESCAPED_DOT";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_LBRACKET:
|
||||||
|
return "T_ESCAPED_LBRACKET";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_LPAREN:
|
||||||
|
return "T_ESCAPED_LPAREN";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_PIPE:
|
||||||
|
return "T_ESCAPED_PIPE";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_PLUS:
|
||||||
|
return "T_ESCAPED_PLUS";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_QUESTIONMARK:
|
||||||
|
return "T_ESCAPED_QUESTIONMARK";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_RBRACKET:
|
||||||
|
return "T_ESCAPED_RBRACKET";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_RPAREN:
|
||||||
|
return "T_ESCAPED_RPAREN";
|
||||||
|
case RegexParser_Symbol::T_ESCAPED_STAR:
|
||||||
|
return "T_ESCAPED_STAR";
|
||||||
|
case RegexParser_Symbol::T_FORMFEED:
|
||||||
|
return "T_FORMFEED";
|
||||||
|
case RegexParser_Symbol::T_LPAREN:
|
||||||
|
return "T_LPAREN";
|
||||||
|
case RegexParser_Symbol::T_NEWLINE:
|
||||||
|
return "T_NEWLINE";
|
||||||
|
case RegexParser_Symbol::T_PIPE:
|
||||||
|
return "T_PIPE";
|
||||||
|
case RegexParser_Symbol::T_PLUS:
|
||||||
|
return "T_PLUS";
|
||||||
|
case RegexParser_Symbol::T_QUESTIONMARK:
|
||||||
|
return "T_QUESTIONMARK";
|
||||||
|
case RegexParser_Symbol::T_RPAREN:
|
||||||
|
return "T_RPAREN";
|
||||||
|
case RegexParser_Symbol::T_SPACE:
|
||||||
|
return "T_SPACE";
|
||||||
|
case RegexParser_Symbol::T_STAR:
|
||||||
|
return "T_STAR";
|
||||||
|
case RegexParser_Symbol::T_TAB:
|
||||||
|
return "T_TAB";
|
||||||
|
case RegexParser_Symbol::T_VTAB:
|
||||||
|
return "T_VTAB";
|
||||||
|
case RegexParser_Symbol::V_error:
|
||||||
|
return "V_error";
|
||||||
|
case RegexParser_Symbol::V_re:
|
||||||
|
return "V_re";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************
|
||||||
|
* Default error method *
|
||||||
|
**************************/
|
||||||
|
template <typename Value>
|
||||||
|
Value RegexParser<Value>::error(Token current, const std::vector<RegexParser_Symbol>& expected) {
|
||||||
|
std::string msg = "Syntax Error: got " + to_string(current.symbol) + "\n Expected any of:";
|
||||||
|
for (auto& s : expected) {
|
||||||
|
msg += "\n " + to_string(s);
|
||||||
|
}
|
||||||
|
throw SyntaxError(msg.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************
|
||||||
|
* Parser implementation *
|
||||||
|
***************************/
|
||||||
|
template <typename Value>
|
||||||
|
Value RegexParser<Value>::parse() {
|
||||||
|
std::stack<Token> valueStack;
|
||||||
|
std::stack<std::uint64_t> stateStack;
|
||||||
|
|
||||||
|
stateStack.push(0);
|
||||||
|
Token tok = lex();
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
std::uint64_t act = TABLE[stateStack.top()][static_cast<std::uint64_t>(tok.symbol)];
|
||||||
|
|
||||||
|
switch (act & 0x3) {
|
||||||
|
case ERROR:
|
||||||
|
{
|
||||||
|
constexpr std::uint64_t verr = static_cast<std::uint64_t>(RegexParser_Symbol::V_error);
|
||||||
|
std::vector<RegexParser_Symbol> expected;
|
||||||
|
std::uint64_t top = stateStack.top();
|
||||||
|
for (std::uint64_t i = 0; i <= static_cast<std::uint64_t>(RegexParser_Symbol::T_VTAB); i++) {
|
||||||
|
if ((TABLE[top][i] & 0x3) != ERROR)
|
||||||
|
expected.emplace_back(static_cast<RegexParser_Symbol>(i));
|
||||||
|
}
|
||||||
|
Token report = Token{tok.symbol, std::move(tok.value)};
|
||||||
|
Value errorVal = error(std::move(report), expected);
|
||||||
|
|
||||||
|
while (!valueStack.empty() && !TABLE[stateStack.top()][verr]) {
|
||||||
|
valueStack.pop();
|
||||||
|
stateStack.pop();
|
||||||
|
}
|
||||||
|
if (!TABLE[stateStack.top()][verr]) {
|
||||||
|
throw SyntaxError("Syntax error: could not recover");
|
||||||
|
}
|
||||||
|
|
||||||
|
stateStack.push(TABLE[stateStack.top()][verr] >> 2);
|
||||||
|
valueStack.emplace(Token{ RegexParser_Symbol::V_error, std::move(errorVal)});
|
||||||
|
|
||||||
|
while (tok.symbol != RegexParser_Symbol::T_EOF && (TABLE[stateStack.top()][static_cast<std::uint64_t>(tok.symbol)] & 0x3) == ERROR) {
|
||||||
|
tok = lex();
|
||||||
|
}
|
||||||
|
if ((TABLE[stateStack.top()][static_cast<std::uint64_t>(tok.symbol)] & 0x3) == ERROR) {
|
||||||
|
throw SyntaxError("Syntax error: could not recover");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SHIFT:
|
||||||
|
valueStack.emplace(std::move(tok));
|
||||||
|
stateStack.push(act >> 2);
|
||||||
|
tok = lex();
|
||||||
|
break;
|
||||||
|
case REDUCE:
|
||||||
|
{
|
||||||
|
std::uint64_t tmp = act >> 2;
|
||||||
|
RegexParser_Symbol symbol = static_cast<RegexParser_Symbol>(tmp >> 31);
|
||||||
|
std::uint32_t rule = tmp & ((1ull << 31) - 1);
|
||||||
|
|
||||||
|
std::deque<Token> dq;
|
||||||
|
for (unsigned char i = 0; i < REDUCE_COUNT[rule]; i++) {
|
||||||
|
dq.emplace_front(std::move(valueStack.top()));
|
||||||
|
valueStack.pop();
|
||||||
|
stateStack.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (rule) {
|
||||||
|
case 0:
|
||||||
|
valueStack.emplace(symbol, reduce_or(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
valueStack.emplace(symbol, reduce_paren(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
valueStack.emplace(symbol, reduce_star(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
valueStack.emplace(symbol, reduce_plus(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
valueStack.emplace(symbol, reduce_optional(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
valueStack.emplace(symbol, reduce_concat(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 17:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 18:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 19:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 22:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 23:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 24:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 25:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 26:
|
||||||
|
valueStack.emplace(symbol, reduce_char(std::move(dq)));
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(false); //There should be no such rule
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
stateStack.push(TABLE[stateStack.top()][static_cast<std::uint64_t>(valueStack.top().symbol)] >> 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACCEPT:
|
||||||
|
assert(stateStack.size() == 2);
|
||||||
|
assert(valueStack.size() == 1);
|
||||||
|
return std::move(valueStack.top().value);
|
||||||
|
default:
|
||||||
|
//IMPOSSIBLE
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef REDUCE_COUNT
|
||||||
|
#undef TABLE
|
||||||
|
|
||||||
|
#endif /* PARSODUS_PARSER_RegexParser_H */
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lexesis/automata.h
|
* Lexesis/automata.h
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef LEXESIS_BACKEND_H
|
#ifndef LEXESIS_BACKEND_H
|
||||||
#define LEXESIS_BACKEND_H
|
#define LEXESIS_BACKEND_H
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef LEXESIS_BACKENDMANAGER_H
|
#ifndef LEXESIS_BACKENDMANAGER_H
|
||||||
#define LEXESIS_BACKENDMANAGER_H
|
#define LEXESIS_BACKENDMANAGER_H
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef LEXESIS_BACKENDS_CPP_H
|
#ifndef LEXESIS_BACKENDS_CPP_H
|
||||||
#define LEXESIS_BACKENDS_CPP_H
|
#define LEXESIS_BACKENDS_CPP_H
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef LEXESIS_DRIVER_H
|
#ifndef LEXESIS_DRIVER_H
|
||||||
#define LEXESIS_DRIVER_H
|
#define LEXESIS_DRIVER_H
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef INPUT_PARSER_H
|
#ifndef INPUT_PARSER_H
|
||||||
#define INPUT_PARSER_H
|
#define INPUT_PARSER_H
|
||||||
|
|
|
@ -1,9 +1,31 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef RE_H
|
#ifndef RE_H
|
||||||
#define RE_H
|
#define RE_H
|
||||||
|
|
||||||
#include "Lexesis/automata.h"
|
#include "Lexesis/automata.h"
|
||||||
#include "RegexLexer.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -139,24 +161,6 @@ namespace lxs {
|
||||||
std::shared_ptr<RE> e, f;
|
std::shared_ptr<RE> e, f;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse the given regular expression and return the associated Regex
|
|
||||||
*
|
|
||||||
* @param input The regular expression to parse
|
|
||||||
* @returns An abstraction representation of `input`
|
|
||||||
*
|
|
||||||
* @throws SyntaxError if the regex is invalid, the `what()` method contains some information on the problem.
|
|
||||||
*/
|
|
||||||
std::shared_ptr<RE> parseRE(const std::string& input);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An exception to represent a syntax error in a regular expression
|
|
||||||
*/
|
|
||||||
class SyntaxError : public std::runtime_error
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SyntaxError(RegexLexer& lex, const std::string w) : std::runtime_error((std::to_string(lex.getByteOffset()) + ": " + w)) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace lxs
|
} //namespace lxs
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
#pragma once
|
||||||
|
#ifndef LEXESIS_RE_PARSER_H
|
||||||
|
#define LEXESIS_RE_PARSER_H
|
||||||
|
|
||||||
|
#include "Lexesis/RegexLexer.h"
|
||||||
|
#include "Lexesis/RegexParser.h"
|
||||||
|
#include "Lexesis/re.h"
|
||||||
|
#include <deque>
|
||||||
|
#include <memory>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
namespace lxs {
|
||||||
|
|
||||||
|
class ReParser : public RegexParser<std::shared_ptr<RE>> {
|
||||||
|
public:
|
||||||
|
ReParser(RegexLexer lex);
|
||||||
|
|
||||||
|
private:
|
||||||
|
RegexParser::Token lex() override;
|
||||||
|
|
||||||
|
std::shared_ptr<RE> reduce_char(std::deque<RegexParser::Token> subparts) override;
|
||||||
|
std::shared_ptr<RE> reduce_concat(std::deque<RegexParser::Token> subparts) override;
|
||||||
|
std::shared_ptr<RE> reduce_optional(std::deque<RegexParser::Token> subparts) override;
|
||||||
|
std::shared_ptr<RE> reduce_or(std::deque<RegexParser::Token> subparts) override;
|
||||||
|
std::shared_ptr<RE> reduce_paren(std::deque<RegexParser::Token> subparts) override;
|
||||||
|
std::shared_ptr<RE> reduce_plus(std::deque<RegexParser::Token> subparts) override;
|
||||||
|
std::shared_ptr<RE> reduce_star(std::deque<RegexParser::Token> subparts) override;
|
||||||
|
|
||||||
|
RegexLexer m_lex;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the given regular expression and return the associated Regex
|
||||||
|
*
|
||||||
|
* @param input The regular expression to parse
|
||||||
|
* @returns An abstraction representation of `input`
|
||||||
|
*
|
||||||
|
* @throws SyntaxError if the regex is invalid, the `what()` method contains some information on the problem.
|
||||||
|
*/
|
||||||
|
std::shared_ptr<RE> parseRE(const std::string& input);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An exception to represent a syntax error in a regular expression
|
||||||
|
*/
|
||||||
|
class SyntaxError : public std::runtime_error
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SyntaxError(RegexLexer& lex, const std::string w) : std::runtime_error((std::to_string(lex.getByteOffset()) + ": " + w)) {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef LEXESIS_TEMPLATE_H
|
#ifndef LEXESIS_TEMPLATE_H
|
||||||
#define LEXESIS_TEMPLATE_H
|
#define LEXESIS_TEMPLATE_H
|
||||||
|
|
21
run_tests.py
21
run_tests.py
|
@ -1,4 +1,25 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
import unittest, subprocess, filecmp, argparse, os.path, os, shutil
|
import unittest, subprocess, filecmp, argparse, os.path, os, shutil
|
||||||
|
|
||||||
REFERENCE_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "tests")
|
REFERENCE_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "tests")
|
||||||
|
|
|
@ -1,9 +1,31 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
add_library(Lexesis-backends
|
add_library(templ
|
||||||
backends/cpp.cpp
|
template.cpp
|
||||||
)
|
)
|
||||||
|
add_dependencies(templ mstch::mstch)
|
||||||
|
|
||||||
add_library(lxs
|
add_library(lxs
|
||||||
automata.cpp
|
automata.cpp
|
||||||
|
@ -12,16 +34,20 @@ add_library(lxs
|
||||||
driver.cpp
|
driver.cpp
|
||||||
RegexLexer.cpp
|
RegexLexer.cpp
|
||||||
re.cpp
|
re.cpp
|
||||||
|
RegexParser.cpp
|
||||||
|
reParser.cpp
|
||||||
)
|
)
|
||||||
|
add_dependencies(lxs templ)
|
||||||
|
|
||||||
|
add_library(Lexesis-backends
|
||||||
|
backends/cpp.cpp
|
||||||
|
)
|
||||||
|
add_dependencies(Lexesis-backends lxs)
|
||||||
|
|
||||||
add_library(lxsinput
|
add_library(lxsinput
|
||||||
inputparser.cpp
|
inputparser.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(templ
|
|
||||||
template.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(Lexesis
|
add_executable(Lexesis
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
@ -34,6 +60,9 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
target_link_libraries(Lexesis-test Lexesis-backends lxs templ lxsinput mstch::mstch)
|
target_link_libraries(Lexesis-test Lexesis-backends lxs templ lxsinput mstch::mstch)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS Lexesis
|
install(TARGETS Lexesis templ lxs Lexesis-backends lxsinput EXPORT LexesisTargets
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
INCLUDES DESTINATION include
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "RegexLexer.h"
|
#include "Lexesis/RegexLexer.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
|
@ -0,0 +1,125 @@
|
||||||
|
/*
|
||||||
|
* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||||
|
*
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||||
|
*
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
#include "Lexesis/RegexParser.h"
|
||||||
|
|
||||||
|
#define TABLE RegexParser___Table___RegexParser
|
||||||
|
#define REDUCE_COUNT RegexParser___Num_Reduces___RegexParser
|
||||||
|
|
||||||
|
const std::uint64_t TABLE[32][31] = {
|
||||||
|
{ (ERROR | (0) << 2),(SHIFT | (1) << 2),(SHIFT | (2) << 2),(SHIFT | (3) << 2),(SHIFT | (4) << 2),(SHIFT | (5) << 2),(SHIFT | (6) << 2),(SHIFT | (7) << 2),(ERROR | (0) << 2),(SHIFT | (8) << 2),(SHIFT | (9) << 2),(SHIFT | (10) << 2),(SHIFT | (11) << 2),(SHIFT | (12) << 2),(SHIFT | (13) << 2),(SHIFT | (14) << 2),(SHIFT | (15) << 2),(SHIFT | (16) << 2),(SHIFT | (17) << 2),(SHIFT | (18) << 2),(SHIFT | (19) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(SHIFT | (20) << 2),(ERROR | (0) << 2),(SHIFT | (21) << 2),(SHIFT | (22) << 2),
|
||||||
|
((0) << 2),((23) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 15) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 10) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 12) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 9) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 26) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 6) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 25) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 24) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 21) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 19) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 18) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 17) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 23) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 22) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 20) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 16) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 13) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (ERROR | (0) << 2),(SHIFT | (1) << 2),(SHIFT | (2) << 2),(SHIFT | (3) << 2),(SHIFT | (4) << 2),(SHIFT | (5) << 2),(SHIFT | (6) << 2),(SHIFT | (7) << 2),(ERROR | (0) << 2),(SHIFT | (8) << 2),(SHIFT | (9) << 2),(SHIFT | (10) << 2),(SHIFT | (11) << 2),(SHIFT | (12) << 2),(SHIFT | (13) << 2),(SHIFT | (14) << 2),(SHIFT | (15) << 2),(SHIFT | (16) << 2),(SHIFT | (17) << 2),(SHIFT | (18) << 2),(SHIFT | (19) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(SHIFT | (20) << 2),(ERROR | (0) << 2),(SHIFT | (21) << 2),(SHIFT | (22) << 2),
|
||||||
|
((0) << 2),((24) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 8) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 11) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 7) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 14) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (ACCEPT | (0) << 2),(SHIFT | (1) << 2),(SHIFT | (2) << 2),(SHIFT | (3) << 2),(SHIFT | (4) << 2),(SHIFT | (5) << 2),(SHIFT | (6) << 2),(SHIFT | (7) << 2),(ERROR | (0) << 2),(SHIFT | (8) << 2),(SHIFT | (9) << 2),(SHIFT | (10) << 2),(SHIFT | (11) << 2),(SHIFT | (12) << 2),(SHIFT | (13) << 2),(SHIFT | (14) << 2),(SHIFT | (15) << 2),(SHIFT | (16) << 2),(SHIFT | (17) << 2),(SHIFT | (18) << 2),(SHIFT | (19) << 2),(SHIFT | (25) << 2),(SHIFT | (26) << 2),(SHIFT | (27) << 2),(ERROR | (0) << 2),(SHIFT | (20) << 2),(SHIFT | (28) << 2),(SHIFT | (21) << 2),(SHIFT | (22) << 2),
|
||||||
|
((0) << 2),((29) << 2), },
|
||||||
|
{ (ERROR | (0) << 2),(SHIFT | (1) << 2),(SHIFT | (2) << 2),(SHIFT | (3) << 2),(SHIFT | (4) << 2),(SHIFT | (5) << 2),(SHIFT | (6) << 2),(SHIFT | (7) << 2),(ERROR | (0) << 2),(SHIFT | (8) << 2),(SHIFT | (9) << 2),(SHIFT | (10) << 2),(SHIFT | (11) << 2),(SHIFT | (12) << 2),(SHIFT | (13) << 2),(SHIFT | (14) << 2),(SHIFT | (15) << 2),(SHIFT | (16) << 2),(SHIFT | (17) << 2),(SHIFT | (18) << 2),(SHIFT | (19) << 2),(SHIFT | (25) << 2),(SHIFT | (26) << 2),(SHIFT | (27) << 2),(SHIFT | (30) << 2),(SHIFT | (20) << 2),(SHIFT | (28) << 2),(SHIFT | (21) << 2),(SHIFT | (22) << 2),
|
||||||
|
((0) << 2),((29) << 2), },
|
||||||
|
{ (ERROR | (0) << 2),(SHIFT | (1) << 2),(SHIFT | (2) << 2),(SHIFT | (3) << 2),(SHIFT | (4) << 2),(SHIFT | (5) << 2),(SHIFT | (6) << 2),(SHIFT | (7) << 2),(ERROR | (0) << 2),(SHIFT | (8) << 2),(SHIFT | (9) << 2),(SHIFT | (10) << 2),(SHIFT | (11) << 2),(SHIFT | (12) << 2),(SHIFT | (13) << 2),(SHIFT | (14) << 2),(SHIFT | (15) << 2),(SHIFT | (16) << 2),(SHIFT | (17) << 2),(SHIFT | (18) << 2),(SHIFT | (19) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(ERROR | (0) << 2),(SHIFT | (20) << 2),(ERROR | (0) << 2),(SHIFT | (21) << 2),(SHIFT | (22) << 2),
|
||||||
|
((0) << 2),((31) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 3) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 4) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 2) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(SHIFT | (26) << 2),(SHIFT | (27) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(SHIFT | (28) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 5) << 2),
|
||||||
|
((0) << 2),((29) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(ERROR | (0) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 1) << 2),
|
||||||
|
((0) << 2),((0) << 2), },
|
||||||
|
{ (REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 0) << 2),(SHIFT | (1) << 2),(SHIFT | (2) << 2),(SHIFT | (3) << 2),(SHIFT | (4) << 2),(SHIFT | (5) << 2),(SHIFT | (6) << 2),(SHIFT | (7) << 2),(ERROR | (0) << 2),(SHIFT | (8) << 2),(SHIFT | (9) << 2),(SHIFT | (10) << 2),(SHIFT | (11) << 2),(SHIFT | (12) << 2),(SHIFT | (13) << 2),(SHIFT | (14) << 2),(SHIFT | (15) << 2),(SHIFT | (16) << 2),(SHIFT | (17) << 2),(SHIFT | (18) << 2),(SHIFT | (19) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 0) << 2),(SHIFT | (26) << 2),(SHIFT | (27) << 2),(REDUCE | (static_cast<std::uint64_t>(RegexParser_Symbol::V_re) << 31 | 0) << 2),(SHIFT | (20) << 2),(SHIFT | (28) << 2),(SHIFT | (21) << 2),(SHIFT | (22) << 2),
|
||||||
|
((0) << 2),((29) << 2), },
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsigned char REDUCE_COUNT[27] = { 3,3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, };
|
||||||
|
|
||||||
|
|
||||||
|
bool RegexParser<bool>::parse() {
|
||||||
|
std::stack<std::uint64_t> stateStack;
|
||||||
|
using Sym = RegexParser_Symbol;
|
||||||
|
|
||||||
|
stateStack.push(0);
|
||||||
|
Sym tok = lex();
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
std::uint64_t act = TABLE[stateStack.top()][static_cast<std::uint64_t>(tok)];
|
||||||
|
|
||||||
|
switch (act & 0x3) {
|
||||||
|
case ERROR:
|
||||||
|
return false;
|
||||||
|
case SHIFT:
|
||||||
|
stateStack.push(act >> 2);
|
||||||
|
tok = lex();
|
||||||
|
break;
|
||||||
|
case REDUCE:
|
||||||
|
{
|
||||||
|
std::uint64_t tmp = act >> 2;
|
||||||
|
Sym symbol = static_cast<Sym>(tmp >> 31);
|
||||||
|
std::uint32_t rule = tmp & ((1ull << 31) - 1);
|
||||||
|
|
||||||
|
for (unsigned char i = 0; i < REDUCE_COUNT[rule]; i++) {
|
||||||
|
stateStack.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
stateStack.push(TABLE[stateStack.top()][static_cast<std::uint64_t>(symbol)] >> 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACCEPT:
|
||||||
|
assert(stateStack.size() == 2);
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
//IMPOSSIBLE
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
# Lexesis - A language agnostic lexer generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
parser: SLR(1)
|
||||||
|
lexesis: regexLexer.lxs
|
||||||
|
precedence:
|
||||||
|
left "QUESTIONMARK" "PLUS" "STAR"
|
||||||
|
left "CHAR_CLASS" "TAB" "NEWLINE" "CARRIAGE_RETURN" "BACKSPACE" "SPACE" "BELL" "FORMFEED" "LPAREN"
|
||||||
|
"VTAB" "BACKSLASH" "ESCAPED_STAR" "ESCAPED_PLUS" "ESCAPED_PIPE" "ESCAPED_LPAREN" "ESCAPED_RPAREN"
|
||||||
|
"ESCAPED_LBRACKET" "ESCAPED_RBRACKET" "ESCAPED_QUESTIONMARK" "ESCAPED_DOT" "DOT" "CHAR"
|
||||||
|
left
|
||||||
|
left "PIPE"
|
||||||
|
|
||||||
|
start: <re>
|
||||||
|
grammar:
|
||||||
|
<re> ::= <re> "PIPE" <re> [or, left 0]
|
||||||
|
| "LPAREN" <re> "RPAREN" [paren, left 1]
|
||||||
|
| <re> "STAR" [star, left 3]
|
||||||
|
| <re> "PLUS" [plus, left 3]
|
||||||
|
| <re> "QUESTIONMARK" [optional, left 3]
|
||||||
|
| <re> <re> [concat, left 2]
|
||||||
|
| "CHAR_CLASS" [char, left 2]
|
||||||
|
| "TAB" [char, left 2]
|
||||||
|
| "NEWLINE" [char, left 2]
|
||||||
|
| "CARRIAGE_RETURN" [char, left 2]
|
||||||
|
| "BACKSPACE" [char, left 2]
|
||||||
|
| "SPACE" [char, left 2]
|
||||||
|
| "BELL" [char, left 2]
|
||||||
|
| "FORMFEED" [char, left 2]
|
||||||
|
| "VTAB" [char, left 2]
|
||||||
|
| "BACKSLASH" [char, left 2]
|
||||||
|
| "ESCAPED_STAR" [char, left 2]
|
||||||
|
| "ESCAPED_PLUS" [char, left 2]
|
||||||
|
| "ESCAPED_PIPE" [char, left 2]
|
||||||
|
| "ESCAPED_LPAREN" [char, left 2]
|
||||||
|
| "ESCAPED_RPAREN" [char, left 2]
|
||||||
|
| "ESCAPED_LBRACKET" [char, left 2]
|
||||||
|
| "ESCAPED_RBRACKET" [char, left 2]
|
||||||
|
| "ESCAPED_QUESTIONMARK" [char, left 2]
|
||||||
|
| "ESCAPED_DOT" [char, left 2]
|
||||||
|
| "DOT" [char, left 2]
|
||||||
|
| "CHAR" [char, left 2]
|
||||||
|
;
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/automata.h"
|
#include "Lexesis/automata.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/backend.h"
|
#include "Lexesis/backend.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/backendmanager.h"
|
#include "Lexesis/backendmanager.h"
|
||||||
#include "Lexesis/backend.h"
|
#include "Lexesis/backend.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/backends/cpp.h"
|
#include "Lexesis/backends/cpp.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,30 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/driver.h"
|
#include "Lexesis/driver.h"
|
||||||
#include "Lexesis/inputparser.h"
|
#include "Lexesis/inputparser.h"
|
||||||
#include "Lexesis/automata.h"
|
#include "Lexesis/automata.h"
|
||||||
#include "Lexesis/re.h"
|
#include "Lexesis/reParser.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/inputparser.h"
|
#include "Lexesis/inputparser.h"
|
||||||
|
|
||||||
#include <istream>
|
#include <istream>
|
||||||
|
@ -18,8 +41,8 @@ namespace input {
|
||||||
auto lines = parseInput(is);
|
auto lines = parseInput(is);
|
||||||
std::set<std::string> tokens;
|
std::set<std::string> tokens;
|
||||||
for(auto line: lines) {
|
for(auto line: lines) {
|
||||||
|
if(line.second.first != "ignore")
|
||||||
tokens.insert(line.second.first);
|
tokens.insert(line.second.first);
|
||||||
std::cout << line.second.first << std::endl;
|
|
||||||
}
|
}
|
||||||
return tokens;
|
return tokens;
|
||||||
}
|
}
|
||||||
|
|
23
src/main.cpp
23
src/main.cpp
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/backendmanager.h"
|
#include "Lexesis/backendmanager.h"
|
||||||
#include "Lexesis/backends/cpp.h"
|
#include "Lexesis/backends/cpp.h"
|
||||||
#include "Lexesis/driver.h"
|
#include "Lexesis/driver.h"
|
||||||
|
|
295
src/re.cpp
295
src/re.cpp
|
@ -1,15 +1,37 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/re.h"
|
#include "Lexesis/re.h"
|
||||||
#include "RegexLexer.h"
|
#include "Lexesis/RegexLexer.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
namespace lxs {
|
namespace lxs {
|
||||||
string EmptyRE::toRe()
|
std::string EmptyRE::toRe()
|
||||||
{
|
{
|
||||||
return "∅";
|
return "∅";
|
||||||
}
|
}
|
||||||
|
@ -22,7 +44,7 @@ namespace lxs {
|
||||||
return attach + 1;
|
return attach + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
string EpsilonRE::toRe()
|
std::string EpsilonRE::toRe()
|
||||||
{
|
{
|
||||||
return "ε";
|
return "ε";
|
||||||
}
|
}
|
||||||
|
@ -36,9 +58,9 @@ namespace lxs {
|
||||||
return attach + 1;
|
return attach + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
string SingleRE::toRe()
|
std::string SingleRE::toRe()
|
||||||
{
|
{
|
||||||
return string(1, c);
|
return std::string(1, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
State SingleRE::toENFA(ENFA& enfa, State attach)
|
State SingleRE::toENFA(ENFA& enfa, State attach)
|
||||||
|
@ -50,9 +72,9 @@ namespace lxs {
|
||||||
return attach + 1;
|
return attach + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
string MultiRE::toRe()
|
std::string MultiRE::toRe()
|
||||||
{
|
{
|
||||||
return "[" + string(chars.begin(), chars.end()) + "]";
|
return "[" + std::string(chars.begin(), chars.end()) + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
State MultiRE::toENFA(ENFA& enfa, State attach)
|
State MultiRE::toENFA(ENFA& enfa, State attach)
|
||||||
|
@ -66,7 +88,7 @@ namespace lxs {
|
||||||
return attach + 1;
|
return attach + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ConcatRE::toRe()
|
std::string ConcatRE::toRe()
|
||||||
{
|
{
|
||||||
return e->toRe() + f->toRe();
|
return e->toRe() + f->toRe();
|
||||||
}
|
}
|
||||||
|
@ -78,7 +100,7 @@ namespace lxs {
|
||||||
return f->toENFA(enfa, a + 1);
|
return f->toENFA(enfa, a + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
string StarRE::toRe()
|
std::string StarRE::toRe()
|
||||||
{
|
{
|
||||||
return "(" + e->toRe() + ")*";
|
return "(" + e->toRe() + ")*";
|
||||||
}
|
}
|
||||||
|
@ -96,7 +118,7 @@ namespace lxs {
|
||||||
return a + 1;
|
return a + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
string PlusRE::toRe()
|
std::string PlusRE::toRe()
|
||||||
{
|
{
|
||||||
return "(" + e->toRe() + "|" + f->toRe() + ")";
|
return "(" + e->toRe() + "|" + f->toRe() + ")";
|
||||||
}
|
}
|
||||||
|
@ -115,255 +137,4 @@ namespace lxs {
|
||||||
return b + 1;
|
return b + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
/**
|
|
||||||
* Take the two top elements from `stk` and combine them with a ConcatRE
|
|
||||||
*/
|
|
||||||
void compress(stack<std::shared_ptr<RE>>& stk)
|
|
||||||
{
|
|
||||||
std::shared_ptr<RE> a = stk.top();
|
|
||||||
stk.pop();
|
|
||||||
std::shared_ptr<RE> b = stk.top();
|
|
||||||
stk.pop();
|
|
||||||
stk.push(std::make_shared<ConcatRE>(b, a)); //Attention: reversed order because of stack
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Apply compress until only one RE remains on the stack
|
|
||||||
*/
|
|
||||||
void compactStack(stack<std::shared_ptr<RE> >& stk)
|
|
||||||
{
|
|
||||||
if (stk.empty()) return;
|
|
||||||
std::shared_ptr<RE> tp = stk.top();
|
|
||||||
stk.pop();
|
|
||||||
while (stk.size() >= 2)
|
|
||||||
{
|
|
||||||
compress(stk);
|
|
||||||
}
|
|
||||||
stk.push(tp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse a character class
|
|
||||||
*/
|
|
||||||
std::shared_ptr<RE> parseCharacterClass(const string& input) {
|
|
||||||
std::set<char> used_chars;
|
|
||||||
|
|
||||||
bool invert = false;
|
|
||||||
std::size_t start = 1;
|
|
||||||
std::size_t end = input.size() - 1;
|
|
||||||
|
|
||||||
if (input[1] == '^') {
|
|
||||||
invert = true;
|
|
||||||
start = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input[start] == ']') {
|
|
||||||
used_chars.insert(']');
|
|
||||||
++start;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input[start] == '-') {
|
|
||||||
used_chars.insert('-');
|
|
||||||
++start;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input[end - 1] == '-') {
|
|
||||||
used_chars.insert('-');
|
|
||||||
--end;
|
|
||||||
}
|
|
||||||
|
|
||||||
int last_char = -1;
|
|
||||||
for (std::size_t idx = start; idx < end; idx++)
|
|
||||||
{
|
|
||||||
if (input[idx] == '-')
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
for (int i = last_char; i <= input[idx]; i++) {
|
|
||||||
used_chars.insert((char) i);
|
|
||||||
}
|
|
||||||
last_char = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (idx == end - 1 || (idx < end - 1 && input[idx + 1] != '-'))
|
|
||||||
used_chars.insert(input[idx]);
|
|
||||||
else
|
|
||||||
last_char = input[idx];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<char> chars;
|
|
||||||
for (int i = 0; i < 256; i++) {
|
|
||||||
if (invert ^ (used_chars.count((char) i) > 0))
|
|
||||||
chars.push_back((char) i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::make_shared<MultiRE>(chars);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the RE for the `.` pattern: everything except a newline
|
|
||||||
*/
|
|
||||||
std::shared_ptr<RE> dotChar() {
|
|
||||||
std::vector<char> any;
|
|
||||||
for (int i = 0; i < 256; i++)
|
|
||||||
if ((char) i != '\n') //Dot matches anything except newlines
|
|
||||||
any.push_back((char) i);
|
|
||||||
return std::make_shared<MultiRE>(any);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse the actual regex
|
|
||||||
*/
|
|
||||||
std::shared_ptr<RE> parseRE(RegexLexer& lex, bool& exit_by_closed_paren, bool inside_parens=false)
|
|
||||||
{
|
|
||||||
stack<std::shared_ptr<RE> > stk;
|
|
||||||
|
|
||||||
try {
|
|
||||||
while (true) {
|
|
||||||
exit_by_closed_paren = false;
|
|
||||||
RegexLexer::Token tok = lex.nextToken();
|
|
||||||
std::shared_ptr<RE> n;
|
|
||||||
switch (tok.type) {
|
|
||||||
case RegexLexer::TAB:
|
|
||||||
stk.push(std::make_shared<SingleRE>('\t'));
|
|
||||||
break;
|
|
||||||
case RegexLexer::NEWLINE:
|
|
||||||
stk.push(std::make_shared<SingleRE>('\n'));
|
|
||||||
break;
|
|
||||||
case RegexLexer::CARRIAGE_RETURN:
|
|
||||||
stk.push(std::make_shared<SingleRE>('\r'));
|
|
||||||
break;
|
|
||||||
case RegexLexer::BACKSPACE:
|
|
||||||
stk.push(std::make_shared<SingleRE>('\b'));
|
|
||||||
break;
|
|
||||||
case RegexLexer::SPACE:
|
|
||||||
stk.push(std::make_shared<SingleRE>(' '));
|
|
||||||
break;
|
|
||||||
case RegexLexer::BELL:
|
|
||||||
stk.push(std::make_shared<SingleRE>('\a'));
|
|
||||||
break;
|
|
||||||
case RegexLexer::FORMFEED:
|
|
||||||
stk.push(std::make_shared<SingleRE>('\f'));
|
|
||||||
break;
|
|
||||||
case RegexLexer::VTAB:
|
|
||||||
stk.push(std::make_shared<SingleRE>('\v'));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::BACKSLASH:
|
|
||||||
case RegexLexer::ESCAPED_STAR:
|
|
||||||
case RegexLexer::ESCAPED_PLUS:
|
|
||||||
case RegexLexer::ESCAPED_PIPE:
|
|
||||||
case RegexLexer::ESCAPED_LPAREN:
|
|
||||||
case RegexLexer::ESCAPED_RPAREN:
|
|
||||||
case RegexLexer::ESCAPED_LBRACKET:
|
|
||||||
case RegexLexer::ESCAPED_RBRACKET:
|
|
||||||
case RegexLexer::ESCAPED_QUESTIONMARK:
|
|
||||||
case RegexLexer::ESCAPED_DOT:
|
|
||||||
stk.push(std::make_shared<SingleRE>(tok.content[1]));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::DOT:
|
|
||||||
stk.push(dotChar());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::STAR:
|
|
||||||
if (stk.empty())
|
|
||||||
throw SyntaxError(lex, "Cannot apply kleene star to empty regex");
|
|
||||||
n = std::make_shared<StarRE>(stk.top());
|
|
||||||
stk.pop();
|
|
||||||
stk.push(n);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::PLUS:
|
|
||||||
if (stk.empty())
|
|
||||||
throw SyntaxError(lex, "Cannot apply kleene plus to empty regex");
|
|
||||||
n = stk.top();
|
|
||||||
stk.pop();
|
|
||||||
n = std::make_shared<ConcatRE>(n, std::make_shared<StarRE>(n));
|
|
||||||
stk.push(n);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::QUESTIONMARK:
|
|
||||||
if (stk.empty())
|
|
||||||
throw SyntaxError(lex, "Cannot apply '?' to empty regex");
|
|
||||||
n = std::make_shared<PlusRE>(stk.top(), std::make_shared<EpsilonRE>());
|
|
||||||
stk.pop();
|
|
||||||
stk.push(n);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::PIPE:
|
|
||||||
if (stk.empty())
|
|
||||||
throw SyntaxError(lex, "Invalid regex: nothing to the left of '|'");
|
|
||||||
if (stk.size() > 1)
|
|
||||||
compactStack(stk), compress(stk);
|
|
||||||
n = std::make_shared<PlusRE>(stk.top(), parseRE(lex, exit_by_closed_paren, inside_parens));
|
|
||||||
stk.pop();
|
|
||||||
stk.push(n);
|
|
||||||
if (exit_by_closed_paren) {
|
|
||||||
if (stk.size() == 1)
|
|
||||||
return stk.top();
|
|
||||||
else if (stk.size() == 2)
|
|
||||||
return compress(stk), stk.top();
|
|
||||||
else
|
|
||||||
throw SyntaxError(lex, "Invalid regex");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::LPAREN:
|
|
||||||
n = parseRE(lex, exit_by_closed_paren, true);
|
|
||||||
if (!exit_by_closed_paren) {
|
|
||||||
throw SyntaxError(lex, "Unclosed parenthesis");
|
|
||||||
}
|
|
||||||
stk.push(n);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::RPAREN:
|
|
||||||
if (!inside_parens)
|
|
||||||
throw SyntaxError(lex, "Unopened parenthesis");
|
|
||||||
|
|
||||||
exit_by_closed_paren = true;
|
|
||||||
if (stk.size() == 1)
|
|
||||||
return stk.top();
|
|
||||||
else if (stk.size() == 2)
|
|
||||||
return compress(stk), stk.top();
|
|
||||||
throw SyntaxError(lex, "Could not parse regex, nothing inside parentheses");
|
|
||||||
|
|
||||||
case RegexLexer::CHAR:
|
|
||||||
stk.push(std::make_shared<SingleRE>(tok.content[0]));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::CHAR_CLASS:
|
|
||||||
stk.push(parseCharacterClass(tok.content));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RegexLexer::ERROR:
|
|
||||||
throw SyntaxError(lex, "Error on character: " + tok.content);
|
|
||||||
|
|
||||||
case RegexLexer::ignore: case RegexLexer::nonmatching:
|
|
||||||
//Just ignore these
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
compactStack(stk);
|
|
||||||
}
|
|
||||||
} catch (RegexLexer::NoMoreTokens& err) {
|
|
||||||
if (stk.size() == 1)
|
|
||||||
return stk.top();
|
|
||||||
else if (stk.size() == 2)
|
|
||||||
return compress(stk), stk.top();
|
|
||||||
throw SyntaxError(lex, "Could not parse regex");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<RE> parseRE(const string& input)
|
|
||||||
{
|
|
||||||
std::istringstream inputstream(input);
|
|
||||||
RegexLexer lex(inputstream);
|
|
||||||
bool exit_by_closed_paren = false;
|
|
||||||
std::shared_ptr<RE> res = parseRE(lex, exit_by_closed_paren);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,186 @@
|
||||||
|
#include <algorithm>
|
||||||
|
#include <cassert>
|
||||||
|
#include <codecvt>
|
||||||
|
#include <deque>
|
||||||
|
#include <locale>
|
||||||
|
#include <sstream>
|
||||||
|
#include "Lexesis/reParser.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
namespace lxs {
|
||||||
|
|
||||||
|
ReParser::ReParser(RegexLexer lex) : RegexParser<std::shared_ptr<RE>>(), m_lex(lex)
|
||||||
|
{}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
std::shared_ptr<RE> dotChar() {
|
||||||
|
std::vector<char> any;
|
||||||
|
for (int i = 0; i < 256; i++)
|
||||||
|
if ((char) i != '\n') //Dot matches anything except newlines
|
||||||
|
any.push_back((char) i);
|
||||||
|
return std::make_shared<MultiRE>(any);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse a character class
|
||||||
|
*/
|
||||||
|
std::shared_ptr<RE> parseCharacterClass(const std::string& input) {
|
||||||
|
std::set<char> used_chars;
|
||||||
|
|
||||||
|
bool invert = false;
|
||||||
|
std::size_t start = 1;
|
||||||
|
std::size_t end = input.size() - 1;
|
||||||
|
|
||||||
|
if (input[1] == '^') {
|
||||||
|
invert = true;
|
||||||
|
start = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input[start] == ']') {
|
||||||
|
used_chars.insert(']');
|
||||||
|
++start;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input[start] == '-') {
|
||||||
|
used_chars.insert('-');
|
||||||
|
++start;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input[end - 1] == '-') {
|
||||||
|
used_chars.insert('-');
|
||||||
|
--end;
|
||||||
|
}
|
||||||
|
|
||||||
|
int last_char = -1;
|
||||||
|
for (std::size_t idx = start; idx < end; idx++)
|
||||||
|
{
|
||||||
|
if (input[idx] == '-')
|
||||||
|
{
|
||||||
|
idx++;
|
||||||
|
for (int i = last_char; i <= input[idx]; i++) {
|
||||||
|
used_chars.insert((char) i);
|
||||||
|
}
|
||||||
|
last_char = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (idx == end - 1 || (idx < end - 1 && input[idx + 1] != '-'))
|
||||||
|
used_chars.insert(input[idx]);
|
||||||
|
else
|
||||||
|
last_char = input[idx];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<char> chars;
|
||||||
|
for (int i = 0; i < 256; i++) {
|
||||||
|
if (invert ^ (used_chars.count((char) i) > 0))
|
||||||
|
chars.push_back((char) i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::make_shared<MultiRE>(chars);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RegexParser<std::shared_ptr<RE>>::Token ReParser::lex() {
|
||||||
|
try {
|
||||||
|
RegexLexer::Token orig = m_lex.nextToken();
|
||||||
|
switch(orig.type) {
|
||||||
|
case RegexLexer::TAB:
|
||||||
|
return Token(RegexParser_Symbol::T_TAB, std::make_shared<SingleRE>('\t'));
|
||||||
|
case RegexLexer::NEWLINE:
|
||||||
|
return Token(RegexParser_Symbol::T_NEWLINE, std::make_shared<SingleRE>('\n'));
|
||||||
|
case RegexLexer::CARRIAGE_RETURN:
|
||||||
|
return Token(RegexParser_Symbol::T_CARRIAGE_RETURN, std::make_shared<SingleRE>('\r'));
|
||||||
|
case RegexLexer::BACKSPACE:
|
||||||
|
return Token(RegexParser_Symbol::T_BACKSPACE, std::make_shared<SingleRE>('\b'));
|
||||||
|
case RegexLexer::SPACE:
|
||||||
|
return Token(RegexParser_Symbol::T_SPACE, std::make_shared<SingleRE>(' '));
|
||||||
|
case RegexLexer::BELL:
|
||||||
|
return Token(RegexParser_Symbol::T_BELL, std::make_shared<SingleRE>('\a'));
|
||||||
|
case RegexLexer::FORMFEED:
|
||||||
|
return Token(RegexParser_Symbol::T_FORMFEED, std::make_shared<SingleRE>('\f'));
|
||||||
|
case RegexLexer::VTAB:
|
||||||
|
return Token(RegexParser_Symbol::T_VTAB, std::make_shared<SingleRE>('\v'));
|
||||||
|
case RegexLexer::BACKSLASH:
|
||||||
|
return Token(RegexParser_Symbol::T_BACKSLASH, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_STAR:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_STAR, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_PLUS:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_PLUS, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_PIPE:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_PIPE, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_LPAREN:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_LPAREN, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_RPAREN:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_RPAREN, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_LBRACKET:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_LBRACKET, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_RBRACKET:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_RBRACKET, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_QUESTIONMARK:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_QUESTIONMARK, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::ESCAPED_DOT:
|
||||||
|
return Token(RegexParser_Symbol::T_ESCAPED_DOT, std::make_shared<SingleRE>(orig.content[1]));
|
||||||
|
case RegexLexer::DOT:
|
||||||
|
return Token(RegexParser_Symbol::T_DOT, dotChar());
|
||||||
|
case RegexLexer::STAR:
|
||||||
|
return Token(RegexParser_Symbol::T_STAR, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
case RegexLexer::PLUS:
|
||||||
|
return Token(RegexParser_Symbol::T_PLUS, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
case RegexLexer::QUESTIONMARK:
|
||||||
|
return Token(RegexParser_Symbol::T_QUESTIONMARK, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
case RegexLexer::PIPE:
|
||||||
|
return Token(RegexParser_Symbol::T_PIPE, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
case RegexLexer::LPAREN:
|
||||||
|
return Token(RegexParser_Symbol::T_LPAREN, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
case RegexLexer::RPAREN:
|
||||||
|
return Token(RegexParser_Symbol::T_RPAREN, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
case RegexLexer::CHAR:
|
||||||
|
return Token(RegexParser_Symbol::T_CHAR, std::make_shared<SingleRE>(orig.content[0]));
|
||||||
|
case RegexLexer::CHAR_CLASS:
|
||||||
|
return Token(RegexParser_Symbol::T_DOT, parseCharacterClass(orig.content));
|
||||||
|
case RegexLexer::ERROR: case RegexLexer::ignore: case RegexLexer::nonmatching:
|
||||||
|
throw SyntaxError(m_lex,"Received an error from the lexer while parsing token: " + orig.content);
|
||||||
|
default:
|
||||||
|
return Token(RegexParser_Symbol::T_EOF, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (RegexLexer::NoMoreTokens) {
|
||||||
|
return Token(RegexParser_Symbol::T_EOF, std::shared_ptr<RE>(new EmptyRE()));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<RE> ReParser::reduce_char(std::deque<RegexParser::Token> subparts) {
|
||||||
|
return std::move(subparts[0].value);
|
||||||
|
}
|
||||||
|
std::shared_ptr<RE> ReParser::reduce_concat(std::deque<RegexParser::Token> subparts) {
|
||||||
|
return std::make_shared<ConcatRE>(subparts[0].value, subparts[1].value);
|
||||||
|
}
|
||||||
|
std::shared_ptr<RE> ReParser::reduce_optional(std::deque<RegexParser::Token> subparts) {
|
||||||
|
return std::make_shared<PlusRE>(subparts[0].value, std::make_shared<EpsilonRE>());
|
||||||
|
}
|
||||||
|
std::shared_ptr<RE> ReParser::reduce_or(std::deque<RegexParser::Token> subparts) {
|
||||||
|
return std::make_shared<PlusRE>(subparts[0].value, subparts[2].value);
|
||||||
|
}
|
||||||
|
std::shared_ptr<RE> ReParser::reduce_paren(std::deque<RegexParser::Token> subparts) {
|
||||||
|
return std::move(subparts[1].value);
|
||||||
|
}
|
||||||
|
std::shared_ptr<RE> ReParser::reduce_plus(std::deque<RegexParser::Token> subparts) {
|
||||||
|
return std::make_shared<ConcatRE>(subparts[0].value, std::make_shared<StarRE>(subparts[0].value));
|
||||||
|
}
|
||||||
|
std::shared_ptr<RE> ReParser::reduce_star(std::deque<RegexParser::Token> subparts) {
|
||||||
|
return std::make_shared<StarRE>(subparts[0].value);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<RE> parseRE(const std::string& input) {
|
||||||
|
std::stringstream ss(input);
|
||||||
|
RegexLexer lexer(ss);
|
||||||
|
ReParser parser(lexer);
|
||||||
|
auto res = parser.parse();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,3 +1,24 @@
|
||||||
|
# Lexesis - A language agnostic lexical analyser generator
|
||||||
|
# Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
# \[
|
# \[
|
||||||
# ( ^ ( \]-? | - | X' )
|
# ( ^ ( \]-? | - | X' )
|
||||||
# | \]-? | - | Y' )
|
# | \]-? | - | Y' )
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/template.h"
|
#include "Lexesis/template.h"
|
||||||
#include "mstch/mstch.hpp"
|
#include "mstch/mstch.hpp"
|
||||||
|
|
||||||
|
|
25
src/test.cpp
25
src/test.cpp
|
@ -1,6 +1,29 @@
|
||||||
|
/*
|
||||||
|
Lexesis - A language agnostic lexical analyser generator
|
||||||
|
Copyright © 2016-2017 Thomas Avé, Robin Jadoul
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Lexesis/automata.h"
|
#include "Lexesis/automata.h"
|
||||||
#include "Lexesis/driver.h"
|
#include "Lexesis/driver.h"
|
||||||
#include "Lexesis/re.h"
|
#include "Lexesis/reParser.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||||
|
*
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||||
|
*
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
#include "{{name}}.h"
|
#include "{{name}}.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||||
|
*
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||||
|
*
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef LEXER_{{name}}_H
|
#ifndef LEXER_{{name}}_H
|
||||||
#define LEXER_{{name}}_H
|
#define LEXER_{{name}}_H
|
||||||
|
|
Loading…
Reference in New Issue