sheepy

build system (sheepy) and package manager (spm) for C
git clone https://spartatek.se/git/sheepy.git
Log | Files | Refs | README | LICENSE

commit bd76fad142515c60e15141f4ea52da532907ab46
Author: Remy Noulin <loader2x@gmail.com>
Date:   Fri,  6 Sep 2019 14:46:01 +0200

new git starting at b8e2992

LICENSE                                           |    21 +
README.md                                         |   285 +
genMake.c                                         |   187 +
homeInstall.sh                                    |    38 +
install.sh                                        |    27 +
installHaiku.sh                                   |    33 +
installOpenIndiana.sh                             |    27 +
installTermux.sh                                  |    27 +
make.sh                                           |     3 +
src/common.c                                      |   261 +
src/common.h                                      |   227 +
src/compileSheepy.sh                              |     1 +
src/compileSheepyHaiku.sh                         |     1 +
src/compileSpm.sh                                 |     1 +
src/parser/Accumulator                            |    69 +
src/parser/Accumulator.i                          |   196 +
src/parser/Buffer.i                               |   933 ++
src/parser/BufferMemory.i                         |    58 +
src/parser/Buffer_debug                           |    43 +
src/parser/Buffer_debug.i                         |   345 +
src/parser/Buffer_fill.i                          |    98 +
src/parser/Buffer_navigation.i                    |   195 +
src/parser/ByteLoader                             |    99 +
src/parser/ByteLoader.i                           |   164 +
src/parser/ByteLoader_FILE                        |    28 +
src/parser/ByteLoader_FILE.i                      |   125 +
src/parser/ByteLoader_stream                      |    27 +
src/parser/ByteLoader_stream.i                    |   150 +
src/parser/C-adaptions.h                          |   141 +
src/parser/Converter                              |    95 +
src/parser/Converter.i                            |    47 +
src/parser/Counter.i                              |   102 +
src/parser/EasyLexer-configuration.h              |   401 +
src/parser/EasyLexer-token.h                      |   109 +
src/parser/EasyLexer-token_ids.h                  |   145 +
src/parser/EasyLexer.c                            | 17341 ++++++++++++++++++++
src/parser/EasyLexer.h                            |   114 +
src/parser/EngineMemento_body                     |    31 +
src/parser/Engine_body                            |    51 +
src/parser/LexatomLoader                          |   160 +
src/parser/LexatomLoader.i                        |   258 +
src/parser/LexatomLoader_Converter                |   170 +
src/parser/LexatomLoader_Converter.i              |   428 +
src/parser/LexatomLoader_Converter_RawBuffer.i    |   118 +
src/parser/LexatomLoader_Plain                    |    32 +
src/parser/LexatomLoader_Plain.i                  |   198 +
src/parser/LexatomLoader_navigation.i             |   195 +
src/parser/MemoryManager                          |    47 +
src/parser/MemoryManager.i                        |    82 +
src/parser/Mode.i                                 |    39 +
src/parser/TokenPolicy                            |   158 +
src/parser/TokenQueue                             |    84 +
src/parser/TokenQueue.i                           |   320 +
src/parser/analyzerAsserts                        |    43 +
src/parser/analyzerAsserts.i                      |    64 +
src/parser/analyzerBasic                          |    25 +
src/parser/analyzerConfigDerived                  |   436 +
src/parser/analyzerConstructor                    |    87 +
src/parser/analyzerCounter                        |    61 +
src/parser/analyzerHeaders                        |    49 +
src/parser/analyzerInclude-stack                  |    99 +
src/parser/analyzerMode                           |    68 +
src/parser/analyzerReset                          |    83 +
src/parser/asserts                                |    32 +
src/parser/aux-string                             |    42 +
src/parser/aux-string.i                           |    84 +
src/parser/basic.i                                |    16 +
src/parser/bom                                    |    98 +
src/parser/bom.i                                  |   183 +
src/parser/bufferAsserts                          |    32 +
src/parser/bufferAsserts.i                        |    78 +
src/parser/bufferBuffer                           |   175 +
src/parser/character-converter-to-char-wchar_t.gi |    71 +
src/parser/compatStdbool-pseudo.h                 |    36 +
src/parser/compatStdint.h                         |    27 +
src/parser/constructor.i                          |   409 +
src/parser/converterHelperCommon.h                |    23 +
src/parser/converterHelperGeneratorDeclarations.g |    93 +
src/parser/definitions                            |   426 +
src/parser/from-unicode-buffer                    |    44 +
src/parser/from-unicode-buffer.i                  |   108 +
src/parser/from-utf16                             |    44 +
src/parser/from-utf16.i                           |   133 +
src/parser/from-utf32                             |    44 +
src/parser/from-utf32.i                           |   126 +
src/parser/from-utf8                              |    44 +
src/parser/from-utf8.i                            |   181 +
src/parser/headers.i                              |    54 +
src/parser/iconv-argument-types.h                 |    28 +
src/parser/identity                               |    52 +
src/parser/identity.i                             |    78 +
src/parser/implementations.gi                     |    50 +
src/parser/include-stack.i                        |   409 +
src/parser/misc                                   |    72 +
src/parser/misc.i                                 |   215 +
src/parser/mode-handling                          |    38 +
src/parser/mode-handling.i                        |   163 +
src/parser/multi.i                                |    51 +
src/parser/navigation                             |    21 +
src/parser/navigation.i                           |    97 +
src/parser/on_indentation.i                       |    57 +
src/parser/parser.c                               |   958 ++
src/parser/parser.h                               |   118 +
src/parser/reset.i                                |   260 +
src/parser/single.i                               |    30 +
src/parser/string-converter.gi                    |   111 +
src/parser/token-receiving                        |    28 +
src/parser/token-receiving.i                      |   143 +
src/parser/token-sending                          |    70 +
src/sha256/bconSha256.c                           |   158 +
src/sha256/bconSha256.h                           |     0
src/sha256/package.yml                            |    14 +
src/sha256/sha256.c                               |    37 +
src/sha256/sha256.h                               |    39 +
src/sha256/test.c                                 |    14 +
src/sheepy.c                                      |  2140 +++
src/sheepy.h                                      |   529 +
src/spm.c                                         |  1945 +++
src/spm.h                                         |    58 +
119 files changed, 36136 insertions(+)

Diffstat:
ALICENSE | 21+++++++++++++++++++++
AREADME.md | 285+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AgenMake.c | 187+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AhomeInstall.sh | 38++++++++++++++++++++++++++++++++++++++
Ainstall.sh | 27+++++++++++++++++++++++++++
AinstallHaiku.sh | 33+++++++++++++++++++++++++++++++++
AinstallOpenIndiana.sh | 27+++++++++++++++++++++++++++
AinstallTermux.sh | 27+++++++++++++++++++++++++++
Amake.sh | 3+++
Asrc/common.c | 261+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/common.h | 227+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/compileSheepy.sh | 1+
Asrc/compileSheepyHaiku.sh | 1+
Asrc/compileSpm.sh | 1+
Asrc/parser/Accumulator | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Accumulator.i | 196+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Buffer.i | 933+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/BufferMemory.i | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Buffer_debug | 43+++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Buffer_debug.i | 345+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Buffer_fill.i | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Buffer_navigation.i | 195+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/ByteLoader | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/ByteLoader.i | 164+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/ByteLoader_FILE | 28++++++++++++++++++++++++++++
Asrc/parser/ByteLoader_FILE.i | 125+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/ByteLoader_stream | 27+++++++++++++++++++++++++++
Asrc/parser/ByteLoader_stream.i | 150+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/C-adaptions.h | 141+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Converter | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Converter.i | 47+++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Counter.i | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/EasyLexer-configuration.h | 401+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/EasyLexer-token.h | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/EasyLexer-token_ids.h | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/EasyLexer.c | 17341+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/EasyLexer.h | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/EngineMemento_body | 31+++++++++++++++++++++++++++++++
Asrc/parser/Engine_body | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader | 160+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader.i | 258+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader_Converter | 170+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader_Converter.i | 428+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader_Converter_RawBuffer.i | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader_Plain | 32++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader_Plain.i | 198+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/LexatomLoader_navigation.i | 195+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/MemoryManager | 47+++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/MemoryManager.i | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/Mode.i | 39+++++++++++++++++++++++++++++++++++++++
Asrc/parser/TokenPolicy | 158+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/TokenQueue | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/TokenQueue.i | 320+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerAsserts | 43+++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerAsserts.i | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerBasic | 25+++++++++++++++++++++++++
Asrc/parser/analyzerConfigDerived | 436+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerConstructor | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerCounter | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerHeaders | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerInclude-stack | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerMode | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/analyzerReset | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/asserts | 32++++++++++++++++++++++++++++++++
Asrc/parser/aux-string | 42++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/aux-string.i | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/basic.i | 16++++++++++++++++
Asrc/parser/bom | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/bom.i | 183+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/bufferAsserts | 32++++++++++++++++++++++++++++++++
Asrc/parser/bufferAsserts.i | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/bufferBuffer | 175+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/character-converter-to-char-wchar_t.gi | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/compatStdbool-pseudo.h | 36++++++++++++++++++++++++++++++++++++
Asrc/parser/compatStdint.h | 27+++++++++++++++++++++++++++
Asrc/parser/constructor.i | 409+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/converterHelperCommon.h | 23+++++++++++++++++++++++
Asrc/parser/converterHelperGeneratorDeclarations.g | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/definitions | 426+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-unicode-buffer | 44++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-unicode-buffer.i | 108+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-utf16 | 44++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-utf16.i | 133+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-utf32 | 44++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-utf32.i | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-utf8 | 44++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/from-utf8.i | 181+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/headers.i | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/iconv-argument-types.h | 28++++++++++++++++++++++++++++
Asrc/parser/identity | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/identity.i | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/implementations.gi | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/include-stack.i | 409+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/misc | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/misc.i | 215+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/mode-handling | 38++++++++++++++++++++++++++++++++++++++
Asrc/parser/mode-handling.i | 163+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/multi.i | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/navigation | 21+++++++++++++++++++++
Asrc/parser/navigation.i | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/on_indentation.i | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/parser.c | 958+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/parser.h | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/reset.i | 260+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/single.i | 30++++++++++++++++++++++++++++++
Asrc/parser/string-converter.gi | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/token-receiving | 28++++++++++++++++++++++++++++
Asrc/parser/token-receiving.i | 143+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/parser/token-sending | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/sha256/bconSha256.c | 158+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/sha256/bconSha256.h | 0
Asrc/sha256/package.yml | 14++++++++++++++
Asrc/sha256/sha256.c | 37+++++++++++++++++++++++++++++++++++++
Asrc/sha256/sha256.h | 39+++++++++++++++++++++++++++++++++++++++
Asrc/sha256/test.c | 14++++++++++++++
Asrc/sheepy.c | 2140+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/sheepy.h | 529+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/spm.c | 1945+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/spm.h | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
119 files changed, 36136 insertions(+), 0 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Remy Noulin + +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. diff --git a/README.md b/README.md @@ -0,0 +1,285 @@ +- [Install](#install) +- [Dependencies](#dependencies) +- [Starting a new project](#starting-a-new-project) +- [Compilation](#compilation) +- [Packages](#packages) +- [Compiling multiple source files](#compiling-multiple-source-files) +- [Creating classes](#creating-classes) + +sheepy compiles and runs C programs **without makefiles** and it has the ability to run as a C script with a hashbang. +GCC (minimum 4.9) has to be installed for a working system. + +The build system is multiprocess by default and already built objects are reused. + +`sheepy` depends on [libsheepy](https://spartatek.se/r/libsheepy/file/README.md.html), `libsheepy` is installed during the installation process. + +Check out the [user guide](http://spartatek.se/libsheepyUserGuide/) to learn how to use sheepy and libsheepy, for more detailed information read the libsheepy reference documentation available at [http://spartatek.se/libsheepy/](http://spartatek.se/libsheepy/). + +The prefered C standard is `C11` because libsheepy has many **generics**, `C99` is supported but is much less convenient to use than C11 since there are thousands of functions in libsheepy (a function for each type and feature). + +- `sheepy` builds the executables and libraries. +- `spm` is the package manager. + +Demo: [![asciicast](https://asciinema.org/a/sVPOkMKI951Nw8DBeLPxzNlo7.svg)](https://asciinema.org/a/sVPOkMKI951Nw8DBeLPxzNlo7) + +# Install + +Platforms: +- Linux/GNU, Intel (Ivy Bridge or newer for DRNG RDRAND) +- Linux/GNU, ARM (raspberry pi) +- Android/Termux ARM +- MacOS +- FreeBSD +- OpenBSD +- DragonflyBSD +- Alpine Linux (musl libc) +- OpenIndiana (illumos, solaris, sunOS) +- Haiku + +These commands install `sheepy` and `spm`: + +``` +git clone https://spartatek.se/git/sheepy.git +cd sheepy + +sudo -H ./install.sh +``` + +To install sheepy in your home folder, run: +``` +./homeInstall.sh + +# then add 'export LIBSHEEPY=...' and 'export PATH=...' in your startup scripts +``` + + +In Alpine Linux: +``` +# Apline Linux only +apk add gcc libc-dev git +# End Alpine Linux + +git clone https://spartatek.se/git/sheepy.git +cd sheepy + +sudo -H ./install.sh +``` + +In Termux: +``` +# Termux only +pkg install git clang curl gdb + +git clone https://spartatek.se/git/sheepy.git +cd sheepy + +./installTermux.sh +``` + +In OpenIndiana: +``` +# OpenIndiana only +pkg install git gcc-8 system/header + +git clone https://spartatek.se/git/sheepy.git +cd sheepy + +./installOpenIndiana.sh +``` + +## Configuration + +The user configuration is located at `~/.sheepy/config.yml`. + +If the configuration file doesn't already exist, it is created when sheepy is executed for the first time. + +Settings: + +- _system_ install location of the sheepy and spm commands and global packages +- _cflags_ flags for the C compiler +- _lflags_ flags for the linker +- _linkWithGold_ enable/disable gold linker (multithreaded linking) +- _32bit_ generate a 32bit executable +- _parallelSheepy_ enable/disable multiprocess build +- _buildPath_ directory where the intermediary object files are stored +- _key_ secret key to log on the `spm` registry +- _testflags_ compile flags for tests + +When musl libc is installed on the system, configure sheepy to link against musl libc like this: + +``` + cflags: -ggdb -std=gnu11 -fPIC -pipe -specs "/usr/local/musl/lib/musl-gcc.specs" + # statically link musl libc + lflags: -static -specs "/usr/local/musl/lib/musl-gcc.specs" + # dynamically link musl libc + #lflags: -specs "/usr/local/musl/lib/musl-gcc.specs" +``` + +The commands for installing musl libc are: + +``` +git clone git://git.musl-libc.org/musl +cd musl +./configure +make +sudo make install +``` + +Then libsheepy has to be compiled using the musl libc headers, see [README.md](https://spartatek.se/r/libsheepy/file/README.md.html) in the libsheepy repo. + +# Dependencies + +`sheepy` and `spm` have some external dependencies: +- GCC 4.9 or clang +- Optionally gold linker, this can be disabled in the configuration (~/.sheepy/config.yml) +- curl (`spm`) +- tar (`spm`) +- gzip or pigz (`spm`) + +# Starting a new project + +With `sheepy`: + +``` +sheepy -n example + +# run: +./example.c +``` + +To create new packages with `spm`: + +``` +spm new example1 examples2 + +# run: +cd example1 +./example1.c +``` + +# Compilation + +To get help, run: +``` +sheepy -h +``` + +To run a program: + +``` +sheepy <C_SOURCE> +``` + +To run as a script, add a hashbang at the top of the main c file: +``` +#! /usr/bin/env sheepy +``` + +`libsheepy.a` is always linked and `pthread` is always enabled. + +minimal C source: + +```c +#! /usr/bin/env sheepy +int main(int ARGC, char** ARGV) { +} +``` + +## Compilation errors + +In some linux distributions (RHEL), this error occurs: + +``` +...git/libsheepy/release/libsheepy.a(libsheepy.o): In function `getMonotonicTime': +...git/libsheepy/release/libsheepy.c:50790: undefined reference to `clock_gettime' +``` + +To solve this error, add __-lrt__ in compileSheepy.sh and in ~/.sheepy/config.yml in lflags + +# Packages + +To get help, run: +``` +spm help +``` + +To install a package: + +``` +sudo spm -g install sheepyExamples +sudo spm -g install md +``` + +The `searchReplace` requires libpcre to compile successfully, to install pcre: + +``` +sudo apt-get install libpcre3-dev +``` + +To create a new package: + +``` +spm new packageName +cd packageName +``` + +# Compiling multiple source files + +sheepy doesn't use makefiles, it scans the `#include` lines in the source code to figure out what to compile. + +When an _include_ statement is found, sheepy searches for a C source file with the same name changing the extension from .h to .c. +For includes in installed packages, the source files are already in the static library so the library is statically linked. + +For example, main.c: + +```c +#include "libsheepyObject.h" +#include "test.h" +#include "shpPackages/apkg/apkg.h" +int main(int c, char **a) { + XSUCCESS; +} +``` +sheepy compiles main.c, test.c if it exists and statically link libapkg.a. + +# Creating classes + +As seen in previously `sheepy -n name` generates a new main file. `sheepy -C className` generates the files for a class called _className_ + +In order to use the class, simply add `#include "className.h"` in a source file. + +The class templates has the methods inherited from the `baset` class, all the sheepy classes inherit from the `baset` class. The template has `TODO` comments showing how to extend the class. + +# Unit tests and memcheck + +sheepy and spm have commands for generating unit test and memcheck (valgrind) templates. The following is the instructions to generate and run the tests for <package name>: + +Create <package name> and edit package.yml to enable the tests: + +``` +spm new <package name> +cd <package name> +vi package.yml +``` + +Uncomment: `testBin`, `testCflags`, `testLflags`, `memcheckBin`, `memcheckCflags`, `memcheckLflags` and add the compilation flags as necessary + +Generate the test templates: + +``` +sheepy -T +``` + +Add the tests in test<Package name>.c + +Run the tests: + +Unit tests: +``` +spm test +``` + +Memcheck: +``` +./test<Package name>Mem.sh +``` diff --git a/genMake.c b/genMake.c @@ -0,0 +1,187 @@ +// +#include <stdio.h> +#include <stdint.h> +#include <stdbool.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <string.h> +#include <unistd.h> + +ssize_t fileSize(const char *filePath) { + struct stat st; + + int r = stat(filePath, &st);; + if (r) { + return(-1); + } + + // macOS returns a varying number a number above the constant below + // when the file doesnt exists + if ((uint64_t)(st.st_size) > 140734000000000) { + return(-1);//LCOV_EXCL_LINE + } + return(st.st_size); +} + +void *readFileToS(const char *filePath) { + FILE *f = NULL; + void *r = NULL; + ssize_t len; + size_t readStatus; + + len = fileSize(filePath);; + + // +1 to add \0 at the end + r = malloc(len+1); + if (!r) { + return(NULL); + } + + f = fopen(filePath, "r"); + readStatus = fread(r, 1, len , f); + fclose(f); + + if (readStatus != (size_t)len) { + return(NULL); + } + + *((char*)r+len) = 0; + + return(r); +} + +int iReplaceS(char **s, const char *olds, const char *news, size_t max ) { + char *r = NULL; + char *tmp = NULL; + char *workingS = NULL; + // ins is next insert point + char *ins = NULL; + size_t count; + size_t lfront; + bool freeNewsStatus = false;; + char *internalNews = NULL; + + // sanity checks and initialization + // count the number of replacements needed + // allocate result + // replace olds with news + // copy end of string + + size_t lolds; + lolds = strlen(olds); + if (!lolds) { + // empty olds causes infinite loop + return(-1); + } + internalNews = (char *) news; + + // count the number of replacements needed + ins = workingS = *s; + for (count = 0 ; (tmp = strstr(ins, olds)) ; ++count) { + ins = tmp + lolds; + if (max && (count == max)) { + // the maximum number is replacements is reached, stop + break; + } + } + + + size_t lnews; + lnews = strlen(internalNews); + + // allocate result + size_t rLen = strlen(*s) + (lnews - lolds) * count + 1;; + tmp = r = malloc(rLen); + if (!r) { + if (freeNewsStatus) { + free(internalNews); + } + return(-1); + } + + // replace olds with news + // ins points to the start of olds in s + // tmp is the front of s, tmp points the end of s front in r + // copy news to tmp, tmp points the end of news in r + // s is the remainder of s after end of olds + while (count--) { + ins = strstr(workingS, olds); + lfront = ins - workingS; + tmp = strncpy(tmp, workingS, lfront) + lfront; + tmp = strcpy(tmp, internalNews) + lnews; + workingS += lfront + lolds; + } + + // copy end of string + strcpy(tmp, workingS); + if (freeNewsStatus) { + free(internalNews); + } + + free(*s); + *s = r; + return(0); +} + +int writeFileS(const char *filePath, char *string) { + FILE *f = NULL; + size_t len; + size_t writeStatus; + + len = strlen(string); + + f = fopen(filePath, "w"); + writeStatus = fwrite(string, 1, len , f); + fclose(f); + + if (writeStatus != len) { + return(-1); + } + + return(0); +} + +bool fileExists(const char *filePath) { + + int r = access(filePath, F_OK); + //if r + // perror("fileExists error"); + // dont print error because this is a test + return(r != -1); +} + +int main(int ARGC, char** ARGV) { + +#if TERMUX + + puts("ARM cpu Termux"); + // define __arm__ + char *m = readFileToS("src/compileSheepy.sh"); + iReplaceS(&m, "gcc", "gcc -D__TERMUX__=1 -D__arm__=1", 1); + writeFileS("src/compileSheepy.sh", m); + free(m); + +#endif // __APPLE__ + +#if __APPLE__ + + // not needed + /* // Compile with gcc in MacOS */ + /* char *m = readFileToS("src/compileSheepy.sh"); */ + /* iReplaceS(&m, "gcc", "gcc-6", 1); */ + /* writeFileS("src/compileSheepy.sh", m); */ + /* free(m); */ + +#else // #if __APPLE__ + // check if the os is alpine linux because the libc in alpine is musl + if (fileExists("/etc/alpine-release")) { + puts("alpine linux detected, add define MUSL_LIBC=1 in compileSheepy.sh"); + + char *M = readFileToS("src/compileSheepy.sh"); + iReplaceS(&M, "gcc", "gcc -DMUSL_LIBC=1", 1); + writeFileS("src/compileSheepy.sh", M); + free(M); + } +#endif // __APPLE__ + +} diff --git a/homeInstall.sh b/homeInstall.sh @@ -0,0 +1,38 @@ +# +# build and install libsheepy +# build and install sheepy +# build and install spm +# + +a=`pwd` +cd .. +git clone https://spartatek.se/git/libsheepy.git +cd libsheepy +git pull +source ./homeMake.sh +cd $a + +# configure and build sheepy +gcc -o genMake genMake.c +./genMake +rm genMake + +cd src +./compileSheepy.sh ../../libsheepy/release ../../libsheepy/release +mkdir ~/bin/ +cp sheepy ~/bin/ +export PATH=~/bin/:$PATH +sheepy +sed -i 's/\/usr\/local/\~\//g' ~/.sheepy/config.yml +sheepy -h +./compileSpm.sh +cp spm ~/bin/ + +# reset build scripts +git checkout compileSheepy.sh + +echo sheepy and spm are installed in ~/bin/ +echo Add this line in your startup script: +echo export PATH=~/bin/:\$PATH +echo or +echo setenv PATH ~/bin/:\$PATH diff --git a/install.sh b/install.sh @@ -0,0 +1,27 @@ +# +# build and install libsheepy +# build and install sheepy +# build and install spm +# + +a=`pwd` +cd .. +git clone https://spartatek.se/git/libsheepy.git +cd libsheepy +git pull +./make.sh +cd $a + +# configure and build sheepy +gcc -o genMake genMake.c +./genMake +rm genMake + +cd src +./compileSheepy.sh /usr/local/lib /usr/local/include +cp sheepy /usr/local/bin/ +./compileSpm.sh +cp spm /usr/local/bin/ + +# reset build scripts +git checkout compileSheepy.sh diff --git a/installHaiku.sh b/installHaiku.sh @@ -0,0 +1,33 @@ +# +# build and install libsheepy +# build and install sheepy +# build and install spm +# + +a=`pwd` +cd .. +git clone https://spartatek.se/git/libsheepy.git +cd libsheepy +git pull +./make.sh +cd $a + +# configure and build sheepy +gcc -o genMake genMake.c +./genMake +rm genMake + +cd src +./compileSheepyHaiku.sh ~/libsheepy/release ~/libsheepy/release +cp sheepy /boot/home/config/non-packaged/bin/ + +echo "export LIBSHEEPY=/boot/home/libsheepy/release/" >> ~/.bashrc +source ~/.bashrc + +./compileSpm.sh +cp spm /boot/home/config/non-packaged/bin/ + +mkdir /boot/home/config/non-packaged/shpPackages + +# reset build scripts +git checkout compileSheepy.sh diff --git a/installOpenIndiana.sh b/installOpenIndiana.sh @@ -0,0 +1,27 @@ +# +# build and install libsheepy +# build and install sheepy +# build and install spm +# + +a=`pwd` +cd .. +git clone https://spartatek.se/git/libsheepy.git +cd libsheepy +git pull +./makeOpenIndiana.sh +cd $a + +# configure and build sheepy +gcc -o genMake genMake.c +./genMake +rm genMake + +cd src +./compileSheepy.sh /usr/lib /usr/include +cp sheepy /usr/bin/ +./compileSpm.sh +cp spm /usr/bin/ + +# reset build scripts +git checkout compileSheepy.sh diff --git a/installTermux.sh b/installTermux.sh @@ -0,0 +1,27 @@ +# +# build and install libsheepy +# build and install sheepy +# build and install spm +# + +cd .. +git clone https://spartatek.se/git/libsheepy.git +cd libsheepy +git pull +./makeTermux.sh +cd ../sheepy + +# configure and build sheepy +# clang/termux doesnt define __arm__ +gcc -DTERMUX=1 -D__arm__=1 -o genMake genMake.c +./genMake +rm genMake + +cd src +./compileSheepy.sh /data/data/com.termux/files/usr/lib /data/data/com.termux/files/usr/include +cp sheepy /data/data/com.termux/files/usr/bin/ +./compileSpm.sh +cp spm /data/data/com.termux/files/usr/bin/ + +# reset build scripts +git checkout compileSheepy.sh diff --git a/make.sh b/make.sh @@ -0,0 +1,3 @@ +cd src +./compileSheepy.sh /usr/local/lib /usr/local/include +./compileSpm.sh diff --git a/src/common.c b/src/common.c @@ -0,0 +1,261 @@ +// MIT License +// +// Copyright (c) 2019 Remy Noulin +// +// 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 "libsheepyObject.h" +#include "common.h" + +#define internal static + +#include <stdio.h> +#include <dirent.h> +#include <string.h> +#include <sys/wait.h> +#include <stdlib.h> +#include <unistd.h> + +#if (!(__arm__ || __APPLE__ || __FreeBSD__ || __TERMUX__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __sun__)) +#elif (__TERMUX__) +#elif ((__HAIKU__)) +#else +#endif +smallJsont *loadSheepyConfig(char **homedir); +void sourceFromTemplate(const char *filename); +void pkgFromTemplate(const char *pkgname); +void spawnProc(cbFt cb, void *arg); +void waitForJobs(void); +void childProc(void *arg); +char* findLocalPackageDir(smallDictt* cfgD); + +/** + * \file + * common functions and data + */ + +#if (!(__arm__ || __APPLE__ || __FreeBSD__ || __TERMUX__ || __OpenBSD__ || __DragonFly__ || MUSL_LIBC || __sun__)) +char *defaultSpC = CONFIG_YML; +#elif (__TERMUX__) +// gold doesn't work in raspbian - deactivate +// define __arm__ +char *defaultSpC = CONFIG_YML_NO_GOLD_ARM; +#elif ((__HAIKU__)) +// gold doesn't work in raspbian - deactivate +// remove -rdynamic +// install in /boot/home/config/non-packaged +char *defaultSpC = CONFIG_YML_HAIKU; +#else +// gold doesn't work in raspbian - deactivate +char *defaultSpC = CONFIG_YML_NO_GOLD; +#endif + +//^^ __arm__ +/** + * child process list compiling the code + */ +jobst jobs; + +/** + * load ~/.sheepy/config.yml + * if config.yml doesn't exists, create a default config + * + * \return + * homedir real sheepy home path + * json configuration + */ +smallJsont *loadSheepyConfig(char **homedir) { + char *dum = NULL; + + // Steps + // create homedir and default configuration + // load sheepy configuration + + // create homedir + *homedir = expandHomeG(HOME_DIR); + char *file = catS(*homedir, CONFIG_NAME); + if (!fileExists(*homedir) || !fileExists(file)) { + mkdirParents(*homedir); + writeFileG(defaultSpC, file); + } + + // load sheepy configuration + createAllocateSmallJson(cfgJ); + readFileG(cfgJ, file); + free(file); + return(cfgJ); +} + +void sourceFromTemplate(const char *filename) { + + if (!filename || isBlankG(filename)) { + return; + } + + char *fn; + if (endsWithG(filename, ".c")) { + fn = strdup(filename); + } + else { + fn = appendG(filename, ".c"); + } + + if (fileExists(fn)) { + printf(BLD RED "%s already exists. Current path: ", fn); + char *s = getCwd();; + logNFree(s); + puts(RST); + free(fn); + return; + } + + writeFileG(C_TEMPLATE, fn); + fileChmod(fn, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + + free(fn); +} + + + +void pkgFromTemplate(const char *pkgname) { + + if (!pkgname || isBlankG(pkgname)) { + return; + } + + if (fileExists(PACKAGE)) { + printf(BLD RED "%s already exists. Current path: ", PACKAGE); + char *s = getCwd();; + logNFree(s); + puts(RST); + return; + } + + char *testname = dupG(pkgname);; + toUpper(testname[0]); + char *memcheckname = dupG(testname);; + iPrependS(&testname, "test"); + iPrependS(&memcheckname, "memcheck"); + + char *t = replaceManyS(PKG_TEMPLATE, "<PKG_NAME>", pkgname, "<TEST_NAME>", testname, "<MEMCHECK_NAME>", memcheckname);; + + writeFileG(t, PACKAGE); + freeManyS(testname, memcheckname, t); +} + +/** + * spawn a child process and add to the list + */ +void spawnProc(cbFt cb, void *arg) { + pid_t pid; + int status; + + staticArrayPush(jobs) + staticArrayLast(jobs).pid = fork(); + switch (staticArrayLast(jobs).pid) { + case -1: + perror("spawnProc error: "); + XFAILURE + case 0: + cb(arg); + perror("spawnProc error: "); + XFAILURE + default: + break; + } + + return; +} + +/** + * wait for all child processes to finish + */ +void waitForJobs(void) { + + range(i, staticArrayCount(jobs)) { + if (waitpid(staticArrayGet(jobs,i).pid, &(staticArrayGet(jobs,i).status), 0) == -1) { + printf("couldn't wait for child %d\n", jobs.list[i].pid); { + XFAILURE + } + } + + #ifdef __HAIKU__ + if (WEXITSTATUS(staticArrayGet(jobs,i).status) || WTERMSIG(staticArrayGet(jobs,i).status)) { + puts("subprocess trouble, check output"); + XFAILURE + } + #else + if (WEXITSTATUS(staticArrayGet(jobs,i).status) || WTERMSIG(staticArrayGet(jobs,i).status) || WCOREDUMP(staticArrayGet(jobs,i).status)) { + puts("subprocess trouble, check output"); + XFAILURE + } + #endif + } +} + +void childProc(void *arg) { + char **args = NULL; + char **userArgs = NULL; + + userArgs = (char **) arg; + + //listPrintS(userArgs); + + execvp(userArgs[0], userArgs); + perror("failed to start: "); + puts(userArgs[0]); + XFAILURE +} + + +char* findLocalPackageDir(smallDictt* cfgD) { + + char *localPackageDir = PACKAGE_DIR; + + if (!isDirG(PACKAGE_DIR)) { + // search in parent directories + char *cwd = getCwd(); + char **spl = splitG(cwd, '/'); + while (!isBlankG(spl)) { + char *p = joinG(spl, '/');; + iAppendManyS(&p, "/", PACKAGE_DIR); + if (isDir(p)) { + localPackageDir = p; + break; + } + //logVarG(p); + free(p); + delG(&spl, -1, 0); + } + freeG(spl); + free(cwd); + + // ignore found dir if it is the global package dir + char *packageDir = catS(getG(cfgD, rtChar, "system") , "/", PACKAGE_DIR); + normalizePathG(&packageDir); + expandHomeG(&packageDir); + if (eqG(localPackageDir, packageDir)) { + // revert to default package dir, the local package dir cant be the global package dir + free(localPackageDir); + localPackageDir = PACKAGE_DIR; + } + free(packageDir); + } + return(localPackageDir); +} diff --git a/src/common.h b/src/common.h @@ -0,0 +1,227 @@ +// MIT License +// +// Copyright (c) 2019 Remy Noulin +// +// 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 _commonH +#define _commonH +#include "libsheepyObject.h" + +#define HOME_DIR "~/.sheepy/" +// HOME_DIR/build is the folder for building + +#define CONFIG_NAME "config.yml" + +#define CONFIG_YML "---\n"\ + " tcc: false\n"\ + " print_compile_commands: false\n"\ + " clean_exe: true # when true sheepy -d deletes the executable or libraries\n"\ + " system: /usr/local # spm -g install the packages in this folder under shpPackages and bin\n"\ + " cflags: -g3 -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " lflags: -rdynamic # these flags are overriden by package.yml\n"\ + " linkWithGold: true\n"\ + " 32bit: false\n"\ + " parallelSheepy: 1 # optional, 0 to disable, default is 1\n"\ + " parallelSpm: 1 # optional, 0 to disable, default is 1\n"\ + " #cflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The test* are the options for building the test (sheepy -t, testBin in package.yml)\n"\ + " # gcov is enabled and the unit tests are done with check (apt-get install check, #include <check>)\n"\ + " testCflags: -ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra # these flags are overriden by package.yml\n"\ + " testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic # these flags are overriden by package.yml\n"\ + " testLinkWithGold: true\n"\ + " #testCflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The memcheck* are the options for building the memory leak tests (sheepy -m, memcheckBin in package.yml)\n"\ + " memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all\n"\ + " memcheckCflags: -ggdb -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " memcheckLflags: -rdynamic # these flags are overriden by package.yml\n"\ + " memcheckLinkWithGold: true\n"\ + " key: uninitialized" + +#define CONFIG_YML_NO_GOLD "---\n"\ + " tcc: false\n"\ + " print_compile_commands: false\n"\ + " clean_exe: true # when true sheepy -d deletes the executable or libraries\n"\ + " system: /usr/local # spm -g install the packages in this folder under shpPackages and bin\n"\ + " cflags: -ggdb -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " lflags: -rdynamic # these flags are overriden by package.yml\n"\ + " linkWithGold: false\n"\ + " 32bit: false\n"\ + " parallelSheepy: 1 # optional, 0 to disable, default is 1\n"\ + " parallelSpm: 1 # optional, 0 to disable, default is 1\n"\ + " #cflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The test* are the options for building the test (sheepy -t, testBin in package.yml)\n"\ + " # gcov is enabled and the unit tests are done with check (apt-get install check, #include <check>)\n"\ + " testCflags: -ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra # these flags are overriden by package.yml\n"\ + " testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic # these flags are overriden by package.yml\n"\ + " testLinkWithGold: false\n"\ + " #testCflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The memcheck* are the options for building the memory leak tests (sheepy -m, memcheckBin in package.yml)\n"\ + " memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all\n"\ + " memcheckCflags: -ggdb -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " memcheckLflags: -rdynamic # these flags are overriden by package.yml\n"\ + " memcheckLinkWithGold: false\n"\ + " key: uninitialized" + +#define CONFIG_YML_NO_GOLD_ARM "---\n"\ + " tcc: false\n"\ + " print_compile_commands: false\n"\ + " clean_exe: true # when true sheepy -d deletes the executable or libraries\n"\ + " system: /data/data/com.termux/files/usr # spm -g install the packages in this folder under shpPackages and bin\n"\ + " cflags: -D__arm__=1 -ggdb -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " lflags: -rdynamic # these flags are overriden by package.yml\n"\ + " linkWithGold: false\n"\ + " 32bit: false\n"\ + " parallelSheepy: 1 # optional, 0 to disable, default is 1\n"\ + " parallelSpm: 1 # optional, 0 to disable, default is 1\n"\ + " #cflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The test* are the options for building the test (sheepy -t, testBin in package.yml)\n"\ + " # gcov is enabled and the unit tests are done with check (apt-get install check, #include <check>)\n"\ + " testCflags: -ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra # these flags are overriden by package.yml\n"\ + " testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic # these flags are overriden by package.yml\n"\ + " testLinkWithGold: false\n"\ + " #testCflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The memcheck* are the options for building the memory leak tests (sheepy -m, memcheckBin in package.yml)\n"\ + " memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all\n"\ + " memcheckCflags: -ggdb -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " memcheckLflags: -rdynamic # these flags are overriden by package.yml\n"\ + " memcheckLinkWithGold: false\n"\ + " key: uninitialized" + +#define CONFIG_YML_HAIKU "---\n"\ + " tcc: false\n"\ + " print_compile_commands: false\n"\ + " clean_exe: true # when true sheepy -d deletes the executable or libraries\n"\ + " system: /boot/home/config/non-packaged # spm -g install the packages in this folder under shpPackages and bin\n"\ + " cflags: -ggdb -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " lflags: # these flags are overriden by package.yml\n"\ + " linkWithGold: false\n"\ + " 32bit: false\n"\ + " parallelSheepy: 1 # optional, 0 to disable, default is 1\n"\ + " parallelSpm: 1 # optional, 0 to disable, default is 1\n"\ + " #cflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The test* are the options for building the test (sheepy -t, testBin in package.yml)\n"\ + " # gcov is enabled and the unit tests are done with check (apt-get install check, #include <check>)\n"\ + " testCflags: -ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra # these flags are overriden by package.yml\n"\ + " testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic # these flags are overriden by package.yml\n"\ + " testLinkWithGold: false\n"\ + " #testCflagsAlways: # these flags will always be present, independent of package.yml\n"\ + " # The memcheck* are the options for building the memory leak tests (sheepy -m, memcheckBin in package.yml)\n"\ + " memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all\n"\ + " memcheckCflags: -ggdb -std=gnu11 -fPIC -pipe # these flags are overriden by package.yml\n"\ + " memcheckLflags: -rdynamic # these flags are overriden by package.yml\n"\ + " memcheckLinkWithGold: false\n"\ + " key: uninitialized" + +extern char *defaultSpC; + +#define PACKAGE_DIR "shpPackages" + +// package information +#define PACKAGE "package.yml" + + +#define C_TEMPLATE "#! /usr/bin/env sheepy\n\ +/* or direct path to sheepy: #! /usr/local/bin/sheepy */\n\ +\n\ +/* Libsheepy documentation: https://spartatek.se/libsheepy/ */\n\ +#include \"libsheepyObject.h\"\n\ +\n\ +int argc; char **argv;\n\ +\n\ +/* enable/disable logging */\n\ +/* #undef pLog */\n\ +/* #define pLog(...) */\n\ +\n\ +int main(int ARGC, char** ARGV) {\n\ +\n\ + argc = ARGC; argv = ARGV;\n\ +\n\ + initLibsheepy(ARGV[0]);\n\ + setLogMode(LOG_VERBOSE);\n\ + //setLogSymbols(LOG_UTF8);\n\ + //disableLibsheepyErrorLogs;\n\ +\n\ + logI(\"C template\");\n\ +\n\ +}\n\ +// vim: set expandtab ts=2 sw=2:" + +#define PKG_TEMPLATE "---\n\ + name: <PKG_NAME>\n\ + version: 0.0.1\n\ + description: \"explanation\"\n\ + bin: ./<PKG_NAME>.c\n\ + #cflags: -DA -ggdb -std=gnu11 -fPIC -pipe\n\ + #lflags: -lpcre\n\ + repository:\n\ + type: git\n\ + url: git+https://github.com/USER/<PKG_NAME>.git\n\ + keywords:\n\ + #- utility\n\ + - command\n\ + author: Anonymous\n\ + license: MIT\n\ + bugs:\n\ + url: https://github.com/USER/<PKG_NAME>/issues\n\ + homepage: https://github.com/USER/<PKG_NAME>#readme\n\ + #compileHelp: # text displayed when there is a compilation error\n\ + #dependencies:\n\ + # md4c: \n\ + # Test configuration:\n\ + #testBin: ./<TEST_NAME>.c\n\ + #testCflags: -ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra\n\ + #testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic\n\ + # Memcheck configuration:\n\ + #memcheckBin: ./<MEMCHECK_NAME>.c\n\ + #memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all\n\ + #memcheckCflags: -ggdb -std=gnu11 -fPIC -pipe\n\ + #memcheckLflags: -rdynamic\n\ + #documentationCmd: # command for generating the documentation with spm doc\n\ + private: false # true for private package\ +" + +smallJsont *loadSheepyConfig(char **homedir); +void sourceFromTemplate(const char *filename); +void pkgFromTemplate(const char *pkgname); + +typedef void (*cbFt)(void *); +void spawnProc(cbFt cb, void *arg); +void waitForJobs(void); +void childProc(void *arg); + +char* findLocalPackageDir(smallDictt* cfgD); + +typedef struct { + pid_t pid; + int status; +} job; + +#define MAX_JOBS 10000 +staticArrayT(jobst, job, MAX_JOBS) +extern jobst jobs; + +typedef struct { + struct stat st; + /** source/header file path */ + char *fpath; + /** build path */ + char *bpath; +} srcFilet; + +#endif // #ifndef _commonH diff --git a/src/compileSheepy.sh b/src/compileSheepy.sh @@ -0,0 +1 @@ +gcc -g3 -std=gnu11 -DQUEX_SETTING_BUFFER_MIN_FALLBACK_N=0 -rdynamic -o sheepy sheepy.c common.c parser/EasyLexer.c parser/parser.c $1/libsheepy.a -I $2 -pthread diff --git a/src/compileSheepyHaiku.sh b/src/compileSheepyHaiku.sh @@ -0,0 +1 @@ +gcc -ggdb -std=gnu11 -DQUEX_SETTING_BUFFER_MIN_FALLBACK_N=0 -o sheepy sheepy.c common.c parser/EasyLexer.c parser/parser.c $1/libsheepy.a -I $2 diff --git a/src/compileSpm.sh b/src/compileSpm.sh @@ -0,0 +1 @@ +sheepy -c spm.c diff --git a/src/parser/Accumulator b/src/parser/Accumulator @@ -0,0 +1,69 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * + * (C) 2004-2009 Frank-Rene Schaefer + * + * __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR may be undefined in case + * that multiple lexical analyzers are used. Then, the name of the + * QUEX_NAME(Accumulator) must be different. */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR +#define __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR + + +#include "definitions" + + +QUEX_NAMESPACE_MAIN_OPEN + +# ifdef __QUEX_OPTION_PLAIN_C + QUEX_TYPE0_ANALYZER; +# else + class QUEX_TYPE0_ANALYZER; +# endif + + /* (*) pure text accumulation and flushing */ + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { +# ifdef QUEX_OPTION_LINE_NUMBER_COUNTING + size_t _begin_line; +# endif +# ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING + size_t _begin_column; +# endif + + struct { + QUEX_TYPE_LEXATOM* begin; + QUEX_TYPE_LEXATOM* end; + QUEX_TYPE_LEXATOM* memory_end; + } text; + QUEX_TYPE_ANALYZER* the_lexer; + + } QUEX_NAME(Accumulator); + + QUEX_INLINE void + QUEX_NAME(Accumulator_init_memory)(QUEX_NAME(Accumulator)* me); + + QUEX_INLINE void + QUEX_NAME(Accumulator_construct)(QUEX_NAME(Accumulator)*, QUEX_TYPE_ANALYZER*); + + QUEX_INLINE void + QUEX_NAME(Accumulator_destruct)(QUEX_NAME(Accumulator)* me); + + QUEX_INLINE bool + QUEX_NAME(Accumulator_extend)(QUEX_NAME(Accumulator)* me, size_t MinAddSize); + + QUEX_INLINE void + QUEX_NAME(Accumulator_clear)(QUEX_NAME(Accumulator)* me); + + QUEX_INLINE void + QUEX_NAME(Accumulator_add)(QUEX_NAME(Accumulator)* me, + const QUEX_TYPE_LEXATOM* Begin, const QUEX_TYPE_LEXATOM* End); + + QUEX_INLINE void + QUEX_NAME(Accumulator_add_character)(QUEX_NAME(Accumulator)* me, + const QUEX_TYPE_LEXATOM Character); + + QUEX_INLINE void + QUEX_NAME(Accumulator_print_this)(QUEX_NAME(Accumulator)* me); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR */ diff --git a/src/parser/Accumulator.i b/src/parser/Accumulator.i @@ -0,0 +1,196 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * + * (C) 2005-2009 Frank-Rene Schaefer + * + * __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR may be undefined in case + * that multiple lexical analyzers are used. Then, the name of the + * QUEX_NAME(Accumulator) must be different. */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR_I + +#include "definitions" +#include "Accumulator" +#include "MemoryManager" +#include "TokenPolicy" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_NAME(Accumulator_construct)(QUEX_NAME(Accumulator)* me, + QUEX_TYPE_ANALYZER* lexer) +{ + me->the_lexer = lexer; + QUEX_NAME(Accumulator_init_memory)(me); + __QUEX_IF_COUNT_LINES(me->_begin_line = 0); + __QUEX_IF_COUNT_COLUMNS(me->_begin_column = 0); +} + + +QUEX_INLINE void +QUEX_NAME(Accumulator_destruct)(QUEX_NAME(Accumulator)* me) +{ + if( me->text.begin ) { + QUEXED(MemoryManager_free)((void*)me->text.begin, + E_MemoryObjectType_TEXT); + } + me->the_lexer = 0x0; + me->text.begin = 0x0; + me->text.end = 0x0; + me->text.memory_end = 0x0; +} + +QUEX_INLINE void +QUEX_NAME(Accumulator_init_memory)(QUEX_NAME(Accumulator)* me) +{ + if( QUEX_SETTING_ACCUMULATOR_INITIAL_SIZE == 0 ) { + me->text.begin = 0x0; + } + else { + me->text.begin = \ + (QUEX_TYPE_LEXATOM*) + QUEXED(MemoryManager_allocate)( + QUEX_SETTING_ACCUMULATOR_INITIAL_SIZE * sizeof(QUEX_TYPE_LEXATOM), + E_MemoryObjectType_TEXT); + if( ! me->text.begin ) { + QUEX_ERROR_EXIT("Quex engine: out of memory--cannot allocate Accumulator."); + } + } + me->text.end = me->text.begin; + me->text.memory_end = me->text.begin + QUEX_SETTING_ACCUMULATOR_INITIAL_SIZE; +} + +QUEX_INLINE bool +QUEX_NAME(Accumulator_extend)(QUEX_NAME(Accumulator)* me, size_t MinAddSize) +{ + const size_t OldContentSize = (size_t)(me->text.end - me->text.begin); + const size_t Size = (size_t)(me->text.memory_end - me->text.begin); + const size_t AddSize = (size_t)((float)Size * (float)QUEX_SETTING_ACCUMULATOR_GRANULARITY_FACTOR); + const size_t NewSize = Size + (AddSize < MinAddSize ? MinAddSize : AddSize); + + QUEX_TYPE_LEXATOM* chunk = \ + (QUEX_TYPE_LEXATOM*) + QUEXED(MemoryManager_allocate)(NewSize*sizeof(QUEX_TYPE_LEXATOM), + E_MemoryObjectType_TEXT); + + if( chunk == 0x0 ) return false; + + __quex_assert(me->text.end >= me->text.begin); + __quex_assert(me->text.memory_end >= me->text.begin); + + __QUEX_STD_memcpy(chunk, me->text.begin, sizeof(QUEX_TYPE_LEXATOM) * Size); + + QUEXED(MemoryManager_free)((void*)me->text.begin, E_MemoryObjectType_TEXT); + + me->text.begin = chunk; + me->text.end = chunk + OldContentSize; + me->text.memory_end = chunk + NewSize; + return true; +} + +QUEX_INLINE void +QUEX_NAME(Accumulator_clear)(QUEX_NAME(Accumulator)* me) +{ + /* If no text is to be flushed, return undone */ + if( me->text.begin == me->text.end ) return; + me->text.end = me->text.begin; +} + +QUEX_INLINE void +QUEX_NAME(Accumulator_add)(QUEX_NAME(Accumulator)* me, + const QUEX_TYPE_LEXATOM* Begin, const QUEX_TYPE_LEXATOM* End) +{ + const size_t L = (size_t)(End - Begin); + __quex_assert(End > Begin); + + /* If it is the first string to be appended, the store the location */ +# ifdef __QUEX_OPTION_COUNTER + if( me->text.begin == me->text.end ) { + __QUEX_IF_COUNT_COLUMNS(me->_begin_column = me->the_lexer->counter._column_number_at_begin); + __QUEX_IF_COUNT_LINES(me->_begin_line = me->the_lexer->counter._line_number_at_begin); + } +# endif + + /* Ensure, that there is one more cell between end and .memory_end to store + * the terminating zero for flushing or printing. */ + if( me->text.memory_end <= me->text.end + L ) { + /* L + 1 we need space for the string + the terminating zero */ + if( QUEX_NAME(Accumulator_extend)(me, L + 1) == false ) { + QUEX_ERROR_EXIT("Quex Engine: Out of Memory. Accumulator could not be further extended.\n"); + } + } + + __QUEX_STD_memcpy(me->text.end, Begin, L * sizeof(QUEX_TYPE_LEXATOM)); + me->text.end += L; +} + + +QUEX_INLINE void +QUEX_NAME(Accumulator_add_character)(QUEX_NAME(Accumulator)* me, + const QUEX_TYPE_LEXATOM Character) +{ + /* If it is the first string to be appended, the store the location */ +# ifdef __QUEX_OPTION_COUNTER + if( me->text.begin == me->text.end ) { + __QUEX_IF_COUNT_COLUMNS(me->_begin_column = me->the_lexer->counter._column_number_at_begin); + __QUEX_IF_COUNT_LINES(me->_begin_line = me->the_lexer->counter._line_number_at_begin); + } +# endif + + /* Ensure, that there is one more cell between end and .memory_end to store + * the terminating zero for flushing or printing. */ + if( me->text.memory_end <= me->text.end + 1 ) { + /* 1 + 1 we need space for the character + the terminating zero */ + if( QUEX_NAME(Accumulator_extend)(me, 2) == false ) { + QUEX_ERROR_EXIT("Quex Engine: Out of Memory. Accumulator could not be further extended.\n"); + } + } + + *(me->text.end) = Character; + ++(me->text.end); +} + +#if 0 +QUEX_INLINE void +QUEX_NAME(Accumulator_flush)(QUEX_NAME(Accumulator)* me, + const QUEX_TYPE_TOKEN_ID TokenID) +{ + /* All functions must ensure that there is one cell left to store the terminating zero. */ + __quex_assert(me->text.end < me->text.memory_end); + + + /* If no text is to be flushed, return undone */ + if( me->text.begin == me->text.end ) return; + + *(me->text.end) = (QUEX_TYPE_LEXATOM)0; /* see above '__quex_assert()' */ + +# define self (*me->the_lexer) + self_token_set_id(TokenID); + if( QUEX_NAME_TOKEN(take_text)(__QUEX_CURRENT_TOKEN_P, + me->the_lexer, + me->text.begin, + me->text.end) == false ) { + /* The called function does not need the memory chunk, we reuse it. */ + QUEX_NAME(Accumulator_clear)(me); + } else { + /* The called function wants to use the memory, so we get some new. */ + QUEX_NAME(Accumulator_init_memory)(me); + } + QUEX_TOKEN_POLICY_PREPARE_NEXT(); +# undef self +} +#endif + +QUEX_INLINE void +QUEX_NAME(Accumulator_print_this)(QUEX_NAME(Accumulator)* me) +{ + /* All functions must ensure that there is one cell left to store the terminating zero. */ + __quex_assert(me->text.end < me->text.memory_end); + + *(me->text.end) = (QUEX_TYPE_LEXATOM)0; /* see above '__quex_assert()' */ + + __QUEX_STD_printf(" Accumulator = '%s'\n", (const char*)me->text.begin); +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR_I */ diff --git a/src/parser/Buffer.i b/src/parser/Buffer.i @@ -0,0 +1,933 @@ +/* vim:set ft=c: -*- C++ -*- */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_I + +#include "asserts" +#include "bufferAsserts" +#include "definitions" +#include "bufferBuffer" +#include "Buffer_debug.i" +#include "LexatomLoader" +#include "MemoryManager" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE ptrdiff_t QUEX_NAME(Buffer_move_forward)(QUEX_NAME(Buffer)* me, + ptrdiff_t move_distance); +QUEX_INLINE void QUEX_NAME(Buffer_move_forward_undo)(QUEX_NAME(Buffer)* me, + intmax_t move_distance, + ptrdiff_t move_size); +QUEX_INLINE ptrdiff_t QUEX_NAME(Buffer_move_backward)(QUEX_NAME(Buffer)* me, + ptrdiff_t move_distance); + +QUEX_INLINE void* QUEX_NAME(Buffer_fill)(QUEX_NAME(Buffer)* me, + const void* ContentBegin, + const void* ContentEnd); +QUEX_INLINE void QUEX_NAME(Buffer_fill_prepare)(QUEX_NAME(Buffer)* me, + void** begin_p, + const void** end_p); +QUEX_INLINE void QUEX_NAME(Buffer_fill_finish)(QUEX_NAME(Buffer)* me, + const void* FilledEndP); +QUEX_INLINE bool QUEX_NAME(Buffer_is_end_of_stream_inside)(QUEX_NAME(Buffer)* me); +QUEX_INLINE void QUEX_NAME(Buffer_init_content)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_LEXATOM* EndOfFileP); +QUEX_INLINE void QUEX_NAME(Buffer_init_analyzis)(QUEX_NAME(Buffer)* me); + +QUEX_INLINE void QUEX_NAME(Buffer_on_overflow_DEFAULT)(QUEX_NAME(Buffer)*, bool ForwardF); +QUEX_INLINE void QUEX_NAME(Buffer_on_content_change_DEFAULT)(const QUEX_TYPE_LEXATOM*, + const QUEX_TYPE_LEXATOM*); + +QUEX_INLINE void +QUEX_NAME(Buffer_construct)(QUEX_NAME(Buffer)* me, + QUEX_NAME(LexatomLoader)* filler, + QUEX_TYPE_LEXATOM* memory, + const size_t MemorySize, + QUEX_TYPE_LEXATOM* EndOfFileP, + E_Ownership Ownership) +{ + /* Ownership of InputMemory is passed to 'me->_memory'. */ + QUEX_NAME(BufferMemory_construct)(&me->_memory, memory, MemorySize, + Ownership); + + /* By setting begin and end to zero, we indicate to the loader that + * this is the very first load procedure. */ + me->filler = filler; + me->fill = QUEX_NAME(Buffer_fill); + me->fill_prepare = QUEX_NAME(Buffer_fill_prepare); + me->fill_finish = QUEX_NAME(Buffer_fill_finish); + + /* Event handlers. */ + me->on_content_change = QUEX_NAME(Buffer_on_content_change_DEFAULT); + me->on_overflow = QUEX_NAME(Buffer_on_overflow_DEFAULT); + + /* Initialize. */ + QUEX_NAME(Buffer_init_content)(me, EndOfFileP); + QUEX_NAME(Buffer_init_analyzis)(me); + + QUEX_BUFFER_ASSERT_CONSISTENCY(me); +} + +QUEX_INLINE void +QUEX_NAME(Buffer_destruct)(QUEX_NAME(Buffer)* me) +{ + if( me->filler && me->filler->ownership == E_Ownership_LEXICAL_ANALYZER ) { + me->filler->delete_self(me->filler); + } + QUEX_NAME(BufferMemory_destruct)(&me->_memory); +} + +QUEX_INLINE void +QUEX_NAME(Buffer_init_analyzis)(QUEX_NAME(Buffer)* me) +/* Initialize: _read_p + * _lexeme_start_p + * _lexatom_at_lexeme_start + * _lexatom_before_lexeme_start */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + + if( ! me->_memory._front ) { + /* No memory => Analyzer is put into a non-functional state. */ + me->_read_p = (QUEX_TYPE_LEXATOM*)0; + me->_lexeme_start_p = (QUEX_TYPE_LEXATOM*)0; + me->_lexatom_at_lexeme_start = (QUEX_TYPE_LEXATOM)0; +# ifdef __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION + me->_lexatom_before_lexeme_start = (QUEX_TYPE_LEXATOM)0; +# endif + } + else { + /* The first state in the state machine does not increment. + * => input pointer is set to the first position, not before. */ + me->_read_p = BeginP; + me->_lexeme_start_p = BeginP; + me->_lexatom_at_lexeme_start = '\0'; /* Nothing covered. */ +# ifdef __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION + /* When the buffer is initialized, a line begins. Set 'newline'. */ + me->_lexatom_before_lexeme_start = QUEX_SETTING_CHARACTER_NEWLINE_IN_ENGINE_CODEC; +# endif + } +} + +QUEX_INLINE void +QUEX_NAME(Buffer_init_content)(QUEX_NAME(Buffer)* me, QUEX_TYPE_LEXATOM* EndOfFileP) +/* Initialize: input.lexatom_index_begin + * input.lexatom_index_end_of_stream + * input.end_p */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_LEXATOM* EndP = me->_memory._back; + QUEX_TYPE_STREAM_POSITION ci_begin = (QUEX_TYPE_STREAM_POSITION)0; + QUEX_TYPE_STREAM_POSITION ci_end_of_stream = (QUEX_TYPE_STREAM_POSITION)-1; + QUEX_TYPE_LEXATOM* end_p = (QUEX_TYPE_LEXATOM*)0; + (void)EndP; + + if( ! me->_memory._front ) { + ci_end_of_stream = (QUEX_TYPE_STREAM_POSITION)-1; + end_p = (QUEX_TYPE_LEXATOM*)0; + ci_begin = (QUEX_TYPE_STREAM_POSITION)-1; + } + else if( me->filler && me->filler->byte_loader ) { + __quex_assert(! EndOfFileP); + +# if 0 + loaded_n = QUEX_NAME(LexatomLoader_load)(me->filler, BeginP, ContentSize, + 0, &end_of_stream_f, &encoding_error_f); + ci_end_of_stream = ((! loaded_n) || end_of_stream_f) ? loaded_n + : (QUEX_TYPE_STREAM_POSITION)-1; + end_p = &BeginP[loaded_n]; +# endif + /* Setup condition to initiate immediate load when the state machine + * is entered: 'read pointer hits buffer limit code'. */ + ci_begin = (QUEX_TYPE_STREAM_POSITION)0; + ci_end_of_stream = (QUEX_TYPE_STREAM_POSITION)-1; + end_p = &BeginP[0]; + } + else { + __quex_assert(me->_memory._front); /* See first condition. */ + __quex_assert(! EndOfFileP || (EndOfFileP >= BeginP && EndOfFileP <= EndP)); + + if( EndOfFileP ) { + ci_end_of_stream = EndOfFileP - BeginP; + end_p = EndOfFileP; + } + else { + ci_end_of_stream = (QUEX_TYPE_STREAM_POSITION)-1; + end_p = BeginP; + } + } + me->input.lexatom_index_begin = ci_begin; + me->input.lexatom_index_end_of_stream = ci_end_of_stream; + me->input.end_p = end_p; + if( me->input.end_p ) { + *(me->input.end_p) = QUEX_SETTING_BUFFER_LIMIT_CODE; + } + + QUEX_IF_ASSERTS_poison(&me->input.end_p[1], me->_memory._back); +} + +QUEX_INLINE void +QUEX_NAME(Buffer_register_content)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_LEXATOM* EndOfInputP, + QUEX_TYPE_STREAM_POSITION CharacterIndexBegin) +/* Registers information about the stream that fills the buffer and its + * relation to the buffer. + * + * EndOfInputP --> Position behind the last lexatom in the buffer that has + * been streamed. + * '0' --> No change. + * + * CharacterIndexBegin --> Character index of the first lexatom in the + * buffer. + * '-1' --> No change. */ +{ + if( EndOfInputP ) { + __quex_assert(EndOfInputP <= me->_memory._back); + __quex_assert(EndOfInputP > me->_memory._front); + + me->input.end_p = EndOfInputP; + *(me->input.end_p) = QUEX_SETTING_BUFFER_LIMIT_CODE; + } + + if( CharacterIndexBegin != (QUEX_TYPE_STREAM_POSITION)-1 ) { + me->input.lexatom_index_begin = CharacterIndexBegin; + } + + QUEX_IF_ASSERTS_poison(&me->input.end_p[1], me->_memory._back); + /* NOT: assert(QUEX_NAME(Buffer_input_lexatom_index_begin)(me) >= 0); + * This function may be called before content is setup/loaded propperly. */ +} + +QUEX_INLINE void +QUEX_NAME(Buffer_register_eos)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_STREAM_POSITION CharacterIndexEndOfStream) +{ + me->input.lexatom_index_end_of_stream = CharacterIndexEndOfStream; +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_is_empty)(QUEX_NAME(Buffer)* me) +/* RETURNS: true, if buffer does not contain anything. + * false, else. */ +{ + return me->input.end_p == &me->_memory._front[1] + && me->input.lexatom_index_begin == 0; +} + +QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(Buffer_input_lexatom_index_end)(QUEX_NAME(Buffer)* me) +/* RETURNS: Character index of the lexatom to which '.input.end_p' points. + * */ +{ + __quex_assert(me->input.lexatom_index_begin >= 0); + QUEX_BUFFER_ASSERT_pointers_in_range(me); + + return me->input.lexatom_index_begin + + (me->input.end_p - &me->_memory._front[1]); +} + +QUEX_INLINE void +QUEX_NAME(Buffer_read_p_add_offset)(QUEX_NAME(Buffer)* buffer, const size_t Offset) +/* Add offset to '._read_p'. No check applies whether this is admissible. + * */ +{ + QUEX_BUFFER_ASSERT_pointers_in_range(buffer); + buffer->_read_p += Offset; + QUEX_BUFFER_ASSERT_pointers_in_range(buffer); +} + +QUEX_INLINE size_t +QUEX_NAME(Buffer_content_size)(QUEX_NAME(Buffer)* me) +{ + return QUEX_NAME(BufferMemory_size)(&(me->_memory)) - 2; +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_is_end_of_file)(QUEX_NAME(Buffer)* me) +{ + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + if ( me->_read_p != me->input.end_p ) return false; + else if( me->input.lexatom_index_end_of_stream == -1 ) return false; + + return QUEX_NAME(Buffer_input_lexatom_index_end)(me) + == me->input.lexatom_index_end_of_stream; +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_is_end_of_stream_inside)(QUEX_NAME(Buffer)* me) +{ + const ptrdiff_t ContentSize = (ptrdiff_t)QUEX_NAME(Buffer_content_size)(me); + + if ( me->input.lexatom_index_end_of_stream == -1 ) return false; + else if( me->input.lexatom_index_end_of_stream < me->input.lexatom_index_begin ) return false; + + return me->input.lexatom_index_end_of_stream - me->input.lexatom_index_begin < ContentSize; +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_is_begin_of_file)(QUEX_NAME(Buffer)* buffer) +{ + QUEX_BUFFER_ASSERT_CONSISTENCY(buffer); + if ( buffer->_read_p != buffer->_memory._front ) return false; + else if( QUEX_NAME(Buffer_input_lexatom_index_begin)(buffer) ) return false; + else return true; +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_move_and_load_forward)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_STREAM_POSITION NewCharacterIndexBegin, + QUEX_TYPE_STREAM_POSITION MinCharacterIndexInBuffer) +/* RETURNS: true -- if the the buffer could be filled start from + * NewCharacterIndexBegin. + * false, else. + * + * In case, that the loading fails, the buffer is setup as it was BEFORE the call + * to this function. + * + * EXPLANATION: + * + * Before: .-------------------------------------- prev lexatom_index_begin + * : + * | . . . . . . . . .x.x.x.x.x.x.x.x.x.x.x| + * |<---- move size ---->| + * After: |<- move distance | + * .-------------------------------------- new lexatom_index_begin + * : .---------------- prev lexatom index begin + * : : + * |x.x.x.x.x.x.x.x.x.x.x|N.N.N.N.N.N.N. . | + * |- move_size -------->|- loaded_n ->| + * + * Moves the region of size 'Size' from the end of the buffer to the beginning + * of the buffer and tries to load as many lexatoms as possible behind it. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_LEXATOM* EndP = me->_memory._back; + const ptrdiff_t ContentSize = (ptrdiff_t)QUEX_NAME(Buffer_content_size)(me); + QUEX_TYPE_STREAM_POSITION load_lexatom_index; + ptrdiff_t load_request_n; + QUEX_TYPE_LEXATOM* load_p; + ptrdiff_t loaded_n; + intmax_t move_distance; + ptrdiff_t move_size; + bool end_of_stream_f = false; + bool encoding_error_f = false; + + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + __quex_assert(me->input.lexatom_index_begin <= NewCharacterIndexBegin); + __quex_assert(NewCharacterIndexBegin <= MinCharacterIndexInBuffer); + __quex_assert(NewCharacterIndexBegin + ContentSize >= MinCharacterIndexInBuffer ); + + if( me->input.lexatom_index_end_of_stream != -1 + && MinCharacterIndexInBuffer >= me->input.lexatom_index_end_of_stream ) { + /* If the end of the stream is INSIDE the buffer already, then there + * is no need, no chance, of loading more content. */ + return false; + } + + /* Move existing content in the buffer to appropriate position. */ + move_distance = NewCharacterIndexBegin - me->input.lexatom_index_begin; + move_size = QUEX_NAME(Buffer_move_forward)(me, (ptrdiff_t)move_distance); + load_lexatom_index = NewCharacterIndexBegin + move_size; + load_request_n = ContentSize - move_size; + load_p = &BeginP[move_size]; + + __quex_assert(load_lexatom_index == NewCharacterIndexBegin + (load_p - BeginP)); + __quex_assert(load_p >= BeginP); + __quex_assert(&load_p[load_request_n] <= EndP); + (void)EndP; + loaded_n = QUEX_NAME(LexatomLoader_load)(me->filler, load_p, load_request_n, + load_lexatom_index, + &end_of_stream_f, &encoding_error_f); + + if( (! loaded_n) || end_of_stream_f ) { /* End of stream detected. */ + QUEX_NAME(Buffer_register_eos)(me, load_lexatom_index + loaded_n); + } + + /* (3) In case of failure, restore previous buffer content. */ + if( MinCharacterIndexInBuffer >= load_lexatom_index + loaded_n ) { + QUEX_NAME(Buffer_move_forward_undo)(me, move_distance, move_size); + return false; + } + + QUEX_NAME(Buffer_register_content)(me, &load_p[loaded_n], NewCharacterIndexBegin); + return true; +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_move_and_load_backward)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_STREAM_POSITION NewCharacterIndexBegin) +/* Before: + * .------------------------------------- prev lexatom index begin + * : + * |x.x.x.x.x.x.x.x.x.x. . . . . . . . . . . . . | + * |<--- move size---->| + * After: + * .------------------------------------- new lexatom index begin + * : .--------------- prev lexatom index begin + * : : + * :--- move distance--->| + * |N.N.N.N.N.N.N.N.N.N.N.x.x.x.x.x.x.x.x.x.x. . | + * + * Moves the region of size 'Size' from the beginning of the buffer to the end + * and tries to load as many lexatoms as possible behind it. If the try fails + * something is seriously wrong. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_LEXATOM* EndP = me->_memory._back; + QUEX_TYPE_STREAM_POSITION ci_begin = QUEX_NAME(Buffer_input_lexatom_index_begin)(me); + ptrdiff_t load_request_n; + ptrdiff_t loaded_n; + ptrdiff_t move_distance; + QUEX_TYPE_LEXATOM* end_p; + bool end_of_stream_f = false; + bool encoding_error_f = false; + + __quex_assert(NewCharacterIndexBegin >= 0); + __quex_assert(ci_begin >= NewCharacterIndexBegin); + + /* (1) Move away content, so that previous content can be reloaded. */ + move_distance = (ptrdiff_t)(ci_begin - NewCharacterIndexBegin); + load_request_n = QUEX_NAME(Buffer_move_backward)(me, (ptrdiff_t)move_distance); + + __quex_assert(&BeginP[load_request_n] <= EndP); + + /* (2) Move away content, so that previous content can be reloaded. */ + loaded_n = QUEX_NAME(LexatomLoader_load)(me->filler, BeginP, load_request_n, + NewCharacterIndexBegin, + &end_of_stream_f, &encoding_error_f); + + /* (3) In case of error, the stream must have been corrupted. Previously + * present content is not longer available. Continuation impossible. */ + if( loaded_n != load_request_n ) { + QUEX_ERROR_EXIT("Buffer filler failed to load content that has been loaded before.!"); + return false; + } + + end_p = EndP - me->input.end_p < move_distance ? + EndP : &me->input.end_p[move_distance]; + + QUEX_NAME(Buffer_register_content)(me, end_p, NewCharacterIndexBegin); + return true; +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(Buffer_move_away_passed_content)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_LEXATOM** position_register, + const size_t PositionRegisterN) +/* Free some space AHEAD so that new content can be loaded. Content that + * is still used, or expected to be used shall remain inside the buffer. + * Following things need to be respected: + * + * _lexeme_start_p --> points to the lexeme that is currently treated. + * MUST BE INSIDE BUFFER! + * _read_p --> points to the lexatom that is currently used + * for triggering. MUST BE INSIDE BUFFER! + * fall back region --> A used defined buffer backwards from the lexeme + * start. Shall help to avoid extensive backward + * loading. + * + * RETURNS: Pointer to the end of the maintained content. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + const QUEX_TYPE_LEXATOM* EndP = me->_memory._back; + const ptrdiff_t ContentSize = (ptrdiff_t)QUEX_NAME(Buffer_content_size)(me); + QUEX_TYPE_LEXATOM* move_begin_p; + ptrdiff_t move_size; + ptrdiff_t move_distance; + const ptrdiff_t FallBackN = (ptrdiff_t)QUEX_SETTING_BUFFER_MIN_FALLBACK_N; + QUEX_TYPE_LEXATOM** pr_it = 0x0; + + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + __quex_assert(FallBackN >= 0); + + if( me->_read_p - me->_lexeme_start_p >= ContentSize - FallBackN ) { + /* OVERFLOW: If stretch from _read_p to _lexeme_start_p + * spans the whole buffer, then nothing can be loaded. */ + me->on_overflow(me, /* Forward */ true); + return 0; + } + else if( QUEX_NAME(Buffer_is_end_of_stream_inside)(me) ) { + /* Refuse the move, if the end of stream is inside buffer. */ + return 0; + } + + /* Determine from where the region-to-be-moved BEGINS, what its size is + * and how far it is to be moved. */ + move_begin_p = me->_read_p; + if( me->_lexeme_start_p ) { + move_begin_p = QUEX_MIN(move_begin_p, me->_lexeme_start_p); + } + if( move_begin_p - BeginP <= FallBackN ) { + return 0; + } + move_begin_p = &move_begin_p[- FallBackN]; + move_distance = move_begin_p - BeginP; + + if( ! move_distance ) { + return 0; + } + + move_size = QUEX_NAME(Buffer_move_forward)(me, move_distance); + + /* Pointer Adaption: _read_p, _lexeme_start_p, position registers. + * input.end_p, input.end_lexatom_index */ + me->_read_p -= move_distance; + if( me->_lexeme_start_p ) me->_lexeme_start_p -= move_distance; + + if( position_register ) { + /* All position registers MUST point behind '_lexeme_start_p'. */ + for(pr_it = position_register; pr_it != &position_register[PositionRegisterN]; ++pr_it) { + if( ! *pr_it ) continue; + *pr_it = (*pr_it - BeginP) >= move_distance ? *pr_it - move_distance : 0; + } + } + + /* input.end_p/end_lexatom_index: End lexatom index remains the SAME, + * since no new content has been loaded into the buffer. */ + __quex_assert(me->input.end_p - BeginP >= move_distance); + + QUEX_NAME(Buffer_register_content)(me, &me->input.end_p[- move_distance], + me->input.lexatom_index_begin + move_distance); + + /*_______________________________________________________________________*/ + __quex_assert(me->input.end_p == &move_begin_p[move_size - move_distance]); + (void)move_size; + QUEX_IF_ASSERTS_poison(&EndP[- move_distance + 1], EndP); + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + (void)EndP; + + return move_distance; +} + +QUEX_INLINE E_LoadResult +QUEX_NAME(Buffer_load_forward)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_LEXATOM** position_register, + const size_t PositionRegisterN) +/* Load as much new content into the buffer as possible--from what lies ahead + * in the input stream. Maintains '_read_p', '_lexeme_start_p' inside the + * buffer (if possible also fallback region). The 'input.end_p' pointer and + * 'input.end_lexatom_index' are adapted according to the newly loaded + * content, i.e. the point to exactly the same lexatom as before the load. + * + * BEHAVIOR: BLOCKING wait for incoming stream content. + * No return without content--except at end of stream. + * + * Buffer and pointers are adapted are adapted IN ANY CASE! + * + * (i) Content present: + * => return 'true'. + * + * (ii) No content: + * => pointers are 'disabled' because 'end_p = _read_p'. + * return 'false'. + * + * RETURNS: + * + * DONE => Something has been loaded (analysis MAY CONTINUE) + * FAILURE => General load failure. (analysis MUST STOP) + * NO_SPACE_FOR_LOAD => Lexeme exceeds buffer size. (analysis MUST STOP) + * ENCODING_ERROR => Failed. conversion error (analysis MUST STOP) + * NO_MORE_DATA => No more data available. (analysis MUST STOP) + * BAD_LEXATOM => Read pointer on buffer limit code, + * but it was not a buffer limit. + * + * The case of 'end-of-stream' may be true in both cases. When 'end-of-stream' + * is detected, the lexatom index of the 'end-of-stream' is registered. This + * prevents future attemps to load beyond that index. Again, even if + * 'end-of-stream' has been detected, there might be lexatoms for the lexer + * to chew on. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_LEXATOM* EndP = me->_memory._back; + const ptrdiff_t ContentSize = (ptrdiff_t)QUEX_NAME(Buffer_content_size)(me); + QUEX_TYPE_STREAM_POSITION ci_begin = QUEX_NAME(Buffer_input_lexatom_index_begin)(me); + QUEX_TYPE_STREAM_POSITION ci_load_begin; + ptrdiff_t move_distance; + ptrdiff_t load_request_n; + ptrdiff_t loaded_n; + bool end_of_stream_f = false; + bool encoding_error_f = false; + + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + + if( me->_read_p != me->input.end_p) { + /* If the read pointer does not stand on the end of input pointer, then + * the 'buffer limit code' at the read pointer is a bad lexatom. + * Buffer limit codes cannot be possibly be part of buffer content. */ + return E_LoadResult_BAD_LEXATOM; + } + else if( ! me->filler || ! me->filler->byte_loader ) { + QUEX_NAME(Buffer_register_eos)(me, ci_begin + (me->input.end_p - BeginP)); + return E_LoadResult_NO_MORE_DATA; /* No filler/loader => no load! */ + } + + /* Move remaining content. + * Maintain lexeme and fallback. + * Adapt pointers. */ + move_distance = QUEX_NAME(Buffer_move_away_passed_content)(me, position_register, + PositionRegisterN); + if( ! move_distance && me->input.end_p == EndP ) { + return E_LoadResult_NO_SPACE_FOR_LOAD; /* No free space for loading. */ + } + + /* Load new content. */ + ci_load_begin = me->input.lexatom_index_begin + (me->input.end_p - BeginP); + load_request_n = ContentSize - (me->input.end_p - BeginP); + loaded_n = QUEX_NAME(LexatomLoader_load)(me->filler, + me->input.end_p, load_request_n, + ci_load_begin, + &end_of_stream_f, + &encoding_error_f); + QUEX_NAME(Buffer_register_content)(me, &me->input.end_p[loaded_n], -1); + + if( ! loaded_n ) { + /* If filler returned, then either some lexatoms have been filled, + * or it indicates 'end-of-stream' by 'load_n = 0'. */ + end_of_stream_f = true; + } + if( end_of_stream_f ) { + QUEX_NAME(Buffer_register_eos)(me, ci_load_begin + loaded_n); + } + + __quex_debug_buffer_load(me, "LOAD FORWARD(exit)\n"); + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + if ( encoding_error_f ) return E_LoadResult_BAD_LEXATOM; + else if( loaded_n ) return E_LoadResult_DONE; + else return E_LoadResult_NO_MORE_DATA; +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(Buffer_move_away_upfront_content)(QUEX_NAME(Buffer)* me) +/* Free some space in the REAR so that previous content can be re-loaded. Some + * content is to be left in front, so that no immediate reload is necessary + * once the analysis goes forward again. Following things need to be respected: + * + * _lexeme_start_p --> points to the lexeme that is currently treated. + * MUST BE INSIDE BUFFER! + * _read_p --> points to the lexatom that is currently used + * for triggering. MUST BE INSIDE BUFFER! + * + * RETURNS: Distance the the buffer content has been freed to be filled. */ +{ + const QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_LEXATOM* EndP = me->_memory._back; + QUEX_TYPE_LEXATOM* LastP = &me->_memory._back[-1]; + const ptrdiff_t ContentSize = EndP - BeginP; + ptrdiff_t move_distance; + ptrdiff_t move_distance_max; + ptrdiff_t move_distance_nominal; + QUEX_TYPE_LEXATOM* end_p; + + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + __quex_assert(me->_read_p <= LastP); + + if( me->input.lexatom_index_begin == 0 && BeginP == me->_read_p ) { + return 0; /* Begin of stream. */ + } + else if( me->_lexeme_start_p >= LastP ) { + /* If _lexeme_start_p at back, then no new content can be loaded. */ + me->on_overflow(me, /* Forward */ false); + return 0; + } + + /* Max. possible move distance: where 'read_p' or 'lexeme_start_p' + * land on last position in the buffer. */ + move_distance_max = LastP - QUEX_MAX(me->_read_p, me->_lexeme_start_p); + /* Also, move before lexatom index '0' is impossible. */ + move_distance_max = QUEX_MIN(move_distance_max, (ptrdiff_t)me->input.lexatom_index_begin); + + /* Desired move distance: ContentSize / 3 */ + move_distance_nominal = ContentSize > 3 ? ContentSize / 3 : ContentSize; + + move_distance = QUEX_MIN(move_distance_max, move_distance_nominal); + if( ! move_distance ) { + return 0; + } + + (void)QUEX_NAME(Buffer_move_backward)(me, move_distance); + + /* Pointer Adaption: _read_p, _lexeme_start_p. */ + me->_read_p += move_distance; + if( me->_lexeme_start_p ) me->_lexeme_start_p += move_distance; + + /* Adapt and of content pointer and new lexatom index at begin. */ + end_p = EndP - me->input.end_p < move_distance ? EndP + : &me->input.end_p[move_distance]; + + QUEX_NAME(Buffer_register_content)(me, end_p, + me->input.lexatom_index_begin - move_distance); + + /*_______________________________________________________________________*/ + QUEX_IF_ASSERTS_poison(BeginP, &BeginP[move_distance]); + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + + return move_distance; +} + +QUEX_INLINE E_LoadResult +QUEX_NAME(Buffer_load_backward)(QUEX_NAME(Buffer)* me) +/* Load *previous* content into the buffer so that the analyzer can continue + * seeminglessly (in backward direction). + * + * BEHAVIOR: BLOCKING wait for incoming stream content. + * No return without content--except at end of stream. + * + * Buffer and pointers are adapted are adapted IN ANY CASE! + * + * RETURNS: + * + * DONE => Something has been loaded (analysis MAY CONTINUE) + * FAILURE => General load failure. (analysis MUST STOP) + * NO_SPACE_FOR_LOAD => Lexeme exceeds buffer size. (analysis MUST STOP) + * ENCODING_ERROR => Failed. Conversion error. (analysis MUST STOP) + * NO_MORE_DATA => Begin of stream reached. (analysis MUST STOP) + * + * __________________________________________________________________________ + * ! In the false case, the range from 'Begin' to '_lexeme_start_p' may ! + * ! have ARBITRARY CONTENT. Then the '_read_p' MUST be reset IMMEDIATELY and ! + * ! only forward analysis may work. ! + * '--------------------------------------------------------------------------' + * + *_____________________________________________________________________________ + * NO ADAPTIONS OF POST-CONTEXT POSITIONS. Reason: Backward analysis appears + * only in the following two cases. + * + * (1) When checking for a pre-condition. This does not involve pre-contexts. + * + * (2) When tracing back along a 'pseudo-ambigous post context'. However, + * the stretch from 'end-of-core' pattern to 'end-of-post context' lies + * completely in between 'lexeme start' to 'read '. Thus, one never has + * to go farther back then the buffer's begin. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + ptrdiff_t move_distance; + ptrdiff_t loaded_n; + bool end_of_stream_f = false; + bool encoding_error_f = false; + + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + + __quex_debug_buffer_load(me, "BACKWARD(entry)\n"); + if( me->_read_p != me->_memory._front ) { + /* If the read pointer does not stand on 'front', then the buffer limit + * code is a bad character, Buffer limit codes are not supposed to + * appear in buffer content. */ + return E_LoadResult_BAD_LEXATOM; + } + else if( me->input.lexatom_index_begin == 0 ) { + return E_LoadResult_NO_MORE_DATA; /* Begin of stream. */ + } + else if( ! me->filler || ! me->filler->byte_loader ) { + return E_LoadResult_NO_MORE_DATA; /* No filler/loader => no loading! */ + } + else if( ! QUEX_NAME(ByteLoader_seek_is_enabled)(me->filler->byte_loader) ) { + return E_LoadResult_NO_MORE_DATA; /* Stream cannot go backwards. */ + } + + move_distance = QUEX_NAME(Buffer_move_away_upfront_content)(me); + + if( ! move_distance ) { + return E_LoadResult_NO_SPACE_FOR_LOAD; /* Cannot be further back. */ + } + + /* Load new content. */ + loaded_n = QUEX_NAME(LexatomLoader_load)(me->filler, + BeginP, move_distance, + me->input.lexatom_index_begin, + &end_of_stream_f, &encoding_error_f); + if( encoding_error_f ) { + return E_LoadResult_BAD_LEXATOM; + } + + if( loaded_n != move_distance ) { + /* Serious: previously loaded content could not be loaded again! + * => Buffer has now hole: + * from BeginP[loaded_n] to Begin[move_distance] + * The analysis can continue in forward direction, but not backwards.*/ + return E_LoadResult_FAILURE; + } + + __quex_debug_buffer_load(me, "BACKWARD(exit)\n"); + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + return E_LoadResult_DONE; +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(Buffer_move_forward)(QUEX_NAME(Buffer)* me, + ptrdiff_t move_distance) +/* Moves the entire (meaningful) content of the buffer by 'move_distance' + * forward. It does NOT MODIFY any pointers about the buffer content! + * + * EndP + * |<---- move size ---->| + * Before: | . . . . . . . . . . . . .x.x.x.x.x.x.x.x.x.x.x| + * |<---- move distance -----| | + * .----------------------' | + * .-' .----------------' + * | .-------' + * After: |x.x.x.x.x.x.x.x.x.x.x| . . . . . . . . . . . . | + * |<---- move_size ---->| + * + * The callback 'on_content_change()' informs the user that any pointer into + * the buffer must now copy its pointed objects, because the pointers will + * become invalid. + * + * RETURNS: Number of lexatoms that have been moved. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + const ptrdiff_t FilledSize = me->input.end_p - BeginP; + ptrdiff_t move_size; + + me->on_content_change(BeginP, me->input.end_p); + + if( move_distance >= FilledSize ) { + return 0; + } + + move_size = FilledSize - move_distance; + + if( move_distance && move_size ) { + __QUEX_STD_memmove((void*)BeginP, (void*)&BeginP[move_distance], + (size_t)move_size * sizeof(QUEX_TYPE_LEXATOM)); + } + return move_size; +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(Buffer_move_backward)(QUEX_NAME(Buffer)* me, + ptrdiff_t move_distance) +/* Moves content so that previous content may be filled into the buffer. + * + * BeginP + * |<--- move size---->| + * |x.x.x.x.x.x.x.x.x.x| . . . . . . . . . . . . . . | + * | '--------------. + * '------------. '-------------. + * '---------------. | + * :------- move distance------->| | + * | . . . . . . . . . . . . . . |x.x.x.x.x.x.x.x.x.x| + * + * + * RETURNS: Number of lexatom that need to be filled into the gap. + * */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + const ptrdiff_t ContentSize = (ptrdiff_t)QUEX_NAME(Buffer_content_size)(me); + ptrdiff_t move_size; + + me->on_content_change(BeginP, me->input.end_p); + + if( move_distance > ContentSize ) { + return ContentSize; + } + + move_size = ContentSize - move_distance; + + if( move_distance && move_size ) { + __QUEX_STD_memmove((void*)&BeginP[move_distance], BeginP, + (size_t)move_size * sizeof(QUEX_TYPE_LEXATOM)); + } + return (ptrdiff_t)move_distance; +} + +QUEX_INLINE void +QUEX_NAME(Buffer_move_forward_undo)(QUEX_NAME(Buffer)* me, + intmax_t move_distance, + ptrdiff_t move_size) +/* Restore the buffer's raw memory to what it was before in the 'FORWARD' case. + * It is assumed that the buffer's parameters in + * + * me->input + * + * remained UNTOUCHED during the moving and loading of the caller function. + * That is, they indicate the situation to be restored. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_LEXATOM* EndP = me->_memory._back; + ptrdiff_t load_request_n; + ptrdiff_t loaded_n; + bool end_of_stream_f = false; + bool encoding_error_f = false; + + /* Character with lexatom index 'MinCharacterIndexInBuffer' has + * not been loaded. => Buffer must be setup as before. */ + if( move_size ) { + __QUEX_STD_memmove((void*)&BeginP[move_distance], (void*)BeginP, + (size_t)move_size * sizeof(QUEX_TYPE_LEXATOM)); + load_request_n = (ptrdiff_t)move_distance; + } + else { + load_request_n = (me->input.end_p - BeginP); + } + __quex_assert(&BeginP[load_request_n] <= EndP); + (void)EndP; + loaded_n = QUEX_NAME(LexatomLoader_load)(me->filler, BeginP, load_request_n, + me->input.lexatom_index_begin, + &end_of_stream_f, &encoding_error_f); + + if( loaded_n != load_request_n ) { + QUEX_ERROR_EXIT("Buffer filler failed to load content that has been loaded before.!"); + } + else { + /* Ensure, that the buffer limit code is restored. */ + *(me->input.end_p) = (QUEX_TYPE_LEXATOM)QUEX_SETTING_BUFFER_LIMIT_CODE; + } +} + +QUEX_INLINE void +QUEX_NAME(Buffer_on_content_change_DEFAULT)(const QUEX_TYPE_LEXATOM* BeginP, + const QUEX_TYPE_LEXATOM* EndP) +{ (void)BeginP; (void)EndP; } + +QUEX_INLINE void +QUEX_NAME(Buffer_on_overflow_DEFAULT)(QUEX_NAME(Buffer)* me, bool ForwardF) +{ + (void)me; (void)ForwardF; +# ifdef QUEX_OPTION_INFORMATIVE_BUFFER_OVERFLOW_MESSAGE + uint8_t utf8_encoded_str[512]; + char message[1024]; + const size_t MessageSize = (size_t)1024; + uint8_t* WEnd = 0x0; + uint8_t* witerator = 0x0; + QUEX_TYPE_LEXATOM* End = 0x0; + const QUEX_TYPE_LEXATOM* iterator = 0x0; + + /* Print out the lexeme start, so that the user has a hint. */ + WEnd = utf8_encoded_str + 512 - 7; + witerator = utf8_encoded_str; + End = me->_memory._back; + iterator = me->_lexeme_start_p; + + QUEX_CONVERTER_STRING(QUEX_SETTING_CHARACTER_CODEC, utf8)(&iterator, End, &witerator, WEnd); + + message[0] = '\0'; + /* No use of 'snprintf()' because not all systems seem to support it propperly. */ + __QUEX_STD_strncat(message, + "Distance between lexeme start and current pointer exceeds buffer size.\n" + "(tried to load buffer", + MessageSize); + __QUEX_STD_strncat(message, ForwardF ? "forward)" : "backward)", MessageSize); + __QUEX_STD_strncat(message, "As a hint consider the beginning of the lexeme:\n[[", MessageSize); + __QUEX_STD_strncat(message, (char*)utf8_encoded_str, MessageSize); + __QUEX_STD_strncat(message, "]]\n", MessageSize); + + QUEX_ERROR_EXIT(message); +# else + QUEX_ERROR_EXIT("Distance between lexeme start and current pointer exceeds buffer size.\n" + "(tried to load buffer forward). Please, compile with option\n\n" + " QUEX_OPTION_INFORMATIVE_BUFFER_OVERFLOW_MESSAGE\n\n" + "in order to get a more informative output. Most likely, one of your patterns\n" + "eats more than you intended. Alternatively you might want to set the buffer\n" + "size to a greater value or use skippers (<skip: [ \\n\\t]> for example).\n"); +# endif /* QUEX_OPTION_INFORMATIVE_BUFFER_OVERFLOW_MESSAGE */ +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#include "LexatomLoader.i" +#include "Buffer_debug.i" +#include "Buffer_navigation.i" +#include "Buffer_fill.i" +#include "BufferMemory.i" + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_I */ + + diff --git a/src/parser/BufferMemory.i b/src/parser/BufferMemory.i @@ -0,0 +1,58 @@ +/* vim:set ft=c: -*- C++ -*- */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_MEMORY_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_MEMORY_I + +#include "asserts" +#include "bufferAsserts" +#include "definitions" +#include "bufferBuffer" +#include "Buffer_debug.i" +#include "LexatomLoader" +#include "MemoryManager" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_NAME(BufferMemory_construct)(QUEX_NAME(BufferMemory)* me, + QUEX_TYPE_LEXATOM* Memory, + const size_t Size, + E_Ownership Ownership) +{ + if( Memory ) { + /* "Memory size > QUEX_SETTING_BUFFER_MIN_FALLBACK_N + 2" is reqired. + * Maybe, define '-DQUEX_SETTING_BUFFER_MIN_FALLBACK_N=0' for + * compilation (assumed no pre-contexts.) */ + __quex_assert(Size > QUEX_SETTING_BUFFER_MIN_FALLBACK_N + 2); + + me->_front = Memory; + me->_back = &Memory[Size-1]; + me->ownership = Ownership; + *(me->_front) = QUEX_SETTING_BUFFER_LIMIT_CODE; + *(me->_back) = QUEX_SETTING_BUFFER_LIMIT_CODE; + } else { + me->_front = (QUEX_TYPE_LEXATOM*)0; + me->_back = me->_front; + me->ownership = Ownership; + } +} + +QUEX_INLINE void +QUEX_NAME(BufferMemory_destruct)(QUEX_NAME(BufferMemory)* me) +/* Does not set 'me->_front' to zero, if it is not deleted. Thus, the user + * may detect wether it needs to be deleted or not. */ +{ + if( me->_front && me->ownership == E_Ownership_LEXICAL_ANALYZER ) { + QUEXED(MemoryManager_free)((void*)me->_front, + E_MemoryObjectType_BUFFER_MEMORY); + /* Protect against double-destruction. */ + me->_front = me->_back = (QUEX_TYPE_LEXATOM*)0x0; + } +} + +QUEX_INLINE size_t +QUEX_NAME(BufferMemory_size)(QUEX_NAME(BufferMemory)* me) +{ return (size_t)(me->_back - me->_front + 1); } + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_MEMORY_I */ diff --git a/src/parser/Buffer_debug b/src/parser/Buffer_debug @@ -0,0 +1,43 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * + * (C) 2008 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_DEBUG +#define __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_DEBUG + +#include "definitions" +#include "bufferBuffer" +#include "LexatomLoader" +#include "bufferAsserts" + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE void + QUEX_NAME(Buffer_show_brief_content)(QUEX_NAME(Buffer)* buffer); + + QUEX_INLINE void + QUEX_NAME(Buffer_x_show_content)(QUEX_NAME(Buffer)* buffer); + + QUEX_INLINE void + QUEX_NAME(Buffer_show_content_intern)(QUEX_NAME(Buffer)* buffer); + + QUEX_INLINE void + QUEX_NAME(Buffer_show_content)(QUEX_NAME(Buffer)* buffer); + + QUEX_INLINE void + QUEX_NAME(Buffer_show_byte_content)(QUEX_NAME(Buffer)* buffer, + const int IndentationN); + + QUEX_INLINE void + QUEX_NAME(Buffer_show_debug_content)(QUEX_NAME(Buffer)* buffer); + + QUEX_INLINE void + QUEX_NAME(Buffer_print_content_core)(const size_t ElementSize, + const uint8_t* Front, + const uint8_t* Back, + const uint8_t* ReadP, + const uint8_t* InputEnd, + bool BordersF); +QUEX_NAMESPACE_MAIN_CLOSE + + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_DEBUG */ diff --git a/src/parser/Buffer_debug.i b/src/parser/Buffer_debug.i @@ -0,0 +1,345 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * + * (C) 2008 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_DEBUG_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_DEBUG_I + +#include "definitions" +#include "bufferBuffer" +#include "LexatomLoader" +#include "bufferAsserts" +#include "bufferAsserts.i" +#include "Buffer_debug" + + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE void + QUEX_NAME(Buffer_show_brief_content)(QUEX_NAME(Buffer)* buffer) + { + QUEX_NAME(LexatomLoader)* me = buffer->filler; + + __quex_assert(buffer != 0x0); + __quex_assert(me != 0x0); + + QUEX_BUFFER_ASSERT_CONSISTENCY(buffer); + __QUEX_STD_printf("Begin of Buffer Character Index: %i\n", (int)QUEX_NAME(Buffer_input_lexatom_index_begin)(buffer)); + __QUEX_STD_printf("End of Buffer Character Index: %i\n", (int)me->input_lexatom_tell(me)); + if( buffer->input.end_p == 0x0 ) + __QUEX_STD_printf("_memory.input.end_p (offset) = <0x0>\n"); + else + __QUEX_STD_printf("input.end_p (offset) = %08X\n", + (int)(buffer->input.end_p - buffer->_memory._front)); + __QUEX_STD_printf("_read_p (offset) = %08X\n", (int)(buffer->_read_p - buffer->_memory._front)); + __QUEX_STD_printf("_lexeme_start_p (offset) = %08X\n", (int)(buffer->_lexeme_start_p - buffer->_memory._front)); + __QUEX_STD_printf("_back (offset) = %08X\n", (int)(buffer->_memory._back - buffer->_memory._front)); + } + + QUEX_INLINE void + QUEX_NAME(Buffer_x_show_content)(QUEX_NAME(Buffer)* buffer) + { + QUEX_NAME(Buffer_show_content_intern)(buffer); + QUEX_NAME(Buffer_show_brief_content)(buffer); + } + + QUEX_INLINE QUEX_TYPE_LEXATOM + QUEX_NAME(__Buffer_get_border_char)(QUEX_NAME(Buffer)* buffer, const QUEX_TYPE_LEXATOM* C) + { + if ( *C != QUEX_SETTING_BUFFER_LIMIT_CODE ) + return (QUEX_TYPE_LEXATOM)'?'; + else if( buffer->input.end_p == C ) + return (QUEX_TYPE_LEXATOM)']'; /* End of stream sign. */ + else if( QUEX_NAME(Buffer_input_lexatom_index_begin)(buffer) == 0 && buffer->_memory._front == C ) + return (QUEX_TYPE_LEXATOM)'['; /* Begin of stream sign. */ + else + return (QUEX_TYPE_LEXATOM)'|'; + } + + QUEX_INLINE void + QUEX_NAME(Buffer_show_content_intern)(QUEX_NAME(Buffer)* buffer) + { + size_t i = 0; + size_t length = 0; + + QUEX_TYPE_LEXATOM EmptyChar = (QUEX_TYPE_LEXATOM)(-1); + QUEX_TYPE_LEXATOM* BeginP = &buffer->_memory._front[1]; + QUEX_TYPE_LEXATOM* BufferFront = buffer->_memory._front; + QUEX_TYPE_LEXATOM* BufferBack = buffer->_memory._back; + QUEX_TYPE_LEXATOM* iterator = 0x0; + QUEX_TYPE_LEXATOM* end_p = buffer->input.end_p; + bool end_p_error_f = ( end_p > buffer->_memory._back + || end_p < buffer->_memory._front); + + end_p = QUEX_MIN(end_p, buffer->_memory._front); + end_p = QUEX_MAX(end_p, buffer->_memory._back); + + __QUEX_STD_printf("|%c", (int)QUEX_NAME(__Buffer_get_border_char)(buffer, BufferFront)); + for(iterator = BeginP; iterator != end_p; ++iterator) { + __QUEX_STD_printf("%c", *iterator == EmptyChar ? (int)'~' + : *iterator == QUEX_SETTING_BUFFER_LIMIT_CODE ? (int)'*' + : (int)*iterator); + } + __QUEX_STD_printf("%c", (int)QUEX_NAME(__Buffer_get_border_char)(buffer, end_p)); + /**/ + length = (buffer->input.end_p == 0x0) ? 0 : (size_t)(BufferBack - end_p); + for(i=0; i < length; ++i) __QUEX_STD_printf("|"); + + __QUEX_STD_printf("|"); + if( end_p_error_f ) { + __QUEX_STD_printf("ERROR: end_of_file_p: %p; front: %p; back %p;\n", + (void*)buffer->input.end_p, (void*)buffer->_memory._front, + (void*)buffer->_memory._back); + } + __QUEX_STD_printf("\n"); + } + + QUEX_INLINE void + QUEX_NAME(Buffer_show_content)(QUEX_NAME(Buffer)* buffer) + /* Simple printing function for unit testing and debugging it is thought to + * print only ASCII characters (i.e. code points < 0xFF) */ + { + size_t i = 0; + char* tmp = 0; + const size_t ContentSize = QUEX_NAME(Buffer_content_size)(buffer); + QUEX_TYPE_LEXATOM* BeginP = &buffer->_memory._front[1]; + QUEX_TYPE_LEXATOM* BufferFront = buffer->_memory._front; + QUEX_TYPE_LEXATOM* BufferBack = buffer->_memory._back; + + __quex_assert(buffer != 0x0); + /*__________________________________________________________________*/ + tmp = (char*)__QUEX_STD_malloc(ContentSize + 4); + /* tmp[0] = outer border*/ + /* tmp[1] = buffer limit*/ + /* tmp[2...ContentSize+1] = BeginP[0...ContentSize-1]*/ + /* tmp[ContentSize+2] = buffer limit*/ + /* tmp[ContentSize+3] = outer border*/ + /* tmp[ContentSize+4] = terminating zero*/ + for(i=2; i<ContentSize + 2 ; ++i) tmp[i] = ' '; + tmp[ContentSize+4] = '\0'; + tmp[ContentSize+3] = '|'; + tmp[ContentSize+2] = (char)QUEX_NAME(__Buffer_get_border_char)(buffer, BufferBack); + tmp[1] = (char)QUEX_NAME(__Buffer_get_border_char)(buffer, BufferFront); + tmp[0] = '|'; + /* tmp[_SHOW_current_fallback_n - 1 + 2] = ':'; */ + tmp[buffer->_read_p - BeginP + 2] = 'C'; + if( buffer->_lexeme_start_p >= BeginP && buffer->_lexeme_start_p <= BufferBack ) + tmp[(int)(buffer->_lexeme_start_p - BeginP) + 2] = 'S'; + /**/ + if ( buffer->_read_p == BeginP - 2 ) { + __QUEX_STD_printf("%s", tmp); + __QUEX_STD_printf(" <out>"); + } else { + __QUEX_STD_printf(" "); + if( *buffer->_read_p == QUEX_SETTING_BUFFER_LIMIT_CODE ) + __QUEX_STD_printf("BLC"); + else + __QUEX_STD_printf("'%c'", (char)(*buffer->_read_p)); + } + /* std::cout << " = 0x" << std::hex << int(*buffer->_read_p) << std::dec */ + __QUEX_STD_printf("\n"); + QUEX_NAME(Buffer_show_content_intern)(buffer); + __QUEX_STD_free(tmp); + } + + QUEX_INLINE void + QUEX_NAME(Buffer_show_byte_content)(QUEX_NAME(Buffer)* buffer, const int IndentationN) + { + QUEX_NAME(BufferMemory)* memory = &buffer->_memory; + + int i = 0, j = 0; + uint8_t* byte_p = (uint8_t*)memory->_front; + uint8_t* next_byte_p = (uint8_t*)memory->_front + 1; + uint8_t* End = (uint8_t*)(memory->_back + 1); + + __quex_assert(buffer != 0x0); + __quex_assert(memory != 0x0); + + for(j=0; j<IndentationN; ++j) fprintf(stdout, " "); + for(; byte_p != End; ++byte_p, ++next_byte_p, ++i) { + fprintf(stdout, "%02X", (int)*byte_p); + if ( next_byte_p == (uint8_t*)buffer->input.end_p ) + fprintf(stdout, "["); + else if( byte_p == (uint8_t*)buffer->input.end_p + sizeof(QUEX_TYPE_LEXATOM)-1) + fprintf(stdout, "]"); + else + fprintf(stdout, "."); + if( (i+1) % 0x8 == 0 ) fprintf(stdout, " "); + if( (i+1) % 0x10 == 0 ) { + fprintf(stdout, "\n"); + for(j=0; j<IndentationN; ++j) fprintf(stdout, " "); + } + } + fprintf(stdout, "\n"); + } + + QUEX_INLINE void + QUEX_NAME(Buffer_show_debug_print_lines)(QUEX_TYPE_LEXATOM** iterator, + QUEX_TYPE_LEXATOM* Begin, + QUEX_TYPE_LEXATOM* TotalEnd, + QUEX_NAME(Buffer)* buffer) + { + int length = 0; + QUEX_TYPE_LEXATOM* end = Begin + 5 > TotalEnd ? TotalEnd : Begin + 5; + + if( Begin > *iterator ) { + *iterator = Begin; + __QUEX_STD_fprintf(stderr, " ...\n"); + } else if( *iterator >= end ) { + return; + } + + for(; *iterator < end; ++*iterator) { + length = 0; + __QUEX_STD_fprintf(stderr, " "); + + if( *iterator == buffer->_memory._front ) { + __QUEX_STD_fprintf(stderr, "buffer front"); + length += 12; + } + if( *iterator == buffer->_lexeme_start_p ) { + if( length ) { __QUEX_STD_fprintf(stderr, ", "); length += 2; } + __QUEX_STD_fprintf(stderr, "lexeme start"); + length += 12; + } + if( *iterator == buffer->_read_p ) { + if( length ) { __QUEX_STD_fprintf(stderr, ", "); length += 2; } + __QUEX_STD_fprintf(stderr, "input"); + length += 5; + } + if( *iterator == buffer->input.end_p ) { + if( length ) { __QUEX_STD_fprintf(stderr, ", "); length += 2; } + __QUEX_STD_fprintf(stderr, "end of file"); + length += 11; + } + if( *iterator == buffer->_memory._back ) { + if( length ) { __QUEX_STD_fprintf(stderr, ", "); length += 2; } + __QUEX_STD_fprintf(stderr, "buffer back"); + length += 11; + } + if( length ) { + for(; length < 39; ++length) + __QUEX_STD_fprintf(stderr, "-"); + __QUEX_STD_fprintf(stderr, ">"); + } else { + __QUEX_STD_fprintf(stderr, " "); + } + + /* Print the character information */ + __QUEX_STD_fprintf(stderr, "[%04X] 0x%04X\n", + (int)(*iterator - buffer->_memory._front), + (int)(**iterator)); + } + } + + QUEX_INLINE void + QUEX_NAME(Buffer_show_debug_content)(QUEX_NAME(Buffer)* buffer) + { + /* Assumptions: + * (1) width of terminal = 80 chars + * (2) border right and left = 3 chars + * (3) display at least the last 5 chars at the begin of buffer. + * 5 chars around input_p. + * 5 chars from lexeme_start. + * 5 chars to the end of buffer. + * + * |12345 ... 12345 .... 12345 .... 12345| + * Begin lexeme start input_p buffer end */ + QUEX_TYPE_LEXATOM* iterator = buffer->_memory._front; + QUEX_TYPE_LEXATOM* total_end = buffer->_memory._back + 1; + + __quex_assert(buffer != 0x0); + __QUEX_STD_fprintf(stderr, "_________________________________________________________________\n"); + QUEX_NAME(Buffer_show_debug_print_lines)(&iterator, buffer->_memory._front, total_end, buffer); + QUEX_NAME(Buffer_show_debug_print_lines)(&iterator, buffer->_lexeme_start_p - 2, total_end, buffer); + QUEX_NAME(Buffer_show_debug_print_lines)(&iterator, buffer->_read_p - 2, total_end, buffer); + if( buffer->input.end_p != 0x0 ) { + QUEX_NAME(Buffer_show_debug_print_lines)(&iterator, buffer->input.end_p - 4, total_end, buffer); + } + QUEX_NAME(Buffer_show_debug_print_lines)(&iterator, buffer->_memory._back - 4, total_end, buffer); + __QUEX_STD_fprintf(stderr, "_________________________________________________________________\n"); + } + + QUEX_INLINE void + QUEX_NAME(Buffer_print_this)(QUEX_NAME(Buffer)* me) + { + QUEX_TYPE_LEXATOM* Offset = me->_memory._front; + + __QUEX_STD_printf(" Buffer:\n"); + __QUEX_STD_printf(" Memory:\n"); + __QUEX_STD_printf(" _front = 0;\n"); + __QUEX_STD_printf(" _back = +0x%X;\n", (int)(me->_memory._back - Offset)); + if( me->input.end_p != 0x0 ) + __QUEX_STD_printf(" input.end_p = +0x%X;\n", (int)(me->input.end_p - Offset)); + else + __QUEX_STD_printf(" input.end_p = <void>;\n"); + + /* Store whether the memory has an external owner */ + __QUEX_STD_printf(" _external_owner_f = %s;\n", me->_memory.ownership == E_Ownership_EXTERNAL ? "true" : "false"); + + __QUEX_STD_printf(" _read_p = +0x%X;\n", (int)(me->_read_p - Offset)); + __QUEX_STD_printf(" _lexeme_start_p = +0x%X;\n", (int)(me->_lexeme_start_p - Offset)); + + __QUEX_STD_printf(" _character_at_lexeme_start = %X;\n", (int)me->_lexatom_at_lexeme_start); +# ifdef __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION + __QUEX_STD_printf(" _character_before_lexeme_start = %X;\n", (int)me->_lexatom_before_lexeme_start); +# endif + __QUEX_STD_printf(" _content_character_index_begin = %i;\n", (int)QUEX_NAME(Buffer_input_lexatom_index_begin)(me)); + __QUEX_STD_printf(" input.end_character_index = %i;\n", (int)QUEX_NAME(Buffer_input_lexatom_index_end)(me)); + if( me->filler ) { + __QUEX_STD_printf(" _byte_order_reversion_active_f = %s;\n", me->filler->_byte_order_reversion_active_f ? "true" : "false"); + } + } + + QUEX_INLINE void + QUEX_NAME(Buffer_print_content)(QUEX_NAME(Buffer)* me) + { + QUEX_NAME(Buffer_print_content_core)(sizeof(QUEX_TYPE_LEXATOM), + (const uint8_t*)me->_memory._front, + (const uint8_t*)me->_memory._back, + (const uint8_t*)me->_read_p, + (const uint8_t*)me->input.end_p, + /* BordersF */ true); + + } + + QUEX_INLINE void + QUEX_NAME(Buffer_print_content_core)(const size_t ElementSize, + const uint8_t* Front, + const uint8_t* Back, + const uint8_t* ReadP, + const uint8_t* InputEndP, + bool BordersF) + { + const uint8_t* it; + __QUEX_STD_printf("["); + for(it=Front; it <= Back; it += ElementSize) { + if( it < InputEndP ) { + switch( ElementSize ) { + case 1: __QUEX_STD_printf("%02X", it[0]); break; + case 2: __QUEX_STD_printf("%04X", ((uint16_t*)it)[0]); break; + case 4: + default: __QUEX_STD_printf("%08X", ((uint32_t*)it)[0]); break; + } + } + else { + __QUEX_STD_printf("--"); + } + + if( &it[ElementSize] == ReadP ) { + __QUEX_STD_printf(">"); + } + else if( BordersF && (it == Front || &it[1] == Back ) ) { + __QUEX_STD_printf("|"); + } + else if( it != Back && &it[ElementSize] != ReadP ) { + __QUEX_STD_printf("."); + } + } + __QUEX_STD_printf("]"); + } + + +QUEX_NAMESPACE_MAIN_CLOSE + + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_DEBUG_I */ diff --git a/src/parser/Buffer_fill.i b/src/parser/Buffer_fill.i @@ -0,0 +1,98 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_FILL_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_FILL_I + +#include "bufferBuffer" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void* +QUEX_NAME(Buffer_fill)(QUEX_NAME(Buffer)* me, + const void* ContentBegin, + const void* ContentEnd) +{ + ptrdiff_t copy_n; + void* begin_p; + const void* end_p; + + /* Prepare the buffer for the reception of new input an acquire the + * border pointers of where new content can be filled. */ + me->fill_prepare(me, &begin_p, &end_p); + + /* Copy as much as possible of the new content into the designated + * region in memory. This may be the engine's buffer or a 'raw' buffer + * whose content still needs to be converted. */ + copy_n = (ptrdiff_t)QUEXED(MemoryManager_insert)((uint8_t*)begin_p, + (uint8_t*)end_p, + (uint8_t*)ContentBegin, + (uint8_t*)ContentEnd); + + /* Flush into buffer what has been filled from &begin[0] to + * &begin[inserted_byte_n]. */ + me->fill_finish(me, &((uint8_t*)begin_p)[copy_n]); + + /* Report a pointer to the first content element that has not yet + * been treated (== ContentEnd if all complete). */ + return (void*)&((uint8_t*)ContentBegin)[copy_n]; +} + +QUEX_INLINE void +QUEX_NAME(Buffer_fill_prepare)(QUEX_NAME(Buffer)* me, + void** begin_p, + const void** end_p) +/* SETS: *begin_p: position where the next content needs to be filled. + * *end_p: address directly behind the last byte that can be filled. + * + * The content may be filled into the engine's buffer or an intermediate + * 'raw' buffer which still needs to be converted. */ +{ + (void)QUEX_NAME(Buffer_move_away_passed_content)(me, (QUEX_TYPE_LEXATOM**)0, 0); + + /* Get the pointers for the border where to fill content. */ + me->filler->derived.fill_prepare(me->filler, me, begin_p, end_p); + + __quex_assert(*end_p >= *begin_p); +} + +QUEX_INLINE void +QUEX_NAME(Buffer_fill_finish)(QUEX_NAME(Buffer)* me, + const void* FilledEndP) +/* Uses the content that has been inserted until 'FilledEndP' to fill the + * engine's lexatom buffer (if it is not already done). A fille of type + * 'LexatomLoader_Converter' takes the content of the raw buffer and converts + * it into the engine's buffer from 'me->input.end_p' to 'me->_memory._back'. + * */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + __quex_assert((QUEX_TYPE_LEXATOM*)FilledEndP <= me->_memory._back); + + /* Place new content in the engine's buffer. */ + ptrdiff_t inserted_lexatom_n = me->filler->derived.fill_finish(me->filler, + me->input.end_p, + me->_memory._back, + FilledEndP); + + /* Assume: content from 'input.end_p' to 'input.end_p[CharN]' + * has been filled with data. */ + if( me->filler->_byte_order_reversion_active_f ) { + QUEX_NAME(LexatomLoader_reverse_byte_order)(me->input.end_p, + &me->input.end_p[inserted_lexatom_n]); + } + + /* -- Manual buffer filling requires the end-of-stream pointer always + * to be set. + * -- The 'lexatom_index_begin' has been set in 'fill_prepare()'. + * '-1' => no change. + * -- The 'lexatom_index_end_of_stream' can now be set, since it is + * known how many lexatoms have been inserted. + * */ + QUEX_NAME(Buffer_register_content)(me, &me->input.end_p[inserted_lexatom_n], -1); + QUEX_NAME(Buffer_register_eos)(me, me->input.lexatom_index_begin + + (me->input.end_p - BeginP)); + + QUEX_BUFFER_ASSERT_CONSISTENCY(me); +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_FILL_I */ diff --git a/src/parser/Buffer_navigation.i b/src/parser/Buffer_navigation.i @@ -0,0 +1,195 @@ +/* vim: set ft=c: + * + * PURPOSE: Buffer's seek: + * + * .---------------------------------------------------------------. + * | Setting the '_read_p' to a specific position in the stream. | + * '---------------------------------------------------------------' + * + * This is the type of 'seek' used in the user interface's seek functions. + * + * NOT TO CONFUSE with two other forms of seek: + * + * -- LexatomLoader's seek sets the input position of the next + * lexatom to be loaded into the buffer. + * -- QUEX_NAME(ByteLoader)'s seek sets the position in the low level input + * stream. + * + * A 'seek' always implies that the following happens: + * + * _lexeme_start_p = _read_p + * + * The two stored lexatoms will be assigned after seeking as + * + * _lexatom_at_lexeme_start = _read_p[0] + * _lexatom_before_lexeme_start = _read_p[-1] + * + * If the read pointer stands at the beginning of the file, then + * + * _lexatom_before_lexeme_start = newline + * + * It is crucial to understand the difference between 'stream seeking' and + * 'buffer seeking'. Stream seeking determines the next position in the input + * stream from where content is loaded into the buffer. Buffer seeking sets + * the input pointer '_read_p' to a particular position. The position-1 where + * it points contains the next lexatom to be read during analysis. + * + * (C) Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_NAVIGATION_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_NAVIGATION_I + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE bool +QUEX_NAME(Buffer_finish_seek_based_on_read_p)(QUEX_NAME(Buffer)* me); + +QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(Buffer_input_lexatom_index_begin)(QUEX_NAME(Buffer)* me) +/* Determine lexatom index of first lexatom in the buffer. */ +{ + __quex_assert(me->input.lexatom_index_begin >= 0); + return me->input.lexatom_index_begin; +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_seek_forward)(QUEX_NAME(Buffer)* me, const ptrdiff_t CharacterN) +/* Move '_read_p' forwards by 'CharacterN'. This may involve reload in + * forward direction. + * + * Seeking error => Buffer is completely left as is. In particular no change + * to '_read_p' or '_lexeme_start_p'. + * + * RETURNS: True -- if positioning was successful, + * False -- else. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_STREAM_POSITION CharacterIndexAtReadP = me->input.lexatom_index_begin + + (me->_read_p - BeginP); + QUEX_TYPE_STREAM_POSITION target = CharacterIndexAtReadP + CharacterN; + QUEX_TYPE_STREAM_POSITION new_lexatom_index_begin; + + if( ! CharacterN ) { + return true; + } + else if( target < QUEX_NAME(Buffer_input_lexatom_index_end)(me) ) { + me->_read_p += CharacterN; + /* => &me->_read_p[-1] inside buffer. */ + } + else if( me->input.lexatom_index_end_of_stream != -1 + && target > me->input.lexatom_index_end_of_stream ) { + return false; + } + else { + /* Character index at read_p = lexatom index at begin + offset */ + new_lexatom_index_begin = QUEX_MAX(0, target - QUEX_SETTING_BUFFER_MIN_FALLBACK_N); + if( ! QUEX_NAME(Buffer_move_and_load_forward)(me, new_lexatom_index_begin, target) ) { + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + return false; + } + + me->_read_p = &BeginP[target - new_lexatom_index_begin]; + } + me->_lexeme_start_p = me->_read_p; + + return QUEX_NAME(Buffer_finish_seek_based_on_read_p)(me); +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_seek_backward)(QUEX_NAME(Buffer)* me, + const ptrdiff_t CharacterN) +/* Move '_read_p' backwards by 'CharacterN'. This may involve reload in + * backward direction. + * + * Seeking error => Buffer is completely left as is. In particular no change + * to '_read_p' or '_lexeme_start_p'. + * + * RETURNS: True -- if positioning was successful, + * False -- else. */ +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + QUEX_TYPE_STREAM_POSITION CharacterIndexAtReadP = me->input.lexatom_index_begin + + (me->_read_p - BeginP); + QUEX_TYPE_STREAM_POSITION target = CharacterIndexAtReadP - CharacterN; + const ptrdiff_t ContentSize = (ptrdiff_t)QUEX_NAME(Buffer_content_size)(me); + QUEX_TYPE_STREAM_POSITION new_lexatom_index_begin; + ptrdiff_t offset; + + if( ! CharacterN ) { + return true; + } + else if( target > me->input.lexatom_index_begin ) { + /* => &me->_read_p[-1] inside buffer. */ + me->_read_p -= CharacterN; + } + else { + /* offset = desired distance from begin to 'read_p'. */ + offset = (ptrdiff_t)QUEX_MIN((QUEX_TYPE_STREAM_POSITION)(ContentSize >> 1), target); + new_lexatom_index_begin = target - offset; + + if( ! QUEX_NAME(Buffer_move_and_load_backward)(me, new_lexatom_index_begin) ) { + /* QUEX_ERROR_EXIT() initiated inside above function. */ + return false; + } + me->_read_p = &BeginP[offset]; + } + + return QUEX_NAME(Buffer_finish_seek_based_on_read_p)(me); +} + +QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(Buffer_tell)(QUEX_NAME(Buffer)* me) +/* RETURNS: lexatom index which corresponds to the position of the input + * pointer. */ +{ + const QUEX_TYPE_STREAM_POSITION DeltaToBufferBegin = me->_read_p - &me->_memory._front[1]; + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + + return DeltaToBufferBegin + QUEX_NAME(Buffer_input_lexatom_index_begin)(me); +} + +QUEX_INLINE void +QUEX_NAME(Buffer_seek)(QUEX_NAME(Buffer)* me, const QUEX_TYPE_STREAM_POSITION CharacterIndex) +/* Set the _read_p according to a lexatom index of the input. It is the + * inverse of 'tell()'. */ +{ + const QUEX_TYPE_STREAM_POSITION CurrentCharacterIndex = QUEX_NAME(Buffer_tell)(me); + + if( CharacterIndex > CurrentCharacterIndex ) { + QUEX_NAME(Buffer_seek_forward)(me, (ptrdiff_t)(CharacterIndex - CurrentCharacterIndex)); + } + else if( CharacterIndex < CurrentCharacterIndex ) { + QUEX_NAME(Buffer_seek_backward)(me,(ptrdiff_t)(CurrentCharacterIndex - CharacterIndex)); + } +} + +QUEX_INLINE bool +QUEX_NAME(Buffer_finish_seek_based_on_read_p)(QUEX_NAME(Buffer)* me) +{ + QUEX_TYPE_LEXATOM* BeginP = &me->_memory._front[1]; + bool verdict_f = true; + + if( me->_read_p >= me->input.end_p ) { + me->_read_p = me->input.end_p; + verdict_f = false; + } + else if( me->_read_p < BeginP ) { + me->_read_p = BeginP; + verdict_f = false; + } + + me->_lexeme_start_p = me->_read_p; + me->_lexatom_at_lexeme_start = me->_read_p[0]; +# ifdef __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION + /* Seek was towards 'target - 1' + * => Now, there must be at least one lexatom before '_read_p'. + * Or if not, then the target was on the lower limit 0 and the '_read_p' + * stands on the buffer's content front. */ + me->_lexatom_before_lexeme_start = me->_read_p > BeginP ? me->_read_p[-1] + : QUEX_SETTING_CHARACTER_NEWLINE_IN_ENGINE_CODEC; +# endif + QUEX_BUFFER_ASSERT_CONSISTENCY(me); + return verdict_f; +} + +QUEX_NAMESPACE_MAIN_CLOSE +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFER_NAVIGATION_I */ diff --git a/src/parser/ByteLoader b/src/parser/ByteLoader @@ -0,0 +1,99 @@ +/* vim: set ft=c: + * (C) Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER +#define __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER + +#include "definitions" +#include "MemoryManager" + +QUEX_NAMESPACE_MAIN_OPEN + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(ByteLoader_tag) { + QUEX_TYPE_STREAM_POSITION (*tell)(struct QUEX_NAME(ByteLoader_tag)* me); + void (*seek)(struct QUEX_NAME(ByteLoader_tag)* me, + QUEX_TYPE_STREAM_POSITION Pos); + size_t (*load)(struct QUEX_NAME(ByteLoader_tag)*, + void*, const size_t, + bool* end_of_stream_f); + void (*delete_self)(struct QUEX_NAME(ByteLoader_tag)*); + + /* .compare_handle(A, B): + * + * Quex checks whether A and B are of the same class (comparing the + * function pointer '.load'). The derived class can safely cast both + * to its pointer type. + * + * Upon reset, the the new input handle might be the same as the old one. + * Such a usage is against the design of the reset functions! To detect + * these situations, the byte loader provides '.compare_handle()'. + * + * In case of doubt, return always 'false'. The only disadvantage is that + * if the user makes the aforementioned error, he will not get a nice hint + * upon crash. + * + * ByteLoader_FILE, ByteLoader_stream, and ByteLoader_POSIX implement the + * function propperly. */ + bool (*compare_handle)(const struct QUEX_NAME(ByteLoader_tag)* A, + const struct QUEX_NAME(ByteLoader_tag)* B); + + /* .on_nothing(...) + * + * When '.load' cannot provide anymore data, customized actions may be + * performed. + * + * -- If '.on_nothing' is not defined, '.load' returns zero and the + * caller must assume that the stream terminated. + * -- Else, the user defined '.no_nothing()' function is called. If it + * returns 'true', '.load' tries again to load data. Else, '.load()' + * returns with zero. Then, the caller, again, must assume that the + * end of stream has been reached. */ + bool (*on_nothing)(struct QUEX_NAME(ByteLoader_tag)*, size_t TryN, size_t RequestN); + + E_Ownership handle_ownership; + E_Ownership ownership; + + /* Upon construction, the stream handle may be setup to a particular + * position in the stream. This is going to be the reference position. + * The consideration of offsets is handled in this base class' functions. + * The derived class does not need to know about an initial offset. */ + QUEX_TYPE_STREAM_POSITION initial_position; + + /* It is crucial for 'seeking' in the stream whether the stream is in + * binary mode or not. If not, then character/byte number is not const. */ + bool binary_mode_f; /* In doubt, say 'false'. */ + + struct { + QUEX_TYPE_STREAM_POSITION (*tell)(struct QUEX_NAME(ByteLoader_tag)*); + void (*seek)(struct QUEX_NAME(ByteLoader_tag)*, + QUEX_TYPE_STREAM_POSITION); + size_t (*load)(struct QUEX_NAME(ByteLoader_tag)*, void*, const size_t, + bool*); + } derived; +} QUEX_NAME(ByteLoader); + +QUEX_INLINE void QUEX_NAME(ByteLoader_construct)(QUEX_NAME(ByteLoader)* me, + QUEX_TYPE_STREAM_POSITION (*tell)(QUEX_NAME(ByteLoader)* me), + void (*seek)(QUEX_NAME(ByteLoader)* me, QUEX_TYPE_STREAM_POSITION Pos), + size_t (*load)(QUEX_NAME(ByteLoader)*, void*, const size_t, bool*), + void (*delete_self)(QUEX_NAME(ByteLoader)*), + bool (*compare_handle)(const QUEX_NAME(ByteLoader)*, + const QUEX_NAME(ByteLoader)*)); +QUEX_INLINE void QUEX_NAME(ByteLoader_seek_disable)(QUEX_NAME(ByteLoader)* me); +QUEX_INLINE bool QUEX_NAME(ByteLoader_seek_is_enabled)(QUEX_NAME(ByteLoader)* me); +QUEX_INLINE bool QUEX_NAME(ByteLoader_is_equivalent)(const QUEX_NAME(ByteLoader)* A, + const QUEX_NAME(ByteLoader)* B); +QUEX_INLINE void QUEX_NAME(ByteLoader_delete)(QUEX_NAME(ByteLoader)** me); + +QUEX_NAMESPACE_MAIN_CLOSE + +#include "ByteLoader_FILE" +#include "ByteLoader_stream" +#ifdef QUEX_OPTION_POSIX +# include <quex/code_base/buffer/bytes/ByteLoader_POSIX> /* (tm) */ +#endif +#if 0 +# include <quex/code_base/buffer/bytes/ByteLoader_FreeRTOS> /* (tm) */ +# include <quex/code_base/buffer/bytes/ByteLoader_PalmOS> /* (tm) */ +#endif + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER */ diff --git a/src/parser/ByteLoader.i b/src/parser/ByteLoader.i @@ -0,0 +1,164 @@ +/* vim: set ft=c: + * (C) Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_I + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(ByteLoader_tell)(QUEX_NAME(ByteLoader)* me); + +QUEX_INLINE void +QUEX_NAME(ByteLoader_seek)(QUEX_NAME(ByteLoader)* me, QUEX_TYPE_STREAM_POSITION Position); + +QUEX_INLINE size_t +QUEX_NAME(ByteLoader_load)(QUEX_NAME(ByteLoader)* me, void* begin_p, const size_t N, bool* end_of_stream_f); + +QUEX_INLINE void +QUEX_NAME(ByteLoader_construct)(QUEX_NAME(ByteLoader)* me, + QUEX_TYPE_STREAM_POSITION (*tell)(QUEX_NAME(ByteLoader)* me), + void (*seek)(QUEX_NAME(ByteLoader)* me, QUEX_TYPE_STREAM_POSITION Pos), + size_t (*load)(QUEX_NAME(ByteLoader)*, void*, const size_t, bool*), + void (*delete_self)(QUEX_NAME(ByteLoader)*), + bool (*compare_handle)(const QUEX_NAME(ByteLoader)*, + const QUEX_NAME(ByteLoader)*)) +{ + me->tell = QUEX_NAME(ByteLoader_tell); + me->seek = QUEX_NAME(ByteLoader_seek); + me->load = QUEX_NAME(ByteLoader_load); + me->derived.tell = tell; + me->derived.seek = seek; + me->derived.load = load; + me->delete_self = delete_self; + me->compare_handle = compare_handle; + me->on_nothing = (bool (*)(struct QUEX_NAME(ByteLoader_tag)*, size_t, size_t))0; + + me->handle_ownership = E_Ownership_EXTERNAL; /* Default */ + me->ownership = E_Ownership_EXTERNAL; /* Default */ + + me->initial_position = tell(me); + + me->binary_mode_f = false; /* Default: 'false' is SAFE */ +} + +QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(ByteLoader_tell)(QUEX_NAME(ByteLoader)* me) +{ + return me->derived.tell(me); +} + +QUEX_INLINE void +QUEX_NAME(ByteLoader_seek_disable)(QUEX_NAME(ByteLoader)* me) +{ + me->derived.seek = (void (*)(QUEX_NAME(ByteLoader)*, QUEX_TYPE_STREAM_POSITION))0; +} + +QUEX_INLINE bool +QUEX_NAME(ByteLoader_seek_is_enabled)(QUEX_NAME(ByteLoader)* me) +{ + return me->derived.seek ? true : false; +} + +QUEX_INLINE void +QUEX_NAME(ByteLoader_seek)(QUEX_NAME(ByteLoader)* me, QUEX_TYPE_STREAM_POSITION Position) +{ + if ( Position < me->initial_position ) return; + else if( ! me->derived.seek ) return; + me->derived.seek(me, Position); +} + +QUEX_INLINE size_t +QUEX_NAME(ByteLoader_load)(QUEX_NAME(ByteLoader)* me, void* begin_p, const size_t N, bool* end_of_stream_f) +/* RETURNS: != 0, if something could be loaded + * == 0, if nothing could be loaded further. End of stream (EOS). + * + * Additionally, 'end_of_stream_f' may hint the end of the stream while still + * some bytes have been loaded. + * + * *end_of_stream_f == true => End of stream has been reached. + * *end_of_stream_f == false => No assumption if end of stream ore not. + * + * The first case is solely a hint to help the caller to act upon end of stream + * before actually reading zero bytes. It may spare a unnecessary load-cycle + * which ends up with no load at all. */ +{ + size_t loaded_n; + size_t try_n = 0; + + *end_of_stream_f = false; + + if( ! N ) { + return 0; + } + + do { + /* Try to load 'N' bytes. */ + loaded_n = me->derived.load(me, begin_p, N, end_of_stream_f); + if( loaded_n ) { + /* If at least some bytes could be loaded, return 'success'. */ + return loaded_n; + } + else if( ! me->on_nothing ) { + /* No plan for absence of data, return 'failure', EOS. */ + *end_of_stream_f = true; + return 0; + } + ++try_n; + + } while( me->on_nothing(me, try_n, N) ); + + /* If user's on nothing returns 'false' no further attemps to read. */ + *end_of_stream_f = true; + + return 0; +} + +QUEX_INLINE bool +QUEX_NAME(ByteLoader_is_equivalent)(const QUEX_NAME(ByteLoader)* A, + const QUEX_NAME(ByteLoader)* B) +/* RETURNS: true -- if A and B are equivalent. + * false -- else. */ +{ + /* If two QUEX_NAME(ByteLoader )classes use the same 'load()' function, then they + * should not be different. For example, it does not make sense to have + * two loaders implementing stdandard libraries 'fread()' interface. + * + * Further, it is always safe to return 'false'. */ + if( A == NULL ) { + if( B != NULL ) return false; + else return true; + } + else if( B == NULL ) { + return false; + } + else if( A->load != B->load ) { + return false; + } + + /* The 'compare_handle()' function can now safely cast the two pointers + * to its pointer type. */ + return A->compare_handle(A, B); +} + +QUEX_INLINE void +QUEX_NAME(ByteLoader_delete)(QUEX_NAME(ByteLoader)** me) +{ + if( ! *me ) return; + else if( (*me)->ownership != E_Ownership_LEXICAL_ANALYZER ) return; + else if( (*me)->delete_self ) (*me)->delete_self(*me); + (*me) = (QUEX_NAME(ByteLoader)*)0; +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#include "ByteLoader_FILE.i" +#include "ByteLoader_stream.i" +#ifdef QUEX_OPTION_POSIX +# include <quex/code_base/buffer/bytes/ByteLoader_POSIX.i> /* (tm) */ +#endif +#if 0 +# include <quex/code_base/buffer/bytes/ByteLoader_FreeRTOS.i> /* (tm) */ +# include <quex/code_base/buffer/bytes/ByteLoader_PalmOS.i> /* (tm) */ +#endif + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_I */ diff --git a/src/parser/ByteLoader_FILE b/src/parser/ByteLoader_FILE @@ -0,0 +1,28 @@ +/* vim: ft=c: + * (C) Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_FILE +#define __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_FILE + +#include "ByteLoader" + +QUEX_NAMESPACE_MAIN_OPEN + +#ifdef __cplusplus +extern "C" { +#endif +#include <stdio.h> +#ifdef __cplusplus +} +#endif + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + QUEX_NAME(ByteLoader) base; + FILE* input_handle; +} QUEX_NAME(ByteLoader_FILE); + +QUEX_INLINE QUEX_NAME(ByteLoader)* QUEX_NAME(ByteLoader_FILE_new)(FILE* fh, bool BinaryModeF); +QUEX_INLINE QUEX_NAME(ByteLoader)* QUEX_NAME(ByteLoader_FILE_new_from_file_name)(const char*); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_FILE */ diff --git a/src/parser/ByteLoader_FILE.i b/src/parser/ByteLoader_FILE.i @@ -0,0 +1,125 @@ +/* vim: set ft=c: + * (C) Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_FILE_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_FILE_I + +#include "MemoryManager" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void QUEX_NAME(ByteLoader_FILE_construct)(QUEX_NAME(ByteLoader_FILE)* me, __QUEX_STD_FILE* fh); +QUEX_INLINE QUEX_TYPE_STREAM_POSITION QUEX_NAME(ByteLoader_FILE_tell)(QUEX_NAME(ByteLoader)* me); +QUEX_INLINE void QUEX_NAME(ByteLoader_FILE_seek)(QUEX_NAME(ByteLoader)* me, QUEX_TYPE_STREAM_POSITION Pos); +QUEX_INLINE size_t QUEX_NAME(ByteLoader_FILE_load)(QUEX_NAME(ByteLoader)* me, void* buffer, const size_t ByteN, bool*); +QUEX_INLINE void QUEX_NAME(ByteLoader_FILE_delete_self)(QUEX_NAME(ByteLoader)* me); +QUEX_INLINE bool QUEX_NAME(ByteLoader_FILE_compare_handle)(const QUEX_NAME(ByteLoader)* alter_ego_A, + const QUEX_NAME(ByteLoader)* alter_ego_B); + +QUEX_INLINE QUEX_NAME(ByteLoader)* +QUEX_NAME(ByteLoader_FILE_new)(FILE* fh, bool BinaryModeF) +{ + QUEX_NAME(ByteLoader_FILE)* me; + + if( ! fh ) return (QUEX_NAME(ByteLoader)*)0; + + me = (QUEX_NAME(ByteLoader_FILE)*)QUEXED(MemoryManager_allocate)(sizeof(QUEX_NAME(ByteLoader_FILE)), + E_MemoryObjectType_BYTE_LOADER); + if( ! me ) return (QUEX_NAME(ByteLoader)*)0; + + QUEX_NAME(ByteLoader_FILE_construct)(me, fh); + me->base.binary_mode_f = BinaryModeF; + + return &me->base; +} + +QUEX_INLINE QUEX_NAME(ByteLoader)* +QUEX_NAME(ByteLoader_FILE_new_from_file_name)(const char* FileName) +{ + __QUEX_STD_FILE* fh = fopen(FileName, "rb"); + QUEX_NAME(ByteLoader)* alter_ego; + + if( ! fh ) { + return (QUEX_NAME(ByteLoader)*)0; + } + alter_ego = QUEX_NAME(ByteLoader_FILE_new)(fh, true); + if( ! alter_ego ) { + return (QUEX_NAME(ByteLoader)*)0; + } + alter_ego->handle_ownership = E_Ownership_LEXICAL_ANALYZER; + return alter_ego; +} + +QUEX_INLINE void +QUEX_NAME(ByteLoader_FILE_construct)(QUEX_NAME(ByteLoader_FILE)* me, __QUEX_STD_FILE* fh) +{ + /* IMPORTANT: input_handle must be set BEFORE call to constructor! + * Constructor does call 'tell()' */ + me->input_handle = fh; + + QUEX_NAME(ByteLoader_construct)(&me->base, + QUEX_NAME(ByteLoader_FILE_tell), + QUEX_NAME(ByteLoader_FILE_seek), + QUEX_NAME(ByteLoader_FILE_load), + QUEX_NAME(ByteLoader_FILE_delete_self), + QUEX_NAME(ByteLoader_FILE_compare_handle)); +} + +QUEX_INLINE void +QUEX_NAME(ByteLoader_FILE_delete_self)(QUEX_NAME(ByteLoader)* alter_ego) +{ + QUEX_NAME(ByteLoader_FILE)* me = (QUEX_NAME(ByteLoader_FILE)*)(alter_ego); + + if( me->input_handle && me->base.handle_ownership == E_Ownership_LEXICAL_ANALYZER ) { + fclose(me->input_handle); + } + QUEXED(MemoryManager_free)(me, E_MemoryObjectType_BYTE_LOADER); +} + +QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(ByteLoader_FILE_tell)(QUEX_NAME(ByteLoader)* alter_ego) +{ + QUEX_NAME(ByteLoader_FILE)* me = (QUEX_NAME(ByteLoader_FILE)*)(alter_ego); + + return (QUEX_TYPE_STREAM_POSITION)ftell(me->input_handle); +} + +QUEX_INLINE void +QUEX_NAME(ByteLoader_FILE_seek)(QUEX_NAME(ByteLoader)* alter_ego, QUEX_TYPE_STREAM_POSITION Pos) +{ + QUEX_NAME(ByteLoader_FILE)* me = (QUEX_NAME(ByteLoader_FILE)*)(alter_ego); + fseek(me->input_handle, (long)Pos, SEEK_SET); +} + +QUEX_INLINE size_t +QUEX_NAME(ByteLoader_FILE_load)(QUEX_NAME(ByteLoader)* alter_ego, + void* buffer, + const size_t ByteN, + bool* end_of_stream_f) +{ + QUEX_NAME(ByteLoader_FILE)* me = (QUEX_NAME(ByteLoader_FILE)*)(alter_ego); + size_t loaded_byte_n = fread(buffer, 1, ByteN, me->input_handle); +# if 0 + int i; + printf("#load @%i: [", (int)ftell(((QUEX_NAME(ByteLoader_FILE)*)me)->input_handle)); + for(i=0; i<loaded_byte_n; ++i) printf("%02X.", ((uint8_t*)buffer)[i]); + printf("]\n"); +# endif + *end_of_stream_f = feof(me->input_handle) ? true : false; + return loaded_byte_n; +} + +QUEX_INLINE bool +QUEX_NAME(ByteLoader_FILE_compare_handle)(const QUEX_NAME(ByteLoader)* alter_ego_A, + const QUEX_NAME(ByteLoader)* alter_ego_B) +/* RETURNS: true -- if A and B point to the same FILE object. + * false -- else. */ +{ + const QUEX_NAME(ByteLoader_FILE)* A = (QUEX_NAME(ByteLoader_FILE)*)(alter_ego_A); + const QUEX_NAME(ByteLoader_FILE)* B = (QUEX_NAME(ByteLoader_FILE)*)(alter_ego_B); + + return A->input_handle == B->input_handle; +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_FILE_I */ diff --git a/src/parser/ByteLoader_stream b/src/parser/ByteLoader_stream @@ -0,0 +1,27 @@ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_STREAM +#define __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_STREAM +#ifdef __cplusplus + + +#include <quex/code_base/buffer/bytes/ByteLoader> + +QUEX_NAMESPACE_MAIN_OPEN + +template <class StreamType> +class QUEX_NAME(ByteLoader_stream) { +public: + QUEX_NAME(ByteLoader) base; + StreamType* input_handle; +}; + +template <class StreamType> QUEX_INLINE void +QUEX_NAME(ByteLoader_stream_construct)(QUEX_NAME(ByteLoader_stream)<StreamType>* me, StreamType* sh); +template <class StreamType> QUEX_INLINE QUEX_NAME(ByteLoader)* +QUEX_NAME(ByteLoader_stream_new)(StreamType* sh); +QUEX_INLINE QUEX_NAME(ByteLoader)* +QUEX_NAME(ByteLoader_stream_new_from_file_name)(const char* FileName); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __cplusplus */ +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_STREAM */ diff --git a/src/parser/ByteLoader_stream.i b/src/parser/ByteLoader_stream.i @@ -0,0 +1,150 @@ +/* vim: set ft=c: + * (C) Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_STREAM_I +#define __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_STREAM_I + +#if ! defined(__QUEX_OPTION_PLAIN_C) + +#include <fstream> +#include <sstream> + +QUEX_NAMESPACE_MAIN_OPEN + +template <class StreamType> QUEX_INLINE QUEX_TYPE_STREAM_POSITION QUEX_NAME(ByteLoader_stream_tell)(QUEX_NAME(ByteLoader)* me); +template <class StreamType> QUEX_INLINE void QUEX_NAME(ByteLoader_stream_seek)(QUEX_NAME(ByteLoader)* me, + QUEX_TYPE_STREAM_POSITION Pos); +template <class StreamType> QUEX_INLINE size_t QUEX_NAME(ByteLoader_stream_load)(QUEX_NAME(ByteLoader)* me, void* buffer, const size_t ByteN, bool*); +template <class StreamType> QUEX_INLINE void QUEX_NAME(ByteLoader_stream_delete_self)(QUEX_NAME(ByteLoader)* me); +template <class StreamType> QUEX_INLINE bool QUEX_NAME(ByteLoader_stream_compare_handle)(const QUEX_NAME(ByteLoader)* alter_ego_A, + const QUEX_NAME(ByteLoader)* alter_ego_B); + +template <class StreamType> QUEX_INLINE QUEX_NAME(ByteLoader)* +QUEX_NAME(ByteLoader_stream_new)(StreamType* sh) +{ + QUEX_NAME(ByteLoader_stream)<StreamType>* me; + + if( ! sh ) return (QUEX_NAME(ByteLoader)*)0; + + me = (QUEX_NAME(ByteLoader_stream)<StreamType>*)QUEXED(MemoryManager_allocate)(sizeof(QUEX_NAME(ByteLoader_stream)<StreamType>), + E_MemoryObjectType_BYTE_LOADER); + + if( ! me ) return (QUEX_NAME(ByteLoader)*)0; + + QUEX_NAME(ByteLoader_stream_construct)(me, sh); + return &me->base; +} + +QUEX_INLINE QUEX_NAME(ByteLoader)* +QUEX_NAME(ByteLoader_stream_new_from_file_name)(const char* FileName) +{ + std::ifstream* sh = new std::ifstream(FileName, std::ios_base::binary | std::ios::in); + QUEX_NAME(ByteLoader)* alter_ego; + if( ! sh || ! *sh ) { + return (QUEX_NAME(ByteLoader)*)0; + } + alter_ego = QUEX_NAME(ByteLoader_stream_new)(sh); + if( ! alter_ego ) { + return (QUEX_NAME(ByteLoader)*)0; + } + alter_ego->handle_ownership = E_Ownership_LEXICAL_ANALYZER; + return alter_ego; +} + +template <class StreamType> QUEX_INLINE void +QUEX_NAME(ByteLoader_stream_construct)(QUEX_NAME(ByteLoader_stream)<StreamType>* me, + StreamType* sh) +{ + /* IMPORTANT: input_handle must be set BEFORE call to constructor! + * Constructor does call 'tell()' */ + me->input_handle = sh; + + QUEX_NAME(ByteLoader_construct)(&me->base, + QUEX_NAME(ByteLoader_stream_tell)<StreamType>, + QUEX_NAME(ByteLoader_stream_seek)<StreamType>, + QUEX_NAME(ByteLoader_stream_load)<StreamType>, + QUEX_NAME(ByteLoader_stream_delete_self)<StreamType>, + QUEX_NAME(ByteLoader_stream_compare_handle)<StreamType>); +} + +template <class StreamType> QUEX_INLINE void +QUEX_NAME(ByteLoader_stream_delete_self)(QUEX_NAME(ByteLoader)* alter_ego) +{ + QUEX_NAME(ByteLoader_stream)<StreamType>* me = (QUEX_NAME(ByteLoader_stream)<StreamType>*)alter_ego; + + if( me->input_handle && me->base.handle_ownership == E_Ownership_LEXICAL_ANALYZER ) { + delete me->input_handle; + } + QUEXED(MemoryManager_free)(me, E_MemoryObjectType_BYTE_LOADER); +} + +/* The 'char_type' of a stream determines the atomic size of elements which are + * read from the stream. It is unrelated to QUEX_TYPE_LEXATOM which + * determines the size of a buffer element. */ +template <class StreamType> QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(ByteLoader_stream_tell)(QUEX_NAME(ByteLoader)* alter_ego) +{ + QUEX_NAME(ByteLoader_stream)<StreamType>* me = (QUEX_NAME(ByteLoader_stream)<StreamType>*)alter_ego; + const QUEX_TYPE_STREAM_POSITION CharSize = \ + (QUEX_TYPE_STREAM_POSITION)sizeof(typename StreamType::char_type); + std::streampos Position = me->input_handle->tellg(); + + return (QUEX_TYPE_STREAM_POSITION)(Position * CharSize); +} + +template <class StreamType> QUEX_INLINE void +QUEX_NAME(ByteLoader_stream_seek)(QUEX_NAME(ByteLoader)* alter_ego, + QUEX_TYPE_STREAM_POSITION Pos) +{ + QUEX_NAME(ByteLoader_stream)<StreamType>* me = (QUEX_NAME(ByteLoader_stream)<StreamType>*)alter_ego; + const QUEX_TYPE_STREAM_POSITION CharSize = \ + (QUEX_TYPE_STREAM_POSITION)sizeof(typename StreamType::char_type); + std::streampos Target = (std::streampos)(Pos / CharSize); + + me->input_handle->clear(); /* Clear any iostate flag. */ + me->input_handle->seekg(Target); +} + +template <class StreamType> QUEX_INLINE size_t +QUEX_NAME(ByteLoader_stream_load)(QUEX_NAME(ByteLoader)* alter_ego, + void* buffer, + const size_t ByteN, + bool* end_of_stream_f) +{ + QUEX_NAME(ByteLoader_stream)<StreamType>* me = (QUEX_NAME(ByteLoader_stream)<StreamType>*)alter_ego; + const QUEX_TYPE_STREAM_POSITION CharSize = \ + (QUEX_TYPE_STREAM_POSITION)sizeof(typename StreamType::char_type); + + if( ! ByteN ) return (size_t)0; + + me->input_handle->read((typename StreamType::char_type*)buffer, + (std::streamsize)(ByteN / CharSize)); + + const size_t loaded_char_n = (size_t)(me->input_handle->gcount()); + + *end_of_stream_f = me->input_handle->eof(); + + if( (! *end_of_stream_f) && me->input_handle->fail() ) { + throw std::runtime_error("Fatal error during stream reading."); + } + + /* std::fprintf(stdout, "tell 1 = %i, loaded_char_n = %i\n", (long)(me->input_handle->tellg()), loaded_char_n);*/ + return (size_t)(loaded_char_n * CharSize); +} + +template <class StreamType> QUEX_INLINE bool +QUEX_NAME(ByteLoader_stream_compare_handle)(const QUEX_NAME(ByteLoader)* alter_ego_A, + const QUEX_NAME(ByteLoader)* alter_ego_B) +/* RETURNS: true -- if A and B point to the same StreamType object. + * false -- else. */ +{ + const QUEX_NAME(ByteLoader_stream)<StreamType>* A = (QUEX_NAME(ByteLoader_stream)<StreamType>*)(alter_ego_A); + const QUEX_NAME(ByteLoader_stream)<StreamType>* B = (QUEX_NAME(ByteLoader_stream)<StreamType>*)(alter_ego_B); + + return A->input_handle == B->input_handle; +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_OPTION_PLAIN_C */ +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BYTES__BYTE_LOADER_STREAM_I */ + diff --git a/src/parser/C-adaptions.h b/src/parser/C-adaptions.h @@ -0,0 +1,141 @@ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__C_ADAPTIONS_H +#define __QUEX_INCLUDE_GUARD__ANALYZER__C_ADAPTIONS_H + +#ifdef self_accumulator_add +/* Token / Token Policy _____________________________________________________*/ +# undef self_token_take_text + +/* Modes ____________________________________________________________________*/ +# undef self_current_mode_p +# undef self_current_mode_id +# undef self_current_mode_name +/* Map: mode id to mode and vice versa */ +# undef self_map_mode_id_to_mode_p +# undef self_map_mode_p_to_mode_id +/* Changing Modes */ +# undef self_set_mode_brutally +# undef self_enter_mode +/* Changing Modes with stack */ +# undef self_pop_mode +# undef self_pop_drop_mode +# undef self_push_mode +/* Undo lexeme match */ +# undef self_undo +# undef self_undo_n + +/* Accumulator ______________________________________________________________*/ +# undef self_accumulator_add +# undef self_accumulator_add_character +# undef self_accumulator_clear +# undef self_accumulator_flush +# undef self_accumulator_is_empty +/* Indentation/Counter _____________________________________________________*/ +# ifdef QUEX_OPTION_LINE_NUMBER_COUNTING +# undef self_line_number +# undef self_line_number_at_begin +# undef self_line_number_at_begin_set +# undef self_line_number_at_end +# endif +# ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING +# undef self_column_number +# undef self_column_number_at_begin +# undef self_column_number_at_begin_set +# undef self_column_number_at_end +# endif +# ifdef QUEX_OPTION_INDENTATION_TRIGGER +# undef self_indentation +# undef self_disable_next_indentation_event +# endif +#endif + +/* Token / Token Policy + * (NOTE: Macros for token sending are defined separately in file 'member/token-sending'. + * Those macros have to perform a little 'type loose'). */ +#define self_token_take_text(Begin, End) \ + QUEX_NAME_TOKEN(take_text)(__QUEX_CURRENT_TOKEN_P, &self, (Begin), (End)) + +/* Modes */ +#define self_current_mode_p() /* QUEX_NAME(Mode)* */ QUEX_NAME(mode)(&self) +#define self_current_mode_id() /* int */ QUEX_NAME(mode_id)(&self) +#define self_current_mode_name() /* const char* */ QUEX_NAME(mode_name)(&self) + +/* Map: mode id to mode and vice versa */ +#define self_map_mode_id_to_mode_p(ID) QUEX_NAME(map_mode_id_to_mode)(&self, (ID)) +#define self_map_mode_p_to_mode_id(ModeP) QUEX_NAME(map_mode_to_mode_id)(&self, (ModeP)) + +/* Changing Modes */ +#define self_set_mode_brutally(ModeP) QUEX_NAME(set_mode_brutally)(&self, (ModeP)) + +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE +#define self_enter_mode(ModeP) \ + QUEX_NAME(enter_mode)(&self, (ModeP)) +#else +#define self_enter_mode(ModeP) \ + do { \ + QUEX_NAME(enter_mode)(&self, (ModeP)); \ + __self_result_token_id = self_write_token_p()->_id; \ + } while(0) +#endif + +/* Changing Modes with stack */ +#define self_pop_mode() QUEX_NAME(pop_mode)(&self) +#define self_pop_drop_mode() QUEX_NAME(pop_drop_mode)(&self) +#define self_push_mode(ModeP) QUEX_NAME(push_mode)(&self, (ModeP)) + +#ifdef QUEX_OPTION_LINE_NUMBER_COUNTING +# define self_line_number_at_begin() (self.counter._line_number_at_begin) +# define self_line_number_at_begin_set(X) do { self.counter._line_number_at_begin = (X); } while(0) +# define self_line_number_at_end() (self.counter._line_number_at_end) +# define self_line_number() (self_line_number_at_begin()) +#endif +#ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING +# define self_column_number_at_begin() (self.counter._column_number_at_begin) +# define self_column_number_at_begin_set(X) do { self.counter._column_number_at_begin = (X); } while(0) +# define self_column_number_at_end() (self.counter._column_number_at_end) +# define self_column_number() (self_column_number_at_begin()) +#endif +#ifdef QUEX_OPTION_INDENTATION_TRIGGER +# define self_indentation() (counter._indentation_stack.back - counter._indentation_stack.front + 1) +#endif + +/* Accumulator ______________________________________________________________*/ +# define self_accumulator_add(Begin, End) QUEX_NAME(Accumulator_add)(&self.accumulator, Begin, End) +# define self_accumulator_add_character(Char) QUEX_NAME(Accumulator_add_character)(&self.accumulator, Char) +# define self_accumulator_clear() QUEX_NAME(Accumulator_clear)(&self.accumulator) +# define self_accumulator_is_empty() (self.accumulator.text.begin == self.accumulator.text.end) +# define self_accumulator_flush(TokenID) \ + do { \ + /* All functions must ensure: there is one cell to store terminating zero. */ \ + __quex_assert(self.accumulator.text.end < self.accumulator.text.memory_end); \ + \ + /* If no text is to be flushed, behave the same as self_send */ \ + /* That is: self_token_set_id(ID); */ \ + /* QUEX_TOKEN_POLICY_PREPARE_NEXT(); */ \ + /* BUT: We clear the text of the otherwise void token. */ \ + self_token_set_id(TokenID) ; \ + if( self.accumulator.text.begin == self.accumulator.text.end ) { \ + QUEX_NAME_TOKEN(take_text)(__QUEX_CURRENT_TOKEN_P, &self, \ + &QUEX_LEXEME_NULL, \ + (&QUEX_LEXEME_NULL) + 1); \ + } \ + else { \ + *(self.accumulator.text.end) = (QUEX_TYPE_LEXATOM)0; /* see above */ \ + \ + if( QUEX_NAME_TOKEN(take_text)(__QUEX_CURRENT_TOKEN_P, &self, \ + self.accumulator.text.begin, \ + self.accumulator.text.end) == false ) { \ + /* The called function does not need the memory chunk, we reuse it. */ \ + QUEX_NAME(Accumulator_clear)(&self.accumulator); \ + } else { \ + /* The called function wants to use the memory, so we get some new. */ \ + QUEX_NAME(Accumulator_init_memory)(&self.accumulator); \ + } \ + } \ + QUEX_TOKEN_POLICY_PREPARE_NEXT(); \ + } while(0) + +/* Undo lexeme match */ +# define self_undo() QUEX_NAME(undo)(&self) +# define self_undo_n(N) QUEX_NAME(undo_n)(&self, N) + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__C_ADAPTIONS_H */ diff --git a/src/parser/Converter b/src/parser/Converter @@ -0,0 +1,95 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2007-2016 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__CONVERTER__CONVERTER +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__CONVERTER__CONVERTER + +#include "definitions" +#include "MemoryManager" + +QUEX_NAMESPACE_MAIN_OPEN + + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(Converter_tag) { + E_Ownership ownership; + + E_LoadResult (*convert)(struct QUEX_NAME(Converter_tag)*, + uint8_t** source, const uint8_t* SourceEnd, + QUEX_TYPE_LEXATOM** drain, const QUEX_TYPE_LEXATOM* DrainEnd); + /* Tries to convert all lexatoms given in 'source' with the coding specified + * earlier to _open(...). 'source' and 'drain' are passed as pointers to pointers + * so that the pointers can be changed. This way the converter can inform the + * user about the state of conversion from source to drain buffer. + * + * BEFORE: *source SourceEnd + * | | + * [ .....................] source buffer + * + * *drain DrainEnd + * | | + * [.... ] drain buffer + * + * At the beginning, 'source' points to the first lexatom to be + * converted. 'drain' points to the place where the first converted + * lexatom is to be written to. + * + * AFTER: *source + * | + * [ .....] source buffer + * + * *drain + * | + * [............. ] drain buffer + * + * After conversion, 'source' points immediately behind the last + * lexatom that was subject to conversion. 'drain' points behind the + * last lexatom that resulted from the conversion. + * + * RETURNS: true --> Drain buffer is filled as much as possible with converted + * lexatoms. + * false --> More source bytes are needed to fill the drain buffer. */ + + ptrdiff_t (*stomach_byte_n)(struct QUEX_NAME(Converter_tag)*); + void (*stomach_clear)(struct QUEX_NAME(Converter_tag)*); + /* [OPTIONAL] can be set to '0x0'. + * + * This function is called whenever a conversion discontinuity appears. + * Such cases appear only when the user navigates through the input + * stream (seek_lexatom_index(...)), or with long pre-conditions when + * the buffer size is exceeded. + * + * For 'normal' converters this function can be set to '0x0'. If a converter + * has an internal 'statefulness' that is difficult to be tamed, then use + * this function to reset the converter. Actually, the initial reason + * for introducing the function pointer was the strange behavior of the + * ICU Converters of IBM(R). */ + + void (*delete_self)(struct QUEX_NAME(Converter_tag)*); + /* Closes the conversion handle produced with open(...). + * Deletes the object of the derived class. */ + + int byte_n_per_lexatom; + /* Some encodings (such as UTF-8) occupy different number of bytes for different + * lexatoms. Others, such as ASCII or UCS-4 use the same number of bytes for + * all lexatoms of the lexatom set. Using the flag, the buffer filler can + * adapt the seek algorithm for navigation in the lexatom stream. */ + + bool virginity_f; + +} QUEX_NAME(Converter); + +QUEX_INLINE bool +QUEX_NAME(Converter_construct)(QUEX_NAME(Converter)* me, + const char* FromCodec, const char* ToCodec, + bool (*open)(QUEX_NAME(Converter)*, + const char* FromCodingName, const char* ToCodingName), + E_LoadResult (*convert)(QUEX_NAME(Converter)*, + uint8_t** source, const uint8_t* SourceEnd, + QUEX_TYPE_LEXATOM** drain, const QUEX_TYPE_LEXATOM* DrainEnd), + void (*delete_self)(QUEX_NAME(Converter)*), + ptrdiff_t (*stomach_byte_n)(QUEX_NAME(Converter)*), + void (*stomach_clear)(QUEX_NAME(Converter)*)); + + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__CONVERTER__CONVERTER */ diff --git a/src/parser/Converter.i b/src/parser/Converter.i @@ -0,0 +1,47 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2007-2008 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__CONVERTER__CONVERTER_I +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__CONVERTER__CONVERTER_I + +#include "MemoryManager" +#include "Converter" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE bool +QUEX_NAME(Converter_construct)(QUEX_NAME(Converter)* me, + const char* FromCodec, const char* ToCodec, + bool (*open)(struct QUEX_NAME(Converter_tag)*, + const char* FromCodec, const char* ToCodec), + E_LoadResult (*convert)(QUEX_NAME(Converter)*, + uint8_t** source, const uint8_t* SourceEnd, + QUEX_TYPE_LEXATOM** drain, const QUEX_TYPE_LEXATOM* DrainEnd), + void (*delete_self)(QUEX_NAME(Converter)*), + ptrdiff_t (*stomach_byte_n)(QUEX_NAME(Converter)*), + void (*stomach_clear)(QUEX_NAME(Converter)*)) +/* RETURNS: true -- construction succesful + * false -- else. */ +{ + me->convert = convert; + me->stomach_byte_n = stomach_byte_n; + me->stomach_clear = stomach_clear; + me->delete_self = delete_self; + + me->virginity_f = true; + me->byte_n_per_lexatom = -1; /* No fixed ratio 'byte_n/lexatom' */ + me->ownership = E_Ownership_EXTERNAL; + + /* Opens internally a conversion handle for the conversion from 'FromCodec' + * to 'ToCodec'. Pass '0x0' as 'ToCodec' in order to indicate a conversion + * to unicode of size sizeof(QUEX_TYPE_LEXATOM). + * + * It is the task of the particular implementation to provide the 'ToCodec' + * which is appropriate for sizeof(QUEX_TYPE_LEXATOM), i.e. ASCII, UCS2, + * UCS4. */ + + return open(me, FromCodec, ToCodec); +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__CONVERTER__CONVERTER_I */ diff --git a/src/parser/Counter.i b/src/parser/Counter.i @@ -0,0 +1,102 @@ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__COUNTER_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__COUNTER_I + +#include "definitions" +#include "analyzerAsserts" +#include "analyzerCounter" + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE void + QUEX_NAME(Counter_construct)(QUEX_NAME(Counter)* me) + { + /* Set all to '0xFF' in order to catch easily a lack of initialization. */ + __QUEX_IF_ASSERTS(memset((void*)me, 0xFF, sizeof(QUEX_NAME(Counter)))); + + __QUEX_IF_COUNT_LINES(me->_line_number_at_begin = (size_t)1); + __QUEX_IF_COUNT_LINES(me->_line_number_at_end = (size_t)1); + __QUEX_IF_COUNT_COLUMNS(me->_column_number_at_begin = (size_t)1); + __QUEX_IF_COUNT_COLUMNS(me->_column_number_at_end = (size_t)1); + __QUEX_IF_COUNT_INDENTATION(QUEX_NAME(IndentationStack_init)(&me->_indentation_stack)); + } + +#if 0 + QUEX_INLINE void + QUEX_NAME(Counter_count)(QUEX_NAME(Counter)* me, + const QUEX_TYPE_LEXATOM* LexemeBegin, + const QUEX_TYPE_LEXATOM* LexemeEnd) + { + const QUEX_TYPE_LEXATOM* it = LexemeBegin; + + __QUEX_COUNTER_SHIFT_VALUES(*me); + + while( it != LexemeEnd ) + { + __QUEX_COUNTER_RULES(*me, it); + } + + __QUEX_ASSERT_COUNTER_CONSISTENCY(me); \ + } + +# if ! defined(__QUEX_COUNTER_RULES_NEWLINE) +# define __QUEX_COUNTER_RULES_NEWLINE(counter, iterator) \ + if( *iterator == (QUEX_TYPE_LEXATOM)'\n' ) { \ + (counter)._line_number_at_end += 1; \ + (counter)._column_number_at_end = 0; \ + } +# endif + + QUEX_INLINE void + QUEX_NAME(Counter_count_newlines)(QUEX_NAME(Counter)* me, + const QUEX_TYPE_LEXATOM* LexemeBegin, + const QUEX_TYPE_LEXATOM* LexemeEnd) + { + const QUEX_TYPE_LEXATOM* it = LexemeBegin; + + __QUEX_COUNTER_SHIFT_VALUES(*me); + + while( it != LexemeEnd ) + { + __QUEX_COUNTER_RULES_NEWLINE(*me, it); + } + __QUEX_ASSERT_COUNTER_CONSISTENCY(me); \ + } +#endif + + QUEX_INLINE void + QUEX_NAME(Counter_print_this)(QUEX_NAME(Counter)* me) + { + __QUEX_IF_COUNT_INDENTATION(size_t* it = 0x0); + + __QUEX_STD_fprintf(stdout, " Counter:\n"); +# ifdef QUEX_OPTION_LINE_NUMBER_COUNTING + __QUEX_STD_fprintf(stdout, " _line_number_at_begin = %i;\n", (int)me->_line_number_at_begin); + __QUEX_STD_fprintf(stdout, " _line_number_at_end = %i;\n", (int)me->_line_number_at_end); +# endif +# ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING + __QUEX_STD_fprintf(stdout, " _column_number_at_begin = %i;\n", (int)me->_column_number_at_begin); + __QUEX_STD_fprintf(stdout, " _column_number_at_end = %i;\n", (int)me->_column_number_at_end); +# endif +# ifdef QUEX_OPTION_INDENTATION_TRIGGER + __QUEX_STD_fprintf(stdout, " _indentation_stack = {"); + for(it = me->_indentation_stack.front; it != me->_indentation_stack.back + 1; ++it) { + __QUEX_STD_fprintf(stdout, "%i, ", (int)*it); + } + __QUEX_STD_fprintf(stdout, "}\n"); +# endif + } + +#if defined(QUEX_OPTION_INDENTATION_TRIGGER) + QUEX_INLINE void + QUEX_NAME(IndentationStack_init)(QUEX_NAME(IndentationStack)* me) + { + *(me->front) = 1; /* first indentation at column = 1 */ + me->back = me->front; + me->memory_end = me->front + QUEX_SETTING_INDENTATION_STACK_SIZE; + } +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__COUNTER_I */ + diff --git a/src/parser/EasyLexer-configuration.h b/src/parser/EasyLexer-configuration.h @@ -0,0 +1,401 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * + * (C) 2005-2015 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION__QUEX___EASYLEXER +#define __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION__QUEX___EASYLEXER +/* Additionally to the 'local' include guard, there is an include indicator + * + * __INCLUDE_INDICATOR_QUEX__CONFIGURATION + * + * If it is defined, this means, that another lexical analyzer configuration + * has been included before this. That in turn means, that multiple lexical + * analyzers are used. The configuration settings of the previous analyzer + * need to be undefined. And, this happens in "configuration/undefine". + * + * NOTE: We do undefine without making sure that there is an older definition + * from a configuration file. This allows users to define some + * configuration options on the command line without being immediately + * deleted by "configuration/undefine". */ +#ifdef __QUEX_INCLUDE_INDICATOR__ANALYZER__CONFIGURATION +# include <quex/code_base/analyzer/configuration/undefine> +#else +# define __QUEX_INCLUDE_INDICATOR__ANALYZER__CONFIGURATION +#endif + +#define QUEX_SETTING_VERSION "0.66.5" +#define QUEX_SETTING_BUILD_DATE "Mon Jul 10 22:38:27 2017" +#define QUEX_SETTING_ANALYZER_VERSION "0.0.0-pre-release" + +#ifndef __QUEX_OPTION_PLAIN_C +#define __QUEX_OPTION_PLAIN_C +#endif + +/* Following checks are best done here: + * -- Verification of the 'C++/C' version. + * -- Assert control by this configuration file. + * + * Errors would be hard to find if the two checks were made in + * -- 'quex/code_base/configuration/validation' or + * -- 'quex/code_base/configuration/derived'. */ +#if ! defined(__QUEX_OPTION_PLAIN_C) && ! defined(__cplusplus) +# error "__QUEX_OPTION_PLAIN_C must be defined if no C++ compiler is used! Call quex with option '--language C'." +#endif + +#if defined(__QUEX_INCLUDE_INDICATOR__ASSERTS) +# error "Asserts included before configuration file. However, the configuration file MUST control asserts!" +#endif +# +#if defined(QUEX_OPTION_ASSERTS_DISABLED) || defined(NDEBUG) +# ifdef QUEX_OPTION_ASSERTS +# undef QUEX_OPTION_ASSERTS +# endif +#else +# ifndef QUEX_OPTION_ASSERTS +# define QUEX_OPTION_ASSERTS +# endif +#endif + +#ifndef QUEX_OPTION_COMPUTED_GOTOS +/* #define QUEX_OPTION_COMPUTED_GOTOS */ +#endif + +#define QUEX_SETTING_CHARACTER_NEWLINE_IN_ENGINE_CODEC ('\n') + +#define __QUEX_SETTING_MAX_MODE_CLASS_N (1) +#ifndef __QUEX_SETTING_INITIAL_LEXER_MODE_ID +# define __QUEX_SETTING_INITIAL_LEXER_MODE_ID (QUEX_NAME(ModeID_PROGRAM)) +#endif +/* QUEX_TYPE_TOKEN_ID is later on defined inside the token class header. */ +#define __QUEX_SETTING_TOKEN_ID_TERMINATION ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_TERMINATION) +#define __QUEX_SETTING_TOKEN_ID_UNINITIALIZED ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_UNINITIALIZED) +#define __QUEX_SETTING_TOKEN_ID_INDENT ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_INDENT) +#define __QUEX_SETTING_TOKEN_ID_DEDENT ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_DEDENT) +#define __QUEX_SETTING_TOKEN_ID_NODENT ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_NODENT) +#define __QUEX_SETTING_TOKEN_ID_REPETITION_TEST(TokenID) (false) + +#ifndef __QUEX_OPTION_LITTLE_ENDIAN +#define __QUEX_OPTION_LITTLE_ENDIAN +#endif +#ifndef __QUEX_OPTION_BIG_ENDIAN +/* #define __QUEX_OPTION_BIG_ENDIAN */ +#endif +#ifndef __QUEX_OPTION_SYSTEM_ENDIAN +#define __QUEX_OPTION_SYSTEM_ENDIAN +#endif + +#if (! defined(QUEX_OPTION_TOKEN_POLICY_QUEUE)) && (! defined(QUEX_OPTION_TOKEN_POLICY_QUEUE)) +#ifndef QUEX_OPTION_TOKEN_POLICY_QUEUE +#define QUEX_OPTION_TOKEN_POLICY_QUEUE +#endif +#ifndef QUEX_OPTION_TOKEN_POLICY_SINGLE +/* #define QUEX_OPTION_TOKEN_POLICY_SINGLE */ +#endif +#endif + +#ifndef QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY +/* #define QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY */ +#endif + +#if defined (QUEX_OPTION_TOKEN_POLICY_QUEUE) +# ifndef QUEX_SETTING_TOKEN_QUEUE_SIZE +# define QUEX_SETTING_TOKEN_QUEUE_SIZE ((size_t)64) +# endif +# ifndef QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER +# define QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER ((size_t)16) +# endif +#endif + +#ifndef QUEX_OPTION_TOKEN_REPETITION_SUPPORT +/* #define QUEX_OPTION_TOKEN_REPETITION_SUPPORT */ +#endif + +/* OPTIONS: ___________________________________________________________________ + * + * Activate/Deactivate Options via comment/uncomment. Options without a + * double underline '__' at the beginning can be turned off in the created + * engine. Options that do start with '__' configure the machine for the + * specified behavior. Such options are better not touched. + * + * -- Line Number / Column Number Counting: + * Turning counting off may result in engine speed-up. */ +#ifndef QUEX_OPTION_LINE_NUMBER_COUNTING +#define QUEX_OPTION_LINE_NUMBER_COUNTING +#endif +#ifndef QUEX_OPTION_COLUMN_NUMBER_COUNTING +#define QUEX_OPTION_COLUMN_NUMBER_COUNTING +#endif + +#define QUEX_IF_IS_NEWLINE(X) if( X == '\n' ) + +#ifndef QUEX_OPTION_POST_CATEGORIZER +/* #define QUEX_OPTION_POST_CATEGORIZER */ +#endif + +/* Mode Transitions: + * If the engine was created without the flag '--no-mode-transition-check' + * then code for mode transition control is inserted. It can be deactivated + * by commenting the following option out. */ +#ifndef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK +#define QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK +#endif + +#ifndef QUEX_SETTING_MODE_STACK_SIZE +# define QUEX_SETTING_MODE_STACK_SIZE (size_t)8 +#endif + +/* Verbosity (uncomment the following, if you want it verbose.) */ +/* #define QUEX_OPTION_ASSERTS_WARNING_MESSAGE_DISABLED */ + +/* Include Stack Support */ +#ifndef QUEX_OPTION_INCLUDE_STACK +#define QUEX_OPTION_INCLUDE_STACK +#endif + +/* BLC -- Buffer Limit Code: + * + * This code is used as a delimiter for buffer borders. When the analyzer + * hits a character with such a code, it knows that a border or the + * end of file has been reached. + * + * IT IS NOT SUPPOSED TO APPEAR IN THE NORMAL CHARACTER STREAM. */ +#ifndef QUEX_SETTING_BUFFER_LIMIT_CODE +# define QUEX_SETTING_BUFFER_LIMIT_CODE ((QUEX_TYPE_LEXATOM)0x0) +#endif + +/* PTC -- Path Termination code: + * + * Only required for path compression (see option '--path-compression' and + * '--path-compression-uniform' for quex on the command line). PTC must be + * different from the BLC so that the pathwalker does not get confuses if + * the input pointer stands on a buffer border and at the same time the + * path iterator stands at the end of the path. + * + * IT IS NOT SUPPOSED TO APPEAR IN THE NORMAL CHARACTER STREAM. */ +#ifndef QUEX_SETTING_PATH_TERMINATION_CODE +# define QUEX_SETTING_PATH_TERMINATION_CODE ((QUEX_TYPE_LEXATOM)0x1) +#endif + +/* NOTE: A cast to 'size_t' would it make impossible to use the macro in + * pre-processor comparisons. */ +#ifndef QUEX_SETTING_BUFFER_SIZE + /* This setting must be defined as plain number, since there might + * be some pre-processor comparison operations depending on it. */ +# define QUEX_SETTING_BUFFER_SIZE 65536 +#endif + +#ifndef QUEX_SETTING_BUFFER_FILLER_SEEK_TEMP_BUFFER_SIZE +# define QUEX_SETTING_BUFFER_FILLER_SEEK_TEMP_BUFFER_SIZE (512) +#endif +#ifndef QUEX_SETTING_ICU_PIVOT_BUFFER_SIZE +# define QUEX_SETTING_ICU_PIVOT_BUFFER_SIZE (64) +#endif + +#ifndef QUEX_OPTION_STRING_ACCUMULATOR +#define QUEX_OPTION_STRING_ACCUMULATOR +#endif +/* Initial size of the character accumulator. */ +#ifndef QUEX_SETTING_ACCUMULATOR_INITIAL_SIZE +# define QUEX_SETTING_ACCUMULATOR_INITIAL_SIZE (256) +#endif + +/* Granularity, if new memory has to be allocated. The new memory will be by + * this factor greater than the previous. Example: At start, memory contains + * 256 characters; then new allocation becomes necessary; if factor = 0.5, then + * the new memory will contain (256 + 128) = 384 characters. The next time, the + * new memory of size (384 + 192) = 576 characters. */ + +#ifndef QUEX_SETTING_ACCUMULATOR_GRANULARITY_FACTOR +# define QUEX_SETTING_ACCUMULATOR_GRANULARITY_FACTOR (0.8) +#endif + +/* If one mode requires indentation support, then the lexical analyser class + * must be setup for indentation counting. The following flag is defined or + * undefined by the lexical analyser generator quex. */ +#define QUEX_OPTION_INDENTATION_TRIGGER +#if defined(QUEX_OPTION_INDENTATION_TRIGGER) +# ifndef QUEX_SETTING_INDENTATION_STACK_SIZE +# define QUEX_SETTING_INDENTATION_STACK_SIZE (64) +# endif +# ifndef QUEX_TYPE_INDENTATION +# define QUEX_TYPE_INDENTATION size_t +# endif +#endif + +/* Quex can determine whether certain handlers are not used at all. If so, + * computation time can be spared and quex comments the following options out. + * */ +/* #define __QUEX_OPTION_ON_ENTRY_HANDLER_PRESENT */ +/* #define __QUEX_OPTION_ON_EXIT_HANDLER_PRESENT */ +/* #define QUEX_OPTION_CONVERTER_ICONV */ +/* #define QUEX_OPTION_CONVERTER_ICU */ +#if defined(QUEX_OPTION_CONVERTER_ICONV) || defined(QUEX_OPTION_CONVERTER_ICU) +# ifndef QUEX_SETTING_TRANSLATION_BUFFER_SIZE +# define QUEX_SETTING_TRANSLATION_BUFFER_SIZE ((size_t)65536) +# endif +#else +# ifndef QUEX_SETTING_TRANSLATION_BUFFER_SIZE +# define QUEX_SETTING_TRANSLATION_BUFFER_SIZE ((size_t)0) +# endif +#endif +/* The call the the 'new' function for the converter, i.e. the function that + * allocates the converter and initializes it. If it is 0x0, this means that + * the converter pointer is set to 0x0. */ +#ifndef QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW +/* # define QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW */ +#endif + +/* Begin of line pre-condition requires an extra flag in the buffer + * structure. Only out-comment this in case of tough memory restrictions, + * if no begin of line pre-condition is required. */ +/* #define __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION */ + +/* Following switch is also set, if a user defined converter is defined. */ +#ifndef __QUEX_OPTION_CONVERTER +/* #define __QUEX_OPTION_CONVERTER */ +#endif +#ifndef __QUEX_OPTION_CONVERTER_HELPER +/* #define __QUEX_OPTION_CONVERTER_HELPER */ +#endif + +/* Type Definitions + * + * CHARACTER TYPE: Type that represents the number of bytes used in the engine + * to store a character. This is independent of the coding (ASCII, WinArabic, + * ...) + * + * Both character types are clearly related, because they are supposed to + * relate to the same type of objects in memory. The following example shows, + * that 'uint8_t' and 'char' belong together, the lexeme type cannot be + * 'uint8_t' because the std-string functions accept 'char*' and not 'uint8_t' + * (which is most propperly 'unsigned char'). + * + * NOTE: If in parallel another engine is built with other bytes per character + * settings, then the engines will also include their own header with their own + * definition of QUEX_TYPE_LEXATOM. Thus there is no danger at all. + * Templatifying the lexer would be possible, but the author has in mind to + * bring out a 'pure C' version of the quex generated engine. Thus templating + * would make this goal harder achievable. + * */ +#ifndef QUEX_TYPE_LEXATOM +# define QUEX_TYPE_LEXATOM uint8_t +# define QUEX_TYPE_LEXATOM_BACKUP uint8_t +#endif +#ifndef QUEX_SETTING_CHARACTER_SIZE + /* Size of a QUEX_TYPE_LEXATOM in bytes. A numeric value is required + * here! '-1' stands for 'Cannot be determined at code generation time'. + * In this case, it must be relied upon 'sizeof(QUEX_TYPE_LEXATOM)'. */ +# define QUEX_SETTING_CHARACTER_SIZE 1 +#endif +#ifndef QUEX_SETTING_CHARACTER_CODEC +# define QUEX_SETTING_CHARACTER_CODEC unicode +#endif +/* The following flag indicates that the engine is running on a specific + * codec. Thus no converter is necessary. Use the flag to detect misuse. */ +/* #define __QUEX_OPTION_ENGINE_RUNNING_ON_CODEC */ + +#ifndef QUEX_TYPE_ACCEPTANCE_ID +# define QUEX_TYPE_ACCEPTANCE_ID int +#endif + +/* QUEX_TYPE_X --> Type of X in global namespace + * QUEX_TYPE0_X --> Type of X in local namespace (namespace omitted) */ +#if defined(__QUEX_OPTION_PLAIN_C) +# define QUEX_FUNCTION_PREFIX quex_EasyLexer_ +# define QUEX_FUNCTION_DEF_PREFIX quex_EasyLexer_ + /* In 'C' there are no namespaces, so namespaces are coded directly + * into the type name. Both, global and local names are equal. */ +# define QUEX_TYPE0_ANALYZER struct quex_EasyLexer_tag +# define QUEX_TYPE_ANALYZER struct quex_EasyLexer_tag +# define QUEX_NAME_COMPLETE_ANALYZER quex_EasyLexer +# define QUEX_TYPE_DERIVED_ANALYZER struct quex_EasyLexer_tag + +# define QUEX_TYPE0_TOKEN struct quex_Token_tag +# define QUEX_TYPE_TOKEN struct quex_Token_tag +# define QUEX_NAME_COMPLETE_TOKEN quex_Token + +# define QUEX_NAMESPACE_MAIN quex_EasyLexer +# define QUEX_NAMESPACE_MAIN_OPEN +# define QUEX_NAMESPACE_MAIN_CLOSE + +# define QUEX_NAMESPACE_TOKEN +# define QUEX_NAMESPACE_TOKEN_OPEN +# define QUEX_NAMESPACE_TOKEN_CLOSE + +# define QUEX_NAMESPACE_LEXEME_NULL_OPEN +# define QUEX_NAMESPACE_LEXEME_NULL_CLOSE +# define QUEX_LEXEME_NULL_IN_ITS_NAMESPACE quex_LexemeNullObject +# define QUEX_LEXEME_NULL quex_LexemeNullObject + +# define QUEX_NAME(NAME) quex_EasyLexer_ ## NAME +# define QUEX_NAME_TOKEN(NAME) quex_Token_ ## NAME +# define QUEX_MEMBER(NAME) void /* Undefined, not required */ + /* When creating a 'shared token class', macros are temporarily redefined. + * This happens to generate converters in the token's namespace. After + * that, the original macros need to be restored. Thus: Backup! */ +# define QUEX_NAMESPACE_MAIN_OPEN_BACKUP +# define QUEX_NAMESPACE_MAIN_CLOSE_BACKUP +# define QUEX_FUNCTION_PREFIX_BACKUP quex_EasyLexer_ +# define QUEX_FUNCTION_DEF_PREFIX_BACKUP quex_EasyLexer_ + +#else + /* Assumption: here is IN the namespace for definition. */ +# define QUEX_FUNCTION_DEF_PREFIX +# define QUEX_FUNCTION_PREFIX quex:: + /* Add namespaces for the global names of the classes of analyzer + * and token. */ +# define QUEX_TYPE0_ANALYZER EasyLexer +# define QUEX_TYPE_ANALYZER quex::EasyLexer +# define QUEX_NAME_COMPLETE_ANALYZER quex::EasyLexer +# define QUEX_TYPE_DERIVED_ANALYZER EasyLexer + +# define QUEX_TYPE0_TOKEN Token +# define QUEX_TYPE_TOKEN quex::Token +# define QUEX_NAME_COMPLETE_TOKEN quex::Token + +# define QUEX_NAMESPACE_MAIN quex +# define QUEX_NAMESPACE_MAIN_OPEN namespace quex {\ + +# define QUEX_NAMESPACE_MAIN_CLOSE } /* Closing Namespace 'quex' */\ + + +# define QUEX_NAMESPACE_TOKEN quex +# define QUEX_NAMESPACE_TOKEN_OPEN namespace quex {\ + +# define QUEX_NAMESPACE_TOKEN_CLOSE } /* Closing Namespace 'quex' */\ + + +# define QUEX_NAMESPACE_LEXEME_NULL_OPEN namespace quex {\ + +# define QUEX_NAMESPACE_LEXEME_NULL_CLOSE } /* Closing Namespace 'quex' */\ + +# define QUEX_LEXEME_NULL_IN_ITS_NAMESPACE LexemeNullObject +# define QUEX_LEXEME_NULL ::quex::LexemeNullObject + +# define QUEX_NAME(NAME) EasyLexer_ ## NAME +# define QUEX_NAME_TOKEN(NAME) Token_ ## NAME +# define QUEX_MEMBER(NAME) EasyLexer::NAME + /* When creating a 'shared token class', macros are temporarily redefined. + * This happens to generate converters in the token's namespace. After + * that, the original macros need to be restored. Thus: Backup! */ +# define QUEX_NAMESPACE_MAIN_OPEN_BACKUP namespace quex {\ + +# define QUEX_NAMESPACE_MAIN_CLOSE_BACKUP } /* Closing Namespace 'quex' */\ + +# define QUEX_FUNCTION_PREFIX_BACKUP +# define QUEX_FUNCTION_DEF_PREFIX_BACKUP quex:: +#endif + +#ifndef QUEX_TYPE_TOKEN_ID +# define QUEX_TYPE_TOKEN_ID uint32_t +#endif +#ifndef QUEX_TYPE_TOKEN_LINE_N +# define QUEX_TYPE_TOKEN_LINE_N size_t +#endif +#ifndef QUEX_TYPE_TOKEN_COLUMN_N +# define QUEX_TYPE_TOKEN_COLUMN_N size_t +#endif + +#include "analyzerConfigDerived" + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION__QUEX___EASYLEXER */ diff --git a/src/parser/EasyLexer-token.h b/src/parser/EasyLexer-token.h @@ -0,0 +1,109 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2004-2009 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY + */ +#ifndef __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN +#define __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN + +/* For '--token-class-only' the following option may not come directly + * from the configuration file. */ +#ifndef __QUEX_OPTION_PLAIN_C +# define __QUEX_OPTION_PLAIN_C +#endif +#include "definitions" +#include "asserts" +#include "compatStdint.h" +#include "MemoryManager" + +/* LexemeNull object may be used for 'take_text'. */ +QUEX_NAMESPACE_LEXEME_NULL_OPEN +extern QUEX_TYPE_LEXATOM QUEX_LEXEME_NULL_IN_ITS_NAMESPACE; +QUEX_NAMESPACE_LEXEME_NULL_CLOSE + + + +# line 2 "CDefault.qx" + + #include <stdio.h> + #include <string.h> + + struct quex_Token_tag; + + extern const char* + quex_Token_get_string(struct quex_Token_tag* me, char* buffer, size_t BufferSize); + + extern const char* + quex_Token_pretty_char_text(struct quex_Token_tag* me, char* buffer, size_t BufferSize); + +# if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) + extern const wchar_t* + quex_Token_pretty_wchar_text(struct quex_Token_tag* me, wchar_t* buffer, size_t BufferSize); +# endif + +#include "identity" + + +# line 47 "EasyLexer-token.h" + + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG quex_Token_tag { + QUEX_TYPE_TOKEN_ID _id; + +# line 27 "CDefault.qx" + const QUEX_TYPE_LEXATOM* text; + +# line 56 "EasyLexer-token.h" + +# line 28 "CDefault.qx" + size_t number; + +# line 61 "EasyLexer-token.h" + + +# ifdef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN +# ifdef QUEX_OPTION_LINE_NUMBER_COUNTING + QUEX_TYPE_TOKEN_LINE_N _line_n; +# endif +# ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING + QUEX_TYPE_TOKEN_COLUMN_N _column_n; +# endif +# endif + +# line 126 "CDefault.qx" + + /* + */ + + +# line 79 "EasyLexer-token.h" + +} quex_Token; + +QUEX_INLINE void quex_Token_construct(quex_Token*); +QUEX_INLINE void quex_Token_copy_construct(quex_Token*, + const quex_Token*); +QUEX_INLINE void quex_Token_copy(quex_Token*, const quex_Token*); +QUEX_INLINE void quex_Token_destruct(quex_Token*); + +/* NOTE: Setters and getters as in the C++ version of the token class are not + * necessary, since the members are accessed directly. */ + +QUEX_INLINE void +quex_Token_set(quex_Token* __this, + const QUEX_TYPE_TOKEN_ID ID); + +extern const char* quex_Token_map_id_to_name(const QUEX_TYPE_TOKEN_ID); + +QUEX_INLINE bool +quex_Token_take_text(quex_Token* __this, + QUEX_TYPE_ANALYZER* analyzer, + const QUEX_TYPE_LEXATOM* Begin, const QUEX_TYPE_LEXATOM* End); + +#ifdef QUEX_OPTION_TOKEN_REPETITION_SUPPORT +QUEX_INLINE size_t quex_Token_repetition_n_get(quex_Token*); +QUEX_INLINE void quex_Token_repetition_n_set(quex_Token*, size_t); +#endif /* QUEX_OPTION_TOKEN_REPETITION_SUPPORT */ + + + +#endif /* __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN */ diff --git a/src/parser/EasyLexer-token_ids.h b/src/parser/EasyLexer-token_ids.h @@ -0,0 +1,145 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: File containing definition of token-identifier and + * a function that maps token identifiers to a string + * name. + * + * NOTE: This file has been created automatically by Quex. + * Visit quex.org for further info. + * + * DATE: Mon Jul 10 22:38:25 2017 + * + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__AUTO_TOKEN_IDS_QUEX_EASYLEXER__QUEX_TOKEN__ +#define __QUEX_INCLUDE_GUARD__AUTO_TOKEN_IDS_QUEX_EASYLEXER__QUEX_TOKEN__ + +#ifndef __QUEX_OPTION_PLAIN_C +# include<cstdio> +#else +# include<stdio.h> +#endif + +/* The token class definition file can only be included after + * the definition on TERMINATION and UNINITIALIZED. + * (fschaef 12y03m24d: "I do not rememember why I wrote this.") */ +#include "EasyLexer-token.h" + +#define QUEX_TKN_AMPERSANT ((QUEX_TYPE_TOKEN_ID)10004) +#define QUEX_TKN_AND ((QUEX_TYPE_TOKEN_ID)10005) +#define QUEX_TKN_ASSIGN_AMPERSANT ((QUEX_TYPE_TOKEN_ID)10006) +#define QUEX_TKN_ASSIGN_DIV ((QUEX_TYPE_TOKEN_ID)10007) +#define QUEX_TKN_ASSIGN_EXCLUSIVE_OR ((QUEX_TYPE_TOKEN_ID)10008) +#define QUEX_TKN_ASSIGN_LOGICAL_OR ((QUEX_TYPE_TOKEN_ID)10009) +#define QUEX_TKN_ASSIGN_MINUS ((QUEX_TYPE_TOKEN_ID)10010) +#define QUEX_TKN_ASSIGN_MODULO ((QUEX_TYPE_TOKEN_ID)10011) +#define QUEX_TKN_ASSIGN_MULT ((QUEX_TYPE_TOKEN_ID)10012) +#define QUEX_TKN_ASSIGN_PLUS ((QUEX_TYPE_TOKEN_ID)10013) +#define QUEX_TKN_ASSIGN_SHIFT_LEFT ((QUEX_TYPE_TOKEN_ID)10014) +#define QUEX_TKN_ASSIGN_SHIFT_RIGHT ((QUEX_TYPE_TOKEN_ID)10015) +#define QUEX_TKN_BACKLASHED_NEWLINE ((QUEX_TYPE_TOKEN_ID)10016) +#define QUEX_TKN_BRACKET_C ((QUEX_TYPE_TOKEN_ID)10017) +#define QUEX_TKN_BRACKET_O ((QUEX_TYPE_TOKEN_ID)10018) +#define QUEX_TKN_BREAK ((QUEX_TYPE_TOKEN_ID)10019) +#define QUEX_TKN_CASE ((QUEX_TYPE_TOKEN_ID)10020) +#define QUEX_TKN_COLON ((QUEX_TYPE_TOKEN_ID)10021) +#define QUEX_TKN_COMMA ((QUEX_TYPE_TOKEN_ID)10022) +#define QUEX_TKN_CONST ((QUEX_TYPE_TOKEN_ID)10023) +#define QUEX_TKN_CONTINUE ((QUEX_TYPE_TOKEN_ID)10024) +#define QUEX_TKN_CORNER_BRACKET_C ((QUEX_TYPE_TOKEN_ID)10025) +#define QUEX_TKN_CORNER_BRACKET_O ((QUEX_TYPE_TOKEN_ID)10026) +#define QUEX_TKN_DECREMENT ((QUEX_TYPE_TOKEN_ID)10027) +#define QUEX_TKN_DEDENT ((QUEX_TYPE_TOKEN_ID)10000) +#define QUEX_TKN_DEFAULT ((QUEX_TYPE_TOKEN_ID)10028) +#define QUEX_TKN_DIV ((QUEX_TYPE_TOKEN_ID)10029) +#define QUEX_TKN_DO ((QUEX_TYPE_TOKEN_ID)10030) +#define QUEX_TKN_DOT ((QUEX_TYPE_TOKEN_ID)10031) +#define QUEX_TKN_DOUBLE_HASH ((QUEX_TYPE_TOKEN_ID)10032) +#define QUEX_TKN_ELSE ((QUEX_TYPE_TOKEN_ID)10033) +#define QUEX_TKN_ENUM ((QUEX_TYPE_TOKEN_ID)10034) +#define QUEX_TKN_EQ ((QUEX_TYPE_TOKEN_ID)10035) +#define QUEX_TKN_EXCLUSIVE_OR ((QUEX_TYPE_TOKEN_ID)10036) +#define QUEX_TKN_EXTERN ((QUEX_TYPE_TOKEN_ID)10037) +#define QUEX_TKN_FAILURE ((QUEX_TYPE_TOKEN_ID)10038) +#define QUEX_TKN_FOR ((QUEX_TYPE_TOKEN_ID)10039) +#define QUEX_TKN_GOTO ((QUEX_TYPE_TOKEN_ID)10040) +#define QUEX_TKN_GREATER ((QUEX_TYPE_TOKEN_ID)10041) +#define QUEX_TKN_GR_EQ ((QUEX_TYPE_TOKEN_ID)10042) +#define QUEX_TKN_HASH ((QUEX_TYPE_TOKEN_ID)10043) +#define QUEX_TKN_IDENTIFIER ((QUEX_TYPE_TOKEN_ID)10044) +#define QUEX_TKN_IF ((QUEX_TYPE_TOKEN_ID)10045) +#define QUEX_TKN_INCREMENT ((QUEX_TYPE_TOKEN_ID)10046) +#define QUEX_TKN_INDENT ((QUEX_TYPE_TOKEN_ID)10001) +#define QUEX_TKN_INLINE ((QUEX_TYPE_TOKEN_ID)10047) +#define QUEX_TKN_LESS ((QUEX_TYPE_TOKEN_ID)10048) +#define QUEX_TKN_LE_EQ ((QUEX_TYPE_TOKEN_ID)10049) +#define QUEX_TKN_LOGICAL_OR ((QUEX_TYPE_TOKEN_ID)10050) +#define QUEX_TKN_MEMBER ((QUEX_TYPE_TOKEN_ID)10051) +#define QUEX_TKN_MINUS ((QUEX_TYPE_TOKEN_ID)10052) +#define QUEX_TKN_MODULO ((QUEX_TYPE_TOKEN_ID)10053) +#define QUEX_TKN_MULT ((QUEX_TYPE_TOKEN_ID)10054) +#define QUEX_TKN_NODENT ((QUEX_TYPE_TOKEN_ID)10002) +#define QUEX_TKN_NOT ((QUEX_TYPE_TOKEN_ID)10055) +#define QUEX_TKN_NOT_EQ ((QUEX_TYPE_TOKEN_ID)10056) +#define QUEX_TKN_NUMBER ((QUEX_TYPE_TOKEN_ID)10057) +#define QUEX_TKN_OP_ASSIGNMENT ((QUEX_TYPE_TOKEN_ID)10058) +#define QUEX_TKN_OR ((QUEX_TYPE_TOKEN_ID)10059) +#define QUEX_TKN_PLUS ((QUEX_TYPE_TOKEN_ID)10060) +#define QUEX_TKN_PP_COMMENT ((QUEX_TYPE_TOKEN_ID)10061) +#define QUEX_TKN_PP_DEFINE ((QUEX_TYPE_TOKEN_ID)10062) +#define QUEX_TKN_PP_DEFINED ((QUEX_TYPE_TOKEN_ID)10063) +#define QUEX_TKN_PP_ELIF ((QUEX_TYPE_TOKEN_ID)10064) +#define QUEX_TKN_PP_ELSE ((QUEX_TYPE_TOKEN_ID)10065) +#define QUEX_TKN_PP_ENDIF ((QUEX_TYPE_TOKEN_ID)10066) +#define QUEX_TKN_PP_ERROR ((QUEX_TYPE_TOKEN_ID)10067) +#define QUEX_TKN_PP_IF ((QUEX_TYPE_TOKEN_ID)10068) +#define QUEX_TKN_PP_IFDEF ((QUEX_TYPE_TOKEN_ID)10069) +#define QUEX_TKN_PP_IFNDEF ((QUEX_TYPE_TOKEN_ID)10070) +#define QUEX_TKN_PP_INCLUDE ((QUEX_TYPE_TOKEN_ID)10071) +#define QUEX_TKN_PP_PRAGMA ((QUEX_TYPE_TOKEN_ID)10072) +#define QUEX_TKN_PP_USE ((QUEX_TYPE_TOKEN_ID)10073) +#define QUEX_TKN_QUESTION_MARK ((QUEX_TYPE_TOKEN_ID)10074) +#define QUEX_TKN_QUOTED_CHAR ((QUEX_TYPE_TOKEN_ID)10075) +#define QUEX_TKN_RESTRICT ((QUEX_TYPE_TOKEN_ID)10076) +#define QUEX_TKN_RETURN ((QUEX_TYPE_TOKEN_ID)10077) +#define QUEX_TKN_SEMICOLON ((QUEX_TYPE_TOKEN_ID)10078) +#define QUEX_TKN_SHIFT_LEFT ((QUEX_TYPE_TOKEN_ID)10079) +#define QUEX_TKN_SHIFT_RIGHT ((QUEX_TYPE_TOKEN_ID)10080) +#define QUEX_TKN_SIZEOF ((QUEX_TYPE_TOKEN_ID)10081) +#define QUEX_TKN_STATIC ((QUEX_TYPE_TOKEN_ID)10082) +#define QUEX_TKN_STRING ((QUEX_TYPE_TOKEN_ID)10083) +#define QUEX_TKN_STRUCT ((QUEX_TYPE_TOKEN_ID)10084) +#define QUEX_TKN_SWITCH ((QUEX_TYPE_TOKEN_ID)10085) +#define QUEX_TKN_TERMINATION ((QUEX_TYPE_TOKEN_ID)0) +#define QUEX_TKN_TILDE ((QUEX_TYPE_TOKEN_ID)10086) +#define QUEX_TKN_TYPE ((QUEX_TYPE_TOKEN_ID)10087) +#define QUEX_TKN_TYPEDEF ((QUEX_TYPE_TOKEN_ID)10088) +#define QUEX_TKN_TYPE_CHAR ((QUEX_TYPE_TOKEN_ID)10089) +#define QUEX_TKN_TYPE_DOUBLE ((QUEX_TYPE_TOKEN_ID)10090) +#define QUEX_TKN_TYPE_FLOAT ((QUEX_TYPE_TOKEN_ID)10091) +#define QUEX_TKN_TYPE_INT ((QUEX_TYPE_TOKEN_ID)10092) +#define QUEX_TKN_TYPE_LONG ((QUEX_TYPE_TOKEN_ID)10093) +#define QUEX_TKN_TYPE_SHORT ((QUEX_TYPE_TOKEN_ID)10094) +#define QUEX_TKN_TYPE_SIGNED ((QUEX_TYPE_TOKEN_ID)10095) +#define QUEX_TKN_TYPE_UNSIGNED ((QUEX_TYPE_TOKEN_ID)10096) +#define QUEX_TKN_TYPE_VOID ((QUEX_TYPE_TOKEN_ID)10097) +#define QUEX_TKN_UNINITIALIZED ((QUEX_TYPE_TOKEN_ID)10003) +#define QUEX_TKN_UNION ((QUEX_TYPE_TOKEN_ID)10098) +#define QUEX_TKN_VOLATILE ((QUEX_TYPE_TOKEN_ID)10099) +#define QUEX_TKN_WHILE ((QUEX_TYPE_TOKEN_ID)10100) +#define QUEX_TKN__ALIGNAS ((QUEX_TYPE_TOKEN_ID)10101) +#define QUEX_TKN__ALIGNOF ((QUEX_TYPE_TOKEN_ID)10102) +#define QUEX_TKN__ATOMIC ((QUEX_TYPE_TOKEN_ID)10103) +#define QUEX_TKN__BOOL ((QUEX_TYPE_TOKEN_ID)10104) +#define QUEX_TKN__COMPLEX ((QUEX_TYPE_TOKEN_ID)10105) +#define QUEX_TKN__GENERIC ((QUEX_TYPE_TOKEN_ID)10106) +#define QUEX_TKN__IMAGINARY ((QUEX_TYPE_TOKEN_ID)10107) +#define QUEX_TKN__NORETURN ((QUEX_TYPE_TOKEN_ID)10108) +#define QUEX_TKN__STATIC_ASSERT ((QUEX_TYPE_TOKEN_ID)10109) +#define QUEX_TKN__THREAD_LOCAL ((QUEX_TYPE_TOKEN_ID)10110) + + +QUEX_NAMESPACE_TOKEN_OPEN +extern const char* QUEX_NAME_TOKEN(map_id_to_name)(const QUEX_TYPE_TOKEN_ID TokenID); +QUEX_NAMESPACE_TOKEN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__AUTO_TOKEN_IDS_QUEX_EASYLEXER__QUEX_TOKEN__ */ diff --git a/src/parser/EasyLexer.c b/src/parser/EasyLexer.c @@ -0,0 +1,17341 @@ + +#include "EasyLexer.h" + +#include "C-adaptions.h" +/* The file 'multi.i' contains implementations which are the same for all + * possibly generated analyzers. If QUEX_OPTION_MULTI is defined, it is + * NOT supposed to be included here. If not--in which case we have a single + * analzer--then it is included. */ +#include "single.i" + +QUEX_NAMESPACE_MAIN_OPEN +QUEX_NAME(Mode) QUEX_NAME(PROGRAM) = { + /* id */ QUEX_NAME(ModeID_PROGRAM), + /* name */ "PROGRAM", +# if defined(QUEX_OPTION_INDENTATION_TRIGGER) \ + && ! defined(QUEX_OPTION_INDENTATION_DEFAULT_HANDLER) + /* on_indentation */ QUEX_NAME(Mode_on_indentation_null_function), +# endif + /* on_entry */ QUEX_NAME(Mode_on_entry_exit_null_function), + /* on_exit */ QUEX_NAME(Mode_on_entry_exit_null_function), +# if defined(QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK) + /* has_base */ QUEX_NAME(PROGRAM_has_base), + /* has_entry_from */ QUEX_NAME(PROGRAM_has_entry_from), + /* has_exit_to */ QUEX_NAME(PROGRAM_has_exit_to), +# endif + /* analyzer_function */ QUEX_NAME(PROGRAM_analyzer_function) +}; + +QUEX_NAME(Mode)* (QUEX_NAME(mode_db)[__QUEX_SETTING_MAX_MODE_CLASS_N]) = { + &QUEX_NAME(PROGRAM) +}; +#ifndef __QUEX_INDICATOR_DUMPED_TOKEN_ID_DEFINED + static QUEX_TYPE_TOKEN_ID QUEX_NAME_TOKEN(DumpedTokenIdObject); +#endif +#define self (*(QUEX_TYPE_DERIVED_ANALYZER*)me) +#define __self_result_token_id QUEX_NAME_TOKEN(DumpedTokenIdObject) + +void +QUEX_NAME(PROGRAM_on_entry)(QUEX_TYPE_ANALYZER* me, const QUEX_NAME(Mode)* FromMode) { + (void)me; + (void)FromMode; +# ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK + QUEX_NAME(PROGRAM).has_entry_from(FromMode); +# endif + +} + +void +QUEX_NAME(PROGRAM_on_exit)(QUEX_TYPE_ANALYZER* me, const QUEX_NAME(Mode)* ToMode) { + (void)me; + (void)ToMode; +# ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK + QUEX_NAME(PROGRAM).has_exit_to(ToMode); +# endif + +} + +#if defined(QUEX_OPTION_INDENTATION_TRIGGER) +void +QUEX_NAME(PROGRAM_on_indentation)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_INDENTATION Indentation, + QUEX_TYPE_LEXATOM* Begin) { + (void)me; + (void)Indentation; + (void)Begin; + return; +} +#endif + +#ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK +bool +QUEX_NAME(PROGRAM_has_base)(const QUEX_NAME(Mode)* Mode) { + (void)Mode; + return false; +} +bool +QUEX_NAME(PROGRAM_has_entry_from)(const QUEX_NAME(Mode)* Mode) { + (void)Mode; + + switch( Mode->id ) { + case QUEX_NAME(ModeID_PROGRAM): return true; + default: + if( Mode->has_base(&QUEX_NAME(PROGRAM)) ) return true; + } + __QUEX_STD_fprintf(stderr, "mode '%s' is not one of (and not a derived mode of): PROGRAM, \n", Mode->name); + __quex_assert(false); + return false; + +} +bool +QUEX_NAME(PROGRAM_has_exit_to)(const QUEX_NAME(Mode)* Mode) { + (void)Mode; + + switch( Mode->id ) { + case QUEX_NAME(ModeID_PROGRAM): return true; + default: + if( Mode->has_base(&QUEX_NAME(PROGRAM)) ) return true; + } + __QUEX_STD_fprintf(stderr, "mode '%s' is not one of (and not a derived mode of): PROGRAM, \n", Mode->name); + __quex_assert(false); + return false; + +} +#endif +#undef self +#undef __self_result_token_id +QUEX_NAMESPACE_MAIN_CLOSE + +/* #include "EasyLexer.h"*/ +#if defined(__QUEX_OPTION_CONVERTER_HELPER) +# include "from-unicode-buffer.i" +#else +# include "from-unicode-buffer.i" +#endif +#include "headers.i" +#include "C-adaptions.h" +QUEX_NAMESPACE_MAIN_OPEN +QUEX_TYPE_LEXATOM QUEX_LEXEME_NULL_IN_ITS_NAMESPACE = (QUEX_TYPE_LEXATOM)0; +#ifdef __QUEX_COUNT_VOID +# undef __QUEX_COUNT_VOID +#endif +#ifdef __QUEX_OPTION_COUNTER +# define __QUEX_COUNT_VOID(ME, BEGIN, END) \ + do { \ + QUEX_NAME(PROGRAM_counter)((ME), (BEGIN), (END)); \ + __quex_debug_counter(); \ + } while(0) +#else +# define __QUEX_COUNT_VOID(ME, BEGIN, END) /* empty */ +#endif +#ifdef __QUEX_OPTION_COUNTER +static void +QUEX_NAME(PROGRAM_counter)(QUEX_TYPE_ANALYZER* me, QUEX_TYPE_LEXATOM* LexemeBegin, QUEX_TYPE_LEXATOM* LexemeEnd) +{ +# define self (*me) +/* 'QUEX_GOTO_STATE' requires 'QUEX_LABEL_STATE_ROUTER' */ +# define QUEX_LABEL_STATE_ROUTER _18 + QUEX_TYPE_LEXATOM input = (QUEX_TYPE_LEXATOM)(0x00); + QUEX_TYPE_GOTO_LABEL target_state_else_index = QUEX_GOTO_LABEL_VOID; + QUEX_TYPE_GOTO_LABEL target_state_index = QUEX_GOTO_LABEL_VOID; +# ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING + QUEX_TYPE_LEXATOM* count_reference_p = (QUEX_TYPE_LEXATOM*)0x0; +# endif /* QUEX_OPTION_COLUMN_NUMBER_COUNTING */ + (void)me; + __QUEX_IF_COUNT_SHIFT_VALUES(); + /* Allow LexemeBegin == LexemeEnd (e.g. END_OF_STREAM) + * => Caller does not need to check + * BUT, if so quit immediately after 'shift values'. + */ + __quex_assert(LexemeBegin <= LexemeEnd); + if( LexemeBegin == LexemeEnd ) { + return; + } + me->buffer._read_p = LexemeBegin; + + /* (3795 from BEFORE_ENTRY) */ + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + input = *(me->buffer._read_p); + +_13: + __quex_debug("Init State\n"); + __quex_debug_state(3795); +if ( input >= 0xB ) goto _4; +else if( input == 0xA ) goto _2; +else if( input == 0x9 ) goto _3; +else goto _4; + + + __quex_assert_no_passage(); +_8: + /* (3795 from 3799) */ + goto _13; + + + __quex_assert_no_passage(); +_5: + /* (DROP_OUT from 3796) */ + goto _10; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_6: + /* (DROP_OUT from 3797) */ + goto _11; + + + __quex_assert_no_passage(); +_7: + /* (DROP_OUT from 3798) */ + goto _12; + + + __quex_assert_no_passage(); +_2: + /* (3796 from 3795) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3796); +goto _5; + + + __quex_assert_no_passage(); +_3: + /* (3797 from 3795) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3797); +goto _6; + + + __quex_assert_no_passage(); +_4: + /* (3798 from 3795) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3798); +goto _7; + + /* (*) Terminal states _______________________________________________________ + * + * States that implement actions of the 'winner patterns. */ +_9: + __quex_debug("* TERMINAL <LOOP EXIT>\n"); + --(me->buffer._read_p); + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +goto _0; + +_10: + __quex_debug("* TERMINAL <LOOP 974>\n"); +__QUEX_IF_COUNT_LINES_ADD((size_t)1); + + __QUEX_IF_COUNT_COLUMNS((me->counter._column_number_at_end) = (size_t)1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +if( me->buffer._read_p != LexemeEnd ) goto _8; + +goto _0; + +_11: + __quex_debug("* TERMINAL <LOOP 975>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p - 1))); + +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end -= 1); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end &= ~ ((size_t)0x3)); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end += 4 + 1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +if( me->buffer._read_p != LexemeEnd ) goto _8; + +goto _0; + +_12: + __quex_debug("* TERMINAL <LOOP 976>\n"); +if( me->buffer._read_p != LexemeEnd ) goto _8; + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +goto _0; + +if(0) { + /* Avoid unreferenced labels. */ + goto _9; + goto _10; + goto _11; + goto _12; +} +_20: /* TERMINAL: BAD_LEXATOM */ +; +_19: /* TERMINAL: FAILURE */ +goto _0; +_0: +/* Assert: lexeme in codec's character boundaries. */ + + __quex_assert(me->buffer._read_p == LexemeEnd); + return; +# ifndef QUEX_OPTION_COMPUTED_GOTOS + __quex_assert_no_passage(); +_18: +# endif /* QUEX_OPTION_COMPUTED_GOTOS */ + +#undef self + + +#undef QUEX_LABEL_STATE_ROUTER + +# if ! defined(QUEX_OPTION_COMPUTED_GOTOS) + goto _18; /* in QUEX_GOTO_STATE */ + goto _20; /* to BAD_LEXATOM */ +# endif + /* Avoid compiler warning: 'Unused labels' */ + + goto _19; + (void)target_state_index; + (void)target_state_else_index; +} +#endif /* __QUEX_OPTION_COUNTER */ + +#include "analyzerBasic" +#include "bufferBuffer" +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE +# include "TokenQueue" +#endif + +#ifdef CONTINUE +# undef CONTINUE +#endif +#define CONTINUE do { goto _0; } while(0) + +#ifdef RETURN +# undef RETURN +#endif +#define RETURN do { goto _322; } while(0) + +__QUEX_TYPE_ANALYZER_RETURN_VALUE +QUEX_NAME(PROGRAM_analyzer_function)(QUEX_TYPE_ANALYZER* me) +{ + /* NOTE: Different modes correspond to different analyzer functions. The + * analyzer functions are all located inside the main class as static + * functions. That means, they are something like 'globals'. They + * receive a pointer to the lexical analyzer, since static members do + * not have access to the 'this' pointer. */ +# if defined(QUEX_OPTION_TOKEN_POLICY_SINGLE) + register QUEX_TYPE_TOKEN_ID __self_result_token_id + = (QUEX_TYPE_TOKEN_ID)__QUEX_SETTING_TOKEN_ID_UNINITIALIZED; +# endif +# ifdef self +# undef self +# endif +# define self (*((QUEX_TYPE_ANALYZER*)me)) +/* 'QUEX_GOTO_STATE' requires 'QUEX_LABEL_STATE_ROUTER' */ +# define QUEX_LABEL_STATE_ROUTER _2065 +# define PROGRAM (QUEX_NAME(PROGRAM)) + + /* Lexeme setup: + * + * There is a temporary zero stored at the end of each lexeme, if the action + * references to the 'Lexeme'. 'LexemeNull' provides a reference to an empty + * zero terminated string. */ +#if defined(QUEX_OPTION_ASSERTS) +# define Lexeme QUEX_NAME(access_Lexeme)((const char*)__FILE__, (size_t)__LINE__, &me->buffer) +# define LexemeBegin QUEX_NAME(access_LexemeBegin)((const char*)__FILE__, (size_t)__LINE__, &me->buffer) +# define LexemeL QUEX_NAME(access_LexemeL)((const char*)__FILE__, (size_t)__LINE__, &me->buffer) +# define LexemeEnd QUEX_NAME(access_LexemeEnd)((const char*)__FILE__, (size_t)__LINE__, &me->buffer) +#else +# define Lexeme (me->buffer._lexeme_start_p) +# define LexemeBegin Lexeme +# define LexemeL ((size_t)(me->buffer._read_p - me->buffer._lexeme_start_p)) +# define LexemeEnd me->buffer._read_p +#endif + +#define LexemeNull (&QUEX_LEXEME_NULL) + QUEX_TYPE_LEXATOM* loop_restart_p = (QUEX_TYPE_LEXATOM*)0x0; + QUEX_TYPE_LEXATOM* read_p_before_reload = (QUEX_TYPE_LEXATOM*)0x0; + E_LoadResult load_result = E_LoadResult_VOID; + QUEX_TYPE_ACCEPTANCE_ID last_acceptance /* un-initilized */; + QUEX_TYPE_GOTO_LABEL target_state_else_index = QUEX_GOTO_LABEL_VOID; + const size_t PositionRegisterN = (size_t)1; + QUEX_TYPE_LEXATOM* position[1] = { 0}; + ptrdiff_t position_delta = (ptrdiff_t)0; + QUEX_TYPE_LEXATOM input = (QUEX_TYPE_LEXATOM)(0x00); + QUEX_TYPE_GOTO_LABEL target_state_index = QUEX_GOTO_LABEL_VOID; +# ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING + QUEX_TYPE_LEXATOM* count_reference_p = (QUEX_TYPE_LEXATOM*)0x0; +# endif /* QUEX_OPTION_COLUMN_NUMBER_COUNTING */ + + /* Post context positions do not have to be reset or initialized. If a state + * is reached which is associated with 'end of post context' it is clear what + * post context is meant. This results from the ways the state machine is + * constructed. Post context position's live cycle: + * + * (1) unitialized (don't care) + * (1.b) on buffer reload it may, or may not be adapted (don't care) + * (2) when a post context begin state is passed, then it is **SET** (now: take care) + * (2.b) on buffer reload it **is adapted**. + * (3) when a terminal state of the post context is reached (which can only be reached + * for that particular post context), then the post context position is used + * to reset the input position. */ +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) \ + || defined(QUEX_OPTION_ASSERTS) + me->DEBUG_analyzer_function_at_entry = me->current_analyzer_function; +# endif +_2064: + me->buffer._lexeme_start_p = me->buffer._read_p; + QUEX_LEXEME_TERMINATING_ZERO_UNDO(&me->buffer); + + /* (3455 from BEFORE_ENTRY) */ + { last_acceptance = ((QUEX_TYPE_ACCEPTANCE_ID)-1); __quex_debug("last_acceptance = ((QUEX_TYPE_ACCEPTANCE_ID)-1)\n"); } + +_1372: + input = *(me->buffer._read_p); + + + __quex_debug("Init State\n"); + __quex_debug_state(3455); +switch( input ) { +case 0x0: goto _1178; +case 0x9: goto _560; +case 0xA: goto _493; +case 0xD: goto _544; +case 0x20: goto _547; +case 0x21: goto _562; +case 0x23: goto _567; +case 0x25: goto _549; +case 0x26: goto _554; +case 0x27: goto _569; +case 0x28: goto _545; +case 0x29: goto _546; +case 0x2A: goto _550; +case 0x2B: goto _571; +case 0x2C: goto _579; +case 0x2D: goto _561; +case 0x2E: goto _576; +case 0x2F: goto _578; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: goto _568; +case 0x3A: goto _556; +case 0x3B: goto _573; +case 0x3C: goto _543; +case 0x3D: goto _552; +case 0x3E: goto _581; +case 0x3F: goto _557; +case 0x40: goto _580; +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: goto _538; +case 0x5B: goto _548; +case 0x5C: goto _563; +case 0x5D: goto _577; +case 0x5E: goto _583; +case 0x5F: goto _553; +case 0x61: goto _538; +case 0x62: goto _541; +case 0x63: goto _542; +case 0x64: goto _539; +case 0x65: goto _564; +case 0x66: goto _575; +case 0x67: goto _572; +case 0x68: goto _538; +case 0x69: goto _540; +case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _565; +case 0x6D: case 0x6E: case 0x6F: case 0x70: case 0x71: goto _538; +case 0x72: goto _584; +case 0x73: goto _551; +case 0x74: goto _566; +case 0x75: goto _559; +case 0x76: goto _558; +case 0x77: goto _582; +case 0x78: case 0x79: case 0x7A: goto _538; +case 0x7C: goto _574; +case 0x7E: goto _555; +default: goto _672; +} + + + __quex_assert_no_passage(); +_1177: + /* (3455 from RELOAD_FORWARD) */ + goto _1372; + + + __quex_assert_no_passage(); +_748: + /* (DROP_OUT from 3622) (DROP_OUT from 3623) */ + + goto _216; +_1373: + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_694: + /* (DROP_OUT from 3492) */ + goto _272; + + + __quex_assert_no_passage(); +_675: + /* (DROP_OUT from 3463) */ + goto _243; + + + __quex_assert_no_passage(); +_716: + /* (DROP_OUT from 3537) */ + goto _261; + + + __quex_assert_no_passage(); +_762: + /* (DROP_OUT from 3693) */ + goto _303; + + + __quex_assert_no_passage(); +_750: + /* (DROP_OUT from 3632) */ + goto _300; + + + __quex_assert_no_passage(); +_756: + /* (DROP_OUT from 3660) */ + goto _305; + + + __quex_assert_no_passage(); +_719: + /* (DROP_OUT from 3542) */ + goto _255; + + + __quex_assert_no_passage(); +_770: + /* (DROP_OUT from 3739) */ + goto _294; + + + __quex_assert_no_passage(); +_677: + /* (DROP_OUT from 3465) */ + goto _124; + + + __quex_assert_no_passage(); +_780: + /* (DROP_OUT from 3759) */ + goto _282; + + + __quex_assert_no_passage(); +_704: + /* (DROP_OUT from 3514) */ + goto _262; + + + __quex_assert_no_passage(); +_776: + /* (DROP_OUT from 3750) */ + goto _274; + + + __quex_assert_no_passage(); +_759: + /* (DROP_OUT from 3673) */ + goto _310; + + + __quex_assert_no_passage(); +_744: + /* (DROP_OUT from 3616) */ + goto _266; + + + __quex_assert_no_passage(); +_722: + /* (DROP_OUT from 3548) */ + goto _240; + + + __quex_assert_no_passage(); +_723: + /* (DROP_OUT from 3557) */ + goto _227; + + + __quex_assert_no_passage(); +_700: + /* (DROP_OUT from 3499) */ + goto _267; + + + __quex_assert_no_passage(); +_749: + /* (DROP_OUT from 3630) */ + goto _237; + + + __quex_assert_no_passage(); +_718: + /* (DROP_OUT from 3541) */ + goto _253; + + + __quex_assert_no_passage(); +_695: + /* (DROP_OUT from 3494) */ + goto _316; + + + __quex_assert_no_passage(); +_741: + /* (DROP_OUT from 3612) */ + goto _289; + + + __quex_assert_no_passage(); +_755: + /* (DROP_OUT from 3644) */ + goto _260; + + + __quex_assert_no_passage(); +_682: + /* (DROP_OUT from 3472) */ + goto _277; + + + __quex_assert_no_passage(); +_745: + /* (DROP_OUT from 3617) */ + goto _279; + + + __quex_assert_no_passage(); +_753: + /* (DROP_OUT from 3642) */ + goto _194; + + + __quex_assert_no_passage(); +_783: + /* (DROP_OUT from 3771) */ + goto _281; + + + __quex_assert_no_passage(); +_693: + /* (DROP_OUT from 3491) */ + goto _315; + + + __quex_assert_no_passage(); +_714: + /* (DROP_OUT from 3535) */ + goto _291; + + + __quex_assert_no_passage(); +_747: + /* (DROP_OUT from 3619) */ + goto _256; + + + __quex_assert_no_passage(); +_767: + /* (DROP_OUT from 3726) */ + goto _235; + + + __quex_assert_no_passage(); +_674: + /* (DROP_OUT from 3461) */ + goto _269; + + + __quex_assert_no_passage(); +_751: + /* (DROP_OUT from 3640) */ + goto _301; + + + __quex_assert_no_passage(); +_702: + /* (DROP_OUT from 3510) */ + goto _307; + + + __quex_assert_no_passage(); +_676: + /* (DROP_OUT from 3464) */ + goto _244; + + + __quex_assert_no_passage(); +_679: + /* (DROP_OUT from 3467) */ + goto _252; + + + __quex_assert_no_passage(); +_690: + /* (DROP_OUT from 3487) */ + goto _319; + + + __quex_assert_no_passage(); +_707: + /* (DROP_OUT from 3520) */ + goto _268; + + + __quex_assert_no_passage(); +_760: + /* (DROP_OUT from 3679) */ + goto _304; + + + __quex_assert_no_passage(); +_713: + /* (DROP_OUT from 3534) */ + goto _232; + + + __quex_assert_no_passage(); +_686: + /* (DROP_OUT from 3478) */ + goto _123; + + + __quex_assert_no_passage(); +_696: + /* (DROP_OUT from 3495) */ + goto _246; + + + __quex_assert_no_passage(); +_687: + /* (DROP_OUT from 3479) */ + goto _249; + + + __quex_assert_no_passage(); +_678: + /* (DROP_OUT from 3466) */ + goto _245; + + + __quex_assert_no_passage(); +_735: + /* (DROP_OUT from 3589) */ + goto _218; + + + __quex_assert_no_passage(); +_673: + /* (DROP_OUT from 3792) (DROP_OUT from 3477) (DROP_OUT from 3651) (DROP_OUT from 3633) (DROP_OUT from 3723) (DROP_OUT from 3648) (DROP_OUT from 3646) (DROP_OUT from 3720) (DROP_OUT from 3661) (DROP_OUT from 3783) (DROP_OUT from 3502) (DROP_OUT from 3765) (DROP_OUT from 3484) (DROP_OUT from 3658) (DROP_OUT from 3606) (DROP_OUT from 3762) (DROP_OUT from 3703) (DROP_OUT from 3621) (DROP_OUT from 3777) (DROP_OUT from 3775) (DROP_OUT from 3700) (DROP_OUT from 3459) (DROP_OUT from 3697) (DROP_OUT from 3631) (DROP_OUT from 3613) (DROP_OUT from 3787) (DROP_OUT from 3538) (DROP_OUT from 3769) (DROP_OUT from 3456) (DROP_OUT from 3735) (DROP_OUT from 3710) (DROP_OUT from 3628) (DROP_OUT from 3610) (DROP_OUT from 3469) (DROP_OUT from 3732) (DROP_OUT from 3707) (DROP_OUT from 3625) (DROP_OUT from 3729) (DROP_OUT from 3704) (DROP_OUT from 3670) (DROP_OUT from 3744) (DROP_OUT from 3511) (DROP_OUT from 3685) (DROP_OUT from 3667) (DROP_OUT from 3508) (DROP_OUT from 3682) (DROP_OUT from 3664) (DROP_OUT from 3598) (DROP_OUT from 3754) (DROP_OUT from 3505) (DROP_OUT from 3736) (DROP_OUT from 3695) (DROP_OUT from 3677) (DROP_OUT from 3595) (DROP_OUT from 3717) (DROP_OUT from 3692) (DROP_OUT from 3674) (DROP_OUT from 3533) (DROP_OUT from 3515) (DROP_OUT from 3714) (DROP_OUT from 3689) (DROP_OUT from 3655) (DROP_OUT from 3637) (DROP_OUT from 3530) (DROP_OUT from 3512) (DROP_OUT from 3727) (DROP_OUT from 3652) (DROP_OUT from 3634) (DROP_OUT from 3493) (DROP_OUT from 3724) (DROP_OUT from 3649) (DROP_OUT from 3647) (DROP_OUT from 3490) (DROP_OUT from 3721) (DROP_OUT from 3662) (DROP_OUT from 3503) (DROP_OUT from 3766) (DROP_OUT from 3485) (DROP_OUT from 3659) (DROP_OUT from 3607) (DROP_OUT from 3781) (DROP_OUT from 3500) (DROP_OUT from 3656) (DROP_OUT from 3604) (DROP_OUT from 3760) (DROP_OUT from 3701) (DROP_OUT from 3601) (DROP_OUT from 3791) (DROP_OUT from 3773) (DROP_OUT from 3460) (DROP_OUT from 3698) (DROP_OUT from 3788) (DROP_OUT from 3539) (DROP_OUT from 3770) (DROP_OUT from 3457) (DROP_OUT from 3711) (DROP_OUT from 3629) (DROP_OUT from 3611) (DROP_OUT from 3785) (DROP_OUT from 3733) (DROP_OUT from 3708) (DROP_OUT from 3626) (DROP_OUT from 3730) (DROP_OUT from 3671) (DROP_OUT from 3745) (DROP_OUT from 3743) (DROP_OUT from 3686) (DROP_OUT from 3758) (DROP_OUT from 3509) (DROP_OUT from 3740) (DROP_OUT from 3683) (DROP_OUT from 3665) (DROP_OUT from 3599) (DROP_OUT from 3755) (DROP_OUT from 3506) (DROP_OUT from 3737) (DROP_OUT from 3680) (DROP_OUT from 3678) (DROP_OUT from 3596) (DROP_OUT from 3675) (DROP_OUT from 3516) (DROP_OUT from 3715) (DROP_OUT from 3672) (DROP_OUT from 3638) (DROP_OUT from 3531) (DROP_OUT from 3653) (DROP_OUT from 3635) (DROP_OUT from 3725) (DROP_OUT from 3476) (DROP_OUT from 3650) (DROP_OUT from 3722) (DROP_OUT from 3663) (DROP_OUT from 3645) (DROP_OUT from 3782) (DROP_OUT from 3764) (DROP_OUT from 3483) (DROP_OUT from 3657) (DROP_OUT from 3605) (DROP_OUT from 3779) (DROP_OUT from 3761) (DROP_OUT from 3702) (DROP_OUT from 3620) (DROP_OUT from 3602) (DROP_OUT from 3776) (DROP_OUT from 3699) (DROP_OUT from 3789) (DROP_OUT from 3458) (DROP_OUT from 3696) (DROP_OUT from 3786) (DROP_OUT from 3768) (DROP_OUT from 3471) (DROP_OUT from 3709) (DROP_OUT from 3627) (DROP_OUT from 3609) (DROP_OUT from 3706) (DROP_OUT from 3624) (DROP_OUT from 3728) (DROP_OUT from 3687) (DROP_OUT from 3741) (DROP_OUT from 3684) (DROP_OUT from 3666) (DROP_OUT from 3756) (DROP_OUT from 3507) (DROP_OUT from 3738) (DROP_OUT from 3681) (DROP_OUT from 3753) (DROP_OUT from 3504) (DROP_OUT from 3694) (DROP_OUT from 3676) (DROP_OUT from 3517) (DROP_OUT from 3716) (DROP_OUT from 3691) (DROP_OUT from 3639) (DROP_OUT from 3532) (DROP_OUT from 3713) (DROP_OUT from 3688) (DROP_OUT from 3654) (DROP_OUT from 3636) */ + goto _318; + + + __quex_assert_no_passage(); +_773: + /* (DROP_OUT from 3747) */ + goto _257; + + + __quex_assert_no_passage(); +_758: + /* (DROP_OUT from 3669) */ + goto _308; + + + __quex_assert_no_passage(); +_736: + /* (DROP_OUT from 3594) */ + goto _219; + + + __quex_assert_no_passage(); +_731: + /* (DROP_OUT from 3575) */ + goto _222; + + + __quex_assert_no_passage(); +_790: + /* (DROP_OUT from 3793) */ + goto _285; + + + __quex_assert_no_passage(); +_706: + /* (DROP_OUT from 3519) */ + goto _275; + + + __quex_assert_no_passage(); +_725: + /* (DROP_OUT from 3561) */ + goto _225; + + + __quex_assert_no_passage(); +_765: + /* (DROP_OUT from 3718) */ + goto _311; + + + __quex_assert_no_passage(); +_778: + /* (DROP_OUT from 3752) */ + goto _263; + + + __quex_assert_no_passage(); +_728: + /* (DROP_OUT from 3571) */ + goto _220; + + + __quex_assert_no_passage(); +_726: + /* (DROP_OUT from 3564) */ + goto _224; + + + __quex_assert_no_passage(); +_733: + /* (DROP_OUT from 3578) */ + goto _223; + + + __quex_assert_no_passage(); +_705: + /* (DROP_OUT from 3518) */ + goto _302; + + + __quex_assert_no_passage(); +_779: + /* (DROP_OUT from 3757) */ + goto _230; + + + __quex_assert_no_passage(); +_710: + /* (DROP_OUT from 3527) */ + goto _168; + + + __quex_assert_no_passage(); +_715: + /* (DROP_OUT from 3536) */ + goto _276; + + + __quex_assert_no_passage(); +_743: + /* (DROP_OUT from 3615) */ + goto _229; + + + __quex_assert_no_passage(); +_683: + /* (DROP_OUT from 3473) */ + goto _242; + + + __quex_assert_no_passage(); +_764: + /* (DROP_OUT from 3712) */ + goto _312; + + + __quex_assert_no_passage(); +_698: + /* (DROP_OUT from 3497) */ + goto _317; + + + __quex_assert_no_passage(); +_775: + /* (DROP_OUT from 3749) */ + goto _152; + + + __quex_assert_no_passage(); +_697: + /* (DROP_OUT from 3496) */ + goto _251; + + + __quex_assert_no_passage(); +_724: + /* (DROP_OUT from 3560) */ + goto _221; + + + __quex_assert_no_passage(); +_738: + /* (DROP_OUT from 3600) */ + goto _299; + + + __quex_assert_no_passage(); +_692: + /* (DROP_OUT from 3489) */ + goto _248; + + + __quex_assert_no_passage(); +_680: + /* (DROP_OUT from 3468) */ + goto _250; + + + __quex_assert_no_passage(); +_701: + /* (DROP_OUT from 3501) */ + goto _273; + + + __quex_assert_no_passage(); +_757: + /* (DROP_OUT from 3668) */ + goto _309; + + + __quex_assert_no_passage(); +_711: + /* (DROP_OUT from 3528) */ + goto _258; + + + __quex_assert_no_passage(); +_787: + /* (DROP_OUT from 3780) */ + goto _286; + + + __quex_assert_no_passage(); +_742: + /* (DROP_OUT from 3614) */ + goto _287; + + + __quex_assert_no_passage(); +_782: + /* (DROP_OUT from 3767) */ + goto _284; + + + __quex_assert_no_passage(); +_761: + /* (DROP_OUT from 3690) */ + goto _314; + + + __quex_assert_no_passage(); +_784: + /* (DROP_OUT from 3772) */ + goto _292; + + + __quex_assert_no_passage(); +_689: + /* (DROP_OUT from 3486) */ + goto _239; + + + __quex_assert_no_passage(); +_746: + /* (DROP_OUT from 3618) */ + goto _254; + + + __quex_assert_no_passage(); +_789: + /* (DROP_OUT from 3790) */ + goto _228; + + + __quex_assert_no_passage(); +_684: + /* (DROP_OUT from 3474) */ + goto _280; + + + __quex_assert_no_passage(); +_699: + /* (DROP_OUT from 3526) (DROP_OUT from 3523) (DROP_OUT from 3524) (DROP_OUT from 3498) (DROP_OUT from 3522) */ + goto _321; + + + __quex_assert_no_passage(); +_688: + /* (DROP_OUT from 3480) */ + goto _271; + + + __quex_assert_no_passage(); +_772: + /* (DROP_OUT from 3746) */ + goto _297; + + + __quex_assert_no_passage(); +_739: + /* (DROP_OUT from 3603) */ + goto _234; + + + __quex_assert_no_passage(); +_786: + /* (DROP_OUT from 3778) */ + goto _306; + + + __quex_assert_no_passage(); +_777: + /* (DROP_OUT from 3751) */ + goto _270; + + + __quex_assert_no_passage(); +_685: + /* (DROP_OUT from 3475) */ + goto _241; + + + __quex_assert_no_passage(); +_703: + /* (DROP_OUT from 3513) */ + goto _293; + + + __quex_assert_no_passage(); +_752: + /* (DROP_OUT from 3641) */ + goto _238; + + + __quex_assert_no_passage(); +_769: + /* (DROP_OUT from 3734) */ + goto _296; + + + __quex_assert_no_passage(); +_788: + /* (DROP_OUT from 3784) */ + goto _231; + + + __quex_assert_no_passage(); +_763: + /* (DROP_OUT from 3705) */ + goto _313; + + + __quex_assert_no_passage(); +_681: + /* (DROP_OUT from 3470) */ + goto _247; + + + __quex_assert_no_passage(); +_785: + /* (DROP_OUT from 3774) */ + goto _233; + + + __quex_assert_no_passage(); +_712: + /* (DROP_OUT from 3529) */ + goto _151; + + + __quex_assert_no_passage(); +_771: + /* (DROP_OUT from 3742) */ + goto _236; + + + __quex_assert_no_passage(); +_774: + /* (DROP_OUT from 3748) */ + goto _259; + + + __quex_assert_no_passage(); +_737: + /* (DROP_OUT from 3597) */ + goto _298; + + + __quex_assert_no_passage(); +_781: + /* (DROP_OUT from 3763) */ + goto _283; + + + __quex_assert_no_passage(); +_720: + /* (DROP_OUT from 3545) (DROP_OUT from 3544) */ + goto _320; + + + __quex_assert_no_passage(); +_768: + /* (DROP_OUT from 3731) */ + goto _295; + + + __quex_assert_no_passage(); +_727: + /* (DROP_OUT from 3569) */ + goto _226; + + + __quex_assert_no_passage(); +_734: + /* (DROP_OUT from 3587) */ + goto _217; + + + __quex_assert_no_passage(); +_766: + /* (DROP_OUT from 3719) */ + goto _265; + + + __quex_assert_no_passage(); +_708: + /* (DROP_OUT from 3521) */ + goto _264; + + + __quex_assert_no_passage(); +_717: + /* (DROP_OUT from 3540) */ + goto _290; + + + __quex_assert_no_passage(); +_754: + /* (DROP_OUT from 3643) */ + goto _278; + + + __quex_assert_no_passage(); +_740: + /* (DROP_OUT from 3608) */ + goto _288; + + + __quex_assert_no_passage(); +_709: + /* (DROP_OUT from 3525) */ + me->buffer._read_p -= 1; +goto _321; + goto _1373; + + + __quex_assert_no_passage(); +_691: + /* (DROP_OUT from 3488) (DROP_OUT from 3543) */ +switch( last_acceptance ) { +case 854: __quex_assert(position[0] != (void*)0); + me->buffer._read_p = position[0]; +goto _320; +case ((QUEX_TYPE_ACCEPTANCE_ID)-1): me->buffer._read_p = me->buffer._lexeme_start_p + 1; +goto _326; +} + + goto _1373; + + + __quex_assert_no_passage(); +_730: + /* (DROP_OUT from 3574) (DROP_OUT from 3576) */ + me->buffer._read_p -= 2; +goto _220; + goto _1373; + + + __quex_assert_no_passage(); +_729: + /* (DROP_OUT from 3572) (DROP_OUT from 3573) */ + me->buffer._read_p -= 1; +goto _220; + goto _1373; + + + __quex_assert_no_passage(); +_672: + /* (DROP_OUT from 3481) (DROP_OUT from 3462) (DROP_OUT from 3455) */ + me->buffer._read_p = me->buffer._lexeme_start_p + 1; +goto _326; + goto _1373; + + + __quex_assert_no_passage(); +_732: + /* (DROP_OUT from 3577) */ + me->buffer._read_p -= 3; +goto _220; + goto _1373; + + + __quex_assert_no_passage(); +_721: + /* (DROP_OUT from 3568) (DROP_OUT from 3581) (DROP_OUT from 3559) (DROP_OUT from 3556) (DROP_OUT from 3553) (DROP_OUT from 3551) (DROP_OUT from 3591) (DROP_OUT from 3566) (DROP_OUT from 3588) (DROP_OUT from 3563) (DROP_OUT from 3585) (DROP_OUT from 3592) (DROP_OUT from 3582) (DROP_OUT from 3579) (DROP_OUT from 3554) (DROP_OUT from 3567) (DROP_OUT from 3549) (DROP_OUT from 3546) (DROP_OUT from 3586) (DROP_OUT from 3593) (DROP_OUT from 3570) (DROP_OUT from 3583) (DROP_OUT from 3580) (DROP_OUT from 3558) (DROP_OUT from 3555) (DROP_OUT from 3552) (DROP_OUT from 3550) (DROP_OUT from 3590) (DROP_OUT from 3565) (DROP_OUT from 3547) (DROP_OUT from 3562) (DROP_OUT from 3584) */ + __quex_assert(position[0] != (void*)0); + me->buffer._read_p = position[0]; +goto _239; + goto _1373; + + + __quex_assert_no_passage(); +_538: + /* (3456 from 3483) (3456 from 3682) (3456 from 3664) (3456 from 3598) (3456 from 3779) (3456 from 3761) (3456 from 3695) (3456 from 3677) (3456 from 3595) (3456 from 3776) (3456 from 3774) (3456 from 3692) (3456 from 3674) (3456 from 3789) (3456 from 3540) (3456 from 3771) (3456 from 3458) (3456 from 3689) (3456 from 3655) (3456 from 3637) (3456 from 3786) (3456 from 3768) (3456 from 3471) (3456 from 3734) (3456 from 3652) (3456 from 3634) (3456 from 3731) (3456 from 3649) (3456 from 3647) (3456 from 3746) (3456 from 3728) (3456 from 3662) (3456 from 3759) (3456 from 3510) (3456 from 3741) (3456 from 3659) (3456 from 3641) (3456 from 3607) (3456 from 3756) (3456 from 3507) (3456 from 3738) (3456 from 3656) (3456 from 3622) (3456 from 3604) (3456 from 3753) (3456 from 3504) (3456 from 3701) (3456 from 3601) (3456 from 3535) (3456 from 3517) (3456 from 3716) (3456 from 3698) (3456 from 3614) (3456 from 3532) (3456 from 3713) (3456 from 3711) (3456 from 3629) (3456 from 3611) (3456 from 3792) (3456 from 3726) (3456 from 3477) (3456 from 3708) (3456 from 3626) (3456 from 3608) (3456 from 3723) (3456 from 3705) (3456 from 3671) (3456 from 3720) (3456 from 3686) (3456 from 3668) (3456 from 3783) (3456 from 3502) (3456 from 3765) (3456 from 3484) (3456 from 3683) (3456 from 3665) (3456 from 3599) (3456 from 3780) (3456 from 3762) (3456 from 3680) (3456 from 3678) (3456 from 3596) (3456 from 3777) (3456 from 3775) (3456 from 3693) (3456 from 3675) (3456 from 3790) (3456 from 3772) (3456 from 3459) (3456 from 3690) (3456 from 3672) (3456 from 3638) (3456 from 3787) (3456 from 3538) (3456 from 3769) (3456 from 3456) (3456 from 3735) (3456 from 3653) (3456 from 3635) (3456 from 3784) (3456 from 3469) (3456 from 3732) (3456 from 3650) (3456 from 3632) (3456 from 3729) (3456 from 3663) (3456 from 3645) (3456 from 3744) (3456 from 3511) (3456 from 3742) (3456 from 3660) (3456 from 3757) (3456 from 3508) (3456 from 3739) (3456 from 3657) (3456 from 3605) (3456 from 3754) (3456 from 3505) (3456 from 3736) (3456 from 3702) (3456 from 3620) (3456 from 3602) (3456 from 3518) (3456 from 3717) (3456 from 3699) (3456 from 3533) (3456 from 3515) (3456 from 3714) (3456 from 3696) (3456 from 3630) (3456 from 3612) (3456 from 3530) (3456 from 3793) (3456 from 3512) (3456 from 3727) (3456 from 3709) (3456 from 3627) (3456 from 3609) (3456 from 3493) (3456 from 3724) (3456 from 3706) (3456 from 3624) (3456 from 3490) (3456 from 3721) (3456 from 3687) (3456 from 3669) (3456 from 3503) (3456 from 3766) (3456 from 3485) (3456 from 3684) (3456 from 3666) (3456 from 3781) (3456 from 3500) (3456 from 3763) (3456 from 3681) (3456 from 3679) (3456 from 3597) (3456 from 3778) (3456 from 3760) (3456 from 3694) (3456 from 3676) (3456 from 3791) (3456 from 3773) (3456 from 3460) (3456 from 3691) (3456 from 3673) (3456 from 3639) (3456 from 3788) (3456 from 3539) (3456 from 3770) (3456 from 3457) (3456 from 3688) (3456 from 3455) (3456 from 3654) (3456 from 3636) (3456 from 3785) (3456 from 3733) (3456 from 3651) (3456 from 3633) (3456 from 3730) (3456 from 3648) (3456 from 3646) (3456 from 3745) (3456 from 3743) (3456 from 3661) (3456 from 3758) (3456 from 3509) (3456 from 3740) (3456 from 3658) (3456 from 3640) (3456 from 3606) (3456 from 3755) (3456 from 3506) (3456 from 3737) (3456 from 3703) (3456 from 3621) (3456 from 3603) (3456 from 3718) (3456 from 3700) (3456 from 3600) (3456 from 3534) (3456 from 3516) (3456 from 3715) (3456 from 3697) (3456 from 3631) (3456 from 3613) (3456 from 3531) (3456 from 3513) (3456 from 3712) (3456 from 3710) (3456 from 3628) (3456 from 3610) (3456 from 3725) (3456 from 3476) (3456 from 3707) (3456 from 3625) (3456 from 3722) (3456 from 3704) (3456 from 3670) (3456 from 3767) (3456 from 3685) (3456 from 3667) (3456 from 3782) (3456 from 3764) */ + + ++(me->buffer._read_p); + +_1377: + input = *(me->buffer._read_p); + + + __quex_debug_state(3456); +switch( input ) { +case 0x0: goto _1180; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1179: + /* (3456 from RELOAD_FORWARD) */ + goto _1377; + + + __quex_assert_no_passage(); +_539: + /* (3457 from 3455) */ + ++(me->buffer._read_p); + +_1379: + input = *(me->buffer._read_p); + + + __quex_debug_state(3457); +switch( input ) { +case 0x0: goto _1182; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _523; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _524; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1181: + /* (3457 from RELOAD_FORWARD) */ + goto _1379; + + + __quex_assert_no_passage(); +_540: + /* (3458 from 3455) */ + ++(me->buffer._read_p); + +_1381: + input = *(me->buffer._read_p); + + + __quex_debug_state(3458); +switch( input ) { +case 0x0: goto _1184; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: goto _538; +case 0x66: goto _516; +case 0x67: case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _517; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1183: + /* (3458 from RELOAD_FORWARD) */ + goto _1381; + + + __quex_assert_no_passage(); +_1185: + /* (3459 from RELOAD_FORWARD) */ +_1383: + input = *(me->buffer._read_p); + + + __quex_debug_state(3459); +switch( input ) { +case 0x0: goto _1186; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _512; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_541: + /* (3459 from 3455) */ + ++(me->buffer._read_p); + + goto _1383; + + + __quex_assert_no_passage(); +_1187: + /* (3460 from RELOAD_FORWARD) */ +_1385: + input = *(me->buffer._read_p); + + + __quex_debug_state(3460); +switch( input ) { +case 0x0: goto _1188; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _498; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: goto _538; +case 0x68: goto _499; +case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _497; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_542: + /* (3460 from 3455) */ + ++(me->buffer._read_p); + + goto _1385; + + + __quex_assert_no_passage(); +_543: + /* (3461 from 3455) */ + ++(me->buffer._read_p); + +_1387: + input = *(me->buffer._read_p); + + + __quex_debug_state(3461); +switch( input ) { +case 0x0: goto _1190; +case 0x3C: goto _494; +case 0x3D: goto _495; +default: goto _674; +} + + + __quex_assert_no_passage(); +_1189: + /* (3461 from RELOAD_FORWARD) */ + goto _1387; + + + __quex_assert_no_passage(); +_544: + /* (3462 from 3455) */ + ++(me->buffer._read_p); + +_1389: + input = *(me->buffer._read_p); + + + __quex_debug_state(3462); +if ( input == 0xA ) goto _493; +else if( input == 0x0 ) goto _1192; +else goto _672; + + + __quex_assert_no_passage(); +_1191: + /* (3462 from RELOAD_FORWARD) */ + goto _1389; + + + __quex_assert_no_passage(); +_545: + /* (3463 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3463); +goto _675; + + + __quex_assert_no_passage(); +_546: + /* (3464 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3464); +goto _676; + + + __quex_assert_no_passage(); +_547: + /* (3465 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3465); +goto _677; + + + __quex_assert_no_passage(); +_548: + /* (3466 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3466); +goto _678; + + + __quex_assert_no_passage(); +_1193: + /* (3467 from RELOAD_FORWARD) */ +_1395: + input = *(me->buffer._read_p); + + + __quex_debug_state(3467); +if ( input == 0x3D ) goto _492; +else if( input == 0x0 ) goto _1194; +else goto _679; + + + __quex_assert_no_passage(); +_549: + /* (3467 from 3455) */ + ++(me->buffer._read_p); + + goto _1395; + + + __quex_assert_no_passage(); +_1195: + /* (3468 from RELOAD_FORWARD) */ +_1397: + input = *(me->buffer._read_p); + + + __quex_debug_state(3468); +if ( input == 0x3D ) goto _491; +else if( input == 0x0 ) goto _1196; +else goto _680; + + + __quex_assert_no_passage(); +_550: + /* (3468 from 3455) */ + ++(me->buffer._read_p); + + goto _1397; + + + __quex_assert_no_passage(); +_551: + /* (3469 from 3455) */ + ++(me->buffer._read_p); + +_1399: + input = *(me->buffer._read_p); + + + __quex_debug_state(3469); +switch( input ) { +case 0x0: goto _1198; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: goto _538; +case 0x68: goto _467; +case 0x69: goto _465; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _466; +case 0x75: case 0x76: goto _538; +case 0x77: goto _464; +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1197: + /* (3469 from RELOAD_FORWARD) */ + goto _1399; + + + __quex_assert_no_passage(); +_552: + /* (3470 from 3455) */ + ++(me->buffer._read_p); + +_1401: + input = *(me->buffer._read_p); + + + __quex_debug_state(3470); +if ( input == 0x3D ) goto _463; +else if( input == 0x0 ) goto _1200; +else goto _681; + + + __quex_assert_no_passage(); +_1199: + /* (3470 from RELOAD_FORWARD) */ + goto _1401; + + + __quex_assert_no_passage(); +_1201: + /* (3471 from RELOAD_FORWARD) */ +_1403: + input = *(me->buffer._read_p); + + + __quex_debug_state(3471); +switch( input ) { +case 0x0: goto _1202; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: goto _538; +case 0x41: goto _395; +case 0x42: goto _392; +case 0x43: goto _394; +case 0x44: case 0x45: case 0x46: goto _538; +case 0x47: goto _389; +case 0x48: goto _538; +case 0x49: goto _396; +case 0x4A: case 0x4B: case 0x4C: case 0x4D: goto _538; +case 0x4E: goto _390; +case 0x4F: case 0x50: case 0x51: case 0x52: goto _538; +case 0x53: goto _391; +case 0x54: goto _393; +case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_553: + /* (3471 from 3455) */ + ++(me->buffer._read_p); + + goto _1403; + + + __quex_assert_no_passage(); +_554: + /* (3472 from 3455) */ + ++(me->buffer._read_p); + +_1405: + input = *(me->buffer._read_p); + + + __quex_debug_state(3472); +switch( input ) { +case 0x0: goto _1204; +case 0x26: goto _387; +case 0x3D: goto _388; +default: goto _682; +} + + + __quex_assert_no_passage(); +_1203: + /* (3472 from RELOAD_FORWARD) */ + goto _1405; + + + __quex_assert_no_passage(); +_555: + /* (3473 from 3455) */ + ++(me->buffer._read_p); + +_1407: + input = *(me->buffer._read_p); + + + __quex_debug_state(3473); +if ( input == 0x7B ) goto _386; +else if( input == 0x0 ) goto _1206; +else goto _683; + + + __quex_assert_no_passage(); +_1205: + /* (3473 from RELOAD_FORWARD) */ + goto _1407; + + + __quex_assert_no_passage(); +_556: + /* (3474 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3474); +goto _684; + + + __quex_assert_no_passage(); +_557: + /* (3475 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3475); +goto _685; + + + __quex_assert_no_passage(); +_558: + /* (3476 from 3455) */ + ++(me->buffer._read_p); + +_1411: + input = *(me->buffer._read_p); + + + __quex_debug_state(3476); +switch( input ) { +case 0x0: goto _1208; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _377; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1207: + /* (3476 from RELOAD_FORWARD) */ + goto _1411; + + + __quex_assert_no_passage(); +_559: + /* (3477 from 3455) */ + ++(me->buffer._read_p); + +_1413: + input = *(me->buffer._read_p); + + + __quex_debug_state(3477); +switch( input ) { +case 0x0: goto _1210; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _364; +case 0x6F: case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _365; +case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1209: + /* (3477 from RELOAD_FORWARD) */ + goto _1413; + + + __quex_assert_no_passage(); +_560: + /* (3478 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3478); +goto _686; + + + __quex_assert_no_passage(); +_1211: + /* (3479 from RELOAD_FORWARD) */ +_1416: + input = *(me->buffer._read_p); + + + __quex_debug_state(3479); +switch( input ) { +case 0x0: goto _1212; +case 0x2D: goto _362; +case 0x3D: goto _363; +case 0x3E: goto _361; +default: goto _687; +} + + + __quex_assert_no_passage(); +_561: + /* (3479 from 3455) */ + ++(me->buffer._read_p); + + goto _1416; + + + __quex_assert_no_passage(); +_1213: + /* (3480 from RELOAD_FORWARD) */ +_1418: + input = *(me->buffer._read_p); + + + __quex_debug_state(3480); +if ( input == 0x3D ) goto _360; +else if( input == 0x0 ) goto _1214; +else goto _688; + + + __quex_assert_no_passage(); +_562: + /* (3480 from 3455) */ + ++(me->buffer._read_p); + + goto _1418; + + + __quex_assert_no_passage(); +_563: + /* (3481 from 3455) */ + ++(me->buffer._read_p); + +_1420: + input = *(me->buffer._read_p); + + + __quex_debug_state(3481); +if ( input == 0xA ) goto _359; +else if( input == 0x0 ) goto _1216; +else goto _672; + + + __quex_assert_no_passage(); +_1215: + /* (3481 from RELOAD_FORWARD) */ + goto _1420; + + + __quex_assert_no_passage(); +_1217: + /* (3483 from RELOAD_FORWARD) */ +_1422: + input = *(me->buffer._read_p); + + + __quex_debug_state(3483); +switch( input ) { +case 0x0: goto _1218; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _348; +case 0x6D: goto _538; +case 0x6E: goto _350; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: goto _538; +case 0x78: goto _349; +case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_564: + /* (3483 from 3455) */ + ++(me->buffer._read_p); + + goto _1422; + + + __quex_assert_no_passage(); +_1219: + /* (3484 from RELOAD_FORWARD) */ +_1424: + input = *(me->buffer._read_p); + + + __quex_debug_state(3484); +switch( input ) { +case 0x0: goto _1220; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _345; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_565: + /* (3484 from 3455) */ + ++(me->buffer._read_p); + + goto _1424; + + + __quex_assert_no_passage(); +_566: + /* (3485 from 3455) */ + ++(me->buffer._read_p); + +_1426: + input = *(me->buffer._read_p); + + + __quex_debug_state(3485); +switch( input ) { +case 0x0: goto _1222; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: goto _538; +case 0x79: goto _339; +case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1221: + /* (3485 from RELOAD_FORWARD) */ + goto _1426; + + + __quex_assert_no_passage(); +_567: + /* (3486 from 3455) */ + ++(me->buffer._read_p); + +_1428: + input = *(me->buffer._read_p); + + + __quex_debug_state(3486); +switch( input ) { +case 0x0: goto _1224; +case 0x9: +case 0x20: goto _629; +case 0x23: goto _633; +case 0x64: goto _631; +case 0x65: goto _638; +case 0x69: goto _634; +case 0x70: goto _636; +default: goto _689; +} + + + __quex_assert_no_passage(); +_1223: + /* (3486 from RELOAD_FORWARD) */ + goto _1428; + + + __quex_assert_no_passage(); +_568: + /* (3487 from 3487) (3487 from 3455) */ + + ++(me->buffer._read_p); + +_1431: + input = *(me->buffer._read_p); + + + __quex_debug_state(3487); +if ( input >= 0x3A ) goto _690; +else if( input >= 0x30 ) goto _568; +else if( input >= 0x1 ) goto _690; +else goto _1226; + + + __quex_assert_no_passage(); +_1225: + /* (3487 from RELOAD_FORWARD) */ + goto _1431; + + + __quex_assert_no_passage(); +_570: + /* (3488 from 3545) */ + position[0] = me->buffer._read_p; __quex_debug("position[0] = input_p;\n"); + +_1433: + ++(me->buffer._read_p); + +_1434: + input = *(me->buffer._read_p); + + + __quex_debug_state(3488); +switch( input ) { +case 0x0: goto _1228; +case 0x1: goto _691; +case 0x27: goto _627; +case 0x5C: goto _625; +default: goto _569; +} + + + __quex_assert_no_passage(); +_1227: + /* (3488 from RELOAD_FORWARD) */ + goto _1434; + + + __quex_assert_no_passage(); +_569: + /* (3488 from 3455) (3488 from 3488) (3488 from 3543) */ + goto _1433; + + + __quex_assert_no_passage(); +_571: + /* (3489 from 3455) */ + ++(me->buffer._read_p); + +_1436: + input = *(me->buffer._read_p); + + + __quex_debug_state(3489); +switch( input ) { +case 0x0: goto _1230; +case 0x2B: goto _623; +case 0x3D: goto _624; +default: goto _692; +} + + + __quex_assert_no_passage(); +_1229: + /* (3489 from RELOAD_FORWARD) */ + goto _1436; + + + __quex_assert_no_passage(); +_572: + /* (3490 from 3455) */ + ++(me->buffer._read_p); + +_1438: + input = *(me->buffer._read_p); + + + __quex_debug_state(3490); +switch( input ) { +case 0x0: goto _1232; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _620; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1231: + /* (3490 from RELOAD_FORWARD) */ + goto _1438; + + + __quex_assert_no_passage(); +_573: + /* (3491 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3491); +goto _693; + + + __quex_assert_no_passage(); +_574: + /* (3492 from 3455) */ + ++(me->buffer._read_p); + +_1441: + input = *(me->buffer._read_p); + + + __quex_debug_state(3492); +switch( input ) { +case 0x0: goto _1234; +case 0x3D: goto _619; +case 0x7C: goto _618; +default: goto _694; +} + + + __quex_assert_no_passage(); +_1233: + /* (3492 from RELOAD_FORWARD) */ + goto _1441; + + + __quex_assert_no_passage(); +_575: + /* (3493 from 3455) */ + ++(me->buffer._read_p); + +_1443: + input = *(me->buffer._read_p); + + + __quex_debug_state(3493); +switch( input ) { +case 0x0: goto _1236; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _613; +case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _612; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1235: + /* (3493 from RELOAD_FORWARD) */ + goto _1443; + + + __quex_assert_no_passage(); +_576: + /* (3494 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3494); +goto _695; + + + __quex_assert_no_passage(); +_577: + /* (3495 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3495); +goto _696; + + + __quex_assert_no_passage(); +_1237: + /* (3496 from RELOAD_FORWARD) */ +_1447: + input = *(me->buffer._read_p); + + + __quex_debug_state(3496); +switch( input ) { +case 0x0: goto _1238; +case 0x2A: goto _611; +case 0x2F: goto _609; +case 0x3D: goto _610; +default: goto _697; +} + + + __quex_assert_no_passage(); +_578: + /* (3496 from 3455) */ + ++(me->buffer._read_p); + + goto _1447; + + + __quex_assert_no_passage(); +_579: + /* (3497 from 3455) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3497); +goto _698; + + + __quex_assert_no_passage(); +_580: + /* (3498 from 3455) */ + ++(me->buffer._read_p); + +_1450: + input = *(me->buffer._read_p); + + + __quex_debug_state(3498); +switch( input ) { +case 0x0: goto _1240; +case 0x1: +case 0x9: case 0xA: goto _699; +case 0x5C: goto _605; +default: goto _604; +} + + + __quex_assert_no_passage(); +_1239: + /* (3498 from RELOAD_FORWARD) */ + goto _1450; + + + __quex_assert_no_passage(); +_1241: + /* (3499 from RELOAD_FORWARD) */ +_1452: + input = *(me->buffer._read_p); + + + __quex_debug_state(3499); +switch( input ) { +case 0x0: goto _1242; +case 0x3D: goto _602; +case 0x3E: goto _601; +default: goto _700; +} + + + __quex_assert_no_passage(); +_581: + /* (3499 from 3455) */ + ++(me->buffer._read_p); + + goto _1452; + + + __quex_assert_no_passage(); +_1243: + /* (3500 from RELOAD_FORWARD) */ +_1454: + input = *(me->buffer._read_p); + + + __quex_debug_state(3500); +switch( input ) { +case 0x0: goto _1244; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: goto _538; +case 0x68: goto _597; +case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_582: + /* (3500 from 3455) */ + ++(me->buffer._read_p); + + goto _1454; + + + __quex_assert_no_passage(); +_583: + /* (3501 from 3455) */ + ++(me->buffer._read_p); + +_1456: + input = *(me->buffer._read_p); + + + __quex_debug_state(3501); +if ( input == 0x3D ) goto _596; +else if( input == 0x0 ) goto _1246; +else goto _701; + + + __quex_assert_no_passage(); +_1245: + /* (3501 from RELOAD_FORWARD) */ + goto _1456; + + + __quex_assert_no_passage(); +_584: + /* (3502 from 3455) */ + ++(me->buffer._read_p); + +_1458: + input = *(me->buffer._read_p); + + + __quex_debug_state(3502); +switch( input ) { +case 0x0: goto _1248; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _585; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1247: + /* (3502 from RELOAD_FORWARD) */ + goto _1458; + + + __quex_assert_no_passage(); +_1249: + /* (3503 from RELOAD_FORWARD) */ +_1460: + input = *(me->buffer._read_p); + + + __quex_debug_state(3503); +switch( input ) { +case 0x0: goto _1250; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _587; +case 0x74: goto _586; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_585: + /* (3503 from 3502) */ + ++(me->buffer._read_p); + + goto _1460; + + + __quex_assert_no_passage(); +_586: + /* (3504 from 3503) */ + ++(me->buffer._read_p); + +_1462: + input = *(me->buffer._read_p); + + + __quex_debug_state(3504); +switch( input ) { +case 0x0: goto _1252; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: goto _538; +case 0x75: goto _593; +case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1251: + /* (3504 from RELOAD_FORWARD) */ + goto _1462; + + + __quex_assert_no_passage(); +_587: + /* (3505 from 3503) */ + ++(me->buffer._read_p); + +_1464: + input = *(me->buffer._read_p); + + + __quex_debug_state(3505); +switch( input ) { +case 0x0: goto _1254; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _588; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1253: + /* (3505 from RELOAD_FORWARD) */ + goto _1464; + + + __quex_assert_no_passage(); +_1255: + /* (3506 from RELOAD_FORWARD) */ +_1466: + input = *(me->buffer._read_p); + + + __quex_debug_state(3506); +switch( input ) { +case 0x0: goto _1256; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _589; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_588: + /* (3506 from 3505) */ + ++(me->buffer._read_p); + + goto _1466; + + + __quex_assert_no_passage(); +_1257: + /* (3507 from RELOAD_FORWARD) */ +_1468: + input = *(me->buffer._read_p); + + + __quex_debug_state(3507); +switch( input ) { +case 0x0: goto _1258; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _590; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_589: + /* (3507 from 3506) */ + ++(me->buffer._read_p); + + goto _1468; + + + __quex_assert_no_passage(); +_1259: + /* (3508 from RELOAD_FORWARD) */ +_1470: + input = *(me->buffer._read_p); + + + __quex_debug_state(3508); +switch( input ) { +case 0x0: goto _1260; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _591; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_590: + /* (3508 from 3507) */ + ++(me->buffer._read_p); + + goto _1470; + + + __quex_assert_no_passage(); +_591: + /* (3509 from 3508) */ + ++(me->buffer._read_p); + +_1472: + input = *(me->buffer._read_p); + + + __quex_debug_state(3509); +switch( input ) { +case 0x0: goto _1262; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _592; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1261: + /* (3509 from RELOAD_FORWARD) */ + goto _1472; + + + __quex_assert_no_passage(); +_592: + /* (3510 from 3509) */ + ++(me->buffer._read_p); + +_1474: + input = *(me->buffer._read_p); + + + __quex_debug_state(3510); +switch( input ) { +case 0x0: goto _1264; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _702; +} + + + __quex_assert_no_passage(); +_1263: + /* (3510 from RELOAD_FORWARD) */ + goto _1474; + + + __quex_assert_no_passage(); +_1265: + /* (3511 from RELOAD_FORWARD) */ +_1476: + input = *(me->buffer._read_p); + + + __quex_debug_state(3511); +switch( input ) { +case 0x0: goto _1266; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _594; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_593: + /* (3511 from 3504) */ + ++(me->buffer._read_p); + + goto _1476; + + + __quex_assert_no_passage(); +_594: + /* (3512 from 3511) */ + ++(me->buffer._read_p); + +_1478: + input = *(me->buffer._read_p); + + + __quex_debug_state(3512); +switch( input ) { +case 0x0: goto _1268; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _595; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1267: + /* (3512 from RELOAD_FORWARD) */ + goto _1478; + + + __quex_assert_no_passage(); +_595: + /* (3513 from 3512) */ + ++(me->buffer._read_p); + +_1480: + input = *(me->buffer._read_p); + + + __quex_debug_state(3513); +switch( input ) { +case 0x0: goto _1270; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _703; +} + + + __quex_assert_no_passage(); +_1269: + /* (3513 from RELOAD_FORWARD) */ + goto _1480; + + + __quex_assert_no_passage(); +_596: + /* (3514 from 3501) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3514); +goto _704; + + + __quex_assert_no_passage(); +_1271: + /* (3515 from RELOAD_FORWARD) */ +_1483: + input = *(me->buffer._read_p); + + + __quex_debug_state(3515); +switch( input ) { +case 0x0: goto _1272; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _598; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_597: + /* (3515 from 3500) */ + ++(me->buffer._read_p); + + goto _1483; + + + __quex_assert_no_passage(); +_598: + /* (3516 from 3515) */ + ++(me->buffer._read_p); + +_1485: + input = *(me->buffer._read_p); + + + __quex_debug_state(3516); +switch( input ) { +case 0x0: goto _1274; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _599; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1273: + /* (3516 from RELOAD_FORWARD) */ + goto _1485; + + + __quex_assert_no_passage(); +_599: + /* (3517 from 3516) */ + ++(me->buffer._read_p); + +_1487: + input = *(me->buffer._read_p); + + + __quex_debug_state(3517); +switch( input ) { +case 0x0: goto _1276; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _600; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1275: + /* (3517 from RELOAD_FORWARD) */ + goto _1487; + + + __quex_assert_no_passage(); +_600: + /* (3518 from 3517) */ + ++(me->buffer._read_p); + +_1489: + input = *(me->buffer._read_p); + + + __quex_debug_state(3518); +switch( input ) { +case 0x0: goto _1278; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _705; +} + + + __quex_assert_no_passage(); +_1277: + /* (3518 from RELOAD_FORWARD) */ + goto _1489; + + + __quex_assert_no_passage(); +_601: + /* (3519 from 3499) */ + ++(me->buffer._read_p); + +_1491: + input = *(me->buffer._read_p); + + + __quex_debug_state(3519); +if ( input == 0x3D ) goto _603; +else if( input == 0x0 ) goto _1280; +else goto _706; + + + __quex_assert_no_passage(); +_1279: + /* (3519 from RELOAD_FORWARD) */ + goto _1491; + + + __quex_assert_no_passage(); +_602: + /* (3520 from 3499) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3520); +goto _707; + + + __quex_assert_no_passage(); +_603: + /* (3521 from 3519) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3521); +goto _708; + + + __quex_assert_no_passage(); +_604: + /* (3522 from 3523) (3522 from 3498) */ + + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3522); +goto _699; + + + __quex_assert_no_passage(); +_1281: + /* (3523 from RELOAD_FORWARD) */ +_1497: + input = *(me->buffer._read_p); + + + __quex_debug_state(3523); +switch( input ) { +case 0x0: goto _1282; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: goto _606; +case 0x40: +case 0x5C: +case 0x61: case 0x62: case 0x63: +case 0x66: +case 0x6E: +case 0x72: +case 0x74: +case 0x76: goto _604; +case 0x78: goto _607; +default: goto _699; +} + + + __quex_assert_no_passage(); +_605: + /* (3523 from 3498) */ + ++(me->buffer._read_p); + + goto _1497; + + + __quex_assert_no_passage(); +_606: + /* (3524 from 3524) (3524 from 3523) */ + + ++(me->buffer._read_p); + +_1500: + input = *(me->buffer._read_p); + + + __quex_debug_state(3524); +if ( input >= 0x38 ) goto _699; +else if( input >= 0x30 ) goto _606; +else if( input >= 0x1 ) goto _699; +else goto _1284; + + + __quex_assert_no_passage(); +_1283: + /* (3524 from RELOAD_FORWARD) */ + goto _1500; + + + __quex_assert_no_passage(); +_607: + /* (3525 from 3523) */ + ++(me->buffer._read_p); + +_1502: + input = *(me->buffer._read_p); + + + __quex_debug_state(3525); +switch( input ) { +case 0x0: goto _1286; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: goto _608; +default: goto _709; +} + + + __quex_assert_no_passage(); +_1285: + /* (3525 from RELOAD_FORWARD) */ + goto _1502; + + + __quex_assert_no_passage(); +_608: + /* (3526 from 3525) (3526 from 3526) */ + + ++(me->buffer._read_p); + +_1505: + input = *(me->buffer._read_p); + + + __quex_debug_state(3526); +switch( input ) { +case 0x0: goto _1288; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: goto _608; +default: goto _699; +} + + + __quex_assert_no_passage(); +_1287: + /* (3526 from RELOAD_FORWARD) */ + goto _1505; + + + __quex_assert_no_passage(); +_609: + /* (3527 from 3496) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3527); +goto _710; + + + __quex_assert_no_passage(); +_610: + /* (3528 from 3496) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3528); +goto _711; + + + __quex_assert_no_passage(); +_611: + /* (3529 from 3496) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3529); +goto _712; + + + __quex_assert_no_passage(); +_612: + /* (3530 from 3493) */ + ++(me->buffer._read_p); + +_1510: + input = *(me->buffer._read_p); + + + __quex_debug_state(3530); +switch( input ) { +case 0x0: goto _1290; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _617; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1289: + /* (3530 from RELOAD_FORWARD) */ + goto _1510; + + + __quex_assert_no_passage(); +_613: + /* (3531 from 3493) */ + ++(me->buffer._read_p); + +_1512: + input = *(me->buffer._read_p); + + + __quex_debug_state(3531); +switch( input ) { +case 0x0: goto _1292; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _614; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1291: + /* (3531 from RELOAD_FORWARD) */ + goto _1512; + + + __quex_assert_no_passage(); +_1293: + /* (3532 from RELOAD_FORWARD) */ +_1514: + input = *(me->buffer._read_p); + + + __quex_debug_state(3532); +switch( input ) { +case 0x0: goto _1294; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _615; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_614: + /* (3532 from 3531) */ + ++(me->buffer._read_p); + + goto _1514; + + + __quex_assert_no_passage(); +_1295: + /* (3533 from RELOAD_FORWARD) */ +_1516: + input = *(me->buffer._read_p); + + + __quex_debug_state(3533); +switch( input ) { +case 0x0: goto _1296; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _616; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_615: + /* (3533 from 3532) */ + ++(me->buffer._read_p); + + goto _1516; + + + __quex_assert_no_passage(); +_616: + /* (3534 from 3533) */ + ++(me->buffer._read_p); + +_1518: + input = *(me->buffer._read_p); + + + __quex_debug_state(3534); +switch( input ) { +case 0x0: goto _1298; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _713; +} + + + __quex_assert_no_passage(); +_1297: + /* (3534 from RELOAD_FORWARD) */ + goto _1518; + + + __quex_assert_no_passage(); +_1299: + /* (3535 from RELOAD_FORWARD) */ +_1520: + input = *(me->buffer._read_p); + + + __quex_debug_state(3535); +switch( input ) { +case 0x0: goto _1300; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _714; +} + + + __quex_assert_no_passage(); +_617: + /* (3535 from 3530) */ + ++(me->buffer._read_p); + + goto _1520; + + + __quex_assert_no_passage(); +_618: + /* (3536 from 3492) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3536); +goto _715; + + + __quex_assert_no_passage(); +_619: + /* (3537 from 3492) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3537); +goto _716; + + + __quex_assert_no_passage(); +_620: + /* (3538 from 3490) */ + ++(me->buffer._read_p); + +_1524: + input = *(me->buffer._read_p); + + + __quex_debug_state(3538); +switch( input ) { +case 0x0: goto _1302; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _621; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1301: + /* (3538 from RELOAD_FORWARD) */ + goto _1524; + + + __quex_assert_no_passage(); +_1303: + /* (3539 from RELOAD_FORWARD) */ +_1526: + input = *(me->buffer._read_p); + + + __quex_debug_state(3539); +switch( input ) { +case 0x0: goto _1304; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _622; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_621: + /* (3539 from 3538) */ + ++(me->buffer._read_p); + + goto _1526; + + + __quex_assert_no_passage(); +_622: + /* (3540 from 3539) */ + ++(me->buffer._read_p); + +_1528: + input = *(me->buffer._read_p); + + + __quex_debug_state(3540); +switch( input ) { +case 0x0: goto _1306; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _717; +} + + + __quex_assert_no_passage(); +_1305: + /* (3540 from RELOAD_FORWARD) */ + goto _1528; + + + __quex_assert_no_passage(); +_623: + /* (3541 from 3489) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3541); +goto _718; + + + __quex_assert_no_passage(); +_624: + /* (3542 from 3489) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3542); +goto _719; + + + __quex_assert_no_passage(); +_626: + /* (3543 from 3545) */ + position[0] = me->buffer._read_p; __quex_debug("position[0] = input_p;\n"); + +_1532: + ++(me->buffer._read_p); + +_1533: + input = *(me->buffer._read_p); + + + __quex_debug_state(3543); +switch( input ) { +case 0x0: goto _1308; +case 0x1: goto _691; +case 0x27: goto _628; +case 0x5C: goto _625; +default: goto _569; +} + + + __quex_assert_no_passage(); +_625: + /* (3543 from 3543) (3543 from 3488) */ + goto _1532; + + + __quex_assert_no_passage(); +_1307: + /* (3543 from RELOAD_FORWARD) */ + goto _1533; + + + __quex_assert_no_passage(); +_627: + /* (3544 from 3545) (3544 from 3488) */ + + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3544); +goto _720; + + + __quex_assert_no_passage(); +_628: + /* (3545 from 3543) */ + ++(me->buffer._read_p); + + { last_acceptance = 854; __quex_debug("last_acceptance = 854\n"); } + +_1537: + input = *(me->buffer._read_p); + + + __quex_debug_state(3545); +switch( input ) { +case 0x0: goto _1310; +case 0x1: goto _720; +case 0x27: goto _627; +case 0x5C: goto _626; +default: goto _570; +} + + + __quex_assert_no_passage(); +_1309: + /* (3545 from RELOAD_FORWARD) */ + goto _1537; + + + __quex_assert_no_passage(); +_629: + /* (3546 from 3486) */ + position[0] = me->buffer._read_p; __quex_debug("position[0] = input_p;\n"); + +_1539: + ++(me->buffer._read_p); + +_1540: + input = *(me->buffer._read_p); + + + __quex_debug_state(3546); +switch( input ) { +case 0x0: goto _1312; +case 0x9: +case 0x20: goto _630; +case 0x64: goto _632; +case 0x65: goto _639; +case 0x69: goto _635; +case 0x70: goto _637; +default: goto _721; +} + + + __quex_assert_no_passage(); +_630: + /* (3546 from 3546) */ + goto _1539; + + + __quex_assert_no_passage(); +_1311: + /* (3546 from RELOAD_FORWARD) */ + goto _1540; + + + __quex_assert_no_passage(); +_632: + /* (3547 from 3546) */ +_1542: + ++(me->buffer._read_p); + +_1543: + input = *(me->buffer._read_p); + + + __quex_debug_state(3547); +if ( input == 0x65 ) goto _334; +else if( input == 0x0 ) goto _1314; +else goto _721; + + + __quex_assert_no_passage(); +_1313: + /* (3547 from RELOAD_FORWARD) */ + goto _1543; + + + __quex_assert_no_passage(); +_631: + /* (3547 from 3486) */ + position[0] = me->buffer._read_p; __quex_debug("position[0] = input_p;\n"); + + goto _1542; + + + __quex_assert_no_passage(); +_633: + /* (3548 from 3486) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3548); +goto _722; + + + __quex_assert_no_passage(); +_635: + /* (3549 from 3546) */ +_1546: + ++(me->buffer._read_p); + +_1547: + input = *(me->buffer._read_p); + + + __quex_debug_state(3549); +switch( input ) { +case 0x0: goto _1316; +case 0x66: goto _659; +case 0x6E: goto _658; +default: goto _721; +} + + + __quex_assert_no_passage(); +_1315: + /* (3549 from RELOAD_FORWARD) */ + goto _1547; + + + __quex_assert_no_passage(); +_634: + /* (3549 from 3486) */ + position[0] = me->buffer._read_p; __quex_debug("position[0] = input_p;\n"); + + goto _1546; + + + __quex_assert_no_passage(); +_637: + /* (3550 from 3546) */ +_1549: + ++(me->buffer._read_p); + +_1550: + input = *(me->buffer._read_p); + + + __quex_debug_state(3550); +if ( input == 0x72 ) goto _653; +else if( input == 0x0 ) goto _1318; +else goto _721; + + + __quex_assert_no_passage(); +_1317: + /* (3550 from RELOAD_FORWARD) */ + goto _1550; + + + __quex_assert_no_passage(); +_636: + /* (3550 from 3486) */ + position[0] = me->buffer._read_p; __quex_debug("position[0] = input_p;\n"); + + goto _1549; + + + __quex_assert_no_passage(); +_638: + /* (3551 from 3486) */ + position[0] = me->buffer._read_p; __quex_debug("position[0] = input_p;\n"); + +_1552: + ++(me->buffer._read_p); + +_1553: + input = *(me->buffer._read_p); + + + __quex_debug_state(3551); +switch( input ) { +case 0x0: goto _1320; +case 0x6C: goto _641; +case 0x6E: goto _640; +case 0x72: goto _642; +default: goto _721; +} + + + __quex_assert_no_passage(); +_1319: + /* (3551 from RELOAD_FORWARD) */ + goto _1553; + + + __quex_assert_no_passage(); +_639: + /* (3551 from 3546) */ + goto _1552; + + + __quex_assert_no_passage(); +_1321: + /* (3552 from RELOAD_FORWARD) */ +_1555: + input = *(me->buffer._read_p); + + + __quex_debug_state(3552); +if ( input == 0x64 ) goto _650; +else if( input == 0x0 ) goto _1322; +else goto _721; + + + __quex_assert_no_passage(); +_640: + /* (3552 from 3551) */ + ++(me->buffer._read_p); + + goto _1555; + + + __quex_assert_no_passage(); +_1323: + /* (3553 from RELOAD_FORWARD) */ +_1557: + input = *(me->buffer._read_p); + + + __quex_debug_state(3553); +switch( input ) { +case 0x0: goto _1324; +case 0x69: goto _647; +case 0x73: goto _646; +default: goto _721; +} + + + __quex_assert_no_passage(); +_641: + /* (3553 from 3551) */ + ++(me->buffer._read_p); + + goto _1557; + + + __quex_assert_no_passage(); +_642: + /* (3554 from 3551) */ + ++(me->buffer._read_p); + +_1559: + input = *(me->buffer._read_p); + + + __quex_debug_state(3554); +if ( input == 0x72 ) goto _643; +else if( input == 0x0 ) goto _1326; +else goto _721; + + + __quex_assert_no_passage(); +_1325: + /* (3554 from RELOAD_FORWARD) */ + goto _1559; + + + __quex_assert_no_passage(); +_1327: + /* (3555 from RELOAD_FORWARD) */ +_1561: + input = *(me->buffer._read_p); + + + __quex_debug_state(3555); +if ( input == 0x6F ) goto _644; +else if( input == 0x0 ) goto _1328; +else goto _721; + + + __quex_assert_no_passage(); +_643: + /* (3555 from 3554) */ + ++(me->buffer._read_p); + + goto _1561; + + + __quex_assert_no_passage(); +_644: + /* (3556 from 3555) */ + ++(me->buffer._read_p); + +_1563: + input = *(me->buffer._read_p); + + + __quex_debug_state(3556); +if ( input == 0x72 ) goto _645; +else if( input == 0x0 ) goto _1330; +else goto _721; + + + __quex_assert_no_passage(); +_1329: + /* (3556 from RELOAD_FORWARD) */ + goto _1563; + + + __quex_assert_no_passage(); +_645: + /* (3557 from 3556) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3557); +goto _723; + + + __quex_assert_no_passage(); +_1331: + /* (3558 from RELOAD_FORWARD) */ +_1566: + input = *(me->buffer._read_p); + + + __quex_debug_state(3558); +if ( input == 0x65 ) goto _649; +else if( input == 0x0 ) goto _1332; +else goto _721; + + + __quex_assert_no_passage(); +_646: + /* (3558 from 3553) */ + ++(me->buffer._read_p); + + goto _1566; + + + __quex_assert_no_passage(); +_1333: + /* (3559 from RELOAD_FORWARD) */ +_1568: + input = *(me->buffer._read_p); + + + __quex_debug_state(3559); +if ( input == 0x66 ) goto _648; +else if( input == 0x0 ) goto _1334; +else goto _721; + + + __quex_assert_no_passage(); +_647: + /* (3559 from 3553) */ + ++(me->buffer._read_p); + + goto _1568; + + + __quex_assert_no_passage(); +_648: + /* (3560 from 3559) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3560); +goto _724; + + + __quex_assert_no_passage(); +_649: + /* (3561 from 3558) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3561); +goto _725; + + + __quex_assert_no_passage(); +_1335: + /* (3562 from RELOAD_FORWARD) */ +_1572: + input = *(me->buffer._read_p); + + + __quex_debug_state(3562); +if ( input == 0x69 ) goto _651; +else if( input == 0x0 ) goto _1336; +else goto _721; + + + __quex_assert_no_passage(); +_650: + /* (3562 from 3552) */ + ++(me->buffer._read_p); + + goto _1572; + + + __quex_assert_no_passage(); +_1337: + /* (3563 from RELOAD_FORWARD) */ +_1574: + input = *(me->buffer._read_p); + + + __quex_debug_state(3563); +if ( input == 0x66 ) goto _652; +else if( input == 0x0 ) goto _1338; +else goto _721; + + + __quex_assert_no_passage(); +_651: + /* (3563 from 3562) */ + ++(me->buffer._read_p); + + goto _1574; + + + __quex_assert_no_passage(); +_652: + /* (3564 from 3563) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3564); +goto _726; + + + __quex_assert_no_passage(); +_1339: + /* (3565 from RELOAD_FORWARD) */ +_1577: + input = *(me->buffer._read_p); + + + __quex_debug_state(3565); +if ( input == 0x61 ) goto _654; +else if( input == 0x0 ) goto _1340; +else goto _721; + + + __quex_assert_no_passage(); +_653: + /* (3565 from 3550) */ + ++(me->buffer._read_p); + + goto _1577; + + + __quex_assert_no_passage(); +_1341: + /* (3566 from RELOAD_FORWARD) */ +_1579: + input = *(me->buffer._read_p); + + + __quex_debug_state(3566); +if ( input == 0x67 ) goto _655; +else if( input == 0x0 ) goto _1342; +else goto _721; + + + __quex_assert_no_passage(); +_654: + /* (3566 from 3565) */ + ++(me->buffer._read_p); + + goto _1579; + + + __quex_assert_no_passage(); +_1343: + /* (3567 from RELOAD_FORWARD) */ +_1581: + input = *(me->buffer._read_p); + + + __quex_debug_state(3567); +if ( input == 0x6D ) goto _656; +else if( input == 0x0 ) goto _1344; +else goto _721; + + + __quex_assert_no_passage(); +_655: + /* (3567 from 3566) */ + ++(me->buffer._read_p); + + goto _1581; + + + __quex_assert_no_passage(); +_1345: + /* (3568 from RELOAD_FORWARD) */ +_1583: + input = *(me->buffer._read_p); + + + __quex_debug_state(3568); +if ( input == 0x61 ) goto _657; +else if( input == 0x0 ) goto _1346; +else goto _721; + + + __quex_assert_no_passage(); +_656: + /* (3568 from 3567) */ + ++(me->buffer._read_p); + + goto _1583; + + + __quex_assert_no_passage(); +_657: + /* (3569 from 3568) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3569); +goto _727; + + + __quex_assert_no_passage(); +_658: + /* (3570 from 3549) */ + ++(me->buffer._read_p); + +_1586: + input = *(me->buffer._read_p); + + + __quex_debug_state(3570); +if ( input == 0x63 ) goto _667; +else if( input == 0x0 ) goto _1348; +else goto _721; + + + __quex_assert_no_passage(); +_1347: + /* (3570 from RELOAD_FORWARD) */ + goto _1586; + + + __quex_assert_no_passage(); +_1349: + /* (3571 from RELOAD_FORWARD) */ +_1588: + input = *(me->buffer._read_p); + + + __quex_debug_state(3571); +switch( input ) { +case 0x0: goto _1350; +case 0x64: goto _661; +case 0x6E: goto _660; +default: goto _728; +} + + + __quex_assert_no_passage(); +_659: + /* (3571 from 3549) */ + ++(me->buffer._read_p); + + goto _1588; + + + __quex_assert_no_passage(); +_660: + /* (3572 from 3571) */ + ++(me->buffer._read_p); + +_1590: + input = *(me->buffer._read_p); + + + __quex_debug_state(3572); +if ( input == 0x64 ) goto _664; +else if( input == 0x0 ) goto _1352; +else goto _729; + + + __quex_assert_no_passage(); +_1351: + /* (3572 from RELOAD_FORWARD) */ + goto _1590; + + + __quex_assert_no_passage(); +_1353: + /* (3573 from RELOAD_FORWARD) */ +_1592: + input = *(me->buffer._read_p); + + + __quex_debug_state(3573); +if ( input == 0x65 ) goto _662; +else if( input == 0x0 ) goto _1354; +else goto _729; + + + __quex_assert_no_passage(); +_661: + /* (3573 from 3571) */ + ++(me->buffer._read_p); + + goto _1592; + + + __quex_assert_no_passage(); +_1355: + /* (3574 from RELOAD_FORWARD) */ +_1594: + input = *(me->buffer._read_p); + + + __quex_debug_state(3574); +if ( input == 0x66 ) goto _663; +else if( input == 0x0 ) goto _1356; +else goto _730; + + + __quex_assert_no_passage(); +_662: + /* (3574 from 3573) */ + ++(me->buffer._read_p); + + goto _1594; + + + __quex_assert_no_passage(); +_663: + /* (3575 from 3574) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3575); +goto _731; + + + __quex_assert_no_passage(); +_664: + /* (3576 from 3572) */ + ++(me->buffer._read_p); + +_1597: + input = *(me->buffer._read_p); + + + __quex_debug_state(3576); +if ( input == 0x65 ) goto _665; +else if( input == 0x0 ) goto _1358; +else goto _730; + + + __quex_assert_no_passage(); +_1357: + /* (3576 from RELOAD_FORWARD) */ + goto _1597; + + + __quex_assert_no_passage(); +_1359: + /* (3577 from RELOAD_FORWARD) */ +_1599: + input = *(me->buffer._read_p); + + + __quex_debug_state(3577); +if ( input == 0x66 ) goto _666; +else if( input == 0x0 ) goto _1360; +else goto _732; + + + __quex_assert_no_passage(); +_665: + /* (3577 from 3576) */ + ++(me->buffer._read_p); + + goto _1599; + + + __quex_assert_no_passage(); +_666: + /* (3578 from 3577) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3578); +goto _733; + + + __quex_assert_no_passage(); +_1361: + /* (3579 from RELOAD_FORWARD) */ +_1602: + input = *(me->buffer._read_p); + + + __quex_debug_state(3579); +if ( input == 0x6C ) goto _668; +else if( input == 0x0 ) goto _1362; +else goto _721; + + + __quex_assert_no_passage(); +_667: + /* (3579 from 3570) */ + ++(me->buffer._read_p); + + goto _1602; + + + __quex_assert_no_passage(); +_668: + /* (3580 from 3579) */ + ++(me->buffer._read_p); + +_1604: + input = *(me->buffer._read_p); + + + __quex_debug_state(3580); +if ( input == 0x75 ) goto _669; +else if( input == 0x0 ) goto _1364; +else goto _721; + + + __quex_assert_no_passage(); +_1363: + /* (3580 from RELOAD_FORWARD) */ + goto _1604; + + + __quex_assert_no_passage(); +_1365: + /* (3581 from RELOAD_FORWARD) */ +_1606: + input = *(me->buffer._read_p); + + + __quex_debug_state(3581); +if ( input == 0x64 ) goto _670; +else if( input == 0x0 ) goto _1366; +else goto _721; + + + __quex_assert_no_passage(); +_669: + /* (3581 from 3580) */ + ++(me->buffer._read_p); + + goto _1606; + + + __quex_assert_no_passage(); +_670: + /* (3582 from 3581) */ + ++(me->buffer._read_p); + +_1608: + input = *(me->buffer._read_p); + + + __quex_debug_state(3582); +if ( input == 0x65 ) goto _671; +else if( input == 0x0 ) goto _1368; +else goto _721; + + + __quex_assert_no_passage(); +_1367: + /* (3582 from RELOAD_FORWARD) */ + goto _1608; + + + __quex_assert_no_passage(); +_671: + /* (3583 from 3582) (3583 from 3583) */ + + ++(me->buffer._read_p); + +_1611: + input = *(me->buffer._read_p); + + + __quex_debug_state(3583); +switch( input ) { +case 0x0: goto _1370; +case 0x9: +case 0x20: goto _671; +case 0x22: goto _329; +case 0x3C: goto _328; +default: goto _721; +} + + + __quex_assert_no_passage(); +_1369: + /* (3583 from RELOAD_FORWARD) */ + goto _1611; + + + __quex_assert_no_passage(); +_328: + /* (3584 from 3583) */ + ++(me->buffer._read_p); + +_1613: + input = *(me->buffer._read_p); + + + __quex_debug_state(3584); +if ( input >= 0x3F ) goto _332; +else if( input == 0x3E ) goto _721; +else if( input >= 0x2 ) goto _332; +else if( input == 0x1 ) goto _721; +else goto _792; + + + __quex_assert_no_passage(); +_791: + /* (3584 from RELOAD_FORWARD) */ + goto _1613; + + + __quex_assert_no_passage(); +_793: + /* (3585 from RELOAD_FORWARD) */ +_1615: + input = *(me->buffer._read_p); + + + __quex_debug_state(3585); +if ( input >= 0x23 ) goto _330; +else if( input == 0x22 ) goto _721; +else if( input >= 0x2 ) goto _330; +else if( input == 0x1 ) goto _721; +else goto _794; + + + __quex_assert_no_passage(); +_329: + /* (3585 from 3583) */ + ++(me->buffer._read_p); + + goto _1615; + + + __quex_assert_no_passage(); +_330: + /* (3586 from 3585) (3586 from 3586) */ + + ++(me->buffer._read_p); + +_1618: + input = *(me->buffer._read_p); + + + __quex_debug_state(3586); +switch( input ) { +case 0x0: goto _796; +case 0x1: goto _721; +case 0x22: goto _331; +default: goto _330; +} + + + __quex_assert_no_passage(); +_795: + /* (3586 from RELOAD_FORWARD) */ + goto _1618; + + + __quex_assert_no_passage(); +_331: + /* (3587 from 3586) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3587); +goto _734; + + + __quex_assert_no_passage(); +_332: + /* (3588 from 3588) (3588 from 3584) */ + + ++(me->buffer._read_p); + +_1622: + input = *(me->buffer._read_p); + + + __quex_debug_state(3588); +switch( input ) { +case 0x0: goto _798; +case 0x1: goto _721; +case 0x3E: goto _333; +default: goto _332; +} + + + __quex_assert_no_passage(); +_797: + /* (3588 from RELOAD_FORWARD) */ + goto _1622; + + + __quex_assert_no_passage(); +_333: + /* (3589 from 3588) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3589); +goto _735; + + + __quex_assert_no_passage(); +_334: + /* (3590 from 3547) */ + ++(me->buffer._read_p); + +_1625: + input = *(me->buffer._read_p); + + + __quex_debug_state(3590); +if ( input == 0x66 ) goto _335; +else if( input == 0x0 ) goto _800; +else goto _721; + + + __quex_assert_no_passage(); +_799: + /* (3590 from RELOAD_FORWARD) */ + goto _1625; + + + __quex_assert_no_passage(); +_801: + /* (3591 from RELOAD_FORWARD) */ +_1627: + input = *(me->buffer._read_p); + + + __quex_debug_state(3591); +if ( input == 0x69 ) goto _336; +else if( input == 0x0 ) goto _802; +else goto _721; + + + __quex_assert_no_passage(); +_335: + /* (3591 from 3590) */ + ++(me->buffer._read_p); + + goto _1627; + + + __quex_assert_no_passage(); +_336: + /* (3592 from 3591) */ + ++(me->buffer._read_p); + +_1629: + input = *(me->buffer._read_p); + + + __quex_debug_state(3592); +if ( input == 0x6E ) goto _337; +else if( input == 0x0 ) goto _804; +else goto _721; + + + __quex_assert_no_passage(); +_803: + /* (3592 from RELOAD_FORWARD) */ + goto _1629; + + + __quex_assert_no_passage(); +_805: + /* (3593 from RELOAD_FORWARD) */ +_1631: + input = *(me->buffer._read_p); + + + __quex_debug_state(3593); +if ( input == 0x65 ) goto _338; +else if( input == 0x0 ) goto _806; +else goto _721; + + + __quex_assert_no_passage(); +_337: + /* (3593 from 3592) */ + ++(me->buffer._read_p); + + goto _1631; + + + __quex_assert_no_passage(); +_338: + /* (3594 from 3593) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3594); +goto _736; + + + __quex_assert_no_passage(); +_807: + /* (3595 from RELOAD_FORWARD) */ +_1634: + input = *(me->buffer._read_p); + + + __quex_debug_state(3595); +switch( input ) { +case 0x0: goto _808; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: goto _538; +case 0x70: goto _340; +case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_339: + /* (3595 from 3485) */ + ++(me->buffer._read_p); + + goto _1634; + + + __quex_assert_no_passage(); +_340: + /* (3596 from 3595) */ + ++(me->buffer._read_p); + +_1636: + input = *(me->buffer._read_p); + + + __quex_debug_state(3596); +switch( input ) { +case 0x0: goto _810; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _341; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_809: + /* (3596 from RELOAD_FORWARD) */ + goto _1636; + + + __quex_assert_no_passage(); +_811: + /* (3597 from RELOAD_FORWARD) */ +_1638: + input = *(me->buffer._read_p); + + + __quex_debug_state(3597); +switch( input ) { +case 0x0: goto _812; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: goto _538; +case 0x64: goto _342; +case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _737; +} + + + __quex_assert_no_passage(); +_341: + /* (3597 from 3596) */ + ++(me->buffer._read_p); + + goto _1638; + + + __quex_assert_no_passage(); +_813: + /* (3598 from RELOAD_FORWARD) */ +_1640: + input = *(me->buffer._read_p); + + + __quex_debug_state(3598); +switch( input ) { +case 0x0: goto _814; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _343; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_342: + /* (3598 from 3597) */ + ++(me->buffer._read_p); + + goto _1640; + + + __quex_assert_no_passage(); +_815: + /* (3599 from RELOAD_FORWARD) */ +_1642: + input = *(me->buffer._read_p); + + + __quex_debug_state(3599); +switch( input ) { +case 0x0: goto _816; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: goto _538; +case 0x66: goto _344; +case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_343: + /* (3599 from 3598) */ + ++(me->buffer._read_p); + + goto _1642; + + + __quex_assert_no_passage(); +_817: + /* (3600 from RELOAD_FORWARD) */ +_1644: + input = *(me->buffer._read_p); + + + __quex_debug_state(3600); +switch( input ) { +case 0x0: goto _818; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _738; +} + + + __quex_assert_no_passage(); +_344: + /* (3600 from 3599) */ + ++(me->buffer._read_p); + + goto _1644; + + + __quex_assert_no_passage(); +_819: + /* (3601 from RELOAD_FORWARD) */ +_1646: + input = *(me->buffer._read_p); + + + __quex_debug_state(3601); +switch( input ) { +case 0x0: goto _820; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _346; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_345: + /* (3601 from 3484) */ + ++(me->buffer._read_p); + + goto _1646; + + + __quex_assert_no_passage(); +_346: + /* (3602 from 3601) */ + ++(me->buffer._read_p); + +_1648: + input = *(me->buffer._read_p); + + + __quex_debug_state(3602); +switch( input ) { +case 0x0: goto _822; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: goto _538; +case 0x67: goto _347; +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_821: + /* (3602 from RELOAD_FORWARD) */ + goto _1648; + + + __quex_assert_no_passage(); +_823: + /* (3603 from RELOAD_FORWARD) */ +_1650: + input = *(me->buffer._read_p); + + + __quex_debug_state(3603); +switch( input ) { +case 0x0: goto _824; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _739; +} + + + __quex_assert_no_passage(); +_347: + /* (3603 from 3602) */ + ++(me->buffer._read_p); + + goto _1650; + + + __quex_assert_no_passage(); +_348: + /* (3604 from 3483) */ + ++(me->buffer._read_p); + +_1652: + input = *(me->buffer._read_p); + + + __quex_debug_state(3604); +switch( input ) { +case 0x0: goto _826; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _357; +case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_825: + /* (3604 from RELOAD_FORWARD) */ + goto _1652; + + + __quex_assert_no_passage(); +_827: + /* (3605 from RELOAD_FORWARD) */ +_1654: + input = *(me->buffer._read_p); + + + __quex_debug_state(3605); +switch( input ) { +case 0x0: goto _828; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _353; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_349: + /* (3605 from 3483) */ + ++(me->buffer._read_p); + + goto _1654; + + + __quex_assert_no_passage(); +_829: + /* (3606 from RELOAD_FORWARD) */ +_1656: + input = *(me->buffer._read_p); + + + __quex_debug_state(3606); +switch( input ) { +case 0x0: goto _830; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: goto _538; +case 0x75: goto _351; +case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_350: + /* (3606 from 3483) */ + ++(me->buffer._read_p); + + goto _1656; + + + __quex_assert_no_passage(); +_831: + /* (3607 from RELOAD_FORWARD) */ +_1658: + input = *(me->buffer._read_p); + + + __quex_debug_state(3607); +switch( input ) { +case 0x0: goto _832; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: goto _538; +case 0x6D: goto _352; +case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_351: + /* (3607 from 3606) */ + ++(me->buffer._read_p); + + goto _1658; + + + __quex_assert_no_passage(); +_833: + /* (3608 from RELOAD_FORWARD) */ +_1660: + input = *(me->buffer._read_p); + + + __quex_debug_state(3608); +switch( input ) { +case 0x0: goto _834; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _740; +} + + + __quex_assert_no_passage(); +_352: + /* (3608 from 3607) */ + ++(me->buffer._read_p); + + goto _1660; + + + __quex_assert_no_passage(); +_835: + /* (3609 from RELOAD_FORWARD) */ +_1662: + input = *(me->buffer._read_p); + + + __quex_debug_state(3609); +switch( input ) { +case 0x0: goto _836; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _354; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_353: + /* (3609 from 3605) */ + ++(me->buffer._read_p); + + goto _1662; + + + __quex_assert_no_passage(); +_354: + /* (3610 from 3609) */ + ++(me->buffer._read_p); + +_1664: + input = *(me->buffer._read_p); + + + __quex_debug_state(3610); +switch( input ) { +case 0x0: goto _838; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _355; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_837: + /* (3610 from RELOAD_FORWARD) */ + goto _1664; + + + __quex_assert_no_passage(); +_839: + /* (3611 from RELOAD_FORWARD) */ +_1666: + input = *(me->buffer._read_p); + + + __quex_debug_state(3611); +switch( input ) { +case 0x0: goto _840; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _356; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_355: + /* (3611 from 3610) */ + ++(me->buffer._read_p); + + goto _1666; + + + __quex_assert_no_passage(); +_356: + /* (3612 from 3611) */ + ++(me->buffer._read_p); + +_1668: + input = *(me->buffer._read_p); + + + __quex_debug_state(3612); +switch( input ) { +case 0x0: goto _842; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _741; +} + + + __quex_assert_no_passage(); +_841: + /* (3612 from RELOAD_FORWARD) */ + goto _1668; + + + __quex_assert_no_passage(); +_843: + /* (3613 from RELOAD_FORWARD) */ +_1670: + input = *(me->buffer._read_p); + + + __quex_debug_state(3613); +switch( input ) { +case 0x0: goto _844; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _358; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_357: + /* (3613 from 3604) */ + ++(me->buffer._read_p); + + goto _1670; + + + __quex_assert_no_passage(); +_845: + /* (3614 from RELOAD_FORWARD) */ +_1672: + input = *(me->buffer._read_p); + + + __quex_debug_state(3614); +switch( input ) { +case 0x0: goto _846; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _742; +} + + + __quex_assert_no_passage(); +_358: + /* (3614 from 3613) */ + ++(me->buffer._read_p); + + goto _1672; + + + __quex_assert_no_passage(); +_359: + /* (3615 from 3481) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3615); +goto _743; + + + __quex_assert_no_passage(); +_360: + /* (3616 from 3480) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3616); +goto _744; + + + __quex_assert_no_passage(); +_361: + /* (3617 from 3479) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3617); +goto _745; + + + __quex_assert_no_passage(); +_362: + /* (3618 from 3479) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3618); +goto _746; + + + __quex_assert_no_passage(); +_363: + /* (3619 from 3479) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3619); +goto _747; + + + __quex_assert_no_passage(); +_364: + /* (3620 from 3477) */ + ++(me->buffer._read_p); + +_1679: + input = *(me->buffer._read_p); + + + __quex_debug_state(3620); +switch( input ) { +case 0x0: goto _848; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _368; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _369; +case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_847: + /* (3620 from RELOAD_FORWARD) */ + goto _1679; + + + __quex_assert_no_passage(); +_849: + /* (3621 from RELOAD_FORWARD) */ +_1681: + input = *(me->buffer._read_p); + + + __quex_debug_state(3621); +switch( input ) { +case 0x0: goto _850; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _366; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_365: + /* (3621 from 3477) */ + ++(me->buffer._read_p); + + goto _1681; + + + __quex_assert_no_passage(); +_851: + /* (3622 from RELOAD_FORWARD) */ +_1683: + input = *(me->buffer._read_p); + + + __quex_debug_state(3622); +switch( input ) { +case 0x0: goto _852; +case 0x9: +case 0x20: goto _367; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _748; +} + + + __quex_assert_no_passage(); +_366: + /* (3622 from 3621) */ + ++(me->buffer._read_p); + + goto _1683; + + + __quex_assert_no_passage(); +_367: + /* (3623 from 3622) (3623 from 3623) */ + + ++(me->buffer._read_p); + +_1686: + input = *(me->buffer._read_p); + + + __quex_debug_state(3623); +switch( input ) { +case 0x0: goto _854; +case 0x9: +case 0x20: goto _367; +default: goto _748; +} + + + __quex_assert_no_passage(); +_853: + /* (3623 from RELOAD_FORWARD) */ + goto _1686; + + + __quex_assert_no_passage(); +_368: + /* (3624 from 3620) */ + ++(me->buffer._read_p); + +_1688: + input = *(me->buffer._read_p); + + + __quex_debug_state(3624); +switch( input ) { +case 0x0: goto _856; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _375; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_855: + /* (3624 from RELOAD_FORWARD) */ + goto _1688; + + + __quex_assert_no_passage(); +_857: + /* (3625 from RELOAD_FORWARD) */ +_1690: + input = *(me->buffer._read_p); + + + __quex_debug_state(3625); +switch( input ) { +case 0x0: goto _858; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _370; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_369: + /* (3625 from 3620) */ + ++(me->buffer._read_p); + + goto _1690; + + + __quex_assert_no_passage(); +_370: + /* (3626 from 3625) */ + ++(me->buffer._read_p); + +_1692: + input = *(me->buffer._read_p); + + + __quex_debug_state(3626); +switch( input ) { +case 0x0: goto _860; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: goto _538; +case 0x67: goto _371; +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_859: + /* (3626 from RELOAD_FORWARD) */ + goto _1692; + + + __quex_assert_no_passage(); +_861: + /* (3627 from RELOAD_FORWARD) */ +_1694: + input = *(me->buffer._read_p); + + + __quex_debug_state(3627); +switch( input ) { +case 0x0: goto _862; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _372; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_371: + /* (3627 from 3626) */ + ++(me->buffer._read_p); + + goto _1694; + + + __quex_assert_no_passage(); +_372: + /* (3628 from 3627) */ + ++(me->buffer._read_p); + +_1696: + input = *(me->buffer._read_p); + + + __quex_debug_state(3628); +switch( input ) { +case 0x0: goto _864; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _373; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_863: + /* (3628 from RELOAD_FORWARD) */ + goto _1696; + + + __quex_assert_no_passage(); +_865: + /* (3629 from RELOAD_FORWARD) */ +_1698: + input = *(me->buffer._read_p); + + + __quex_debug_state(3629); +switch( input ) { +case 0x0: goto _866; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: goto _538; +case 0x64: goto _374; +case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_373: + /* (3629 from 3628) */ + ++(me->buffer._read_p); + + goto _1698; + + + __quex_assert_no_passage(); +_867: + /* (3630 from RELOAD_FORWARD) */ +_1700: + input = *(me->buffer._read_p); + + + __quex_debug_state(3630); +switch( input ) { +case 0x0: goto _868; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _749; +} + + + __quex_assert_no_passage(); +_374: + /* (3630 from 3629) */ + ++(me->buffer._read_p); + + goto _1700; + + + __quex_assert_no_passage(); +_869: + /* (3631 from RELOAD_FORWARD) */ +_1702: + input = *(me->buffer._read_p); + + + __quex_debug_state(3631); +switch( input ) { +case 0x0: goto _870; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _376; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_375: + /* (3631 from 3624) */ + ++(me->buffer._read_p); + + goto _1702; + + + __quex_assert_no_passage(); +_871: + /* (3632 from RELOAD_FORWARD) */ +_1704: + input = *(me->buffer._read_p); + + + __quex_debug_state(3632); +switch( input ) { +case 0x0: goto _872; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _750; +} + + + __quex_assert_no_passage(); +_376: + /* (3632 from 3631) */ + ++(me->buffer._read_p); + + goto _1704; + + + __quex_assert_no_passage(); +_873: + /* (3633 from RELOAD_FORWARD) */ +_1706: + input = *(me->buffer._read_p); + + + __quex_debug_state(3633); +switch( input ) { +case 0x0: goto _874; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _378; +case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _379; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_377: + /* (3633 from 3476) */ + ++(me->buffer._read_p); + + goto _1706; + + + __quex_assert_no_passage(); +_378: + /* (3634 from 3633) */ + ++(me->buffer._read_p); + +_1708: + input = *(me->buffer._read_p); + + + __quex_debug_state(3634); +switch( input ) { +case 0x0: goto _876; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: goto _538; +case 0x64: goto _385; +case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_875: + /* (3634 from RELOAD_FORWARD) */ + goto _1708; + + + __quex_assert_no_passage(); +_877: + /* (3635 from RELOAD_FORWARD) */ +_1710: + input = *(me->buffer._read_p); + + + __quex_debug_state(3635); +switch( input ) { +case 0x0: goto _878; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _380; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_379: + /* (3635 from 3633) */ + ++(me->buffer._read_p); + + goto _1710; + + + __quex_assert_no_passage(); +_380: + /* (3636 from 3635) */ + ++(me->buffer._read_p); + +_1712: + input = *(me->buffer._read_p); + + + __quex_debug_state(3636); +switch( input ) { +case 0x0: goto _880; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _381; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_879: + /* (3636 from RELOAD_FORWARD) */ + goto _1712; + + + __quex_assert_no_passage(); +_881: + /* (3637 from RELOAD_FORWARD) */ +_1714: + input = *(me->buffer._read_p); + + + __quex_debug_state(3637); +switch( input ) { +case 0x0: goto _882; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _382; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_381: + /* (3637 from 3636) */ + ++(me->buffer._read_p); + + goto _1714; + + + __quex_assert_no_passage(); +_883: + /* (3638 from RELOAD_FORWARD) */ +_1716: + input = *(me->buffer._read_p); + + + __quex_debug_state(3638); +switch( input ) { +case 0x0: goto _884; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _383; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_382: + /* (3638 from 3637) */ + ++(me->buffer._read_p); + + goto _1716; + + + __quex_assert_no_passage(); +_885: + /* (3639 from RELOAD_FORWARD) */ +_1718: + input = *(me->buffer._read_p); + + + __quex_debug_state(3639); +switch( input ) { +case 0x0: goto _886; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _384; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_383: + /* (3639 from 3638) */ + ++(me->buffer._read_p); + + goto _1718; + + + __quex_assert_no_passage(); +_887: + /* (3640 from RELOAD_FORWARD) */ +_1720: + input = *(me->buffer._read_p); + + + __quex_debug_state(3640); +switch( input ) { +case 0x0: goto _888; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _751; +} + + + __quex_assert_no_passage(); +_384: + /* (3640 from 3639) */ + ++(me->buffer._read_p); + + goto _1720; + + + __quex_assert_no_passage(); +_889: + /* (3641 from RELOAD_FORWARD) */ +_1722: + input = *(me->buffer._read_p); + + + __quex_debug_state(3641); +switch( input ) { +case 0x0: goto _890; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _752; +} + + + __quex_assert_no_passage(); +_385: + /* (3641 from 3634) */ + ++(me->buffer._read_p); + + goto _1722; + + + __quex_assert_no_passage(); +_386: + /* (3642 from 3473) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3642); +goto _753; + + + __quex_assert_no_passage(); +_387: + /* (3643 from 3472) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3643); +goto _754; + + + __quex_assert_no_passage(); +_388: + /* (3644 from 3472) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3644); +goto _755; + + + __quex_assert_no_passage(); +_891: + /* (3645 from RELOAD_FORWARD) */ +_1727: + input = *(me->buffer._read_p); + + + __quex_debug_state(3645); +switch( input ) { +case 0x0: goto _892; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _457; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_389: + /* (3645 from 3471) */ + ++(me->buffer._read_p); + + goto _1727; + + + __quex_assert_no_passage(); +_390: + /* (3646 from 3471) */ + ++(me->buffer._read_p); + +_1729: + input = *(me->buffer._read_p); + + + __quex_debug_state(3646); +switch( input ) { +case 0x0: goto _894; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _450; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_893: + /* (3646 from RELOAD_FORWARD) */ + goto _1729; + + + __quex_assert_no_passage(); +_895: + /* (3647 from RELOAD_FORWARD) */ +_1731: + input = *(me->buffer._read_p); + + + __quex_debug_state(3647); +switch( input ) { +case 0x0: goto _896; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _438; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_391: + /* (3647 from 3471) */ + ++(me->buffer._read_p); + + goto _1731; + + + __quex_assert_no_passage(); +_897: + /* (3648 from RELOAD_FORWARD) */ +_1733: + input = *(me->buffer._read_p); + + + __quex_debug_state(3648); +switch( input ) { +case 0x0: goto _898; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _435; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_392: + /* (3648 from 3471) */ + ++(me->buffer._read_p); + + goto _1733; + + + __quex_assert_no_passage(); +_899: + /* (3649 from RELOAD_FORWARD) */ +_1735: + input = *(me->buffer._read_p); + + + __quex_debug_state(3649); +switch( input ) { +case 0x0: goto _900; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: goto _538; +case 0x68: goto _424; +case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_393: + /* (3649 from 3471) */ + ++(me->buffer._read_p); + + goto _1735; + + + __quex_assert_no_passage(); +_394: + /* (3650 from 3471) */ + ++(me->buffer._read_p); + +_1737: + input = *(me->buffer._read_p); + + + __quex_debug_state(3650); +switch( input ) { +case 0x0: goto _902; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _418; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_901: + /* (3650 from RELOAD_FORWARD) */ + goto _1737; + + + __quex_assert_no_passage(); +_903: + /* (3651 from RELOAD_FORWARD) */ +_1739: + input = *(me->buffer._read_p); + + + __quex_debug_state(3651); +switch( input ) { +case 0x0: goto _904; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _406; +case 0x6D: case 0x6E: case 0x6F: case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _405; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_395: + /* (3651 from 3471) */ + ++(me->buffer._read_p); + + goto _1739; + + + __quex_assert_no_passage(); +_396: + /* (3652 from 3471) */ + ++(me->buffer._read_p); + +_1741: + input = *(me->buffer._read_p); + + + __quex_debug_state(3652); +switch( input ) { +case 0x0: goto _906; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: goto _538; +case 0x6D: goto _397; +case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_905: + /* (3652 from RELOAD_FORWARD) */ + goto _1741; + + + __quex_assert_no_passage(); +_907: + /* (3653 from RELOAD_FORWARD) */ +_1743: + input = *(me->buffer._read_p); + + + __quex_debug_state(3653); +switch( input ) { +case 0x0: goto _908; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _398; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_397: + /* (3653 from 3652) */ + ++(me->buffer._read_p); + + goto _1743; + + + __quex_assert_no_passage(); +_398: + /* (3654 from 3653) */ + ++(me->buffer._read_p); + +_1745: + input = *(me->buffer._read_p); + + + __quex_debug_state(3654); +switch( input ) { +case 0x0: goto _910; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: goto _538; +case 0x67: goto _399; +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_909: + /* (3654 from RELOAD_FORWARD) */ + goto _1745; + + + __quex_assert_no_passage(); +_911: + /* (3655 from RELOAD_FORWARD) */ +_1747: + input = *(me->buffer._read_p); + + + __quex_debug_state(3655); +switch( input ) { +case 0x0: goto _912; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _400; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_399: + /* (3655 from 3654) */ + ++(me->buffer._read_p); + + goto _1747; + + + __quex_assert_no_passage(); +_913: + /* (3656 from RELOAD_FORWARD) */ +_1749: + input = *(me->buffer._read_p); + + + __quex_debug_state(3656); +switch( input ) { +case 0x0: goto _914; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _401; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_400: + /* (3656 from 3655) */ + ++(me->buffer._read_p); + + goto _1749; + + + __quex_assert_no_passage(); +_915: + /* (3657 from RELOAD_FORWARD) */ +_1751: + input = *(me->buffer._read_p); + + + __quex_debug_state(3657); +switch( input ) { +case 0x0: goto _916; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _402; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_401: + /* (3657 from 3656) */ + ++(me->buffer._read_p); + + goto _1751; + + + __quex_assert_no_passage(); +_402: + /* (3658 from 3657) */ + ++(me->buffer._read_p); + +_1753: + input = *(me->buffer._read_p); + + + __quex_debug_state(3658); +switch( input ) { +case 0x0: goto _918; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _403; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_917: + /* (3658 from RELOAD_FORWARD) */ + goto _1753; + + + __quex_assert_no_passage(); +_919: + /* (3659 from RELOAD_FORWARD) */ +_1755: + input = *(me->buffer._read_p); + + + __quex_debug_state(3659); +switch( input ) { +case 0x0: goto _920; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: goto _538; +case 0x79: goto _404; +case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_403: + /* (3659 from 3658) */ + ++(me->buffer._read_p); + + goto _1755; + + + __quex_assert_no_passage(); +_404: + /* (3660 from 3659) */ + ++(me->buffer._read_p); + +_1757: + input = *(me->buffer._read_p); + + + __quex_debug_state(3660); +switch( input ) { +case 0x0: goto _922; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _756; +} + + + __quex_assert_no_passage(); +_921: + /* (3660 from RELOAD_FORWARD) */ + goto _1757; + + + __quex_assert_no_passage(); +_923: + /* (3661 from RELOAD_FORWARD) */ +_1759: + input = *(me->buffer._read_p); + + + __quex_debug_state(3661); +switch( input ) { +case 0x0: goto _924; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _414; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_405: + /* (3661 from 3651) */ + ++(me->buffer._read_p); + + goto _1759; + + + __quex_assert_no_passage(); +_406: + /* (3662 from 3651) */ + ++(me->buffer._read_p); + +_1761: + input = *(me->buffer._read_p); + + + __quex_debug_state(3662); +switch( input ) { +case 0x0: goto _926; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _407; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_925: + /* (3662 from RELOAD_FORWARD) */ + goto _1761; + + + __quex_assert_no_passage(); +_927: + /* (3663 from RELOAD_FORWARD) */ +_1763: + input = *(me->buffer._read_p); + + + __quex_debug_state(3663); +switch( input ) { +case 0x0: goto _928; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: goto _538; +case 0x67: goto _408; +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_407: + /* (3663 from 3662) */ + ++(me->buffer._read_p); + + goto _1763; + + + __quex_assert_no_passage(); +_929: + /* (3664 from RELOAD_FORWARD) */ +_1765: + input = *(me->buffer._read_p); + + + __quex_debug_state(3664); +switch( input ) { +case 0x0: goto _930; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _409; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_408: + /* (3664 from 3663) */ + ++(me->buffer._read_p); + + goto _1765; + + + __quex_assert_no_passage(); +_931: + /* (3665 from RELOAD_FORWARD) */ +_1767: + input = *(me->buffer._read_p); + + + __quex_debug_state(3665); +switch( input ) { +case 0x0: goto _932; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _410; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _411; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_409: + /* (3665 from 3664) */ + ++(me->buffer._read_p); + + goto _1767; + + + __quex_assert_no_passage(); +_410: + /* (3666 from 3665) */ + ++(me->buffer._read_p); + +_1769: + input = *(me->buffer._read_p); + + + __quex_debug_state(3666); +switch( input ) { +case 0x0: goto _934; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _413; +case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_933: + /* (3666 from RELOAD_FORWARD) */ + goto _1769; + + + __quex_assert_no_passage(); +_935: + /* (3667 from RELOAD_FORWARD) */ +_1771: + input = *(me->buffer._read_p); + + + __quex_debug_state(3667); +switch( input ) { +case 0x0: goto _936; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: goto _538; +case 0x66: goto _412; +case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_411: + /* (3667 from 3665) */ + ++(me->buffer._read_p); + + goto _1771; + + + __quex_assert_no_passage(); +_412: + /* (3668 from 3667) */ + ++(me->buffer._read_p); + +_1773: + input = *(me->buffer._read_p); + + + __quex_debug_state(3668); +switch( input ) { +case 0x0: goto _938; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _757; +} + + + __quex_assert_no_passage(); +_937: + /* (3668 from RELOAD_FORWARD) */ + goto _1773; + + + __quex_assert_no_passage(); +_939: + /* (3669 from RELOAD_FORWARD) */ +_1775: + input = *(me->buffer._read_p); + + + __quex_debug_state(3669); +switch( input ) { +case 0x0: goto _940; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _758; +} + + + __quex_assert_no_passage(); +_413: + /* (3669 from 3666) */ + ++(me->buffer._read_p); + + goto _1775; + + + __quex_assert_no_passage(); +_941: + /* (3670 from RELOAD_FORWARD) */ +_1777: + input = *(me->buffer._read_p); + + + __quex_debug_state(3670); +switch( input ) { +case 0x0: goto _942; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: goto _538; +case 0x6D: goto _415; +case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_414: + /* (3670 from 3661) */ + ++(me->buffer._read_p); + + goto _1777; + + + __quex_assert_no_passage(); +_943: + /* (3671 from RELOAD_FORWARD) */ +_1779: + input = *(me->buffer._read_p); + + + __quex_debug_state(3671); +switch( input ) { +case 0x0: goto _944; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _416; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_415: + /* (3671 from 3670) */ + ++(me->buffer._read_p); + + goto _1779; + + + __quex_assert_no_passage(); +_945: + /* (3672 from RELOAD_FORWARD) */ +_1781: + input = *(me->buffer._read_p); + + + __quex_debug_state(3672); +switch( input ) { +case 0x0: goto _946; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _417; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_416: + /* (3672 from 3671) */ + ++(me->buffer._read_p); + + goto _1781; + + + __quex_assert_no_passage(); +_947: + /* (3673 from RELOAD_FORWARD) */ +_1783: + input = *(me->buffer._read_p); + + + __quex_debug_state(3673); +switch( input ) { +case 0x0: goto _948; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _759; +} + + + __quex_assert_no_passage(); +_417: + /* (3673 from 3672) */ + ++(me->buffer._read_p); + + goto _1783; + + + __quex_assert_no_passage(); +_418: + /* (3674 from 3650) */ + ++(me->buffer._read_p); + +_1785: + input = *(me->buffer._read_p); + + + __quex_debug_state(3674); +switch( input ) { +case 0x0: goto _950; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: goto _538; +case 0x6D: goto _419; +case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_949: + /* (3674 from RELOAD_FORWARD) */ + goto _1785; + + + __quex_assert_no_passage(); +_951: + /* (3675 from RELOAD_FORWARD) */ +_1787: + input = *(me->buffer._read_p); + + + __quex_debug_state(3675); +switch( input ) { +case 0x0: goto _952; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: goto _538; +case 0x70: goto _420; +case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_419: + /* (3675 from 3674) */ + ++(me->buffer._read_p); + + goto _1787; + + + __quex_assert_no_passage(); +_420: + /* (3676 from 3675) */ + ++(me->buffer._read_p); + +_1789: + input = *(me->buffer._read_p); + + + __quex_debug_state(3676); +switch( input ) { +case 0x0: goto _954; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _421; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_953: + /* (3676 from RELOAD_FORWARD) */ + goto _1789; + + + __quex_assert_no_passage(); +_955: + /* (3677 from RELOAD_FORWARD) */ +_1791: + input = *(me->buffer._read_p); + + + __quex_debug_state(3677); +switch( input ) { +case 0x0: goto _956; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _422; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_421: + /* (3677 from 3676) */ + ++(me->buffer._read_p); + + goto _1791; + + + __quex_assert_no_passage(); +_957: + /* (3678 from RELOAD_FORWARD) */ +_1793: + input = *(me->buffer._read_p); + + + __quex_debug_state(3678); +switch( input ) { +case 0x0: goto _958; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: goto _538; +case 0x78: goto _423; +case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_422: + /* (3678 from 3677) */ + ++(me->buffer._read_p); + + goto _1793; + + + __quex_assert_no_passage(); +_959: + /* (3679 from RELOAD_FORWARD) */ +_1795: + input = *(me->buffer._read_p); + + + __quex_debug_state(3679); +switch( input ) { +case 0x0: goto _960; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _760; +} + + + __quex_assert_no_passage(); +_423: + /* (3679 from 3678) */ + ++(me->buffer._read_p); + + goto _1795; + + + __quex_assert_no_passage(); +_961: + /* (3680 from RELOAD_FORWARD) */ +_1797: + input = *(me->buffer._read_p); + + + __quex_debug_state(3680); +switch( input ) { +case 0x0: goto _962; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _425; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_424: + /* (3680 from 3649) */ + ++(me->buffer._read_p); + + goto _1797; + + + __quex_assert_no_passage(); +_963: + /* (3681 from RELOAD_FORWARD) */ +_1799: + input = *(me->buffer._read_p); + + + __quex_debug_state(3681); +switch( input ) { +case 0x0: goto _964; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _426; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_425: + /* (3681 from 3680) */ + ++(me->buffer._read_p); + + goto _1799; + + + __quex_assert_no_passage(); +_426: + /* (3682 from 3681) */ + ++(me->buffer._read_p); + +_1801: + input = *(me->buffer._read_p); + + + __quex_debug_state(3682); +switch( input ) { +case 0x0: goto _966; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _427; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_965: + /* (3682 from RELOAD_FORWARD) */ + goto _1801; + + + __quex_assert_no_passage(); +_967: + /* (3683 from RELOAD_FORWARD) */ +_1803: + input = *(me->buffer._read_p); + + + __quex_debug_state(3683); +switch( input ) { +case 0x0: goto _968; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: goto _538; +case 0x64: goto _428; +case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_427: + /* (3683 from 3682) */ + ++(me->buffer._read_p); + + goto _1803; + + + __quex_assert_no_passage(); +_428: + /* (3684 from 3683) */ + ++(me->buffer._read_p); + +_1805: + input = *(me->buffer._read_p); + + + __quex_debug_state(3684); +switch( input ) { +case 0x0: goto _970; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: goto _538; +case 0x5F: goto _429; +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_969: + /* (3684 from RELOAD_FORWARD) */ + goto _1805; + + + __quex_assert_no_passage(); +_971: + /* (3685 from RELOAD_FORWARD) */ +_1807: + input = *(me->buffer._read_p); + + + __quex_debug_state(3685); +switch( input ) { +case 0x0: goto _972; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _430; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_429: + /* (3685 from 3684) */ + ++(me->buffer._read_p); + + goto _1807; + + + __quex_assert_no_passage(); +_973: + /* (3686 from RELOAD_FORWARD) */ +_1809: + input = *(me->buffer._read_p); + + + __quex_debug_state(3686); +switch( input ) { +case 0x0: goto _974; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _431; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_430: + /* (3686 from 3685) */ + ++(me->buffer._read_p); + + goto _1809; + + + __quex_assert_no_passage(); +_975: + /* (3687 from RELOAD_FORWARD) */ +_1811: + input = *(me->buffer._read_p); + + + __quex_debug_state(3687); +switch( input ) { +case 0x0: goto _976; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _432; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_431: + /* (3687 from 3686) */ + ++(me->buffer._read_p); + + goto _1811; + + + __quex_assert_no_passage(); +_977: + /* (3688 from RELOAD_FORWARD) */ +_1813: + input = *(me->buffer._read_p); + + + __quex_debug_state(3688); +switch( input ) { +case 0x0: goto _978; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _433; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_432: + /* (3688 from 3687) */ + ++(me->buffer._read_p); + + goto _1813; + + + __quex_assert_no_passage(); +_979: + /* (3689 from RELOAD_FORWARD) */ +_1815: + input = *(me->buffer._read_p); + + + __quex_debug_state(3689); +switch( input ) { +case 0x0: goto _980; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _434; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_433: + /* (3689 from 3688) */ + ++(me->buffer._read_p); + + goto _1815; + + + __quex_assert_no_passage(); +_434: + /* (3690 from 3689) */ + ++(me->buffer._read_p); + +_1817: + input = *(me->buffer._read_p); + + + __quex_debug_state(3690); +switch( input ) { +case 0x0: goto _982; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _761; +} + + + __quex_assert_no_passage(); +_981: + /* (3690 from RELOAD_FORWARD) */ + goto _1817; + + + __quex_assert_no_passage(); +_983: + /* (3691 from RELOAD_FORWARD) */ +_1819: + input = *(me->buffer._read_p); + + + __quex_debug_state(3691); +switch( input ) { +case 0x0: goto _984; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _436; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_435: + /* (3691 from 3648) */ + ++(me->buffer._read_p); + + goto _1819; + + + __quex_assert_no_passage(); +_436: + /* (3692 from 3691) */ + ++(me->buffer._read_p); + +_1821: + input = *(me->buffer._read_p); + + + __quex_debug_state(3692); +switch( input ) { +case 0x0: goto _986; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _437; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_985: + /* (3692 from RELOAD_FORWARD) */ + goto _1821; + + + __quex_assert_no_passage(); +_987: + /* (3693 from RELOAD_FORWARD) */ +_1823: + input = *(me->buffer._read_p); + + + __quex_debug_state(3693); +switch( input ) { +case 0x0: goto _988; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _762; +} + + + __quex_assert_no_passage(); +_437: + /* (3693 from 3692) */ + ++(me->buffer._read_p); + + goto _1823; + + + __quex_assert_no_passage(); +_989: + /* (3694 from RELOAD_FORWARD) */ +_1825: + input = *(me->buffer._read_p); + + + __quex_debug_state(3694); +switch( input ) { +case 0x0: goto _990; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _439; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_438: + /* (3694 from 3647) */ + ++(me->buffer._read_p); + + goto _1825; + + + __quex_assert_no_passage(); +_991: + /* (3695 from RELOAD_FORWARD) */ +_1827: + input = *(me->buffer._read_p); + + + __quex_debug_state(3695); +switch( input ) { +case 0x0: goto _992; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _440; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_439: + /* (3695 from 3694) */ + ++(me->buffer._read_p); + + goto _1827; + + + __quex_assert_no_passage(); +_993: + /* (3696 from RELOAD_FORWARD) */ +_1829: + input = *(me->buffer._read_p); + + + __quex_debug_state(3696); +switch( input ) { +case 0x0: goto _994; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _441; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_440: + /* (3696 from 3695) */ + ++(me->buffer._read_p); + + goto _1829; + + + __quex_assert_no_passage(); +_995: + /* (3697 from RELOAD_FORWARD) */ +_1831: + input = *(me->buffer._read_p); + + + __quex_debug_state(3697); +switch( input ) { +case 0x0: goto _996; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _442; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_441: + /* (3697 from 3696) */ + ++(me->buffer._read_p); + + goto _1831; + + + __quex_assert_no_passage(); +_442: + /* (3698 from 3697) */ + ++(me->buffer._read_p); + +_1833: + input = *(me->buffer._read_p); + + + __quex_debug_state(3698); +switch( input ) { +case 0x0: goto _998; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: goto _538; +case 0x5F: goto _443; +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_997: + /* (3698 from RELOAD_FORWARD) */ + goto _1833; + + + __quex_assert_no_passage(); +_999: + /* (3699 from RELOAD_FORWARD) */ +_1835: + input = *(me->buffer._read_p); + + + __quex_debug_state(3699); +switch( input ) { +case 0x0: goto _1000; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _444; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_443: + /* (3699 from 3698) */ + ++(me->buffer._read_p); + + goto _1835; + + + __quex_assert_no_passage(); +_444: + /* (3700 from 3699) */ + ++(me->buffer._read_p); + +_1837: + input = *(me->buffer._read_p); + + + __quex_debug_state(3700); +switch( input ) { +case 0x0: goto _1002; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _445; +case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1001: + /* (3700 from RELOAD_FORWARD) */ + goto _1837; + + + __quex_assert_no_passage(); +_1003: + /* (3701 from RELOAD_FORWARD) */ +_1839: + input = *(me->buffer._read_p); + + + __quex_debug_state(3701); +switch( input ) { +case 0x0: goto _1004; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _446; +case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_445: + /* (3701 from 3700) */ + ++(me->buffer._read_p); + + goto _1839; + + + __quex_assert_no_passage(); +_1005: + /* (3702 from RELOAD_FORWARD) */ +_1841: + input = *(me->buffer._read_p); + + + __quex_debug_state(3702); +switch( input ) { +case 0x0: goto _1006; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _447; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_446: + /* (3702 from 3701) */ + ++(me->buffer._read_p); + + goto _1841; + + + __quex_assert_no_passage(); +_1007: + /* (3703 from RELOAD_FORWARD) */ +_1843: + input = *(me->buffer._read_p); + + + __quex_debug_state(3703); +switch( input ) { +case 0x0: goto _1008; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _448; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_447: + /* (3703 from 3702) */ + ++(me->buffer._read_p); + + goto _1843; + + + __quex_assert_no_passage(); +_1009: + /* (3704 from RELOAD_FORWARD) */ +_1845: + input = *(me->buffer._read_p); + + + __quex_debug_state(3704); +switch( input ) { +case 0x0: goto _1010; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _449; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_448: + /* (3704 from 3703) */ + ++(me->buffer._read_p); + + goto _1845; + + + __quex_assert_no_passage(); +_1011: + /* (3705 from RELOAD_FORWARD) */ +_1847: + input = *(me->buffer._read_p); + + + __quex_debug_state(3705); +switch( input ) { +case 0x0: goto _1012; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _763; +} + + + __quex_assert_no_passage(); +_449: + /* (3705 from 3704) */ + ++(me->buffer._read_p); + + goto _1847; + + + __quex_assert_no_passage(); +_450: + /* (3706 from 3646) */ + ++(me->buffer._read_p); + +_1849: + input = *(me->buffer._read_p); + + + __quex_debug_state(3706); +switch( input ) { +case 0x0: goto _1014; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _451; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1013: + /* (3706 from RELOAD_FORWARD) */ + goto _1849; + + + __quex_assert_no_passage(); +_1015: + /* (3707 from RELOAD_FORWARD) */ +_1851: + input = *(me->buffer._read_p); + + + __quex_debug_state(3707); +switch( input ) { +case 0x0: goto _1016; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _452; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_451: + /* (3707 from 3706) */ + ++(me->buffer._read_p); + + goto _1851; + + + __quex_assert_no_passage(); +_452: + /* (3708 from 3707) */ + ++(me->buffer._read_p); + +_1853: + input = *(me->buffer._read_p); + + + __quex_debug_state(3708); +switch( input ) { +case 0x0: goto _1018; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _453; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1017: + /* (3708 from RELOAD_FORWARD) */ + goto _1853; + + + __quex_assert_no_passage(); +_1019: + /* (3709 from RELOAD_FORWARD) */ +_1855: + input = *(me->buffer._read_p); + + + __quex_debug_state(3709); +switch( input ) { +case 0x0: goto _1020; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: goto _538; +case 0x75: goto _454; +case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_453: + /* (3709 from 3708) */ + ++(me->buffer._read_p); + + goto _1855; + + + __quex_assert_no_passage(); +_454: + /* (3710 from 3709) */ + ++(me->buffer._read_p); + +_1857: + input = *(me->buffer._read_p); + + + __quex_debug_state(3710); +switch( input ) { +case 0x0: goto _1022; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _455; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1021: + /* (3710 from RELOAD_FORWARD) */ + goto _1857; + + + __quex_assert_no_passage(); +_1023: + /* (3711 from RELOAD_FORWARD) */ +_1859: + input = *(me->buffer._read_p); + + + __quex_debug_state(3711); +switch( input ) { +case 0x0: goto _1024; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _456; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_455: + /* (3711 from 3710) */ + ++(me->buffer._read_p); + + goto _1859; + + + __quex_assert_no_passage(); +_1025: + /* (3712 from RELOAD_FORWARD) */ +_1861: + input = *(me->buffer._read_p); + + + __quex_debug_state(3712); +switch( input ) { +case 0x0: goto _1026; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _764; +} + + + __quex_assert_no_passage(); +_456: + /* (3712 from 3711) */ + ++(me->buffer._read_p); + + goto _1861; + + + __quex_assert_no_passage(); +_1027: + /* (3713 from RELOAD_FORWARD) */ +_1863: + input = *(me->buffer._read_p); + + + __quex_debug_state(3713); +switch( input ) { +case 0x0: goto _1028; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _458; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_457: + /* (3713 from 3645) */ + ++(me->buffer._read_p); + + goto _1863; + + + __quex_assert_no_passage(); +_458: + /* (3714 from 3713) */ + ++(me->buffer._read_p); + +_1865: + input = *(me->buffer._read_p); + + + __quex_debug_state(3714); +switch( input ) { +case 0x0: goto _1030; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _459; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1029: + /* (3714 from RELOAD_FORWARD) */ + goto _1865; + + + __quex_assert_no_passage(); +_1031: + /* (3715 from RELOAD_FORWARD) */ +_1867: + input = *(me->buffer._read_p); + + + __quex_debug_state(3715); +switch( input ) { +case 0x0: goto _1032; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _460; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_459: + /* (3715 from 3714) */ + ++(me->buffer._read_p); + + goto _1867; + + + __quex_assert_no_passage(); +_460: + /* (3716 from 3715) */ + ++(me->buffer._read_p); + +_1869: + input = *(me->buffer._read_p); + + + __quex_debug_state(3716); +switch( input ) { +case 0x0: goto _1034; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _461; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1033: + /* (3716 from RELOAD_FORWARD) */ + goto _1869; + + + __quex_assert_no_passage(); +_1035: + /* (3717 from RELOAD_FORWARD) */ +_1871: + input = *(me->buffer._read_p); + + + __quex_debug_state(3717); +switch( input ) { +case 0x0: goto _1036; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _462; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_461: + /* (3717 from 3716) */ + ++(me->buffer._read_p); + + goto _1871; + + + __quex_assert_no_passage(); +_1037: + /* (3718 from RELOAD_FORWARD) */ +_1873: + input = *(me->buffer._read_p); + + + __quex_debug_state(3718); +switch( input ) { +case 0x0: goto _1038; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _765; +} + + + __quex_assert_no_passage(); +_462: + /* (3718 from 3717) */ + ++(me->buffer._read_p); + + goto _1873; + + + __quex_assert_no_passage(); +_463: + /* (3719 from 3470) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3719); +goto _766; + + + __quex_assert_no_passage(); +_1039: + /* (3720 from RELOAD_FORWARD) */ +_1876: + input = *(me->buffer._read_p); + + + __quex_debug_state(3720); +switch( input ) { +case 0x0: goto _1040; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _487; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_464: + /* (3720 from 3469) */ + ++(me->buffer._read_p); + + goto _1876; + + + __quex_assert_no_passage(); +_1041: + /* (3721 from RELOAD_FORWARD) */ +_1878: + input = *(me->buffer._read_p); + + + __quex_debug_state(3721); +switch( input ) { +case 0x0: goto _1042; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: goto _538; +case 0x67: goto _479; +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: goto _538; +case 0x7A: goto _480; +default: goto _673; +} + + + __quex_assert_no_passage(); +_465: + /* (3721 from 3469) */ + ++(me->buffer._read_p); + + goto _1878; + + + __quex_assert_no_passage(); +_466: + /* (3722 from 3469) */ + ++(me->buffer._read_p); + +_1880: + input = *(me->buffer._read_p); + + + __quex_debug_state(3722); +switch( input ) { +case 0x0: goto _1044; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _472; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _471; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1043: + /* (3722 from RELOAD_FORWARD) */ + goto _1880; + + + __quex_assert_no_passage(); +_1045: + /* (3723 from RELOAD_FORWARD) */ +_1882: + input = *(me->buffer._read_p); + + + __quex_debug_state(3723); +switch( input ) { +case 0x0: goto _1046; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _468; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_467: + /* (3723 from 3469) */ + ++(me->buffer._read_p); + + goto _1882; + + + __quex_assert_no_passage(); +_468: + /* (3724 from 3723) */ + ++(me->buffer._read_p); + +_1884: + input = *(me->buffer._read_p); + + + __quex_debug_state(3724); +switch( input ) { +case 0x0: goto _1048; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _469; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1047: + /* (3724 from RELOAD_FORWARD) */ + goto _1884; + + + __quex_assert_no_passage(); +_1049: + /* (3725 from RELOAD_FORWARD) */ +_1886: + input = *(me->buffer._read_p); + + + __quex_debug_state(3725); +switch( input ) { +case 0x0: goto _1050; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _470; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_469: + /* (3725 from 3724) */ + ++(me->buffer._read_p); + + goto _1886; + + + __quex_assert_no_passage(); +_1051: + /* (3726 from RELOAD_FORWARD) */ +_1888: + input = *(me->buffer._read_p); + + + __quex_debug_state(3726); +switch( input ) { +case 0x0: goto _1052; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _767; +} + + + __quex_assert_no_passage(); +_470: + /* (3726 from 3725) */ + ++(me->buffer._read_p); + + goto _1888; + + + __quex_assert_no_passage(); +_1053: + /* (3727 from RELOAD_FORWARD) */ +_1890: + input = *(me->buffer._read_p); + + + __quex_debug_state(3727); +switch( input ) { +case 0x0: goto _1054; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: goto _538; +case 0x75: goto _476; +case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_471: + /* (3727 from 3722) */ + ++(me->buffer._read_p); + + goto _1890; + + + __quex_assert_no_passage(); +_1055: + /* (3728 from RELOAD_FORWARD) */ +_1892: + input = *(me->buffer._read_p); + + + __quex_debug_state(3728); +switch( input ) { +case 0x0: goto _1056; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _473; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_472: + /* (3728 from 3722) */ + ++(me->buffer._read_p); + + goto _1892; + + + __quex_assert_no_passage(); +_1057: + /* (3729 from RELOAD_FORWARD) */ +_1894: + input = *(me->buffer._read_p); + + + __quex_debug_state(3729); +switch( input ) { +case 0x0: goto _1058; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _474; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_473: + /* (3729 from 3728) */ + ++(me->buffer._read_p); + + goto _1894; + + + __quex_assert_no_passage(); +_474: + /* (3730 from 3729) */ + ++(me->buffer._read_p); + +_1896: + input = *(me->buffer._read_p); + + + __quex_debug_state(3730); +switch( input ) { +case 0x0: goto _1060; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _475; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1059: + /* (3730 from RELOAD_FORWARD) */ + goto _1896; + + + __quex_assert_no_passage(); +_1061: + /* (3731 from RELOAD_FORWARD) */ +_1898: + input = *(me->buffer._read_p); + + + __quex_debug_state(3731); +switch( input ) { +case 0x0: goto _1062; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _768; +} + + + __quex_assert_no_passage(); +_475: + /* (3731 from 3730) */ + ++(me->buffer._read_p); + + goto _1898; + + + __quex_assert_no_passage(); +_476: + /* (3732 from 3727) */ + ++(me->buffer._read_p); + +_1900: + input = *(me->buffer._read_p); + + + __quex_debug_state(3732); +switch( input ) { +case 0x0: goto _1064; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _477; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1063: + /* (3732 from RELOAD_FORWARD) */ + goto _1900; + + + __quex_assert_no_passage(); +_1065: + /* (3733 from RELOAD_FORWARD) */ +_1902: + input = *(me->buffer._read_p); + + + __quex_debug_state(3733); +switch( input ) { +case 0x0: goto _1066; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _478; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_477: + /* (3733 from 3732) */ + ++(me->buffer._read_p); + + goto _1902; + + + __quex_assert_no_passage(); +_1067: + /* (3734 from RELOAD_FORWARD) */ +_1904: + input = *(me->buffer._read_p); + + + __quex_debug_state(3734); +switch( input ) { +case 0x0: goto _1068; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _769; +} + + + __quex_assert_no_passage(); +_478: + /* (3734 from 3733) */ + ++(me->buffer._read_p); + + goto _1904; + + + __quex_assert_no_passage(); +_1069: + /* (3735 from RELOAD_FORWARD) */ +_1906: + input = *(me->buffer._read_p); + + + __quex_debug_state(3735); +switch( input ) { +case 0x0: goto _1070; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _484; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_479: + /* (3735 from 3721) */ + ++(me->buffer._read_p); + + goto _1906; + + + __quex_assert_no_passage(); +_1071: + /* (3736 from RELOAD_FORWARD) */ +_1908: + input = *(me->buffer._read_p); + + + __quex_debug_state(3736); +switch( input ) { +case 0x0: goto _1072; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _481; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_480: + /* (3736 from 3721) */ + ++(me->buffer._read_p); + + goto _1908; + + + __quex_assert_no_passage(); +_1073: + /* (3737 from RELOAD_FORWARD) */ +_1910: + input = *(me->buffer._read_p); + + + __quex_debug_state(3737); +switch( input ) { +case 0x0: goto _1074; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: goto _538; +case 0x6F: goto _482; +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_481: + /* (3737 from 3736) */ + ++(me->buffer._read_p); + + goto _1910; + + + __quex_assert_no_passage(); +_482: + /* (3738 from 3737) */ + ++(me->buffer._read_p); + +_1912: + input = *(me->buffer._read_p); + + + __quex_debug_state(3738); +switch( input ) { +case 0x0: goto _1076; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: goto _538; +case 0x66: goto _483; +case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1075: + /* (3738 from RELOAD_FORWARD) */ + goto _1912; + + + __quex_assert_no_passage(); +_1077: + /* (3739 from RELOAD_FORWARD) */ +_1914: + input = *(me->buffer._read_p); + + + __quex_debug_state(3739); +switch( input ) { +case 0x0: goto _1078; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _770; +} + + + __quex_assert_no_passage(); +_483: + /* (3739 from 3738) */ + ++(me->buffer._read_p); + + goto _1914; + + + __quex_assert_no_passage(); +_484: + /* (3740 from 3735) */ + ++(me->buffer._read_p); + +_1916: + input = *(me->buffer._read_p); + + + __quex_debug_state(3740); +switch( input ) { +case 0x0: goto _1080; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _485; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1079: + /* (3740 from RELOAD_FORWARD) */ + goto _1916; + + + __quex_assert_no_passage(); +_1081: + /* (3741 from RELOAD_FORWARD) */ +_1918: + input = *(me->buffer._read_p); + + + __quex_debug_state(3741); +switch( input ) { +case 0x0: goto _1082; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: goto _538; +case 0x64: goto _486; +case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_485: + /* (3741 from 3740) */ + ++(me->buffer._read_p); + + goto _1918; + + + __quex_assert_no_passage(); +_1083: + /* (3742 from RELOAD_FORWARD) */ +_1920: + input = *(me->buffer._read_p); + + + __quex_debug_state(3742); +switch( input ) { +case 0x0: goto _1084; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _771; +} + + + __quex_assert_no_passage(); +_486: + /* (3742 from 3741) */ + ++(me->buffer._read_p); + + goto _1920; + + + __quex_assert_no_passage(); +_1085: + /* (3743 from RELOAD_FORWARD) */ +_1922: + input = *(me->buffer._read_p); + + + __quex_debug_state(3743); +switch( input ) { +case 0x0: goto _1086; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _488; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_487: + /* (3743 from 3720) */ + ++(me->buffer._read_p); + + goto _1922; + + + __quex_assert_no_passage(); +_488: + /* (3744 from 3743) */ + ++(me->buffer._read_p); + +_1924: + input = *(me->buffer._read_p); + + + __quex_debug_state(3744); +switch( input ) { +case 0x0: goto _1088; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: goto _538; +case 0x63: goto _489; +case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1087: + /* (3744 from RELOAD_FORWARD) */ + goto _1924; + + + __quex_assert_no_passage(); +_1089: + /* (3745 from RELOAD_FORWARD) */ +_1926: + input = *(me->buffer._read_p); + + + __quex_debug_state(3745); +switch( input ) { +case 0x0: goto _1090; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: goto _538; +case 0x68: goto _490; +case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_489: + /* (3745 from 3744) */ + ++(me->buffer._read_p); + + goto _1926; + + + __quex_assert_no_passage(); +_490: + /* (3746 from 3745) */ + ++(me->buffer._read_p); + +_1928: + input = *(me->buffer._read_p); + + + __quex_debug_state(3746); +switch( input ) { +case 0x0: goto _1092; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _772; +} + + + __quex_assert_no_passage(); +_1091: + /* (3746 from RELOAD_FORWARD) */ + goto _1928; + + + __quex_assert_no_passage(); +_491: + /* (3747 from 3468) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3747); +goto _773; + + + __quex_assert_no_passage(); +_492: + /* (3748 from 3467) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3748); +goto _774; + + + __quex_assert_no_passage(); +_493: + /* (3749 from 3462) (3749 from 3455) */ + + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3749); +goto _775; + + + __quex_assert_no_passage(); +_1093: + /* (3750 from RELOAD_FORWARD) */ +_1934: + input = *(me->buffer._read_p); + + + __quex_debug_state(3750); +if ( input == 0x3D ) goto _496; +else if( input == 0x0 ) goto _1094; +else goto _776; + + + __quex_assert_no_passage(); +_494: + /* (3750 from 3461) */ + ++(me->buffer._read_p); + + goto _1934; + + + __quex_assert_no_passage(); +_495: + /* (3751 from 3461) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3751); +goto _777; + + + __quex_assert_no_passage(); +_496: + /* (3752 from 3750) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(3752); +goto _778; + + + __quex_assert_no_passage(); +_1095: + /* (3753 from RELOAD_FORWARD) */ +_1938: + input = *(me->buffer._read_p); + + + __quex_debug_state(3753); +switch( input ) { +case 0x0: goto _1096; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _504; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_497: + /* (3753 from 3460) */ + ++(me->buffer._read_p); + + goto _1938; + + + __quex_assert_no_passage(); +_1097: + /* (3754 from RELOAD_FORWARD) */ +_1940: + input = *(me->buffer._read_p); + + + __quex_debug_state(3754); +switch( input ) { +case 0x0: goto _1098; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _502; +case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_498: + /* (3754 from 3460) */ + ++(me->buffer._read_p); + + goto _1940; + + + __quex_assert_no_passage(); +_1099: + /* (3755 from RELOAD_FORWARD) */ +_1942: + input = *(me->buffer._read_p); + + + __quex_debug_state(3755); +switch( input ) { +case 0x0: goto _1100; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _500; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_499: + /* (3755 from 3460) */ + ++(me->buffer._read_p); + + goto _1942; + + + __quex_assert_no_passage(); +_1101: + /* (3756 from RELOAD_FORWARD) */ +_1944: + input = *(me->buffer._read_p); + + + __quex_debug_state(3756); +switch( input ) { +case 0x0: goto _1102; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: goto _538; +case 0x72: goto _501; +case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_500: + /* (3756 from 3755) */ + ++(me->buffer._read_p); + + goto _1944; + + + __quex_assert_no_passage(); +_1103: + /* (3757 from RELOAD_FORWARD) */ +_1946: + input = *(me->buffer._read_p); + + + __quex_debug_state(3757); +switch( input ) { +case 0x0: goto _1104; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _779; +} + + + __quex_assert_no_passage(); +_501: + /* (3757 from 3756) */ + ++(me->buffer._read_p); + + goto _1946; + + + __quex_assert_no_passage(); +_502: + /* (3758 from 3754) */ + ++(me->buffer._read_p); + +_1948: + input = *(me->buffer._read_p); + + + __quex_debug_state(3758); +switch( input ) { +case 0x0: goto _1106; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _503; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1105: + /* (3758 from RELOAD_FORWARD) */ + goto _1948; + + + __quex_assert_no_passage(); +_1107: + /* (3759 from RELOAD_FORWARD) */ +_1950: + input = *(me->buffer._read_p); + + + __quex_debug_state(3759); +switch( input ) { +case 0x0: goto _1108; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _780; +} + + + __quex_assert_no_passage(); +_503: + /* (3759 from 3758) */ + ++(me->buffer._read_p); + + goto _1950; + + + __quex_assert_no_passage(); +_504: + /* (3760 from 3753) */ + ++(me->buffer._read_p); + +_1952: + input = *(me->buffer._read_p); + + + __quex_debug_state(3760); +switch( input ) { +case 0x0: goto _1110; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: goto _538; +case 0x73: goto _506; +case 0x74: goto _505; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1109: + /* (3760 from RELOAD_FORWARD) */ + goto _1952; + + + __quex_assert_no_passage(); +_1111: + /* (3761 from RELOAD_FORWARD) */ +_1954: + input = *(me->buffer._read_p); + + + __quex_debug_state(3761); +switch( input ) { +case 0x0: goto _1112; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _508; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_505: + /* (3761 from 3760) */ + ++(me->buffer._read_p); + + goto _1954; + + + __quex_assert_no_passage(); +_506: + /* (3762 from 3760) */ + ++(me->buffer._read_p); + +_1956: + input = *(me->buffer._read_p); + + + __quex_debug_state(3762); +switch( input ) { +case 0x0: goto _1114; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _507; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1113: + /* (3762 from RELOAD_FORWARD) */ + goto _1956; + + + __quex_assert_no_passage(); +_1115: + /* (3763 from RELOAD_FORWARD) */ +_1958: + input = *(me->buffer._read_p); + + + __quex_debug_state(3763); +switch( input ) { +case 0x0: goto _1116; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _781; +} + + + __quex_assert_no_passage(); +_507: + /* (3763 from 3762) */ + ++(me->buffer._read_p); + + goto _1958; + + + __quex_assert_no_passage(); +_1117: + /* (3764 from RELOAD_FORWARD) */ +_1960: + input = *(me->buffer._read_p); + + + __quex_debug_state(3764); +switch( input ) { +case 0x0: goto _1118; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _509; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_508: + /* (3764 from 3761) */ + ++(me->buffer._read_p); + + goto _1960; + + + __quex_assert_no_passage(); +_1119: + /* (3765 from RELOAD_FORWARD) */ +_1962: + input = *(me->buffer._read_p); + + + __quex_debug_state(3765); +switch( input ) { +case 0x0: goto _1120; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: goto _538; +case 0x75: goto _510; +case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_509: + /* (3765 from 3764) */ + ++(me->buffer._read_p); + + goto _1962; + + + __quex_assert_no_passage(); +_510: + /* (3766 from 3765) */ + ++(me->buffer._read_p); + +_1964: + input = *(me->buffer._read_p); + + + __quex_debug_state(3766); +switch( input ) { +case 0x0: goto _1122; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _511; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1121: + /* (3766 from RELOAD_FORWARD) */ + goto _1964; + + + __quex_assert_no_passage(); +_1123: + /* (3767 from RELOAD_FORWARD) */ +_1966: + input = *(me->buffer._read_p); + + + __quex_debug_state(3767); +switch( input ) { +case 0x0: goto _1124; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _782; +} + + + __quex_assert_no_passage(); +_511: + /* (3767 from 3766) */ + ++(me->buffer._read_p); + + goto _1966; + + + __quex_assert_no_passage(); +_512: + /* (3768 from 3459) */ + ++(me->buffer._read_p); + +_1968: + input = *(me->buffer._read_p); + + + __quex_debug_state(3768); +switch( input ) { +case 0x0: goto _1126; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _513; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1125: + /* (3768 from RELOAD_FORWARD) */ + goto _1968; + + + __quex_assert_no_passage(); +_1127: + /* (3769 from RELOAD_FORWARD) */ +_1970: + input = *(me->buffer._read_p); + + + __quex_debug_state(3769); +switch( input ) { +case 0x0: goto _1128; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _514; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_513: + /* (3769 from 3768) */ + ++(me->buffer._read_p); + + goto _1970; + + + __quex_assert_no_passage(); +_514: + /* (3770 from 3769) */ + ++(me->buffer._read_p); + +_1972: + input = *(me->buffer._read_p); + + + __quex_debug_state(3770); +switch( input ) { +case 0x0: goto _1130; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: goto _538; +case 0x6B: goto _515; +case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1129: + /* (3770 from RELOAD_FORWARD) */ + goto _1972; + + + __quex_assert_no_passage(); +_1131: + /* (3771 from RELOAD_FORWARD) */ +_1974: + input = *(me->buffer._read_p); + + + __quex_debug_state(3771); +switch( input ) { +case 0x0: goto _1132; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _783; +} + + + __quex_assert_no_passage(); +_515: + /* (3771 from 3770) */ + ++(me->buffer._read_p); + + goto _1974; + + + __quex_assert_no_passage(); +_1133: + /* (3772 from RELOAD_FORWARD) */ +_1976: + input = *(me->buffer._read_p); + + + __quex_debug_state(3772); +switch( input ) { +case 0x0: goto _1134; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _784; +} + + + __quex_assert_no_passage(); +_516: + /* (3772 from 3458) */ + ++(me->buffer._read_p); + + goto _1976; + + + __quex_assert_no_passage(); +_1135: + /* (3773 from RELOAD_FORWARD) */ +_1978: + input = *(me->buffer._read_p); + + + __quex_debug_state(3773); +switch( input ) { +case 0x0: goto _1136; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _519; +case 0x6D: case 0x6E: case 0x6F: case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _518; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_517: + /* (3773 from 3458) */ + ++(me->buffer._read_p); + + goto _1978; + + + __quex_assert_no_passage(); +_518: + /* (3774 from 3773) */ + ++(me->buffer._read_p); + +_1980: + input = *(me->buffer._read_p); + + + __quex_debug_state(3774); +switch( input ) { +case 0x0: goto _1138; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _785; +} + + + __quex_assert_no_passage(); +_1137: + /* (3774 from RELOAD_FORWARD) */ + goto _1980; + + + __quex_assert_no_passage(); +_1139: + /* (3775 from RELOAD_FORWARD) */ +_1982: + input = *(me->buffer._read_p); + + + __quex_debug_state(3775); +switch( input ) { +case 0x0: goto _1140; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _520; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_519: + /* (3775 from 3773) */ + ++(me->buffer._read_p); + + goto _1982; + + + __quex_assert_no_passage(); +_520: + /* (3776 from 3775) */ + ++(me->buffer._read_p); + +_1984: + input = *(me->buffer._read_p); + + + __quex_debug_state(3776); +switch( input ) { +case 0x0: goto _1142; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _521; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1141: + /* (3776 from RELOAD_FORWARD) */ + goto _1984; + + + __quex_assert_no_passage(); +_1143: + /* (3777 from RELOAD_FORWARD) */ +_1986: + input = *(me->buffer._read_p); + + + __quex_debug_state(3777); +switch( input ) { +case 0x0: goto _1144; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _522; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_521: + /* (3777 from 3776) */ + ++(me->buffer._read_p); + + goto _1986; + + + __quex_assert_no_passage(); +_522: + /* (3778 from 3777) */ + ++(me->buffer._read_p); + +_1988: + input = *(me->buffer._read_p); + + + __quex_debug_state(3778); +switch( input ) { +case 0x0: goto _1146; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _786; +} + + + __quex_assert_no_passage(); +_1145: + /* (3778 from RELOAD_FORWARD) */ + goto _1988; + + + __quex_assert_no_passage(); +_1147: + /* (3779 from RELOAD_FORWARD) */ +_1990: + input = *(me->buffer._read_p); + + + __quex_debug_state(3779); +switch( input ) { +case 0x0: goto _1148; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: goto _538; +case 0x66: goto _529; +case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_523: + /* (3779 from 3457) */ + ++(me->buffer._read_p); + + goto _1990; + + + __quex_assert_no_passage(); +_1149: + /* (3780 from RELOAD_FORWARD) */ +_1992: + input = *(me->buffer._read_p); + + + __quex_debug_state(3780); +switch( input ) { +case 0x0: goto _1150; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: goto _538; +case 0x75: goto _525; +case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _787; +} + + + __quex_assert_no_passage(); +_524: + /* (3780 from 3457) */ + ++(me->buffer._read_p); + + goto _1992; + + + __quex_assert_no_passage(); +_1151: + /* (3781 from RELOAD_FORWARD) */ +_1994: + input = *(me->buffer._read_p); + + + __quex_debug_state(3781); +switch( input ) { +case 0x0: goto _1152; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: goto _538; +case 0x62: goto _526; +case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_525: + /* (3781 from 3780) */ + ++(me->buffer._read_p); + + goto _1994; + + + __quex_assert_no_passage(); +_526: + /* (3782 from 3781) */ + ++(me->buffer._read_p); + +_1996: + input = *(me->buffer._read_p); + + + __quex_debug_state(3782); +switch( input ) { +case 0x0: goto _1154; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _527; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1153: + /* (3782 from RELOAD_FORWARD) */ + goto _1996; + + + __quex_assert_no_passage(); +_1155: + /* (3783 from RELOAD_FORWARD) */ +_1998: + input = *(me->buffer._read_p); + + + __quex_debug_state(3783); +switch( input ) { +case 0x0: goto _1156; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _528; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_527: + /* (3783 from 3782) */ + ++(me->buffer._read_p); + + goto _1998; + + + __quex_assert_no_passage(); +_528: + /* (3784 from 3783) */ + ++(me->buffer._read_p); + +_2000: + input = *(me->buffer._read_p); + + + __quex_debug_state(3784); +switch( input ) { +case 0x0: goto _1158; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _788; +} + + + __quex_assert_no_passage(); +_1157: + /* (3784 from RELOAD_FORWARD) */ + goto _2000; + + + __quex_assert_no_passage(); +_1159: + /* (3785 from RELOAD_FORWARD) */ +_2002: + input = *(me->buffer._read_p); + + + __quex_debug_state(3785); +switch( input ) { +case 0x0: goto _1160; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: goto _538; +case 0x61: goto _530; +case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: goto _538; +case 0x69: goto _531; +case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_529: + /* (3785 from 3779) */ + ++(me->buffer._read_p); + + goto _2002; + + + __quex_assert_no_passage(); +_1161: + /* (3786 from RELOAD_FORWARD) */ +_2004: + input = *(me->buffer._read_p); + + + __quex_debug_state(3786); +switch( input ) { +case 0x0: goto _1162; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: goto _538; +case 0x75: goto _535; +case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_530: + /* (3786 from 3785) */ + ++(me->buffer._read_p); + + goto _2004; + + + __quex_assert_no_passage(); +_1163: + /* (3787 from RELOAD_FORWARD) */ +_2006: + input = *(me->buffer._read_p); + + + __quex_debug_state(3787); +switch( input ) { +case 0x0: goto _1164; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: goto _538; +case 0x6E: goto _532; +case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_531: + /* (3787 from 3785) */ + ++(me->buffer._read_p); + + goto _2006; + + + __quex_assert_no_passage(); +_1165: + /* (3788 from RELOAD_FORWARD) */ +_2008: + input = *(me->buffer._read_p); + + + __quex_debug_state(3788); +switch( input ) { +case 0x0: goto _1166; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: goto _538; +case 0x65: goto _533; +case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_532: + /* (3788 from 3787) */ + ++(me->buffer._read_p); + + goto _2008; + + + __quex_assert_no_passage(); +_1167: + /* (3789 from RELOAD_FORWARD) */ +_2010: + input = *(me->buffer._read_p); + + + __quex_debug_state(3789); +switch( input ) { +case 0x0: goto _1168; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: goto _538; +case 0x64: goto _534; +case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_533: + /* (3789 from 3788) */ + ++(me->buffer._read_p); + + goto _2010; + + + __quex_assert_no_passage(); +_534: + /* (3790 from 3789) */ + ++(me->buffer._read_p); + +_2012: + input = *(me->buffer._read_p); + + + __quex_debug_state(3790); +switch( input ) { +case 0x0: goto _1170; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _789; +} + + + __quex_assert_no_passage(); +_1169: + /* (3790 from RELOAD_FORWARD) */ + goto _2012; + + + __quex_assert_no_passage(); +_1171: + /* (3791 from RELOAD_FORWARD) */ +_2014: + input = *(me->buffer._read_p); + + + __quex_debug_state(3791); +switch( input ) { +case 0x0: goto _1172; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: goto _538; +case 0x6C: goto _536; +case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_535: + /* (3791 from 3786) */ + ++(me->buffer._read_p); + + goto _2014; + + + __quex_assert_no_passage(); +_536: + /* (3792 from 3791) */ + ++(me->buffer._read_p); + +_2016: + input = *(me->buffer._read_p); + + + __quex_debug_state(3792); +switch( input ) { +case 0x0: goto _1174; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: goto _538; +case 0x74: goto _537; +case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _673; +} + + + __quex_assert_no_passage(); +_1173: + /* (3792 from RELOAD_FORWARD) */ + goto _2016; + + + __quex_assert_no_passage(); +_1175: + /* (3793 from RELOAD_FORWARD) */ +_2018: + input = *(me->buffer._read_p); + + + __quex_debug_state(3793); +switch( input ) { +case 0x0: goto _1176; +case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: +case 0x38: case 0x39: +case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: +case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E: case 0x4F: +case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: +case 0x58: case 0x59: case 0x5A: +case 0x5F: +case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: +case 0x68: case 0x69: case 0x6A: case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: +case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: +case 0x78: case 0x79: case 0x7A: goto _538; +default: goto _790; +} + + + __quex_assert_no_passage(); +_537: + /* (3793 from 3792) */ + ++(me->buffer._read_p); + + goto _2018; +_108: + /* (1956 from BEFORE_ENTRY) */ + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +_2020: +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + input = *(me->buffer._read_p); + +_2019: + __quex_debug("Init State\n"); + __quex_debug_state(1956); +switch( input ) { +case 0x0: goto _117; +case 0x9: goto _109; +case 0x20: goto _110; +default: goto _111; +} + + + __quex_assert_no_passage(); +_118: + /* (1956 from 1961) */ + goto _2019; + + + __quex_assert_no_passage(); +_115: + /* (1956 from RELOAD_FORWARD) */ + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + goto _2020; + + + __quex_assert_no_passage(); +_113: + /* (DROP_OUT from 1958) */ + goto _121; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_112: + /* (DROP_OUT from 1957) */ + goto _120; + + + __quex_assert_no_passage(); +_114: + /* (DROP_OUT from 1959) */ + goto _119; + + + __quex_assert_no_passage(); +_109: + /* (1957 from 1956) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(1957); +goto _112; + + + __quex_assert_no_passage(); +_110: + /* (1958 from 1956) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(1958); +goto _113; + + + __quex_assert_no_passage(); +_111: + /* (1959 from 1956) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(1959); +goto _114; +_126: + /* (2001 from BEFORE_ENTRY) */ + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +_2026: +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + input = *(me->buffer._read_p); + +_2025: + __quex_debug("Init State\n"); + __quex_debug_state(2001); +switch( input ) { +case 0x0: goto _136; +case 0x9: goto _129; +case 0xA: goto _128; +case 0x2A: goto _127; +default: goto _130; +} + + + __quex_assert_no_passage(); +_137: + /* (2001 from 2006) */ + goto _2025; + + + __quex_assert_no_passage(); +_135: + /* (2001 from RELOAD_FORWARD) */ + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + goto _2026; + + + __quex_assert_no_passage(); +_133: + /* (DROP_OUT from 2004) */ + goto _147; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_131: + /* (DROP_OUT from 2002) */ + goto _145; + + + __quex_assert_no_passage(); +_132: + /* (DROP_OUT from 2003) */ + goto _146; + + + __quex_assert_no_passage(); +_134: + /* (DROP_OUT from 2005) */ + goto _148; + + + __quex_assert_no_passage(); +_127: + /* (2002 from 2001) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2002); +goto _131; + + + __quex_assert_no_passage(); +_128: + /* (2003 from 2001) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2003); +goto _132; + + + __quex_assert_no_passage(); +_129: + /* (2004 from 2001) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2004); +goto _133; + + + __quex_assert_no_passage(); +_130: + /* (2005 from 2001) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2005); +goto _134; +_138: + /* (2000 from BEFORE_ENTRY) */ +_2033: + input = *(me->buffer._read_p); + + + __quex_debug("Init State\n"); + __quex_debug_state(2000); +if ( input == 0x2F ) goto _139; +else if( input == 0x0 ) goto _143; +else goto _141; + + + __quex_assert_no_passage(); +_142: + /* (2000 from RELOAD_FORWARD) */ + position_delta = (me->buffer._read_p) - read_p_before_reload; + + loop_restart_p = &loop_restart_p[position_delta]; + + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + goto _2033; + + + __quex_assert_no_passage(); +_141: + /* (DROP_OUT from 2000) */ + goto _149; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_140: + /* (DROP_OUT from 1999) */ + goto _150; + + + __quex_assert_no_passage(); +_139: + /* (1999 from 2000) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(1999); +goto _140; +_153: + /* (2045 from BEFORE_ENTRY) */ + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +_2037: +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + input = *(me->buffer._read_p); + +_2036: + __quex_debug("Init State\n"); + __quex_debug_state(2045); +switch( input ) { +case 0x0: goto _161; +case 0x9: goto _156; +case 0xA: goto _155; +default: goto _154; +} + + + __quex_assert_no_passage(); +_162: + /* (2045 from 2049) */ + goto _2036; + + + __quex_assert_no_passage(); +_160: + /* (2045 from RELOAD_FORWARD) */ + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + goto _2037; + + + __quex_assert_no_passage(); +_158: + /* (DROP_OUT from 2047) */ + goto _166; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_159: + /* (DROP_OUT from 2048) */ + goto _167; + + + __quex_assert_no_passage(); +_157: + /* (DROP_OUT from 2046) */ + goto _165; + + + __quex_assert_no_passage(); +_154: + /* (2048 from 2045) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2048); +goto _159; + + + __quex_assert_no_passage(); +_155: + /* (2046 from 2045) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2046); +goto _157; + + + __quex_assert_no_passage(); +_156: + /* (2047 from 2045) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2047); +goto _158; +_169: + /* (2087 from BEFORE_ENTRY) */ + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +_2043: +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + input = *(me->buffer._read_p); + +_2042: + __quex_debug("Init State\n"); + __quex_debug_state(2087); +switch( input ) { +case 0x0: goto _179; +case 0x9: goto _172; +case 0xA: goto _171; +case 0x7D: goto _170; +default: goto _173; +} + + + __quex_assert_no_passage(); +_180: + /* (2087 from 2092) */ + goto _2042; + + + __quex_assert_no_passage(); +_178: + /* (2087 from RELOAD_FORWARD) */ + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + goto _2043; + + + __quex_assert_no_passage(); +_177: + /* (DROP_OUT from 2091) */ + goto _191; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_174: + /* (DROP_OUT from 2088) */ + goto _188; + + + __quex_assert_no_passage(); +_176: + /* (DROP_OUT from 2090) */ + goto _190; + + + __quex_assert_no_passage(); +_175: + /* (DROP_OUT from 2089) */ + goto _189; + + + __quex_assert_no_passage(); +_170: + /* (2088 from 2087) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2088); +goto _174; + + + __quex_assert_no_passage(); +_171: + /* (2089 from 2087) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2089); +goto _175; + + + __quex_assert_no_passage(); +_172: + /* (2090 from 2087) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2090); +goto _176; + + + __quex_assert_no_passage(); +_173: + /* (2091 from 2087) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2091); +goto _177; +_181: + /* (2086 from BEFORE_ENTRY) */ +_2050: + input = *(me->buffer._read_p); + + + __quex_debug("Init State\n"); + __quex_debug_state(2086); +if ( input == 0x7E ) goto _182; +else if( input == 0x0 ) goto _186; +else goto _184; + + + __quex_assert_no_passage(); +_185: + /* (2086 from RELOAD_FORWARD) */ + position_delta = (me->buffer._read_p) - read_p_before_reload; + + loop_restart_p = &loop_restart_p[position_delta]; + + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + goto _2050; + + + __quex_assert_no_passage(); +_184: + /* (DROP_OUT from 2086) */ + goto _192; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_183: + /* (DROP_OUT from 2085) */ + goto _193; + + + __quex_assert_no_passage(); +_182: + /* (2085 from 2086) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2085); +goto _183; +_196: + /* (2121 from BEFORE_ENTRY) */ + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +_2054: +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + input = *(me->buffer._read_p); + +_2053: + __quex_debug("Init State\n"); + __quex_debug_state(2121); +switch( input ) { +case 0x0: goto _208; +case 0x9: goto _199; +case 0xA: goto _197; +case 0xD: goto _198; +case 0x20: goto _200; +default: goto _201; +} + + + __quex_assert_no_passage(); +_209: + /* (2121 from 2127) */ + goto _2053; + + + __quex_assert_no_passage(); +_207: + /* (2121 from RELOAD_FORWARD) */ + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + goto _2054; + + + __quex_assert_no_passage(); +_203: + /* (DROP_OUT from 2123) */ + goto _213; + + __quex_debug("Drop-Out Catcher\n"); + + + __quex_assert_no_passage(); +_205: + /* (DROP_OUT from 2125) */ + goto _215; + + + __quex_assert_no_passage(); +_206: + /* (DROP_OUT from 2126) */ + goto _210; + + + __quex_assert_no_passage(); +_204: + /* (DROP_OUT from 2124) */ + goto _214; + + + __quex_assert_no_passage(); +_202: + /* (DROP_OUT from 2122) */ + goto _212; + + + __quex_assert_no_passage(); +_197: + /* (2122 from 2121) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2122); +goto _202; + + + __quex_assert_no_passage(); +_198: + /* (2123 from 2121) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2123); +goto _203; + + + __quex_assert_no_passage(); +_199: + /* (2124 from 2121) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2124); +goto _204; + + + __quex_assert_no_passage(); +_200: + /* (2125 from 2121) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2125); +goto _205; + + + __quex_assert_no_passage(); +_201: + /* (2126 from 2121) */ + ++(me->buffer._read_p); + + input = *(me->buffer._read_p); + + + __quex_debug_state(2126); +goto _206; + + /* (*) Terminal states _______________________________________________________ + * + * States that implement actions of the 'winner patterns. */ +_323: + __quex_debug("* TERMINAL BAD_LEXATOM\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); + QUEX_NAME(on_indentation)(me, me->counter._column_number_at_end, LexemeNull); +{ +__QUEX_STD_printf("\n"); +QUEX_NAME(Buffer_show_debug_content)(&me->buffer); +__QUEX_STD_printf("\n"); +QUEX_ERROR_EXIT("\nMode 'PROGRAM': Bad lexatom (character encoding error) detected!\n" + "The 'on_bad_lexatom' handler has not been specified.\n"); +} + /* Bad lexatom detection FORCES a return from the lexical analyzer, so that no + * tokens can be filled after the termination token. + */ +goto _322; +_324: + __quex_debug("* TERMINAL LOAD_FAILURE\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); + QUEX_NAME(on_indentation)(me, me->counter._column_number_at_end, LexemeNull); +{ +__QUEX_STD_printf("\n"); +QUEX_NAME(Buffer_show_debug_content)(&me->buffer); +__QUEX_STD_printf("\n"); +QUEX_ERROR_EXIT("\nMode 'PROGRAM': General failure while loading buffer.\n" + "The 'on_load_failure' handler has not been specified.\n"); +} + /* Load failure FORCES a return from the lexical analyzer, so that no + * tokens can be filled after the termination token. + */ +goto _322; +_325: + __quex_debug("* TERMINAL OVERFLOW\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); + QUEX_NAME(on_indentation)(me, me->counter._column_number_at_end, LexemeNull); +QUEX_LEXEME_TERMINATING_ZERO_SET(&me->buffer); +{ +__QUEX_STD_printf("\n"); +QUEX_NAME(Buffer_show_debug_content)(&me->buffer); +__QUEX_STD_printf("\n"); +QUEX_ERROR_EXIT("\nMode 'PROGRAM': Lexeme exceeds buffer size.\n" + "The 'on_overflow' handler has not been specified.\n"); +} + /* Lexeme size exceeds buffer size. No further buffer load possible. + */ +goto _322; +_116: + __quex_debug("* TERMINAL END_OF_STREAM\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); + QUEX_NAME(on_indentation)(me, me->counter._column_number_at_end, LexemeNull); +{ + +# line 141 "c.qx" +self_send(QUEX_TKN_TERMINATION); + + +# line 11682 "EasyLexer.c" + +} + /* End of Stream FORCES a return from the lexical analyzer, so that no + * tokens can be filled after the termination token. + */ +goto _322; +_152: + __quex_debug("* TERMINAL <indentation handler><indentation newline>\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_LINES_ADD(1); +__QUEX_IF_COUNT_COLUMNS_SET(1); +goto _196; +_326: + __quex_debug("* TERMINAL FAILURE\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 273 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_FAILURE); + + +# line 11705 "EasyLexer.c" + +} +goto _107; +_122: + __quex_debug("* TERMINAL <skip>\n"); +goto _108; +_125: + __quex_debug("* TERMINAL SKIP_RANGE_OPEN\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); + QUEX_NAME(on_indentation)(me, me->counter._column_number_at_end, LexemeNull); +{ +#define Counter counter +__QUEX_STD_printf("\n"); +QUEX_NAME(Buffer_show_debug_content)(&me->buffer); +__QUEX_STD_printf("\n"); +QUEX_ERROR_EXIT("\nMode 'PROGRAM': End of file occurred before closing skip range delimiter!\n" + "The 'on_skip_range_open' handler has not been specified.\n"); +} + /* End of Stream appeared, while scanning for end of skip-range. + */ +goto _322; +_119: + __quex_debug("* TERMINAL <LOOP EXIT>\n"); + --(me->buffer._read_p); + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +goto _107; + +_120: + __quex_debug("* TERMINAL <LOOP 576>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p - 1))); + +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end -= 1); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end &= ~ ((size_t)0x3)); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end += 4 + 1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _118; + +_121: + __quex_debug("* TERMINAL <LOOP 577>\n"); +goto _118; + +_123: + __quex_debug("* TERMINAL ENTER SKIP:\n"); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end -= 1); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end &= ~ ((size_t)0x3)); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end += 4 + 1); + +goto _122; + +_124: + __quex_debug("* TERMINAL ENTER SKIP:\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)1); + +goto _122; + +_150: + __quex_debug("* TERMINAL <SKIP RANGE TERMINATED>\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); +goto _107; +_144: + __quex_debug("* TERMINAL <LOOP EXIT>\n"); + --(me->buffer._read_p); + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +goto _107; + +_149: + __quex_debug("* TERMINAL <LOOP>\n"); + __QUEX_IF_COUNT_COLUMNS(count_reference_p = loop_restart_p); + + (me->buffer._read_p) = loop_restart_p; + +goto _137; + +_145: + __quex_debug("* TERMINAL <COUPLE 594>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + loop_restart_p = (me->buffer._read_p); + +goto _138; + +_146: + __quex_debug("* TERMINAL <LOOP 595>\n"); +__QUEX_IF_COUNT_LINES_ADD((size_t)1); + + __QUEX_IF_COUNT_COLUMNS((me->counter._column_number_at_end) = (size_t)1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _137; + +_147: + __quex_debug("* TERMINAL <LOOP 596>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p - 1))); + +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end -= 1); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end &= ~ ((size_t)0x3)); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end += 4 + 1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _137; + +_148: + __quex_debug("* TERMINAL <LOOP 597>\n"); +goto _137; + +_151: + __quex_debug("* TERMINAL <skip range><skip_range open>\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +goto _126; +_164: + __quex_debug("* TERMINAL <SKIP RANGE TERMINATED>\n"); +goto _152; +_163: + __quex_debug("* TERMINAL <LOOP EXIT>\n"); + --(me->buffer._read_p); + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +goto _152; + +_165: + __quex_debug("* TERMINAL <COUPLE 611>\n"); +__QUEX_IF_COUNT_LINES_ADD((size_t)1); + + __QUEX_IF_COUNT_COLUMNS((me->counter._column_number_at_end) = (size_t)1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _164; + +_166: + __quex_debug("* TERMINAL <LOOP 612>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p - 1))); + +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end -= 1); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end &= ~ ((size_t)0x3)); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end += 4 + 1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _162; + +_167: + __quex_debug("* TERMINAL <LOOP 613>\n"); +goto _162; + +_168: + __quex_debug("* TERMINAL <skip range><skip_range open>\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +goto _153; +_193: + __quex_debug("* TERMINAL <SKIP RANGE TERMINATED>\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); +goto _107; +_187: + __quex_debug("* TERMINAL <LOOP EXIT>\n"); + --(me->buffer._read_p); + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +goto _107; + +_192: + __quex_debug("* TERMINAL <LOOP>\n"); + __QUEX_IF_COUNT_COLUMNS(count_reference_p = loop_restart_p); + + (me->buffer._read_p) = loop_restart_p; + +goto _180; + +_188: + __quex_debug("* TERMINAL <COUPLE 627>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + + loop_restart_p = (me->buffer._read_p); + +goto _181; + +_189: + __quex_debug("* TERMINAL <LOOP 628>\n"); +__QUEX_IF_COUNT_LINES_ADD((size_t)1); + + __QUEX_IF_COUNT_COLUMNS((me->counter._column_number_at_end) = (size_t)1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _180; + +_190: + __quex_debug("* TERMINAL <LOOP 629>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p - 1))); + +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end -= 1); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end &= ~ ((size_t)0x3)); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end += 4 + 1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _180; + +_191: + __quex_debug("* TERMINAL <LOOP 630>\n"); +goto _180; + +_194: + __quex_debug("* TERMINAL <skip range><skip_range open>\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +goto _169; +_195: + __quex_debug("* TERMINAL <CALL INDENTATION HANDLER>\n"); + QUEX_NAME(on_indentation)(me, me->counter._column_number_at_end, LexemeNull); + +goto _107; + +_211: + __quex_debug("* TERMINAL <INDENTATION NEWLINE>\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_LINES_ADD(1); +__QUEX_IF_COUNT_COLUMNS_SET(1); + __QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); +goto _196; +_210: + __quex_debug("* TERMINAL <LOOP EXIT>\n"); + --(me->buffer._read_p); + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +goto _195; + +_212: + __quex_debug("* TERMINAL <COUPLE 640>\n"); +__QUEX_IF_COUNT_LINES_ADD((size_t)1); + + __QUEX_IF_COUNT_COLUMNS((me->counter._column_number_at_end) = (size_t)1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _211; + +_213: + __quex_debug("* TERMINAL <COUPLE 641>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _211; + +_214: + __quex_debug("* TERMINAL <LOOP 642>\n"); +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p - 1))); + +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end -= 1); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end &= ~ ((size_t)0x3)); +__QUEX_IF_COUNT_COLUMNS(self.counter._column_number_at_end += 4 + 1); + +__QUEX_IF_COUNT_COLUMNS(count_reference_p = (me->buffer._read_p)); + +goto _209; + +_215: + __quex_debug("* TERMINAL <LOOP 643>\n"); +goto _209; + +_216: + __quex_debug("* TERMINAL \"use\"[ \\t]*\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 157 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_USE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 11999 "EasyLexer.c" + +} +goto _0; +_217: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"include\"[ \\t]*{P_INCLUDE_FILE2}\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 158 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_INCLUDE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12014 "EasyLexer.c" + +} +goto _0; +_218: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"include\"[ \\t]*{P_INCLUDE_FILE1}\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 159 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_INCLUDE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12029 "EasyLexer.c" + +} +goto _0; +_219: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"define\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 160 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_DEFINE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12044 "EasyLexer.c" + +} +goto _0; +_220: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"if\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 161 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_IF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12059 "EasyLexer.c" + +} +goto _0; +_221: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"elif\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 162 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_ELIF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12074 "EasyLexer.c" + +} +goto _0; +_222: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"ifdef\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 163 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_IFDEF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12089 "EasyLexer.c" + +} +goto _0; +_223: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"ifndef\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 164 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_IFNDEF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12104 "EasyLexer.c" + +} +goto _0; +_224: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"endif\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 165 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_ENDIF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12119 "EasyLexer.c" + +} +goto _0; +_225: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"else\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 166 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_ELSE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12134 "EasyLexer.c" + +} +goto _0; +_226: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"pragma\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 167 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_PRAGMA); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12149 "EasyLexer.c" + +} +goto _0; +_227: + __quex_debug("* TERMINAL \"#\"[ \\t]*\"error\"\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 168 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_ERROR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12164 "EasyLexer.c" + +} +goto _0; +_228: + __quex_debug("* TERMINAL defined\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(7); +{ + +# line 169 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PP_DEFINED); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12180 "EasyLexer.c" + +} +goto _0; +_229: + __quex_debug("* TERMINAL \"\\\\\\n\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_LINES_ADD(1); +__QUEX_IF_COUNT_COLUMNS_SET(1); +{ + +# line 170 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_BACKLASHED_NEWLINE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12197 "EasyLexer.c" + +} +goto _0; +_230: + __quex_debug("* TERMINAL char\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 172 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_CHAR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12213 "EasyLexer.c" + +} +goto _0; +_231: + __quex_debug("* TERMINAL double\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 173 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_DOUBLE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12229 "EasyLexer.c" + +} +goto _0; +_232: + __quex_debug("* TERMINAL float\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(5); +{ + +# line 174 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_FLOAT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12245 "EasyLexer.c" + +} +goto _0; +_233: + __quex_debug("* TERMINAL int\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(3); +{ + +# line 175 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_INT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12261 "EasyLexer.c" + +} +goto _0; +_234: + __quex_debug("* TERMINAL long\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 176 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_LONG); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12277 "EasyLexer.c" + +} +goto _0; +_235: + __quex_debug("* TERMINAL short\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(5); +{ + +# line 177 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_SHORT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12293 "EasyLexer.c" + +} +goto _0; +_236: + __quex_debug("* TERMINAL signed\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 178 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_SIGNED); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12309 "EasyLexer.c" + +} +goto _0; +_237: + __quex_debug("* TERMINAL unsigned\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 179 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_UNSIGNED); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12325 "EasyLexer.c" + +} +goto _0; +_238: + __quex_debug("* TERMINAL void\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 180 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE_VOID); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12341 "EasyLexer.c" + +} +goto _0; +_239: + __quex_debug("* TERMINAL \"#\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 182 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_HASH); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12357 "EasyLexer.c" + +} +goto _0; +_240: + __quex_debug("* TERMINAL \"##\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 183 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_DOUBLE_HASH); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12373 "EasyLexer.c" + +} +goto _0; +_241: + __quex_debug("* TERMINAL \"?\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 184 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_QUESTION_MARK); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12389 "EasyLexer.c" + +} +goto _0; +_242: + __quex_debug("* TERMINAL \"~\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 185 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TILDE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12405 "EasyLexer.c" + +} +goto _0; +_243: + __quex_debug("* TERMINAL \"(\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 186 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_BRACKET_O); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12421 "EasyLexer.c" + +} +goto _0; +_244: + __quex_debug("* TERMINAL \")\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 187 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_BRACKET_C); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12437 "EasyLexer.c" + +} +goto _0; +_245: + __quex_debug("* TERMINAL \"[\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 188 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_CORNER_BRACKET_O); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12453 "EasyLexer.c" + +} +goto _0; +_246: + __quex_debug("* TERMINAL \"]\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 189 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_CORNER_BRACKET_C); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12469 "EasyLexer.c" + +} +goto _0; +_247: + __quex_debug("* TERMINAL \"=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 192 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_OP_ASSIGNMENT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12485 "EasyLexer.c" + +} +goto _0; +_248: + __quex_debug("* TERMINAL \"+\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 193 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_PLUS); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12501 "EasyLexer.c" + +} +goto _0; +_249: + __quex_debug("* TERMINAL \"-\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 194 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_MINUS); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12517 "EasyLexer.c" + +} +goto _0; +_250: + __quex_debug("* TERMINAL \"*\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 195 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_MULT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12533 "EasyLexer.c" + +} +goto _0; +_251: + __quex_debug("* TERMINAL \"/\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 196 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_DIV); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12549 "EasyLexer.c" + +} +goto _0; +_252: + __quex_debug("* TERMINAL \"%\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 197 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_MODULO); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12565 "EasyLexer.c" + +} +goto _0; +_253: + __quex_debug("* TERMINAL \"++\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 198 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_INCREMENT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12581 "EasyLexer.c" + +} +goto _0; +_254: + __quex_debug("* TERMINAL \"--\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 199 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_DECREMENT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12597 "EasyLexer.c" + +} +goto _0; +_255: + __quex_debug("* TERMINAL \"+=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 200 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_PLUS); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12613 "EasyLexer.c" + +} +goto _0; +_256: + __quex_debug("* TERMINAL \"-=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 201 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_MINUS); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12629 "EasyLexer.c" + +} +goto _0; +_257: + __quex_debug("* TERMINAL \"*=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 202 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_MULT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12645 "EasyLexer.c" + +} +goto _0; +_258: + __quex_debug("* TERMINAL \"/=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 203 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_DIV); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12661 "EasyLexer.c" + +} +goto _0; +_259: + __quex_debug("* TERMINAL \"%=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 204 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_MODULO); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12677 "EasyLexer.c" + +} +goto _0; +_260: + __quex_debug("* TERMINAL \"&=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 205 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_AMPERSANT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12693 "EasyLexer.c" + +} +goto _0; +_261: + __quex_debug("* TERMINAL \"|=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 206 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_LOGICAL_OR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12709 "EasyLexer.c" + +} +goto _0; +_262: + __quex_debug("* TERMINAL \"^=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 207 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_EXCLUSIVE_OR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12725 "EasyLexer.c" + +} +goto _0; +_263: + __quex_debug("* TERMINAL \"<<=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(3); +{ + +# line 208 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_SHIFT_LEFT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12741 "EasyLexer.c" + +} +goto _0; +_264: + __quex_debug("* TERMINAL \">>=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(3); +{ + +# line 209 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ASSIGN_SHIFT_RIGHT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12757 "EasyLexer.c" + +} +goto _0; +_265: + __quex_debug("* TERMINAL \"==\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 210 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_EQ); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12773 "EasyLexer.c" + +} +goto _0; +_266: + __quex_debug("* TERMINAL \"!=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 211 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_NOT_EQ); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12789 "EasyLexer.c" + +} +goto _0; +_267: + __quex_debug("* TERMINAL \">\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 212 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_GREATER); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12805 "EasyLexer.c" + +} +goto _0; +_268: + __quex_debug("* TERMINAL \">=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 213 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_GR_EQ); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12821 "EasyLexer.c" + +} +goto _0; +_269: + __quex_debug("* TERMINAL \"<\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 214 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_LESS); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12837 "EasyLexer.c" + +} +goto _0; +_270: + __quex_debug("* TERMINAL \"<=\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 215 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_LE_EQ); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12853 "EasyLexer.c" + +} +goto _0; +_271: + __quex_debug("* TERMINAL \"!\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 216 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_NOT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12869 "EasyLexer.c" + +} +goto _0; +_272: + __quex_debug("* TERMINAL \"|\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 217 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_LOGICAL_OR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12885 "EasyLexer.c" + +} +goto _0; +_273: + __quex_debug("* TERMINAL \"^\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 218 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_EXCLUSIVE_OR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12901 "EasyLexer.c" + +} +goto _0; +_274: + __quex_debug("* TERMINAL \"<<\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 219 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_SHIFT_LEFT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12917 "EasyLexer.c" + +} +goto _0; +_275: + __quex_debug("* TERMINAL \">>\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 220 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_SHIFT_RIGHT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12933 "EasyLexer.c" + +} +goto _0; +_276: + __quex_debug("* TERMINAL \"||\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 221 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_OR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12949 "EasyLexer.c" + +} +goto _0; +_277: + __quex_debug("* TERMINAL \"&\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 222 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_AMPERSANT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12965 "EasyLexer.c" + +} +goto _0; +_278: + __quex_debug("* TERMINAL \"&&\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 223 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_AND); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12981 "EasyLexer.c" + +} +goto _0; +_279: + __quex_debug("* TERMINAL \"->\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 224 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_MEMBER); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 12997 "EasyLexer.c" + +} +goto _0; +_280: + __quex_debug("* TERMINAL \":\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 225 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_COLON); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13013 "EasyLexer.c" + +} +goto _0; +_281: + __quex_debug("* TERMINAL break\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(5); +{ + +# line 226 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_BREAK); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13029 "EasyLexer.c" + +} +goto _0; +_282: + __quex_debug("* TERMINAL case\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 227 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_CASE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13045 "EasyLexer.c" + +} +goto _0; +_283: + __quex_debug("* TERMINAL const\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(5); +{ + +# line 228 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_CONST); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13061 "EasyLexer.c" + +} +goto _0; +_284: + __quex_debug("* TERMINAL continue\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 229 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_CONTINUE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13077 "EasyLexer.c" + +} +goto _0; +_285: + __quex_debug("* TERMINAL default\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(7); +{ + +# line 230 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_DEFAULT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13093 "EasyLexer.c" + +} +goto _0; +_286: + __quex_debug("* TERMINAL do\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 231 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_DO); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13109 "EasyLexer.c" + +} +goto _0; +_287: + __quex_debug("* TERMINAL else\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 232 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ELSE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13125 "EasyLexer.c" + +} +goto _0; +_288: + __quex_debug("* TERMINAL enum\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 233 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_ENUM); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13141 "EasyLexer.c" + +} +goto _0; +_289: + __quex_debug("* TERMINAL extern\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 234 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_EXTERN); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13157 "EasyLexer.c" + +} +goto _0; +_290: + __quex_debug("* TERMINAL goto\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 235 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_GOTO); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13173 "EasyLexer.c" + +} +goto _0; +_291: + __quex_debug("* TERMINAL for\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(3); +{ + +# line 236 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_FOR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13189 "EasyLexer.c" + +} +goto _0; +_292: + __quex_debug("* TERMINAL if\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(2); +{ + +# line 237 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_IF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13205 "EasyLexer.c" + +} +goto _0; +_293: + __quex_debug("* TERMINAL return\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 238 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_RETURN); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13221 "EasyLexer.c" + +} +goto _0; +_294: + __quex_debug("* TERMINAL sizeof\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 239 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_SIZEOF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13237 "EasyLexer.c" + +} +goto _0; +_295: + __quex_debug("* TERMINAL static\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 240 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_STATIC); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13253 "EasyLexer.c" + +} +goto _0; +_296: + __quex_debug("* TERMINAL struct\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 241 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_STRUCT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13269 "EasyLexer.c" + +} +goto _0; +_297: + __quex_debug("* TERMINAL switch\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 242 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_SWITCH); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13285 "EasyLexer.c" + +} +goto _0; +_298: + __quex_debug("* TERMINAL type\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(4); +{ + +# line 243 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13301 "EasyLexer.c" + +} +goto _0; +_299: + __quex_debug("* TERMINAL typedef\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(7); +{ + +# line 244 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_TYPEDEF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13317 "EasyLexer.c" + +} +goto _0; +_300: + __quex_debug("* TERMINAL union\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(5); +{ + +# line 245 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_UNION); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13333 "EasyLexer.c" + +} +goto _0; +_301: + __quex_debug("* TERMINAL volatile\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 246 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_VOLATILE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13349 "EasyLexer.c" + +} +goto _0; +_302: + __quex_debug("* TERMINAL while\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(5); +{ + +# line 247 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_WHILE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13365 "EasyLexer.c" + +} +goto _0; +_303: + __quex_debug("* TERMINAL _Bool\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(5); +{ + +# line 248 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__BOOL); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13381 "EasyLexer.c" + +} +goto _0; +_304: + __quex_debug("* TERMINAL _Complex\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 249 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__COMPLEX); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13397 "EasyLexer.c" + +} +goto _0; +_305: + __quex_debug("* TERMINAL _Imaginary\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(10); +{ + +# line 250 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__IMAGINARY); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13413 "EasyLexer.c" + +} +goto _0; +_306: + __quex_debug("* TERMINAL inline\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(6); +{ + +# line 251 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_INLINE); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13429 "EasyLexer.c" + +} +goto _0; +_307: + __quex_debug("* TERMINAL restrict\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 252 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_RESTRICT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13445 "EasyLexer.c" + +} +goto _0; +_308: + __quex_debug("* TERMINAL _Alignas\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 253 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__ALIGNAS); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13461 "EasyLexer.c" + +} +goto _0; +_309: + __quex_debug("* TERMINAL _Alignof\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 254 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__ALIGNOF); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13477 "EasyLexer.c" + +} +goto _0; +_310: + __quex_debug("* TERMINAL _Atomic\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(7); +{ + +# line 255 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__ATOMIC); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13493 "EasyLexer.c" + +} +goto _0; +_311: + __quex_debug("* TERMINAL _Generic\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(8); +{ + +# line 256 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__GENERIC); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13509 "EasyLexer.c" + +} +goto _0; +_312: + __quex_debug("* TERMINAL _Noreturn\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(9); +{ + +# line 257 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__NORETURN); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13525 "EasyLexer.c" + +} +goto _0; +_313: + __quex_debug("* TERMINAL _Static_assert\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(14); +{ + +# line 258 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__STATIC_ASSERT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13541 "EasyLexer.c" + +} +goto _0; +_314: + __quex_debug("* TERMINAL _Thread_local\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(13); +{ + +# line 259 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN__THREAD_LOCAL); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13557 "EasyLexer.c" + +} +goto _0; +_315: + __quex_debug("* TERMINAL \";\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 260 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_SEMICOLON); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13573 "EasyLexer.c" + +} +goto _0; +_316: + __quex_debug("* TERMINAL \".\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 261 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_DOT); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13589 "EasyLexer.c" + +} +goto _0; +_317: + __quex_debug("* TERMINAL \",\"\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(1); +{ + +# line 262 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_COMMA); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13605 "EasyLexer.c" + +} +goto _0; +_318: + __quex_debug("* TERMINAL {P_IDENTIFIER}\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(LexemeL); +{ + +# line 264 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_IDENTIFIER); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13621 "EasyLexer.c" + +} +goto _0; +_319: + __quex_debug("* TERMINAL {P_NUMBER}\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(LexemeL); +{ + +# line 265 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_NUMBER); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13637 "EasyLexer.c" + +} +goto _0; +_320: + __quex_debug("* TERMINAL {P_STRING}\n"); +__QUEX_COUNT_VOID(&self, LexemeBegin, LexemeEnd); +{ + +# line 266 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_STRING); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13652 "EasyLexer.c" + +} +goto _0; +_321: + __quex_debug("* TERMINAL {P_QUOTED_CHAR}\n"); +__QUEX_IF_COUNT_SHIFT_VALUES(); +__QUEX_IF_COUNT_COLUMNS_ADD(LexemeL); +{ + +# line 267 "c.qx" +QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, self.buffer._lexeme_start_p, self.buffer._read_p); +self_send(QUEX_TKN_QUOTED_CHAR); +QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN(); + + +# line 13668 "EasyLexer.c" + +} +goto _0; +if(0) { + /* Avoid unreferenced labels. */ + goto _323; + goto _324; + goto _325; + goto _116; + goto _152; + goto _326; + goto _122; + goto _125; + goto _119; + goto _120; + goto _121; + goto _123; + goto _124; + goto _150; + goto _144; + goto _149; + goto _145; + goto _146; + goto _147; + goto _148; + goto _151; + goto _164; + goto _163; + goto _165; + goto _166; + goto _167; + goto _168; + goto _193; + goto _187; + goto _192; + goto _188; + goto _189; + goto _190; + goto _191; + goto _194; + goto _195; + goto _211; + goto _210; + goto _212; + goto _213; + goto _214; + goto _215; + goto _216; + goto _217; + goto _218; + goto _219; + goto _220; + goto _221; + goto _222; + goto _223; + goto _224; + goto _225; + goto _226; + goto _227; + goto _228; + goto _229; + goto _230; + goto _231; + goto _232; + goto _233; + goto _234; + goto _235; + goto _236; + goto _237; + goto _238; + goto _239; + goto _240; + goto _241; + goto _242; + goto _243; + goto _244; + goto _245; + goto _246; + goto _247; + goto _248; + goto _249; + goto _250; + goto _251; + goto _252; + goto _253; + goto _254; + goto _255; + goto _256; + goto _257; + goto _258; + goto _259; + goto _260; + goto _261; + goto _262; + goto _263; + goto _264; + goto _265; + goto _266; + goto _267; + goto _268; + goto _269; + goto _270; + goto _271; + goto _272; + goto _273; + goto _274; + goto _275; + goto _276; + goto _277; + goto _278; + goto _279; + goto _280; + goto _281; + goto _282; + goto _283; + goto _284; + goto _285; + goto _286; + goto _287; + goto _288; + goto _289; + goto _290; + goto _291; + goto _292; + goto _293; + goto _294; + goto _295; + goto _296; + goto _297; + goto _298; + goto _299; + goto _300; + goto _301; + goto _302; + goto _303; + goto _304; + goto _305; + goto _306; + goto _307; + goto _308; + goto _309; + goto _310; + goto _311; + goto _312; + goto _313; + goto _314; + goto _315; + goto _316; + goto _317; + goto _318; + goto _319; + goto _320; + goto _321; +} +# ifndef QUEX_OPTION_COMPUTED_GOTOS + __quex_assert_no_passage(); +_2065: + switch( target_state_index ) { + case 115: { goto _115;} + case 116: { goto _116;} + case 125: { goto _125;} + case 135: { goto _135;} + case 142: { goto _142;} + case 160: { goto _160;} + case 178: { goto _178;} + case 185: { goto _185;} + case 207: { goto _207;} + case 672: { goto _672;} + case 673: { goto _673;} + case 674: { goto _674;} + case 679: { goto _679;} + case 680: { goto _680;} + case 681: { goto _681;} + case 682: { goto _682;} + case 683: { goto _683;} + case 687: { goto _687;} + case 688: { goto _688;} + case 689: { goto _689;} + case 690: { goto _690;} + case 691: { goto _691;} + case 692: { goto _692;} + case 694: { goto _694;} + case 697: { goto _697;} + case 699: { goto _699;} + case 700: { goto _700;} + case 701: { goto _701;} + case 702: { goto _702;} + case 703: { goto _703;} + case 705: { goto _705;} + case 706: { goto _706;} + case 709: { goto _709;} + case 713: { goto _713;} + case 714: { goto _714;} + case 717: { goto _717;} + case 720: { goto _720;} + case 721: { goto _721;} + case 728: { goto _728;} + case 729: { goto _729;} + case 730: { goto _730;} + case 732: { goto _732;} + case 737: { goto _737;} + case 738: { goto _738;} + case 739: { goto _739;} + case 740: { goto _740;} + case 741: { goto _741;} + case 742: { goto _742;} + case 748: { goto _748;} + case 749: { goto _749;} + case 750: { goto _750;} + case 751: { goto _751;} + case 752: { goto _752;} + case 756: { goto _756;} + case 757: { goto _757;} + case 758: { goto _758;} + case 759: { goto _759;} + case 760: { goto _760;} + case 761: { goto _761;} + case 762: { goto _762;} + case 763: { goto _763;} + case 764: { goto _764;} + case 765: { goto _765;} + case 767: { goto _767;} + case 768: { goto _768;} + case 769: { goto _769;} + case 770: { goto _770;} + case 771: { goto _771;} + case 772: { goto _772;} + case 776: { goto _776;} + case 779: { goto _779;} + case 780: { goto _780;} + case 781: { goto _781;} + case 782: { goto _782;} + case 783: { goto _783;} + case 784: { goto _784;} + case 785: { goto _785;} + case 786: { goto _786;} + case 787: { goto _787;} + case 788: { goto _788;} + case 789: { goto _789;} + case 790: { goto _790;} + case 791: { goto _791;} + case 793: { goto _793;} + case 795: { goto _795;} + case 797: { goto _797;} + case 799: { goto _799;} + case 801: { goto _801;} + case 803: { goto _803;} + case 805: { goto _805;} + case 807: { goto _807;} + case 809: { goto _809;} + case 811: { goto _811;} + case 813: { goto _813;} + case 815: { goto _815;} + case 817: { goto _817;} + case 819: { goto _819;} + case 821: { goto _821;} + case 823: { goto _823;} + case 825: { goto _825;} + case 827: { goto _827;} + case 829: { goto _829;} + case 831: { goto _831;} + case 833: { goto _833;} + case 835: { goto _835;} + case 837: { goto _837;} + case 839: { goto _839;} + case 841: { goto _841;} + case 843: { goto _843;} + case 845: { goto _845;} + case 847: { goto _847;} + case 849: { goto _849;} + case 851: { goto _851;} + case 853: { goto _853;} + case 855: { goto _855;} + case 857: { goto _857;} + case 859: { goto _859;} + case 861: { goto _861;} + case 863: { goto _863;} + case 865: { goto _865;} + case 867: { goto _867;} + case 869: { goto _869;} + case 871: { goto _871;} + case 873: { goto _873;} + case 875: { goto _875;} + case 877: { goto _877;} + case 879: { goto _879;} + case 881: { goto _881;} + case 883: { goto _883;} + case 885: { goto _885;} + case 887: { goto _887;} + case 889: { goto _889;} + case 891: { goto _891;} + case 893: { goto _893;} + case 895: { goto _895;} + case 897: { goto _897;} + case 899: { goto _899;} + case 901: { goto _901;} + case 903: { goto _903;} + case 905: { goto _905;} + case 907: { goto _907;} + case 909: { goto _909;} + case 911: { goto _911;} + case 913: { goto _913;} + case 915: { goto _915;} + case 917: { goto _917;} + case 919: { goto _919;} + case 921: { goto _921;} + case 923: { goto _923;} + case 925: { goto _925;} + case 927: { goto _927;} + case 929: { goto _929;} + case 931: { goto _931;} + case 933: { goto _933;} + case 935: { goto _935;} + case 937: { goto _937;} + case 939: { goto _939;} + case 941: { goto _941;} + case 943: { goto _943;} + case 945: { goto _945;} + case 947: { goto _947;} + case 949: { goto _949;} + case 951: { goto _951;} + case 953: { goto _953;} + case 955: { goto _955;} + case 957: { goto _957;} + case 959: { goto _959;} + case 961: { goto _961;} + case 963: { goto _963;} + case 965: { goto _965;} + case 967: { goto _967;} + case 969: { goto _969;} + case 971: { goto _971;} + case 973: { goto _973;} + case 975: { goto _975;} + case 977: { goto _977;} + case 979: { goto _979;} + case 981: { goto _981;} + case 983: { goto _983;} + case 985: { goto _985;} + case 987: { goto _987;} + case 989: { goto _989;} + case 991: { goto _991;} + case 993: { goto _993;} + case 995: { goto _995;} + case 997: { goto _997;} + case 999: { goto _999;} + case 1001: { goto _1001;} + case 1003: { goto _1003;} + case 1005: { goto _1005;} + case 1007: { goto _1007;} + case 1009: { goto _1009;} + case 1011: { goto _1011;} + case 1013: { goto _1013;} + case 1015: { goto _1015;} + case 1017: { goto _1017;} + case 1019: { goto _1019;} + case 1021: { goto _1021;} + case 1023: { goto _1023;} + case 1025: { goto _1025;} + case 1027: { goto _1027;} + case 1029: { goto _1029;} + case 1031: { goto _1031;} + case 1033: { goto _1033;} + case 1035: { goto _1035;} + case 1037: { goto _1037;} + case 1039: { goto _1039;} + case 1041: { goto _1041;} + case 1043: { goto _1043;} + case 1045: { goto _1045;} + case 1047: { goto _1047;} + case 1049: { goto _1049;} + case 1051: { goto _1051;} + case 1053: { goto _1053;} + case 1055: { goto _1055;} + case 1057: { goto _1057;} + case 1059: { goto _1059;} + case 1061: { goto _1061;} + case 1063: { goto _1063;} + case 1065: { goto _1065;} + case 1067: { goto _1067;} + case 1069: { goto _1069;} + case 1071: { goto _1071;} + case 1073: { goto _1073;} + case 1075: { goto _1075;} + case 1077: { goto _1077;} + case 1079: { goto _1079;} + case 1081: { goto _1081;} + case 1083: { goto _1083;} + case 1085: { goto _1085;} + case 1087: { goto _1087;} + case 1089: { goto _1089;} + case 1091: { goto _1091;} + case 1093: { goto _1093;} + case 1095: { goto _1095;} + case 1097: { goto _1097;} + case 1099: { goto _1099;} + case 1101: { goto _1101;} + case 1103: { goto _1103;} + case 1105: { goto _1105;} + case 1107: { goto _1107;} + case 1109: { goto _1109;} + case 1111: { goto _1111;} + case 1113: { goto _1113;} + case 1115: { goto _1115;} + case 1117: { goto _1117;} + case 1119: { goto _1119;} + case 1121: { goto _1121;} + case 1123: { goto _1123;} + case 1125: { goto _1125;} + case 1127: { goto _1127;} + case 1129: { goto _1129;} + case 1131: { goto _1131;} + case 1133: { goto _1133;} + case 1135: { goto _1135;} + case 1137: { goto _1137;} + case 1139: { goto _1139;} + case 1141: { goto _1141;} + case 1143: { goto _1143;} + case 1145: { goto _1145;} + case 1147: { goto _1147;} + case 1149: { goto _1149;} + case 1151: { goto _1151;} + case 1153: { goto _1153;} + case 1155: { goto _1155;} + case 1157: { goto _1157;} + case 1159: { goto _1159;} + case 1161: { goto _1161;} + case 1163: { goto _1163;} + case 1165: { goto _1165;} + case 1167: { goto _1167;} + case 1169: { goto _1169;} + case 1171: { goto _1171;} + case 1173: { goto _1173;} + case 1175: { goto _1175;} + case 1177: { goto _1177;} + case 1179: { goto _1179;} + case 1181: { goto _1181;} + case 1183: { goto _1183;} + case 1185: { goto _1185;} + case 1187: { goto _1187;} + case 1189: { goto _1189;} + case 1191: { goto _1191;} + case 1193: { goto _1193;} + case 1195: { goto _1195;} + case 1197: { goto _1197;} + case 1199: { goto _1199;} + case 1201: { goto _1201;} + case 1203: { goto _1203;} + case 1205: { goto _1205;} + case 1207: { goto _1207;} + case 1209: { goto _1209;} + case 1211: { goto _1211;} + case 1213: { goto _1213;} + case 1215: { goto _1215;} + case 1217: { goto _1217;} + case 1219: { goto _1219;} + case 1221: { goto _1221;} + case 1223: { goto _1223;} + case 1225: { goto _1225;} + case 1227: { goto _1227;} + case 1229: { goto _1229;} + case 1231: { goto _1231;} + case 1233: { goto _1233;} + case 1235: { goto _1235;} + case 1237: { goto _1237;} + case 1239: { goto _1239;} + case 1241: { goto _1241;} + case 1243: { goto _1243;} + case 1245: { goto _1245;} + case 1247: { goto _1247;} + case 1249: { goto _1249;} + case 1251: { goto _1251;} + case 1253: { goto _1253;} + case 1255: { goto _1255;} + case 1257: { goto _1257;} + case 1259: { goto _1259;} + case 1261: { goto _1261;} + case 1263: { goto _1263;} + case 1265: { goto _1265;} + case 1267: { goto _1267;} + case 1269: { goto _1269;} + case 1271: { goto _1271;} + case 1273: { goto _1273;} + case 1275: { goto _1275;} + case 1277: { goto _1277;} + case 1279: { goto _1279;} + case 1281: { goto _1281;} + case 1283: { goto _1283;} + case 1285: { goto _1285;} + case 1287: { goto _1287;} + case 1289: { goto _1289;} + case 1291: { goto _1291;} + case 1293: { goto _1293;} + case 1295: { goto _1295;} + case 1297: { goto _1297;} + case 1299: { goto _1299;} + case 1301: { goto _1301;} + case 1303: { goto _1303;} + case 1305: { goto _1305;} + case 1307: { goto _1307;} + case 1309: { goto _1309;} + case 1311: { goto _1311;} + case 1313: { goto _1313;} + case 1315: { goto _1315;} + case 1317: { goto _1317;} + case 1319: { goto _1319;} + case 1321: { goto _1321;} + case 1323: { goto _1323;} + case 1325: { goto _1325;} + case 1327: { goto _1327;} + case 1329: { goto _1329;} + case 1331: { goto _1331;} + case 1333: { goto _1333;} + case 1335: { goto _1335;} + case 1337: { goto _1337;} + case 1339: { goto _1339;} + case 1341: { goto _1341;} + case 1343: { goto _1343;} + case 1345: { goto _1345;} + case 1347: { goto _1347;} + case 1349: { goto _1349;} + case 1351: { goto _1351;} + case 1353: { goto _1353;} + case 1355: { goto _1355;} + case 1357: { goto _1357;} + case 1359: { goto _1359;} + case 1361: { goto _1361;} + case 1363: { goto _1363;} + case 1365: { goto _1365;} + case 1367: { goto _1367;} + case 1369: { goto _1369;} + + default: + __QUEX_STD_fprintf(stderr, "State router: index = %i\n", (int)target_state_index); + QUEX_ERROR_EXIT("State router: unknown index.\n"); + } +# endif /* QUEX_OPTION_COMPUTED_GOTOS */ + + + __quex_assert_no_passage(); +_117: + /* (RELOAD_FORWARD from 1956) */ + target_state_index = QUEX_LABEL(115); target_state_else_index = QUEX_LABEL(116); + +_2063: + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + +__QUEX_IF_COUNT_COLUMNS_ADD((size_t)(((me->buffer._read_p) - count_reference_p))); + +_2061: + + __quex_debug3("RELOAD_FORWARD: success->%i; failure->%i", + (int)target_state_index, (int)target_state_else_index); + __quex_assert(*(me->buffer._read_p) == QUEX_SETTING_BUFFER_LIMIT_CODE); + + __quex_debug_reload_before(); + load_result = QUEX_NAME(Buffer_load_forward)(&me->buffer, (QUEX_TYPE_LEXATOM**)position, PositionRegisterN); + __quex_debug_reload_after(load_result); + + switch( load_result ) { + case E_LoadResult_DONE: QUEX_GOTO_STATE(target_state_index); + case E_LoadResult_BAD_LEXATOM: goto _323; + case E_LoadResult_FAILURE: goto _324; + case E_LoadResult_NO_SPACE_FOR_LOAD: goto _325; + case E_LoadResult_NO_MORE_DATA: QUEX_GOTO_STATE(target_state_else_index); + default: __quex_assert(false); + } + + + __quex_assert_no_passage(); +_1222: + /* (RELOAD_FORWARD from 3485) */ + target_state_index = QUEX_LABEL(1221); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1162: + /* (RELOAD_FORWARD from 3786) */ + target_state_index = QUEX_LABEL(1161); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1296: + /* (RELOAD_FORWARD from 3533) */ + target_state_index = QUEX_LABEL(1295); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_908: + /* (RELOAD_FORWARD from 3653) */ + target_state_index = QUEX_LABEL(907); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_984: + /* (RELOAD_FORWARD from 3691) */ + target_state_index = QUEX_LABEL(983); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1014: + /* (RELOAD_FORWARD from 3706) */ + target_state_index = QUEX_LABEL(1013); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1188: + /* (RELOAD_FORWARD from 3460) */ + target_state_index = QUEX_LABEL(1187); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1242: + /* (RELOAD_FORWARD from 3499) */ + target_state_index = QUEX_LABEL(1241); target_state_else_index = QUEX_LABEL(700); + + goto _2061; + + + __quex_assert_no_passage(); +_1102: + /* (RELOAD_FORWARD from 3756) */ + target_state_index = QUEX_LABEL(1101); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1090: + /* (RELOAD_FORWARD from 3745) */ + target_state_index = QUEX_LABEL(1089); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_916: + /* (RELOAD_FORWARD from 3657) */ + target_state_index = QUEX_LABEL(915); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_926: + /* (RELOAD_FORWARD from 3662) */ + target_state_index = QUEX_LABEL(925); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1196: + /* (RELOAD_FORWARD from 3468) */ + target_state_index = QUEX_LABEL(1195); target_state_else_index = QUEX_LABEL(680); + + goto _2061; + + + __quex_assert_no_passage(); +_824: + /* (RELOAD_FORWARD from 3603) */ + target_state_index = QUEX_LABEL(823); target_state_else_index = QUEX_LABEL(739); + + goto _2061; + + + __quex_assert_no_passage(); +_1210: + /* (RELOAD_FORWARD from 3477) */ + target_state_index = QUEX_LABEL(1209); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1248: + /* (RELOAD_FORWARD from 3502) */ + target_state_index = QUEX_LABEL(1247); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_878: + /* (RELOAD_FORWARD from 3635) */ + target_state_index = QUEX_LABEL(877); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_828: + /* (RELOAD_FORWARD from 3605) */ + target_state_index = QUEX_LABEL(827); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1250: + /* (RELOAD_FORWARD from 3503) */ + target_state_index = QUEX_LABEL(1249); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_968: + /* (RELOAD_FORWARD from 3683) */ + target_state_index = QUEX_LABEL(967); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1158: + /* (RELOAD_FORWARD from 3784) */ + target_state_index = QUEX_LABEL(1157); target_state_else_index = QUEX_LABEL(788); + + goto _2061; + + + __quex_assert_no_passage(); +_1140: + /* (RELOAD_FORWARD from 3775) */ + target_state_index = QUEX_LABEL(1139); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1354: + /* (RELOAD_FORWARD from 3573) */ + target_state_index = QUEX_LABEL(1353); target_state_else_index = QUEX_LABEL(729); + + goto _2061; + + + __quex_assert_no_passage(); +_1278: + /* (RELOAD_FORWARD from 3518) */ + target_state_index = QUEX_LABEL(1277); target_state_else_index = QUEX_LABEL(705); + + goto _2061; + + + __quex_assert_no_passage(); +_1356: + /* (RELOAD_FORWARD from 3574) */ + target_state_index = QUEX_LABEL(1355); target_state_else_index = QUEX_LABEL(730); + + goto _2061; + + + __quex_assert_no_passage(); +_978: + /* (RELOAD_FORWARD from 3688) */ + target_state_index = QUEX_LABEL(977); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1078: + /* (RELOAD_FORWARD from 3739) */ + target_state_index = QUEX_LABEL(1077); target_state_else_index = QUEX_LABEL(770); + + goto _2061; + + + __quex_assert_no_passage(); +_996: + /* (RELOAD_FORWARD from 3697) */ + target_state_index = QUEX_LABEL(995); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1294: + /* (RELOAD_FORWARD from 3532) */ + target_state_index = QUEX_LABEL(1293); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1180: + /* (RELOAD_FORWARD from 3456) */ + target_state_index = QUEX_LABEL(1179); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1026: + /* (RELOAD_FORWARD from 3712) */ + target_state_index = QUEX_LABEL(1025); target_state_else_index = QUEX_LABEL(764); + + goto _2061; + + + __quex_assert_no_passage(); +_1256: + /* (RELOAD_FORWARD from 3506) */ + target_state_index = QUEX_LABEL(1255); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1190: + /* (RELOAD_FORWARD from 3461) */ + target_state_index = QUEX_LABEL(1189); target_state_else_index = QUEX_LABEL(674); + + goto _2061; + + + __quex_assert_no_passage(); +_852: + /* (RELOAD_FORWARD from 3622) */ + target_state_index = QUEX_LABEL(851); target_state_else_index = QUEX_LABEL(748); + + goto _2061; + + + __quex_assert_no_passage(); +_1130: + /* (RELOAD_FORWARD from 3770) */ + target_state_index = QUEX_LABEL(1129); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1328: + /* (RELOAD_FORWARD from 3555) */ + target_state_index = QUEX_LABEL(1327); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_862: + /* (RELOAD_FORWARD from 3627) */ + target_state_index = QUEX_LABEL(861); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1004: + /* (RELOAD_FORWARD from 3701) */ + target_state_index = QUEX_LABEL(1003); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_946: + /* (RELOAD_FORWARD from 3672) */ + target_state_index = QUEX_LABEL(945); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1144: + /* (RELOAD_FORWARD from 3777) */ + target_state_index = QUEX_LABEL(1143); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1018: + /* (RELOAD_FORWARD from 3708) */ + target_state_index = QUEX_LABEL(1017); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1198: + /* (RELOAD_FORWARD from 3469) */ + target_state_index = QUEX_LABEL(1197); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1058: + /* (RELOAD_FORWARD from 3729) */ + target_state_index = QUEX_LABEL(1057); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1094: + /* (RELOAD_FORWARD from 3750) */ + target_state_index = QUEX_LABEL(1093); target_state_else_index = QUEX_LABEL(776); + + goto _2061; + + + __quex_assert_no_passage(); +_1342: + /* (RELOAD_FORWARD from 3566) */ + target_state_index = QUEX_LABEL(1341); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1170: + /* (RELOAD_FORWARD from 3790) */ + target_state_index = QUEX_LABEL(1169); target_state_else_index = QUEX_LABEL(789); + + goto _2061; + + + __quex_assert_no_passage(); +_856: + /* (RELOAD_FORWARD from 3624) */ + target_state_index = QUEX_LABEL(855); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_886: + /* (RELOAD_FORWARD from 3639) */ + target_state_index = QUEX_LABEL(885); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_804: + /* (RELOAD_FORWARD from 3592) */ + target_state_index = QUEX_LABEL(803); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1114: + /* (RELOAD_FORWARD from 3762) */ + target_state_index = QUEX_LABEL(1113); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_960: + /* (RELOAD_FORWARD from 3679) */ + target_state_index = QUEX_LABEL(959); target_state_else_index = QUEX_LABEL(760); + + goto _2061; + + + __quex_assert_no_passage(); +_1116: + /* (RELOAD_FORWARD from 3763) */ + target_state_index = QUEX_LABEL(1115); target_state_else_index = QUEX_LABEL(781); + + goto _2061; + + + __quex_assert_no_passage(); +_962: + /* (RELOAD_FORWARD from 3680) */ + target_state_index = QUEX_LABEL(961); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1320: + /* (RELOAD_FORWARD from 3551) */ + target_state_index = QUEX_LABEL(1319); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1044: + /* (RELOAD_FORWARD from 3722) */ + target_state_index = QUEX_LABEL(1043); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_880: + /* (RELOAD_FORWARD from 3636) */ + target_state_index = QUEX_LABEL(879); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1054: + /* (RELOAD_FORWARD from 3727) */ + target_state_index = QUEX_LABEL(1053); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1324: + /* (RELOAD_FORWARD from 3553) */ + target_state_index = QUEX_LABEL(1323); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_826: + /* (RELOAD_FORWARD from 3604) */ + target_state_index = QUEX_LABEL(825); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_956: + /* (RELOAD_FORWARD from 3677) */ + target_state_index = QUEX_LABEL(955); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_840: + /* (RELOAD_FORWARD from 3611) */ + target_state_index = QUEX_LABEL(839); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1286: + /* (RELOAD_FORWARD from 3525) */ + target_state_index = QUEX_LABEL(1285); target_state_else_index = QUEX_LABEL(709); + + goto _2061; + + + __quex_assert_no_passage(); +_1226: + /* (RELOAD_FORWARD from 3487) */ + target_state_index = QUEX_LABEL(1225); target_state_else_index = QUEX_LABEL(690); + + goto _2061; + + + __quex_assert_no_passage(); +_1150: + /* (RELOAD_FORWARD from 3780) */ + target_state_index = QUEX_LABEL(1149); target_state_else_index = QUEX_LABEL(787); + + goto _2061; + + + __quex_assert_no_passage(); +_850: + /* (RELOAD_FORWARD from 3621) */ + target_state_index = QUEX_LABEL(849); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1304: + /* (RELOAD_FORWARD from 3539) */ + target_state_index = QUEX_LABEL(1303); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_910: + /* (RELOAD_FORWARD from 3654) */ + target_state_index = QUEX_LABEL(909); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1308: + /* (RELOAD_FORWARD from 3543) */ + target_state_index = QUEX_LABEL(1307); target_state_else_index = QUEX_LABEL(691); + + goto _2061; + + + __quex_assert_no_passage(); +_1318: + /* (RELOAD_FORWARD from 3550) */ + target_state_index = QUEX_LABEL(1317); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1200: + /* (RELOAD_FORWARD from 3470) */ + target_state_index = QUEX_LABEL(1199); target_state_else_index = QUEX_LABEL(681); + + goto _2061; + + + __quex_assert_no_passage(); +_876: + /* (RELOAD_FORWARD from 3634) */ + target_state_index = QUEX_LABEL(875); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1016: + /* (RELOAD_FORWARD from 3707) */ + target_state_index = QUEX_LABEL(1015); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_918: + /* (RELOAD_FORWARD from 3658) */ + target_state_index = QUEX_LABEL(917); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_928: + /* (RELOAD_FORWARD from 3663) */ + target_state_index = QUEX_LABEL(927); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_814: + /* (RELOAD_FORWARD from 3598) */ + target_state_index = QUEX_LABEL(813); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1032: + /* (RELOAD_FORWARD from 3715) */ + target_state_index = QUEX_LABEL(1031); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1332: + /* (RELOAD_FORWARD from 3558) */ + target_state_index = QUEX_LABEL(1331); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1040: + /* (RELOAD_FORWARD from 3720) */ + target_state_index = QUEX_LABEL(1039); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_958: + /* (RELOAD_FORWARD from 3678) */ + target_state_index = QUEX_LABEL(957); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1164: + /* (RELOAD_FORWARD from 3787) */ + target_state_index = QUEX_LABEL(1163); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1298: + /* (RELOAD_FORWARD from 3534) */ + target_state_index = QUEX_LABEL(1297); target_state_else_index = QUEX_LABEL(713); + + goto _2061; + + + __quex_assert_no_passage(); +_1240: + /* (RELOAD_FORWARD from 3498) */ + target_state_index = QUEX_LABEL(1239); target_state_else_index = QUEX_LABEL(699); + + goto _2061; + + + __quex_assert_no_passage(); +_1270: + /* (RELOAD_FORWARD from 3513) */ + target_state_index = QUEX_LABEL(1269); target_state_else_index = QUEX_LABEL(703); + + goto _2061; + + + __quex_assert_no_passage(); +_1344: + /* (RELOAD_FORWARD from 3567) */ + target_state_index = QUEX_LABEL(1343); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_846: + /* (RELOAD_FORWARD from 3614) */ + target_state_index = QUEX_LABEL(845); target_state_else_index = QUEX_LABEL(742); + + goto _2061; + + + __quex_assert_no_passage(); +_988: + /* (RELOAD_FORWARD from 3693) */ + target_state_index = QUEX_LABEL(987); target_state_else_index = QUEX_LABEL(762); + + goto _2061; + + + __quex_assert_no_passage(); +_834: + /* (RELOAD_FORWARD from 3608) */ + target_state_index = QUEX_LABEL(833); target_state_else_index = QUEX_LABEL(740); + + goto _2061; + + + __quex_assert_no_passage(); +_936: + /* (RELOAD_FORWARD from 3667) */ + target_state_index = QUEX_LABEL(935); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1126: + /* (RELOAD_FORWARD from 3768) */ + target_state_index = QUEX_LABEL(1125); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1172: + /* (RELOAD_FORWARD from 3791) */ + target_state_index = QUEX_LABEL(1171); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1322: + /* (RELOAD_FORWARD from 3552) */ + target_state_index = QUEX_LABEL(1321); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1182: + /* (RELOAD_FORWARD from 3457) */ + target_state_index = QUEX_LABEL(1181); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1138: + /* (RELOAD_FORWARD from 3774) */ + target_state_index = QUEX_LABEL(1137); target_state_else_index = QUEX_LABEL(785); + + goto _2061; + + + __quex_assert_no_passage(); +_1366: + /* (RELOAD_FORWARD from 3581) */ + target_state_index = QUEX_LABEL(1365); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_964: + /* (RELOAD_FORWARD from 3681) */ + target_state_index = QUEX_LABEL(963); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1224: + /* (RELOAD_FORWARD from 3486) */ + target_state_index = QUEX_LABEL(1223); target_state_else_index = QUEX_LABEL(689); + + goto _2061; + + + __quex_assert_no_passage(); +_884: + /* (RELOAD_FORWARD from 3638) */ + target_state_index = QUEX_LABEL(883); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1098: + /* (RELOAD_FORWARD from 3754) */ + target_state_index = QUEX_LABEL(1097); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_976: + /* (RELOAD_FORWARD from 3687) */ + target_state_index = QUEX_LABEL(975); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1100: + /* (RELOAD_FORWARD from 3755) */ + target_state_index = QUEX_LABEL(1099); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1234: + /* (RELOAD_FORWARD from 3492) */ + target_state_index = QUEX_LABEL(1233); target_state_else_index = QUEX_LABEL(694); + + goto _2061; + + + __quex_assert_no_passage(); +_920: + /* (RELOAD_FORWARD from 3659) */ + target_state_index = QUEX_LABEL(919); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_822: + /* (RELOAD_FORWARD from 3602) */ + target_state_index = QUEX_LABEL(821); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1252: + /* (RELOAD_FORWARD from 3504) */ + target_state_index = QUEX_LABEL(1251); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1038: + /* (RELOAD_FORWARD from 3718) */ + target_state_index = QUEX_LABEL(1037); target_state_else_index = QUEX_LABEL(765); + + goto _2061; + + + __quex_assert_no_passage(); +_874: + /* (RELOAD_FORWARD from 3633) */ + target_state_index = QUEX_LABEL(873); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1260: + /* (RELOAD_FORWARD from 3508) */ + target_state_index = QUEX_LABEL(1259); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1202: + /* (RELOAD_FORWARD from 3471) */ + target_state_index = QUEX_LABEL(1201); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_888: + /* (RELOAD_FORWARD from 3640) */ + target_state_index = QUEX_LABEL(887); target_state_else_index = QUEX_LABEL(751); + + goto _2061; + + + __quex_assert_no_passage(); +_1274: + /* (RELOAD_FORWARD from 3516) */ + target_state_index = QUEX_LABEL(1273); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1148: + /* (RELOAD_FORWARD from 3779) */ + target_state_index = QUEX_LABEL(1147); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_802: + /* (RELOAD_FORWARD from 3591) */ + target_state_index = QUEX_LABEL(801); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_838: + /* (RELOAD_FORWARD from 3610) */ + target_state_index = QUEX_LABEL(837); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_948: + /* (RELOAD_FORWARD from 3673) */ + target_state_index = QUEX_LABEL(947); target_state_else_index = QUEX_LABEL(759); + + goto _2061; + + + __quex_assert_no_passage(); +_1086: + /* (RELOAD_FORWARD from 3743) */ + target_state_index = QUEX_LABEL(1085); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1292: + /* (RELOAD_FORWARD from 3531) */ + target_state_index = QUEX_LABEL(1291); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_186: + /* (RELOAD_FORWARD from 2086) */ + target_state_index = QUEX_LABEL(185); target_state_else_index = QUEX_LABEL(116); + + goto _2062; + + + __quex_assert_no_passage(); +_858: + /* (RELOAD_FORWARD from 3625) */ + target_state_index = QUEX_LABEL(857); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1216: + /* (RELOAD_FORWARD from 3481) */ + target_state_index = QUEX_LABEL(1215); target_state_else_index = QUEX_LABEL(672); + + goto _2061; + + + __quex_assert_no_passage(); +_860: + /* (RELOAD_FORWARD from 3626) */ + target_state_index = QUEX_LABEL(859); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1218: + /* (RELOAD_FORWARD from 3483) */ + target_state_index = QUEX_LABEL(1217); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1064: + /* (RELOAD_FORWARD from 3732) */ + target_state_index = QUEX_LABEL(1063); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_998: + /* (RELOAD_FORWARD from 3698) */ + target_state_index = QUEX_LABEL(997); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_938: + /* (RELOAD_FORWARD from 3668) */ + target_state_index = QUEX_LABEL(937); target_state_else_index = QUEX_LABEL(757); + + goto _2061; + + + __quex_assert_no_passage(); +_798: + /* (RELOAD_FORWARD from 3588) */ + target_state_index = QUEX_LABEL(797); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1068: + /* (RELOAD_FORWARD from 3734) */ + target_state_index = QUEX_LABEL(1067); target_state_else_index = QUEX_LABEL(769); + + goto _2061; + + + __quex_assert_no_passage(); +_1010: + /* (RELOAD_FORWARD from 3704) */ + target_state_index = QUEX_LABEL(1009); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1348: + /* (RELOAD_FORWARD from 3570) */ + target_state_index = QUEX_LABEL(1347); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1006: + /* (RELOAD_FORWARD from 3702) */ + target_state_index = QUEX_LABEL(1005); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1212: + /* (RELOAD_FORWARD from 3479) */ + target_state_index = QUEX_LABEL(1211); target_state_else_index = QUEX_LABEL(687); + + goto _2061; + + + __quex_assert_no_passage(); +_1030: + /* (RELOAD_FORWARD from 3714) */ + target_state_index = QUEX_LABEL(1029); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1360: + /* (RELOAD_FORWARD from 3577) */ + target_state_index = QUEX_LABEL(1359); target_state_else_index = QUEX_LABEL(732); + + goto _2061; + + + __quex_assert_no_passage(); +_894: + /* (RELOAD_FORWARD from 3646) */ + target_state_index = QUEX_LABEL(893); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_972: + /* (RELOAD_FORWARD from 3685) */ + target_state_index = QUEX_LABEL(971); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1048: + /* (RELOAD_FORWARD from 3724) */ + target_state_index = QUEX_LABEL(1047); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_950: + /* (RELOAD_FORWARD from 3674) */ + target_state_index = QUEX_LABEL(949); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1124: + /* (RELOAD_FORWARD from 3767) */ + target_state_index = QUEX_LABEL(1123); target_state_else_index = QUEX_LABEL(782); + + goto _2061; + + + __quex_assert_no_passage(); +_1306: + /* (RELOAD_FORWARD from 3540) */ + target_state_index = QUEX_LABEL(1305); target_state_else_index = QUEX_LABEL(717); + + goto _2061; + + + __quex_assert_no_passage(); +_1166: + /* (RELOAD_FORWARD from 3788) */ + target_state_index = QUEX_LABEL(1165); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1052: + /* (RELOAD_FORWARD from 3726) */ + target_state_index = QUEX_LABEL(1051); target_state_else_index = QUEX_LABEL(767); + + goto _2061; + + + __quex_assert_no_passage(); +_898: + /* (RELOAD_FORWARD from 3648) */ + target_state_index = QUEX_LABEL(897); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1062: + /* (RELOAD_FORWARD from 3731) */ + target_state_index = QUEX_LABEL(1061); target_state_else_index = QUEX_LABEL(768); + + goto _2061; + + + __quex_assert_no_passage(); +_980: + /* (RELOAD_FORWARD from 3689) */ + target_state_index = QUEX_LABEL(979); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_990: + /* (RELOAD_FORWARD from 3694) */ + target_state_index = QUEX_LABEL(989); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1330: + /* (RELOAD_FORWARD from 3556) */ + target_state_index = QUEX_LABEL(1329); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_136: + /* (RELOAD_FORWARD from 2001) */ + target_state_index = QUEX_LABEL(135); target_state_else_index = QUEX_LABEL(125); + + goto _2063; + + + __quex_assert_no_passage(); +_1174: + /* (RELOAD_FORWARD from 3792) */ + target_state_index = QUEX_LABEL(1173); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1284: + /* (RELOAD_FORWARD from 3524) */ + target_state_index = QUEX_LABEL(1283); target_state_else_index = QUEX_LABEL(699); + + goto _2061; + + + __quex_assert_no_passage(); +_1146: + /* (RELOAD_FORWARD from 3778) */ + target_state_index = QUEX_LABEL(1145); target_state_else_index = QUEX_LABEL(786); + + goto _2061; + + + __quex_assert_no_passage(); +_1184: + /* (RELOAD_FORWARD from 3458) */ + target_state_index = QUEX_LABEL(1183); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1020: + /* (RELOAD_FORWARD from 3709) */ + target_state_index = QUEX_LABEL(1019); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_930: + /* (RELOAD_FORWARD from 3664) */ + target_state_index = QUEX_LABEL(929); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1076: + /* (RELOAD_FORWARD from 3738) */ + target_state_index = QUEX_LABEL(1075); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1214: + /* (RELOAD_FORWARD from 3480) */ + target_state_index = QUEX_LABEL(1213); target_state_else_index = QUEX_LABEL(688); + + goto _2061; + + + __quex_assert_no_passage(); +_1042: + /* (RELOAD_FORWARD from 3721) */ + target_state_index = QUEX_LABEL(1041); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_161: + /* (RELOAD_FORWARD from 2045) */ + target_state_index = QUEX_LABEL(160); target_state_else_index = QUEX_LABEL(125); + + goto _2063; + + + __quex_assert_no_passage(); +_1088: + /* (RELOAD_FORWARD from 3744) */ + target_state_index = QUEX_LABEL(1087); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1244: + /* (RELOAD_FORWARD from 3500) */ + target_state_index = QUEX_LABEL(1243); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1192: + /* (RELOAD_FORWARD from 3462) */ + target_state_index = QUEX_LABEL(1191); target_state_else_index = QUEX_LABEL(672); + + goto _2061; + + + __quex_assert_no_passage(); +_870: + /* (RELOAD_FORWARD from 3631) */ + target_state_index = QUEX_LABEL(869); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1066: + /* (RELOAD_FORWARD from 3733) */ + target_state_index = QUEX_LABEL(1065); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1008: + /* (RELOAD_FORWARD from 3703) */ + target_state_index = QUEX_LABEL(1007); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_882: + /* (RELOAD_FORWARD from 3637) */ + target_state_index = QUEX_LABEL(881); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1336: + /* (RELOAD_FORWARD from 3562) */ + target_state_index = QUEX_LABEL(1335); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1110: + /* (RELOAD_FORWARD from 3760) */ + target_state_index = QUEX_LABEL(1109); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1220: + /* (RELOAD_FORWARD from 3484) */ + target_state_index = QUEX_LABEL(1219); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1340: + /* (RELOAD_FORWARD from 3565) */ + target_state_index = QUEX_LABEL(1339); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_842: + /* (RELOAD_FORWARD from 3612) */ + target_state_index = QUEX_LABEL(841); target_state_else_index = QUEX_LABEL(741); + + goto _2061; + + + __quex_assert_no_passage(); +_1232: + /* (RELOAD_FORWARD from 3490) */ + target_state_index = QUEX_LABEL(1231); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_844: + /* (RELOAD_FORWARD from 3613) */ + target_state_index = QUEX_LABEL(843); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1176: + /* (RELOAD_FORWARD from 3793) */ + target_state_index = QUEX_LABEL(1175); target_state_else_index = QUEX_LABEL(790); + + goto _2061; + + + __quex_assert_no_passage(); +_922: + /* (RELOAD_FORWARD from 3660) */ + target_state_index = QUEX_LABEL(921); target_state_else_index = QUEX_LABEL(756); + + goto _2061; + + + __quex_assert_no_passage(); +_1280: + /* (RELOAD_FORWARD from 3519) */ + target_state_index = QUEX_LABEL(1279); target_state_else_index = QUEX_LABEL(706); + + goto _2061; + + + __quex_assert_no_passage(); +_1364: + /* (RELOAD_FORWARD from 3580) */ + target_state_index = QUEX_LABEL(1363); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1072: + /* (RELOAD_FORWARD from 3736) */ + target_state_index = QUEX_LABEL(1071); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1302: + /* (RELOAD_FORWARD from 3538) */ + target_state_index = QUEX_LABEL(1301); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_900: + /* (RELOAD_FORWARD from 3649) */ + target_state_index = QUEX_LABEL(899); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1312: + /* (RELOAD_FORWARD from 3546) */ + target_state_index = QUEX_LABEL(1311); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_892: + /* (RELOAD_FORWARD from 3645) */ + target_state_index = QUEX_LABEL(891); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_904: + /* (RELOAD_FORWARD from 3651) */ + target_state_index = QUEX_LABEL(903); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1204: + /* (RELOAD_FORWARD from 3472) */ + target_state_index = QUEX_LABEL(1203); target_state_else_index = QUEX_LABEL(682); + + goto _2061; + + + __quex_assert_no_passage(); +_1290: + /* (RELOAD_FORWARD from 3530) */ + target_state_index = QUEX_LABEL(1289); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_912: + /* (RELOAD_FORWARD from 3655) */ + target_state_index = QUEX_LABEL(911); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_830: + /* (RELOAD_FORWARD from 3606) */ + target_state_index = QUEX_LABEL(829); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1036: + /* (RELOAD_FORWARD from 3717) */ + target_state_index = QUEX_LABEL(1035); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1368: + /* (RELOAD_FORWARD from 3582) */ + target_state_index = QUEX_LABEL(1367); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1316: + /* (RELOAD_FORWARD from 3549) */ + target_state_index = QUEX_LABEL(1315); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_974: + /* (RELOAD_FORWARD from 3686) */ + target_state_index = QUEX_LABEL(973); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_808: + /* (RELOAD_FORWARD from 3595) */ + target_state_index = QUEX_LABEL(807); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1254: + /* (RELOAD_FORWARD from 3505) */ + target_state_index = QUEX_LABEL(1253); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1194: + /* (RELOAD_FORWARD from 3467) */ + target_state_index = QUEX_LABEL(1193); target_state_else_index = QUEX_LABEL(679); + + goto _2061; + + + __quex_assert_no_passage(); +_812: + /* (RELOAD_FORWARD from 3597) */ + target_state_index = QUEX_LABEL(811); target_state_else_index = QUEX_LABEL(737); + + goto _2061; + + + __quex_assert_no_passage(); +_1266: + /* (RELOAD_FORWARD from 3511) */ + target_state_index = QUEX_LABEL(1265); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_952: + /* (RELOAD_FORWARD from 3675) */ + target_state_index = QUEX_LABEL(951); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_982: + /* (RELOAD_FORWARD from 3690) */ + target_state_index = QUEX_LABEL(981); target_state_else_index = QUEX_LABEL(761); + + goto _2061; + + + __quex_assert_no_passage(); +_1092: + /* (RELOAD_FORWARD from 3746) */ + target_state_index = QUEX_LABEL(1091); target_state_else_index = QUEX_LABEL(772); + + goto _2061; + + + __quex_assert_no_passage(); +_1338: + /* (RELOAD_FORWARD from 3563) */ + target_state_index = QUEX_LABEL(1337); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1120: + /* (RELOAD_FORWARD from 3765) */ + target_state_index = QUEX_LABEL(1119); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1262: + /* (RELOAD_FORWARD from 3509) */ + target_state_index = QUEX_LABEL(1261); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1122: + /* (RELOAD_FORWARD from 3766) */ + target_state_index = QUEX_LABEL(1121); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1352: + /* (RELOAD_FORWARD from 3572) */ + target_state_index = QUEX_LABEL(1351); target_state_else_index = QUEX_LABEL(729); + + goto _2061; + + + __quex_assert_no_passage(); +_1012: + /* (RELOAD_FORWARD from 3705) */ + target_state_index = QUEX_LABEL(1011); target_state_else_index = QUEX_LABEL(763); + + goto _2061; + + + __quex_assert_no_passage(); +_800: + /* (RELOAD_FORWARD from 3590) */ + target_state_index = QUEX_LABEL(799); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1228: + /* (RELOAD_FORWARD from 3488) */ + target_state_index = QUEX_LABEL(1227); target_state_else_index = QUEX_LABEL(691); + + goto _2061; + + + __quex_assert_no_passage(); +_1362: + /* (RELOAD_FORWARD from 3579) */ + target_state_index = QUEX_LABEL(1361); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_792: + /* (RELOAD_FORWARD from 3584) */ + target_state_index = QUEX_LABEL(791); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1206: + /* (RELOAD_FORWARD from 3473) */ + target_state_index = QUEX_LABEL(1205); target_state_else_index = QUEX_LABEL(683); + + goto _2061; + + + __quex_assert_no_passage(); +_868: + /* (RELOAD_FORWARD from 3630) */ + target_state_index = QUEX_LABEL(867); target_state_else_index = QUEX_LABEL(749); + + goto _2061; + + + __quex_assert_no_passage(); +_1050: + /* (RELOAD_FORWARD from 3725) */ + target_state_index = QUEX_LABEL(1049); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_896: + /* (RELOAD_FORWARD from 3647) */ + target_state_index = QUEX_LABEL(895); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_796: + /* (RELOAD_FORWARD from 3586) */ + target_state_index = QUEX_LABEL(795); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1154: + /* (RELOAD_FORWARD from 3782) */ + target_state_index = QUEX_LABEL(1153); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1128: + /* (RELOAD_FORWARD from 3769) */ + target_state_index = QUEX_LABEL(1127); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_806: + /* (RELOAD_FORWARD from 3593) */ + target_state_index = QUEX_LABEL(805); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1236: + /* (RELOAD_FORWARD from 3493) */ + target_state_index = QUEX_LABEL(1235); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1002: + /* (RELOAD_FORWARD from 3700) */ + target_state_index = QUEX_LABEL(1001); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1246: + /* (RELOAD_FORWARD from 3501) */ + target_state_index = QUEX_LABEL(1245); target_state_else_index = QUEX_LABEL(701); + + goto _2061; + + + __quex_assert_no_passage(); +_1074: + /* (RELOAD_FORWARD from 3737) */ + target_state_index = QUEX_LABEL(1073); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1028: + /* (RELOAD_FORWARD from 3713) */ + target_state_index = QUEX_LABEL(1027); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_890: + /* (RELOAD_FORWARD from 3641) */ + target_state_index = QUEX_LABEL(889); target_state_else_index = QUEX_LABEL(752); + + goto _2061; + + + __quex_assert_no_passage(); +_1326: + /* (RELOAD_FORWARD from 3554) */ + target_state_index = QUEX_LABEL(1325); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1276: + /* (RELOAD_FORWARD from 3517) */ + target_state_index = QUEX_LABEL(1275); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1186: + /* (RELOAD_FORWARD from 3459) */ + target_state_index = QUEX_LABEL(1185); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_966: + /* (RELOAD_FORWARD from 3682) */ + target_state_index = QUEX_LABEL(965); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_820: + /* (RELOAD_FORWARD from 3601) */ + target_state_index = QUEX_LABEL(819); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_906: + /* (RELOAD_FORWARD from 3652) */ + target_state_index = QUEX_LABEL(905); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_208: + /* (RELOAD_FORWARD from 2121) */ + target_state_index = QUEX_LABEL(207); target_state_else_index = QUEX_LABEL(116); + + goto _2063; + + + __quex_assert_no_passage(); +_932: + /* (RELOAD_FORWARD from 3665) */ + target_state_index = QUEX_LABEL(931); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_986: + /* (RELOAD_FORWARD from 3692) */ + target_state_index = QUEX_LABEL(985); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_832: + /* (RELOAD_FORWARD from 3607) */ + target_state_index = QUEX_LABEL(831); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1358: + /* (RELOAD_FORWARD from 3576) */ + target_state_index = QUEX_LABEL(1357); target_state_else_index = QUEX_LABEL(730); + + goto _2061; + + + __quex_assert_no_passage(); +_1346: + /* (RELOAD_FORWARD from 3568) */ + target_state_index = QUEX_LABEL(1345); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_810: + /* (RELOAD_FORWARD from 3596) */ + target_state_index = QUEX_LABEL(809); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1264: + /* (RELOAD_FORWARD from 3510) */ + target_state_index = QUEX_LABEL(1263); target_state_else_index = QUEX_LABEL(702); + + goto _2061; + + + __quex_assert_no_passage(); +_940: + /* (RELOAD_FORWARD from 3669) */ + target_state_index = QUEX_LABEL(939); target_state_else_index = QUEX_LABEL(758); + + goto _2061; + + + __quex_assert_no_passage(); +_1080: + /* (RELOAD_FORWARD from 3740) */ + target_state_index = QUEX_LABEL(1079); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_854: + /* (RELOAD_FORWARD from 3623) */ + target_state_index = QUEX_LABEL(853); target_state_else_index = QUEX_LABEL(748); + + goto _2061; + + + __quex_assert_no_passage(); +_954: + /* (RELOAD_FORWARD from 3676) */ + target_state_index = QUEX_LABEL(953); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_992: + /* (RELOAD_FORWARD from 3695) */ + target_state_index = QUEX_LABEL(991); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1134: + /* (RELOAD_FORWARD from 3772) */ + target_state_index = QUEX_LABEL(1133); target_state_else_index = QUEX_LABEL(784); + + goto _2061; + + + __quex_assert_no_passage(); +_1084: + /* (RELOAD_FORWARD from 3742) */ + target_state_index = QUEX_LABEL(1083); target_state_else_index = QUEX_LABEL(771); + + goto _2061; + + + __quex_assert_no_passage(); +_994: + /* (RELOAD_FORWARD from 3696) */ + target_state_index = QUEX_LABEL(993); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_902: + /* (RELOAD_FORWARD from 3650) */ + target_state_index = QUEX_LABEL(901); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1022: + /* (RELOAD_FORWARD from 3710) */ + target_state_index = QUEX_LABEL(1021); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1104: + /* (RELOAD_FORWARD from 3757) */ + target_state_index = QUEX_LABEL(1103); target_state_else_index = QUEX_LABEL(779); + + goto _2061; + + + __quex_assert_no_passage(); +_1334: + /* (RELOAD_FORWARD from 3559) */ + target_state_index = QUEX_LABEL(1333); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1178: + /* (RELOAD_FORWARD from 3455) */ + target_state_index = QUEX_LABEL(1177); target_state_else_index = QUEX_LABEL(116); + + goto _2061; + + + __quex_assert_no_passage(); +_1024: + /* (RELOAD_FORWARD from 3711) */ + target_state_index = QUEX_LABEL(1023); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_924: + /* (RELOAD_FORWARD from 3661) */ + target_state_index = QUEX_LABEL(923); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1282: + /* (RELOAD_FORWARD from 3523) */ + target_state_index = QUEX_LABEL(1281); target_state_else_index = QUEX_LABEL(699); + + goto _2061; + + + __quex_assert_no_passage(); +_1000: + /* (RELOAD_FORWARD from 3699) */ + target_state_index = QUEX_LABEL(999); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_934: + /* (RELOAD_FORWARD from 3666) */ + target_state_index = QUEX_LABEL(933); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1108: + /* (RELOAD_FORWARD from 3759) */ + target_state_index = QUEX_LABEL(1107); target_state_else_index = QUEX_LABEL(780); + + goto _2061; + + + __quex_assert_no_passage(); +_816: + /* (RELOAD_FORWARD from 3599) */ + target_state_index = QUEX_LABEL(815); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1118: + /* (RELOAD_FORWARD from 3764) */ + target_state_index = QUEX_LABEL(1117); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1046: + /* (RELOAD_FORWARD from 3723) */ + target_state_index = QUEX_LABEL(1045); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1156: + /* (RELOAD_FORWARD from 3783) */ + target_state_index = QUEX_LABEL(1155); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1056: + /* (RELOAD_FORWARD from 3728) */ + target_state_index = QUEX_LABEL(1055); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_942: + /* (RELOAD_FORWARD from 3670) */ + target_state_index = QUEX_LABEL(941); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1314: + /* (RELOAD_FORWARD from 3547) */ + target_state_index = QUEX_LABEL(1313); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1160: + /* (RELOAD_FORWARD from 3785) */ + target_state_index = QUEX_LABEL(1159); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1350: + /* (RELOAD_FORWARD from 3571) */ + target_state_index = QUEX_LABEL(1349); target_state_else_index = QUEX_LABEL(728); + + goto _2061; + + + __quex_assert_no_passage(); +_1034: + /* (RELOAD_FORWARD from 3716) */ + target_state_index = QUEX_LABEL(1033); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1168: + /* (RELOAD_FORWARD from 3789) */ + target_state_index = QUEX_LABEL(1167); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_914: + /* (RELOAD_FORWARD from 3656) */ + target_state_index = QUEX_LABEL(913); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1112: + /* (RELOAD_FORWARD from 3761) */ + target_state_index = QUEX_LABEL(1111); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1142: + /* (RELOAD_FORWARD from 3776) */ + target_state_index = QUEX_LABEL(1141); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1060: + /* (RELOAD_FORWARD from 3730) */ + target_state_index = QUEX_LABEL(1059); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1370: + /* (RELOAD_FORWARD from 3583) */ + target_state_index = QUEX_LABEL(1369); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1272: + /* (RELOAD_FORWARD from 3515) */ + target_state_index = QUEX_LABEL(1271); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1230: + /* (RELOAD_FORWARD from 3489) */ + target_state_index = QUEX_LABEL(1229); target_state_else_index = QUEX_LABEL(692); + + goto _2061; + + + __quex_assert_no_passage(); +_1300: + /* (RELOAD_FORWARD from 3535) */ + target_state_index = QUEX_LABEL(1299); target_state_else_index = QUEX_LABEL(714); + + goto _2061; + + + __quex_assert_no_passage(); +_1136: + /* (RELOAD_FORWARD from 3773) */ + target_state_index = QUEX_LABEL(1135); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1310: + /* (RELOAD_FORWARD from 3545) */ + target_state_index = QUEX_LABEL(1309); target_state_else_index = QUEX_LABEL(720); + + goto _2061; + + + __quex_assert_no_passage(); +_1208: + /* (RELOAD_FORWARD from 3476) */ + target_state_index = QUEX_LABEL(1207); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1238: + /* (RELOAD_FORWARD from 3496) */ + target_state_index = QUEX_LABEL(1237); target_state_else_index = QUEX_LABEL(697); + + goto _2061; + + + __quex_assert_no_passage(); +_836: + /* (RELOAD_FORWARD from 3609) */ + target_state_index = QUEX_LABEL(835); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1082: + /* (RELOAD_FORWARD from 3741) */ + target_state_index = QUEX_LABEL(1081); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_864: + /* (RELOAD_FORWARD from 3628) */ + target_state_index = QUEX_LABEL(863); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_866: + /* (RELOAD_FORWARD from 3629) */ + target_state_index = QUEX_LABEL(865); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1096: + /* (RELOAD_FORWARD from 3753) */ + target_state_index = QUEX_LABEL(1095); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1268: + /* (RELOAD_FORWARD from 3512) */ + target_state_index = QUEX_LABEL(1267); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_970: + /* (RELOAD_FORWARD from 3684) */ + target_state_index = QUEX_LABEL(969); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_848: + /* (RELOAD_FORWARD from 3620) */ + target_state_index = QUEX_LABEL(847); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1106: + /* (RELOAD_FORWARD from 3758) */ + target_state_index = QUEX_LABEL(1105); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_794: + /* (RELOAD_FORWARD from 3585) */ + target_state_index = QUEX_LABEL(793); target_state_else_index = QUEX_LABEL(721); + + goto _2061; + + + __quex_assert_no_passage(); +_1152: + /* (RELOAD_FORWARD from 3781) */ + target_state_index = QUEX_LABEL(1151); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_179: + /* (RELOAD_FORWARD from 2087) */ + target_state_index = QUEX_LABEL(178); target_state_else_index = QUEX_LABEL(125); + + goto _2063; + + + __quex_assert_no_passage(); +_872: + /* (RELOAD_FORWARD from 3632) */ + target_state_index = QUEX_LABEL(871); target_state_else_index = QUEX_LABEL(750); + + goto _2061; + + + __quex_assert_no_passage(); +_1258: + /* (RELOAD_FORWARD from 3507) */ + target_state_index = QUEX_LABEL(1257); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_944: + /* (RELOAD_FORWARD from 3671) */ + target_state_index = QUEX_LABEL(943); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1132: + /* (RELOAD_FORWARD from 3771) */ + target_state_index = QUEX_LABEL(1131); target_state_else_index = QUEX_LABEL(783); + + goto _2061; + + + __quex_assert_no_passage(); +_818: + /* (RELOAD_FORWARD from 3600) */ + target_state_index = QUEX_LABEL(817); target_state_else_index = QUEX_LABEL(738); + + goto _2061; + + + __quex_assert_no_passage(); +_1070: + /* (RELOAD_FORWARD from 3735) */ + target_state_index = QUEX_LABEL(1069); target_state_else_index = QUEX_LABEL(673); + + goto _2061; + + + __quex_assert_no_passage(); +_1288: + /* (RELOAD_FORWARD from 3526) */ + target_state_index = QUEX_LABEL(1287); target_state_else_index = QUEX_LABEL(699); + + goto _2061; + + + __quex_assert_no_passage(); +_143: + /* (RELOAD_FORWARD from 2000) */ + target_state_index = QUEX_LABEL(142); target_state_else_index = QUEX_LABEL(116); + +_2062: + (me->buffer._lexeme_start_p) = (me->buffer._read_p); + + read_p_before_reload = (me->buffer._read_p); + + (me->buffer._lexeme_start_p) = (me->buffer._lexeme_start_p) < loop_restart_p ? (me->buffer._lexeme_start_p) : loop_restart_p; + + goto _2061; + +_322: +/* RETURN -- after executing 'on_after_match' code. */ + __QUEX_PURE_RETURN; + + +_0: +/* CONTINUE -- after executing 'on_after_match' code. */ + +_107: +/* CONTINUE -- without executing 'on_after_match' (e.g. on FAILURE). */ + + +# ifndef __QUEX_OPTION_PLAIN_ANALYZER_OBJECT +# ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + if( QUEX_NAME(TokenQueue_is_full)(&self._token_queue) ) { + return; + } +# else + if( self_token_get_id() != __QUEX_SETTING_TOKEN_ID_UNINITIALIZED) { + return __self_result_token_id; + } +# endif +# endif + + + /* If a mode change happened, then the function must first return and + * indicate that another mode function is to be called. At this point, + * we to force a 'return' on a mode change. + * + * Pseudo Code: if( previous_mode != current_mode ) { + * return 0; + * } + * + * When the analyzer returns, the caller function has to watch if a mode + * change occurred. If not it can call this function again. */ +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) || defined(QUEX_OPTION_ASSERTS) + if( me->DEBUG_analyzer_function_at_entry != me->current_analyzer_function ) +# endif + { +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) + self_token_set_id(__QUEX_SETTING_TOKEN_ID_UNINITIALIZED); + __QUEX_PURE_RETURN; +# elif defined(QUEX_OPTION_ASSERTS) + QUEX_ERROR_EXIT("Mode change without immediate return from the lexical analyzer."); +# endif + } + + +goto _2064; + + __quex_assert_no_passage(); + + /* Following labels are referenced in macros. It cannot be detected + * whether the macros are applied in user code or not. To avoid compiler. + * warnings of unused labels, they are referenced in unreachable code. */ + goto _322; /* in RETURN */ + goto _0; /* in CONTINUE */ + goto _107; /* in CONTINUE and skippers */ +# if ! defined(QUEX_OPTION_COMPUTED_GOTOS) + goto _2065; /* in QUEX_GOTO_STATE */ +# endif + + /* Prevent compiler warning 'unused variable'. */ + (void)QUEX_LEXEME_NULL; + (void)QUEX_NAME_TOKEN(DumpedTokenIdObject); + /* target_state_index and target_state_else_index appear when + * QUEX_GOTO_STATE is used without computed goto-s. */ + (void)target_state_index; + (void)target_state_else_index; + +# undef Lexeme +# undef LexemeBegin +# undef LexemeEnd +# undef LexemeNull +# undef LexemeL +# undef PROGRAM +# undef self +# undef QUEX_LABEL_STATE_ROUTER +} +QUEX_NAMESPACE_MAIN_CLOSE + + +QUEX_NAMESPACE_TOKEN_OPEN + +const char* +QUEX_NAME_TOKEN(map_id_to_name)(const QUEX_TYPE_TOKEN_ID TokenID) +{ + static char error_string[64]; + static const char uninitialized_string[] = "<UNINITIALIZED>"; + static const char termination_string[] = "<TERMINATION>"; +# if defined(QUEX_OPTION_INDENTATION_TRIGGER) + static const char indent_string[] = "<INDENT>"; + static const char dedent_string[] = "<DEDENT>"; + static const char nodent_string[] = "<NODENT>"; +# endif + static const char token_id_str_AMPERSANT[] = "AMPERSANT"; + static const char token_id_str_AND[] = "AND"; + static const char token_id_str_ASSIGN_AMPERSANT[] = "ASSIGN_AMPERSANT"; + static const char token_id_str_ASSIGN_DIV[] = "ASSIGN_DIV"; + static const char token_id_str_ASSIGN_EXCLUSIVE_OR[] = "ASSIGN_EXCLUSIVE_OR"; + static const char token_id_str_ASSIGN_LOGICAL_OR[] = "ASSIGN_LOGICAL_OR"; + static const char token_id_str_ASSIGN_MINUS[] = "ASSIGN_MINUS"; + static const char token_id_str_ASSIGN_MODULO[] = "ASSIGN_MODULO"; + static const char token_id_str_ASSIGN_MULT[] = "ASSIGN_MULT"; + static const char token_id_str_ASSIGN_PLUS[] = "ASSIGN_PLUS"; + static const char token_id_str_ASSIGN_SHIFT_LEFT[] = "ASSIGN_SHIFT_LEFT"; + static const char token_id_str_ASSIGN_SHIFT_RIGHT[] = "ASSIGN_SHIFT_RIGHT"; + static const char token_id_str_BACKLASHED_NEWLINE[] = "BACKLASHED_NEWLINE"; + static const char token_id_str_BRACKET_C[] = "BRACKET_C"; + static const char token_id_str_BRACKET_O[] = "BRACKET_O"; + static const char token_id_str_BREAK[] = "BREAK"; + static const char token_id_str_CASE[] = "CASE"; + static const char token_id_str_COLON[] = "COLON"; + static const char token_id_str_COMMA[] = "COMMA"; + static const char token_id_str_CONST[] = "CONST"; + static const char token_id_str_CONTINUE[] = "CONTINUE"; + static const char token_id_str_CORNER_BRACKET_C[] = "CORNER_BRACKET_C"; + static const char token_id_str_CORNER_BRACKET_O[] = "CORNER_BRACKET_O"; + static const char token_id_str_DECREMENT[] = "DECREMENT"; + static const char token_id_str_DEFAULT[] = "DEFAULT"; + static const char token_id_str_DIV[] = "DIV"; + static const char token_id_str_DO[] = "DO"; + static const char token_id_str_DOT[] = "DOT"; + static const char token_id_str_DOUBLE_HASH[] = "DOUBLE_HASH"; + static const char token_id_str_ELSE[] = "ELSE"; + static const char token_id_str_ENUM[] = "ENUM"; + static const char token_id_str_EQ[] = "EQ"; + static const char token_id_str_EXCLUSIVE_OR[] = "EXCLUSIVE_OR"; + static const char token_id_str_EXTERN[] = "EXTERN"; + static const char token_id_str_FAILURE[] = "FAILURE"; + static const char token_id_str_FOR[] = "FOR"; + static const char token_id_str_GOTO[] = "GOTO"; + static const char token_id_str_GREATER[] = "GREATER"; + static const char token_id_str_GR_EQ[] = "GR_EQ"; + static const char token_id_str_HASH[] = "HASH"; + static const char token_id_str_IDENTIFIER[] = "IDENTIFIER"; + static const char token_id_str_IF[] = "IF"; + static const char token_id_str_INCREMENT[] = "INCREMENT"; + static const char token_id_str_INLINE[] = "INLINE"; + static const char token_id_str_LESS[] = "LESS"; + static const char token_id_str_LE_EQ[] = "LE_EQ"; + static const char token_id_str_LOGICAL_OR[] = "LOGICAL_OR"; + static const char token_id_str_MEMBER[] = "MEMBER"; + static const char token_id_str_MINUS[] = "MINUS"; + static const char token_id_str_MODULO[] = "MODULO"; + static const char token_id_str_MULT[] = "MULT"; + static const char token_id_str_NOT[] = "NOT"; + static const char token_id_str_NOT_EQ[] = "NOT_EQ"; + static const char token_id_str_NUMBER[] = "NUMBER"; + static const char token_id_str_OP_ASSIGNMENT[] = "OP_ASSIGNMENT"; + static const char token_id_str_OR[] = "OR"; + static const char token_id_str_PLUS[] = "PLUS"; + static const char token_id_str_PP_COMMENT[] = "PP_COMMENT"; + static const char token_id_str_PP_DEFINE[] = "PP_DEFINE"; + static const char token_id_str_PP_DEFINED[] = "PP_DEFINED"; + static const char token_id_str_PP_ELIF[] = "PP_ELIF"; + static const char token_id_str_PP_ELSE[] = "PP_ELSE"; + static const char token_id_str_PP_ENDIF[] = "PP_ENDIF"; + static const char token_id_str_PP_ERROR[] = "PP_ERROR"; + static const char token_id_str_PP_IF[] = "PP_IF"; + static const char token_id_str_PP_IFDEF[] = "PP_IFDEF"; + static const char token_id_str_PP_IFNDEF[] = "PP_IFNDEF"; + static const char token_id_str_PP_INCLUDE[] = "PP_INCLUDE"; + static const char token_id_str_PP_PRAGMA[] = "PP_PRAGMA"; + static const char token_id_str_PP_USE[] = "PP_USE"; + static const char token_id_str_QUESTION_MARK[] = "QUESTION_MARK"; + static const char token_id_str_QUOTED_CHAR[] = "QUOTED_CHAR"; + static const char token_id_str_RESTRICT[] = "RESTRICT"; + static const char token_id_str_RETURN[] = "RETURN"; + static const char token_id_str_SEMICOLON[] = "SEMICOLON"; + static const char token_id_str_SHIFT_LEFT[] = "SHIFT_LEFT"; + static const char token_id_str_SHIFT_RIGHT[] = "SHIFT_RIGHT"; + static const char token_id_str_SIZEOF[] = "SIZEOF"; + static const char token_id_str_STATIC[] = "STATIC"; + static const char token_id_str_STRING[] = "STRING"; + static const char token_id_str_STRUCT[] = "STRUCT"; + static const char token_id_str_SWITCH[] = "SWITCH"; + static const char token_id_str_TILDE[] = "TILDE"; + static const char token_id_str_TYPE[] = "TYPE"; + static const char token_id_str_TYPEDEF[] = "TYPEDEF"; + static const char token_id_str_TYPE_CHAR[] = "TYPE_CHAR"; + static const char token_id_str_TYPE_DOUBLE[] = "TYPE_DOUBLE"; + static const char token_id_str_TYPE_FLOAT[] = "TYPE_FLOAT"; + static const char token_id_str_TYPE_INT[] = "TYPE_INT"; + static const char token_id_str_TYPE_LONG[] = "TYPE_LONG"; + static const char token_id_str_TYPE_SHORT[] = "TYPE_SHORT"; + static const char token_id_str_TYPE_SIGNED[] = "TYPE_SIGNED"; + static const char token_id_str_TYPE_UNSIGNED[] = "TYPE_UNSIGNED"; + static const char token_id_str_TYPE_VOID[] = "TYPE_VOID"; + static const char token_id_str_UNION[] = "UNION"; + static const char token_id_str_VOLATILE[] = "VOLATILE"; + static const char token_id_str_WHILE[] = "WHILE"; + static const char token_id_str__ALIGNAS[] = "_ALIGNAS"; + static const char token_id_str__ALIGNOF[] = "_ALIGNOF"; + static const char token_id_str__ATOMIC[] = "_ATOMIC"; + static const char token_id_str__BOOL[] = "_BOOL"; + static const char token_id_str__COMPLEX[] = "_COMPLEX"; + static const char token_id_str__GENERIC[] = "_GENERIC"; + static const char token_id_str__IMAGINARY[] = "_IMAGINARY"; + static const char token_id_str__NORETURN[] = "_NORETURN"; + static const char token_id_str__STATIC_ASSERT[] = "_STATIC_ASSERT"; + static const char token_id_str__THREAD_LOCAL[] = "_THREAD_LOCAL"; + + + /* NOTE: This implementation works only for token id types that are + * some type of integer or enum. In case an alien type is to + * used, this function needs to be redefined. */ + switch( TokenID ) { + default: { + __QUEX_STD_sprintf(error_string, "<UNKNOWN TOKEN-ID: %i>", (int)TokenID); + return error_string; + } + case QUEX_TKN_TERMINATION: return termination_string; + case QUEX_TKN_UNINITIALIZED: return uninitialized_string; +# if defined(QUEX_OPTION_INDENTATION_TRIGGER) + case QUEX_TKN_INDENT: return indent_string; + case QUEX_TKN_DEDENT: return dedent_string; + case QUEX_TKN_NODENT: return nodent_string; +# endif + case QUEX_TKN_AMPERSANT: return token_id_str_AMPERSANT; + case QUEX_TKN_AND: return token_id_str_AND; + case QUEX_TKN_ASSIGN_AMPERSANT: return token_id_str_ASSIGN_AMPERSANT; + case QUEX_TKN_ASSIGN_DIV: return token_id_str_ASSIGN_DIV; + case QUEX_TKN_ASSIGN_EXCLUSIVE_OR: return token_id_str_ASSIGN_EXCLUSIVE_OR; + case QUEX_TKN_ASSIGN_LOGICAL_OR: return token_id_str_ASSIGN_LOGICAL_OR; + case QUEX_TKN_ASSIGN_MINUS: return token_id_str_ASSIGN_MINUS; + case QUEX_TKN_ASSIGN_MODULO: return token_id_str_ASSIGN_MODULO; + case QUEX_TKN_ASSIGN_MULT: return token_id_str_ASSIGN_MULT; + case QUEX_TKN_ASSIGN_PLUS: return token_id_str_ASSIGN_PLUS; + case QUEX_TKN_ASSIGN_SHIFT_LEFT: return token_id_str_ASSIGN_SHIFT_LEFT; + case QUEX_TKN_ASSIGN_SHIFT_RIGHT: return token_id_str_ASSIGN_SHIFT_RIGHT; + case QUEX_TKN_BACKLASHED_NEWLINE: return token_id_str_BACKLASHED_NEWLINE; + case QUEX_TKN_BRACKET_C: return token_id_str_BRACKET_C; + case QUEX_TKN_BRACKET_O: return token_id_str_BRACKET_O; + case QUEX_TKN_BREAK: return token_id_str_BREAK; + case QUEX_TKN_CASE: return token_id_str_CASE; + case QUEX_TKN_COLON: return token_id_str_COLON; + case QUEX_TKN_COMMA: return token_id_str_COMMA; + case QUEX_TKN_CONST: return token_id_str_CONST; + case QUEX_TKN_CONTINUE: return token_id_str_CONTINUE; + case QUEX_TKN_CORNER_BRACKET_C: return token_id_str_CORNER_BRACKET_C; + case QUEX_TKN_CORNER_BRACKET_O: return token_id_str_CORNER_BRACKET_O; + case QUEX_TKN_DECREMENT: return token_id_str_DECREMENT; + case QUEX_TKN_DEFAULT: return token_id_str_DEFAULT; + case QUEX_TKN_DIV: return token_id_str_DIV; + case QUEX_TKN_DO: return token_id_str_DO; + case QUEX_TKN_DOT: return token_id_str_DOT; + case QUEX_TKN_DOUBLE_HASH: return token_id_str_DOUBLE_HASH; + case QUEX_TKN_ELSE: return token_id_str_ELSE; + case QUEX_TKN_ENUM: return token_id_str_ENUM; + case QUEX_TKN_EQ: return token_id_str_EQ; + case QUEX_TKN_EXCLUSIVE_OR: return token_id_str_EXCLUSIVE_OR; + case QUEX_TKN_EXTERN: return token_id_str_EXTERN; + case QUEX_TKN_FAILURE: return token_id_str_FAILURE; + case QUEX_TKN_FOR: return token_id_str_FOR; + case QUEX_TKN_GOTO: return token_id_str_GOTO; + case QUEX_TKN_GREATER: return token_id_str_GREATER; + case QUEX_TKN_GR_EQ: return token_id_str_GR_EQ; + case QUEX_TKN_HASH: return token_id_str_HASH; + case QUEX_TKN_IDENTIFIER: return token_id_str_IDENTIFIER; + case QUEX_TKN_IF: return token_id_str_IF; + case QUEX_TKN_INCREMENT: return token_id_str_INCREMENT; + case QUEX_TKN_INLINE: return token_id_str_INLINE; + case QUEX_TKN_LESS: return token_id_str_LESS; + case QUEX_TKN_LE_EQ: return token_id_str_LE_EQ; + case QUEX_TKN_LOGICAL_OR: return token_id_str_LOGICAL_OR; + case QUEX_TKN_MEMBER: return token_id_str_MEMBER; + case QUEX_TKN_MINUS: return token_id_str_MINUS; + case QUEX_TKN_MODULO: return token_id_str_MODULO; + case QUEX_TKN_MULT: return token_id_str_MULT; + case QUEX_TKN_NOT: return token_id_str_NOT; + case QUEX_TKN_NOT_EQ: return token_id_str_NOT_EQ; + case QUEX_TKN_NUMBER: return token_id_str_NUMBER; + case QUEX_TKN_OP_ASSIGNMENT: return token_id_str_OP_ASSIGNMENT; + case QUEX_TKN_OR: return token_id_str_OR; + case QUEX_TKN_PLUS: return token_id_str_PLUS; + case QUEX_TKN_PP_COMMENT: return token_id_str_PP_COMMENT; + case QUEX_TKN_PP_DEFINE: return token_id_str_PP_DEFINE; + case QUEX_TKN_PP_DEFINED: return token_id_str_PP_DEFINED; + case QUEX_TKN_PP_ELIF: return token_id_str_PP_ELIF; + case QUEX_TKN_PP_ELSE: return token_id_str_PP_ELSE; + case QUEX_TKN_PP_ENDIF: return token_id_str_PP_ENDIF; + case QUEX_TKN_PP_ERROR: return token_id_str_PP_ERROR; + case QUEX_TKN_PP_IF: return token_id_str_PP_IF; + case QUEX_TKN_PP_IFDEF: return token_id_str_PP_IFDEF; + case QUEX_TKN_PP_IFNDEF: return token_id_str_PP_IFNDEF; + case QUEX_TKN_PP_INCLUDE: return token_id_str_PP_INCLUDE; + case QUEX_TKN_PP_PRAGMA: return token_id_str_PP_PRAGMA; + case QUEX_TKN_PP_USE: return token_id_str_PP_USE; + case QUEX_TKN_QUESTION_MARK: return token_id_str_QUESTION_MARK; + case QUEX_TKN_QUOTED_CHAR: return token_id_str_QUOTED_CHAR; + case QUEX_TKN_RESTRICT: return token_id_str_RESTRICT; + case QUEX_TKN_RETURN: return token_id_str_RETURN; + case QUEX_TKN_SEMICOLON: return token_id_str_SEMICOLON; + case QUEX_TKN_SHIFT_LEFT: return token_id_str_SHIFT_LEFT; + case QUEX_TKN_SHIFT_RIGHT: return token_id_str_SHIFT_RIGHT; + case QUEX_TKN_SIZEOF: return token_id_str_SIZEOF; + case QUEX_TKN_STATIC: return token_id_str_STATIC; + case QUEX_TKN_STRING: return token_id_str_STRING; + case QUEX_TKN_STRUCT: return token_id_str_STRUCT; + case QUEX_TKN_SWITCH: return token_id_str_SWITCH; + case QUEX_TKN_TILDE: return token_id_str_TILDE; + case QUEX_TKN_TYPE: return token_id_str_TYPE; + case QUEX_TKN_TYPEDEF: return token_id_str_TYPEDEF; + case QUEX_TKN_TYPE_CHAR: return token_id_str_TYPE_CHAR; + case QUEX_TKN_TYPE_DOUBLE: return token_id_str_TYPE_DOUBLE; + case QUEX_TKN_TYPE_FLOAT: return token_id_str_TYPE_FLOAT; + case QUEX_TKN_TYPE_INT: return token_id_str_TYPE_INT; + case QUEX_TKN_TYPE_LONG: return token_id_str_TYPE_LONG; + case QUEX_TKN_TYPE_SHORT: return token_id_str_TYPE_SHORT; + case QUEX_TKN_TYPE_SIGNED: return token_id_str_TYPE_SIGNED; + case QUEX_TKN_TYPE_UNSIGNED: return token_id_str_TYPE_UNSIGNED; + case QUEX_TKN_TYPE_VOID: return token_id_str_TYPE_VOID; + case QUEX_TKN_UNION: return token_id_str_UNION; + case QUEX_TKN_VOLATILE: return token_id_str_VOLATILE; + case QUEX_TKN_WHILE: return token_id_str_WHILE; + case QUEX_TKN__ALIGNAS: return token_id_str__ALIGNAS; + case QUEX_TKN__ALIGNOF: return token_id_str__ALIGNOF; + case QUEX_TKN__ATOMIC: return token_id_str__ATOMIC; + case QUEX_TKN__BOOL: return token_id_str__BOOL; + case QUEX_TKN__COMPLEX: return token_id_str__COMPLEX; + case QUEX_TKN__GENERIC: return token_id_str__GENERIC; + case QUEX_TKN__IMAGINARY: return token_id_str__IMAGINARY; + case QUEX_TKN__NORETURN: return token_id_str__NORETURN; + case QUEX_TKN__STATIC_ASSERT: return token_id_str__STATIC_ASSERT; + case QUEX_TKN__THREAD_LOCAL: return token_id_str__THREAD_LOCAL; + + } +} + +QUEX_NAMESPACE_TOKEN_CLOSE + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO(user_constructor) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + (void)me; + + __quex_assert(QUEX_NAME(mode_db)[QUEX_NAME(ModeID_PROGRAM)] == &QUEX_NAME(PROGRAM)); + + +#define self (*(QUEX_TYPE_DERIVED_ANALYZER*)me) +/* START: User's constructor extensions _______________________________________*/ + +/* END: _______________________________________________________________________*/ +#undef self +} + +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO(user_reset) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + (void)me; + +#define self (*(QUEX_TYPE_DERIVED_ANALYZER*)me) +/* START: User's 'reset' ______________________________________________________*/ + +/* END: _______________________________________________________________________*/ +#undef self +} + +#ifdef QUEX_OPTION_INCLUDE_STACK + +QUEX_INLINE bool +QUEX_MEMBER_FUNCTIONO2(user_memento_pack, + const char* InputName, + QUEX_NAME(Memento)* memento) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + (void)me; (void)memento; (void)InputName; + +#define self (*(QUEX_TYPE_DERIVED_ANALYZER*)me) +/* START: User's memento 'pack' _______________________________________________*/ + +/* END: _______________________________________________________________________*/ +#undef self + return true; +} + +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO1(user_memento_unpack, QUEX_NAME(Memento)* memento) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + (void)me; (void)memento; + +#define self (*(QUEX_TYPE_DERIVED_ANALYZER*)me) +/* START: User's memento 'unpack' _____________________________________________*/ + +/* END: _______________________________________________________________________*/ +#undef self +} +#endif /* QUEX_OPTION_INCLUDE_STACK */ + +QUEX_NAMESPACE_MAIN_CLOSE + +#if defined(__QUEX_OPTION_CONVERTER_HELPER) +# include "from-unicode-buffer.i" +#else +# include "from-unicode-buffer.i" +#endif +#include "headers.i" + + +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2004-2009 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY + */ +#ifndef __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN_I +#define __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN_I + +#ifndef __QUEX_OPTION_PLAIN_C +# define __QUEX_OPTION_PLAIN_C +#endif + +#include "EasyLexer-token.h" +#include "definitions" + +QUEX_NAMESPACE_LEXEME_NULL_OPEN +extern QUEX_TYPE_LEXATOM QUEX_LEXEME_NULL_IN_ITS_NAMESPACE; +QUEX_NAMESPACE_LEXEME_NULL_CLOSE + + +QUEX_INLINE void +quex_Token_set(quex_Token* __this, + const QUEX_TYPE_TOKEN_ID ID) +{ __this->_id = ID; } + +QUEX_INLINE const char* +quex_Token_map_id_to_name(QUEX_TYPE_TOKEN_ID); + +QUEX_INLINE void +quex_Token_construct(quex_Token* __this) +{ +# define self (*__this) +# define LexemeNull &QUEX_LEXEME_NULL + (void)__this; + +# line 33 "CDefault.qx" + + self.number = 0; + self.text = LexemeNull; + + +# line 17056 "EasyLexer.c" + +# undef LexemeNull +# undef self +} + +QUEX_INLINE void +quex_Token_copy_construct(quex_Token* __this, + const quex_Token* __That) +{ + QUEX_NAME_TOKEN(construct)(__this); + QUEX_NAME_TOKEN(copy)(__this, __That); +} + +QUEX_INLINE void +quex_Token_destruct(quex_Token* __this) +{ +# define self (*__this) +# define LexemeNull &QUEX_LEXEME_NULL + (void)__this; + +# line 38 "CDefault.qx" + + if( self.text != LexemeNull ) { + QUEXED(MemoryManager_free)((void*)self.text, + E_MemoryObjectType_TEXT); + self.text = LexemeNull; + } + + +# line 17086 "EasyLexer.c" + +# undef LexemeNull +# undef self +} + +QUEX_INLINE void +quex_Token_copy(quex_Token* __this, + const quex_Token* __That) +{ +# define self (*__this) +# define Other (*__That) +# define LexemeNull &QUEX_LEXEME_NULL + (void)__this; + (void)__That; + +# line 46 "CDefault.qx" + + self._id = Other._id; + + if( self.text != LexemeNull ) { + QUEXED(MemoryManager_free)((void*)self.text, + E_MemoryObjectType_TEXT); + } + if( Other.text != LexemeNull ) { + self.text = \ + (QUEX_TYPE_LEXATOM*) + QUEXED(MemoryManager_allocate)( + sizeof(QUEX_TYPE_LEXATOM) * (QUEX_NAME(strlen)(Other.text) + 1), + E_MemoryObjectType_TEXT); + __QUEX_STD_memcpy((void*)self.text, (void*)Other.text, + sizeof(QUEX_TYPE_LEXATOM) + * (QUEX_NAME(strlen)(Other.text) + 1)); + } + self.number = Other.number; + # ifdef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN + __QUEX_IF_COUNT_LINES(self._line_n = Other._line_n); + __QUEX_IF_COUNT_COLUMNS(self._column_n = Other._column_n); + # endif + + +# line 17127 "EasyLexer.c" + +# undef LexemeNull +# undef Other +# undef self + /* If the user even misses to copy the token id, then there's + * something seriously wrong. */ + __quex_assert(__this->_id == __That->_id); +# ifdef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN + __QUEX_IF_COUNT_LINES(__quex_assert(__this->_line_n == __That->_line_n)); + __QUEX_IF_COUNT_COLUMNS(__quex_assert(__this->_column_n == __That->_column_n)); +# endif +} + + +QUEX_INLINE bool +quex_Token_take_text(quex_Token* __this, + QUEX_TYPE_ANALYZER* __analyzer, + const QUEX_TYPE_LEXATOM* Begin, + const QUEX_TYPE_LEXATOM* End) +/* RETURNS: true -- if the token claims ownership over the given memory. + * false -- if no ownership is claimed. */ +{ +# define self (*__this) +# define analyzer (*__analyzer) +# ifdef LexemeNull +# error "Error LexemeNull shall not be defined here." +# endif +# define LexemeNull &QUEX_LEXEME_NULL + (void)__this; + (void)__analyzer; + (void)Begin; + (void)End; + +# line 70 "CDefault.qx" + + +# if 0 + /* Hint for debug: To check take_text change "#if 0" to "#if 1" */ + { + const QUEX_TYPE_LEXATOM* it = (void*)0x0; + printf("previous: '"); + if( self.text != LexemeNull ) { + for(it = self.text; *it ; ++it) printf("%04X.", (int)*it); + printf("%04X.", (int)*it); + } + printf("'\n"); + printf("take_text: '"); + for(it = Begin; it != End; ++it) printf("%04X.", (int)*it); + printf("%04X.", (int)*it); + printf("'\n"); + } +# endif + + if( self.text != LexemeNull ) { + QUEXED(MemoryManager_free)((void*)self.text, + E_MemoryObjectType_TEXT); + } + if( Begin != LexemeNull ) { + __quex_assert(End >= Begin); + self.text = \ + (QUEX_TYPE_LEXATOM*) + QUEXED(MemoryManager_allocate)( + sizeof(QUEX_TYPE_LEXATOM) * (size_t)(End - Begin + 1), + E_MemoryObjectType_TEXT); + __QUEX_STD_memcpy((void*)self.text, (void*)Begin, + sizeof(QUEX_TYPE_LEXATOM) * (size_t)(End - Begin)); + /* The string is not necessarily zero terminated, so terminate it here. */ + *((QUEX_TYPE_LEXATOM*)(self.text + (End - Begin))) = (QUEX_TYPE_LEXATOM)0; + } else { + self.text = LexemeNull; + } + +# if 0 + /* Hint for debug: To check take_text change "#if 0" to "#if 1" */ + { + const QUEX_TYPE_LEXATOM* it = 0x0; + printf("after: '"); + if( self.text != LexemeNull ) { + for(it = self.text; *it ; ++it) printf("%04X.", (int)*it); + printf("%04X.", (int)*it); + } + printf("'\n"); + } +# endif + + /* This token copied the text from the chunk into the string, + * so we do not claim ownership over it. */ + return false; + + +# line 17218 "EasyLexer.c" + +# undef LexemeNull +# undef analyzer +# undef self + /* Default: no ownership. */ + return false; +} + +#ifdef QUEX_OPTION_TOKEN_REPETITION_SUPPORT +QUEX_INLINE size_t +quex_Token_repetition_n_get(quex_Token* __this) +{ +# define self (*__this) +# define LexemeNull &QUEX_LEXEME_NULL + (void)__this; + +# line 135 "CDefault.qx" + + return self.number; + + +# line 17240 "EasyLexer.c" + +# undef LexemeNull +# undef self +} + +QUEX_INLINE void +quex_Token_repetition_n_set(quex_Token* __this, size_t N) +{ +# define self (*__this) +# define LexemeNull &QUEX_LEXEME_NULL + (void)__this; + (void)N; + +# line 131 "CDefault.qx" + + self.number = N; + + +# line 17259 "EasyLexer.c" + +# undef LexemeNull +# undef self +} +#endif /* QUEX_OPTION_TOKEN_REPETITION_SUPPORT */ + + +# line 139 "CDefault.qx" + + const char* + quex_Token_get_string(quex_Token* me, char* buffer, size_t BufferSize) + { + const char* token_type_str = quex_Token_map_id_to_name(me->_id); + const char* BufferEnd = buffer + BufferSize; + const char* iterator = 0; + char* writerator = 0; + + /* Token Type */ + iterator = token_type_str; + writerator = buffer; + while( (*iterator) && writerator != BufferEnd ) { + *writerator++ = *iterator++; + } + + /* Opening Quote */ + if( BufferEnd - writerator > 2 ) { + *writerator++ = ' '; + *writerator++ = '\''; + } + + /* The String */ + quex_Token_pretty_char_text(me, writerator, (size_t)(BufferEnd - writerator)); + + while( *writerator ) { + ++writerator; + } + + /* Closing Quote */ + if( BufferEnd - writerator > 1 ) { + *writerator++ = '\''; + } + *writerator = '\0'; + return buffer; + } + + const char* + quex_Token_pretty_char_text(quex_Token* me, char* buffer, size_t BufferSize) + /* Provides a somehow pretty-print of the text in the token. Note, that the buffer + * in case of UTF8 should be 4bytes longer than the longest expected string. */ + { + const QUEX_TYPE_LEXATOM* source = me->text; + char* drain = buffer; + const char* DrainEnd = buffer + BufferSize; + + const QUEX_TYPE_LEXATOM* SourceEnd = me->text + (size_t)(QUEX_NAME(strlen)(source)) + 1; + QUEX_CONVERTER_STRING(identical,char)(&source, SourceEnd, &drain, DrainEnd); + return buffer; + } + +# if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) + const wchar_t* + quex_Token_pretty_wchar_text(quex_Token* me, wchar_t* buffer, size_t BufferSize) + { + wchar_t* drain = buffer; + const wchar_t* DrainEnd = buffer + (ptrdiff_t)BufferSize; + const QUEX_TYPE_LEXATOM* source = me->text; + const QUEX_TYPE_LEXATOM* SourceEnd = me->text + (ptrdiff_t)(QUEX_NAME(strlen)(source)) + 1; + + QUEX_CONVERTER_STRING(identical,wchar)(&source, SourceEnd, &drain, DrainEnd); + return buffer; + } +# endif + +#include "identity.i" + + +# line 17336 "EasyLexer.c" + + + + +#endif /* __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN_I */ + diff --git a/src/parser/EasyLexer.h b/src/parser/EasyLexer.h @@ -0,0 +1,114 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * CONTENT: + * + * (1) Includes for required standard headers. + * (2) Definitions of options and settings for the particular application. + * (3) #include "definitions" for default settings. + * (4) Lexical Analyzer class EasyLexer and its memento class. + * (5) Constructor and init core of EasyLexer. + * (6) Memento pack and unpack functions. + * + * File content generated by Quex 0.66.5. + * + * (C) 2005-2012 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__GENERATED__QUEX___EASYLEXER +#define __QUEX_INCLUDE_GUARD__ANALYZER__GENERATED__QUEX___EASYLEXER + +#ifdef __QUEX_INCLUDE_INDICATOR__ANALYZER__MAIN + /* In case that multiple lexical analyzers are used the same header + * files are compiled with a different setting of the macros. The + * undef of the include guards happens in the following file. */ +# ifdef __QUEX_SIGNAL_DEFINED_LEXER_IN_NAMESPACE_QUEX_ +# error "More than one lexical analyzer have been generated in the same name space. Read documentation on command line option '-o'." +# endif +# ifndef QUEX_OPTION_MULTI +# error "Multiple lexical analyzers detected. QUEX_OPTION_MULTI must be defined and 'quex/code_base/multi.i' must be included in one single file!" +# endif +# include <quex/code_base/include-guard-undef> +# include <quex/code_base/analyzer/member/token-sending-undef.i> +# undef __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION__QUEX___EASYLEXER +#else +# define __QUEX_INCLUDE_INDICATOR__ANALYZER__MAIN +#endif +#define __QUEX_SIGNAL_DEFINED_LEXER_IN_NAMESPACE_QUEX_ + +#include "EasyLexer-configuration.h" + +#include "definitions" + +struct QUEX_NAME(Engine_tag); +struct QUEX_NAME(Memento_tag); +QUEX_TYPE0_ANALYZER; /* quex_EasyLexer */ +typedef __QUEX_TYPE_ANALYZER_RETURN_VALUE (*QUEX_NAME(AnalyzerFunctionP))(QUEX_TYPE0_ANALYZER*); + +/* Token Class Declaration must preceed the user's header, so that the user + * can refer to it at ease. */ +QUEX_TYPE0_TOKEN; + +/* START: User defined header content _________________________________________ + * Must come before token class definition, since the token class + * might rely on contents of the header. */ + + +/* END: _______________________________________________________________________*/ +#if defined(__QUEX_OPTION_CONVERTER_HELPER) +# include "from-unicode-buffer" +#else +# include "from-unicode-buffer" +#endif +#include "analyzerHeaders" + +#include "EasyLexer-token_ids.h" +#include "EasyLexer-token.h" + + +QUEX_NAMESPACE_MAIN_OPEN + +enum { + QUEX_NAME(ModeID_PROGRAM) = 0 +}; + + extern QUEX_NAME(Mode) QUEX_NAME(PROGRAM); + + +extern __QUEX_TYPE_ANALYZER_RETURN_VALUE QUEX_NAME(PROGRAM_analyzer_function)(QUEX_TYPE_ANALYZER*); +#ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK +extern bool QUEX_NAME(PROGRAM_has_base)(const QUEX_NAME(Mode)*); +extern bool QUEX_NAME(PROGRAM_has_entry_from)(const QUEX_NAME(Mode)*); +extern bool QUEX_NAME(PROGRAM_has_exit_to)(const QUEX_NAME(Mode)*); +#endif + + + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(Memento_tag) { +# include "EngineMemento_body" + + /* Con- and Destruction are **not** necessary in C. No con- or de- + * structors of members need to be triggered. */ + +/* START: User's memento extentions ___________________________________________*/ + +/* END: _______________________________________________________________________*/ +} QUEX_NAME(Memento); + +QUEX_NAMESPACE_MAIN_CLOSE + +QUEX_NAMESPACE_MAIN_OPEN + +extern QUEX_NAME(Mode)* (QUEX_NAME(mode_db)[__QUEX_SETTING_MAX_MODE_CLASS_N]); + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG quex_EasyLexer_tag { + +#include "Engine_body" +#define self (*(QUEX_TYPE_DERIVED_ANALYZER*)this) +/* START: User's class body extensions _____________________________________________*/ + +/* END: ____________________________________________________________________________*/ +#undef self + +} quex_EasyLexer; + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__GENERATED__QUEX___EASYLEXER */ diff --git a/src/parser/EngineMemento_body b/src/parser/EngineMemento_body @@ -0,0 +1,31 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ + char* __input_name; + + QUEX_NAME(Buffer) buffer; + + struct QUEX_NAME(Mode_tag)* __current_mode_p; + QUEX_NAME(AnalyzerFunctionP) current_analyzer_function; + +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) \ + || defined(QUEX_OPTION_ASSERTS) + QUEX_NAME(AnalyzerFunctionP) DEBUG_analyzer_function_at_entry; +# endif + +# if defined(__QUEX_OPTION_COUNTER) + QUEX_NAME(Counter) counter; +# endif + +# if defined(QUEX_OPTION_STRING_ACCUMULATOR) + QUEX_NAME(Accumulator) accumulator; +# endif + + /* Deriberately not subject to include handling: + * -- Mode stack. + * -- Token and token queues. + * -- Post categorizer. */ +# ifdef QUEX_OPTION_INCLUDE_STACK + struct QUEX_NAME(Memento_tag)* _parent_memento; +# endif + diff --git a/src/parser/Engine_body b/src/parser/Engine_body @@ -0,0 +1,51 @@ + + /*_________________________________________________________________________ + * Tokens: + * + * Allow public access. + * + * Tokens are placed directly before the buffer. They are one of the most + * used variables. The most used variables shall be stored close to each + * other, in order to prevent cache misses. + * + * Note, that the token queue is also implemented from higher addresses + * to lower addresses. It is assumed that it is most likely only filled + * at the top, and thus the addresses close to the buffer shall be used + * more often than the addresses far from it. */ +# ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + QUEX_NAME(TokenQueue) _token_queue; +# if ! defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + uint8_t __memory_token_queue[sizeof(QUEX_TYPE_TOKEN)*QUEX_SETTING_TOKEN_QUEUE_SIZE]; +# endif +# else + QUEX_TYPE_TOKEN* token; +# if ! defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_TYPE_TOKEN __memory_token; +# endif +# endif + + char* __input_name; + QUEX_NAME(Buffer) buffer; + +#if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) \ + || defined(QUEX_OPTION_ASSERTS) + /* When a mode change happens and the user does not 'return' but 'CONTINUE' + * an error must be logged, since the following characters are still swallowed + * by the current function and not the new one. For this one needs to return and + * then continue further. */ + QUEX_NAME(AnalyzerFunctionP) DEBUG_analyzer_function_at_entry; +# endif + + /* Each mode has a dedicated analyzer function. The function pointer + * to the currently active mode's function is stored redundantly in + * 'current_analyzer_function' to accelerate the access to it. */ + QUEX_NAME(AnalyzerFunctionP) current_analyzer_function; + QUEX_NAME(Mode)* __current_mode_p; + + QUEX_NAME(ModeStack) _mode_stack; + + __QUEX_IF_COUNT(QUEX_NAME(Counter) counter;) + __QUEX_IF_STRING_ACCUMULATOR(QUEX_NAME(Accumulator) accumulator;) + __QUEX_IF_POST_CATEGORIZER(QUEX_NAME(Dictionary) post_categorizer;) + __QUEX_IF_INCLUDE_STACK(struct QUEX_NAME(Memento_tag)* _parent_memento;) + diff --git a/src/parser/LexatomLoader b/src/parser/LexatomLoader @@ -0,0 +1,160 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER + +#include "definitions" +#include "bufferBuffer" +#include "ByteLoader" + +QUEX_NAMESPACE_MAIN_OPEN + +struct QUEX_NAME(Converter_tag); +struct QUEX_NAME(Buffer_tag); + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(LexatomLoader_tag) { + /* This is the interface that the buffer sees of the buffer filler. Its + * task is to coordinate the filling of buffer content from a stream in the + * background. Some fillers may convert lexatoms or filter. All fillers + * must provide functions for the following pointers. The pointers are set + * with the function + * + * LexatomLoader_setup(...) + * + * which shall be called in any '_construct' function of a filler. Note, + * that filler types shall inherit this class. This means, that the first + * element of the derived struct is to be of this type and best called + * 'base'. For example, please, consider the 'plain' and 'iconv' + * implementations in the correspondent sub directories. */ + E_Ownership ownership; + + QUEX_NAME(ByteLoader)* byte_loader; + + /* -- 'Tell': Character index of the next lexatom to be loaded into + * the buffer, when 'derived.load()' is called. + * */ + QUEX_TYPE_STREAM_POSITION + (*input_lexatom_tell)(struct QUEX_NAME(LexatomLoader_tag)*); + + /* -- 'Seek': Sets the lexatom index of the next lexatom to be loaded + * into the buffer, when 'derived.load()' is + * called. + * */ + bool (*input_lexatom_seek)(struct QUEX_NAME(LexatomLoader_tag)*, + const QUEX_TYPE_STREAM_POSITION Index); + + /* -- 'Stomach Byte Number': is the number of bytes that have been read + * from the stream but not yet converted. + * */ + ptrdiff_t (*stomach_byte_n)(struct QUEX_NAME(LexatomLoader_tag)*); + + /* -- 'Clear': Undo any internal state-dependency. Conversion or what- + * soever starts from a clean page. + * */ + void (*stomach_clear)(struct QUEX_NAME(LexatomLoader_tag)*); + + /* -- 'Delete Operator': There are derived 'classes' from this one. User + * only stores a pointer to LexatomLoader, and requires a + * way to delete the whole object. + * */ + void (*delete_self)(struct QUEX_NAME(LexatomLoader_tag)*); + + + /* -- byte order (i.e little- vs. big-endian) reversion: enable/disable + * the reversion of byte order. + * */ + bool _byte_order_reversion_active_f; + + QUEX_TYPE_STREAM_POSITION lexatom_index_next_to_fill; + + /* Byte number per lexatom. If != -1 => there is a linear relationship + * between lexatom position and lexatom + * index. */ + ptrdiff_t byte_n_per_lexatom; + + struct { + /* PASSIVE API: Lexical analyzer requests LexatomLoader to fill its + * buffer. */ + + /* -- 'Read' reads N lexatoms from a stream into a buffer + * (independent of their size) */ + size_t (*load_lexatoms)(struct QUEX_NAME(LexatomLoader_tag)*, + QUEX_TYPE_LEXATOM* memory, + const size_t N, + bool* end_of_stream_f, + bool* encoding_error_f); + + /* ACTIVE: User fills the buffer manually + * + * To be implemented by the derived class ... */ + void (*fill_prepare)(struct QUEX_NAME(LexatomLoader_tag)* me, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p); + ptrdiff_t (*fill_finish)(struct QUEX_NAME(LexatomLoader_tag)* me, + QUEX_TYPE_LEXATOM* BeginP, + const QUEX_TYPE_LEXATOM* EndP, + const void* FilledEndP); + void (*get_fill_boundaries)(struct QUEX_NAME(LexatomLoader_tag)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p); + + /* destruct_self: Free resources occupied by 'me' BUT NOT 'myself'. + * delete_self: Free resources occupied by 'me' AND 'myself'. */ + void (*destruct_self)(struct QUEX_NAME(LexatomLoader_tag)*); + } derived; +} QUEX_NAME(LexatomLoader); + +QUEX_INLINE QUEX_NAME(LexatomLoader)* +QUEX_NAME(LexatomLoader_new)(QUEX_NAME(ByteLoader)* byte_loader, + struct QUEX_NAME(Converter_tag)* converter, + const size_t TranslationBufferMemorySize); + +QUEX_INLINE QUEX_NAME(LexatomLoader)* +QUEX_NAME(LexatomLoader_new_DEFAULT)(QUEX_NAME(ByteLoader)* byte_loader, + const char* InputCodecName); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_setup)(QUEX_NAME(LexatomLoader)* me, + size_t (*load_lexatoms)(QUEX_NAME(LexatomLoader)*, + QUEX_TYPE_LEXATOM*, + const size_t, bool*, bool*), + ptrdiff_t (*stomach_byte_n)(QUEX_NAME(LexatomLoader)*), + void (*stomach_clear)(QUEX_NAME(LexatomLoader)*), + void (*destruct_self)(QUEX_NAME(LexatomLoader)*), + void (*derived_fill_prepare)(QUEX_NAME(LexatomLoader)* me, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p), + ptrdiff_t (*derived_fill_finish)(QUEX_NAME(LexatomLoader)* me, + QUEX_TYPE_LEXATOM* BeginP, + const QUEX_TYPE_LEXATOM* EndP, + const void* FilledEndP), + void (*derived_get_fill_boundaries)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p), + QUEX_NAME(ByteLoader)* byte_loader, + ptrdiff_t ByteNPerCharacter); + +QUEX_INLINE ptrdiff_t + QUEX_NAME(LexatomLoader_load)(QUEX_NAME(LexatomLoader)* me, + QUEX_TYPE_LEXATOM* RegionBeginP, + const ptrdiff_t Size, + QUEX_TYPE_STREAM_POSITION CharacterIndexBegin, + bool* end_of_stream_f, + bool* encoding_error_f); + +QUEX_INLINE void + QUEX_NAME(LexatomLoader_reset)(QUEX_NAME(LexatomLoader)* me, + QUEX_NAME(ByteLoader)* new_byte_loader); + +QUEX_INLINE void + QUEX_NAME(LexatomLoader_lexatom_index_reset)(QUEX_NAME(LexatomLoader)* me); + +QUEX_NAMESPACE_MAIN_CLOSE + +#include "LexatomLoader_Converter" +#include "LexatomLoader_Plain" + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFERFILLER */ diff --git a/src/parser/LexatomLoader.i b/src/parser/LexatomLoader.i @@ -0,0 +1,258 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_I +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_I + +#include "definitions" +#include "bufferBuffer" +#include "MemoryManager" +#include "LexatomLoader" +#include "Buffer_debug" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE bool QUEX_NAME(LexatomLoader_lexatom_index_seek)(QUEX_NAME(LexatomLoader)* me, + const QUEX_TYPE_STREAM_POSITION LexatomIndex); +QUEX_INLINE QUEX_TYPE_STREAM_POSITION + QUEX_NAME(LexatomLoader_lexatom_index_tell)(QUEX_NAME(LexatomLoader)* me); +QUEX_INLINE bool QUEX_NAME(LexatomLoader_lexatom_index_step_to)(QUEX_NAME(LexatomLoader)* me, + const QUEX_TYPE_STREAM_POSITION TargetCI); +QUEX_INLINE void QUEX_NAME(LexatomLoader_lexatom_index_reset_backup)(QUEX_NAME(LexatomLoader)* me, + QUEX_TYPE_STREAM_POSITION Backup_lexatom_index_next_to_fill, + ptrdiff_t BackupStomachByteN, + QUEX_TYPE_STREAM_POSITION BackupByteLoaderPosition); +QUEX_INLINE void QUEX_NAME(LexatomLoader_reverse_byte_order)(QUEX_TYPE_LEXATOM* Begin, + const QUEX_TYPE_LEXATOM* End); + +QUEX_INLINE void QUEX_NAME(LexatomLoader_delete_self)(QUEX_NAME(LexatomLoader)*); + + +QUEX_INLINE QUEX_NAME(LexatomLoader)* +QUEX_NAME(LexatomLoader_new)(QUEX_NAME(ByteLoader)* byte_loader, + QUEX_NAME(Converter)* converter, + const size_t TranslationBufferMemorySize) +{ + QUEX_NAME(LexatomLoader)* filler; + (void)TranslationBufferMemorySize; + + /* byte_loader = 0; possible if memory is filled manually. */ + if( converter ) { + filler = QUEX_NAME(LexatomLoader_Converter_new)(byte_loader, converter, + TranslationBufferMemorySize); + } + else { + filler = QUEX_NAME(LexatomLoader_Plain_new)(byte_loader); + } + + return filler; +} + +QUEX_INLINE QUEX_NAME(LexatomLoader)* +QUEX_NAME(LexatomLoader_new_DEFAULT)(QUEX_NAME(ByteLoader)* byte_loader, + const char* InputCodecName) +{ +# if defined(QUEX_OPTION_CONVERTER_ICONV) + QUEX_NAME(Converter)* converter = QUEX_NAME(Converter_IConv_new)(InputCodecName, 0); +# elif defined(QUEX_OPTION_CONVERTER_ICU) + QUEX_NAME(Converter)* converter = QUEX_NAME(Converter_ICU_new)(InputCodecName, 0); +# else + QUEX_NAME(Converter)* converter = (QUEX_NAME(Converter)*)0; +# endif + + if( converter ) { + converter->ownership = E_Ownership_LEXICAL_ANALYZER; + if( ! InputCodecName ) { +# ifndef QUEX_OPTION_WARNING_ON_PLAIN_FILLER_DISABLED + __QUEX_STD_printf("Warning: No character encoding name specified, while this\n" \ + "Warning: analyzer was generated for use with a converter.\n" \ + "Warning: Please, consult the documentation about the constructor\n" \ + "Warning: or the reset function. If it is desired to do a plain\n" \ + "Warning: buffer filler with this setup, you might want to disable\n" \ + "Warning: this warning with the macro:\n" \ + "Warning: QUEX_OPTION_WARNING_ON_PLAIN_FILLER_DISABLED\n"); +# endif + return (QUEX_NAME(LexatomLoader)*)0x0; + } + } + + return QUEX_NAME(LexatomLoader_new)(byte_loader, converter, + QUEX_SETTING_TRANSLATION_BUFFER_SIZE); +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_delete_self)(QUEX_NAME(LexatomLoader)* me) +{ + if( ! me ) return; + + if( me->byte_loader && me->byte_loader->ownership == E_Ownership_LEXICAL_ANALYZER ) { + QUEX_NAME(ByteLoader_delete)(&me->byte_loader); + } + + /* destruct_self: Free resources occupied by 'me' BUT NOT 'myself'. + * delete_self: Free resources occupied by 'me' AND 'myself'. */ + if( me->derived.destruct_self ) { + me->derived.destruct_self(me); + } + + QUEXED(MemoryManager_free)((void*)me, E_MemoryObjectType_BUFFER_FILLER); +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_setup)(QUEX_NAME(LexatomLoader)* me, + size_t (*derived_load_lexatoms)(QUEX_NAME(LexatomLoader)*, + QUEX_TYPE_LEXATOM*, + const size_t, + bool*, bool*), + ptrdiff_t (*stomach_byte_n)(QUEX_NAME(LexatomLoader)*), + void (*stomach_clear)(QUEX_NAME(LexatomLoader)*), + void (*derived_destruct_self)(QUEX_NAME(LexatomLoader)*), + void (*derived_fill_prepare)(QUEX_NAME(LexatomLoader)* me, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p), + ptrdiff_t (*derived_fill_finish)(QUEX_NAME(LexatomLoader)* me, + QUEX_TYPE_LEXATOM* BeginP, + const QUEX_TYPE_LEXATOM* EndP, + const void* FilledEndP), + void (*derived_get_fill_boundaries)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p), + QUEX_NAME(ByteLoader)* byte_loader, + ptrdiff_t ByteNPerCharacter) +{ + __quex_assert(me); + __quex_assert(derived_load_lexatoms); + __quex_assert(derived_destruct_self); + + /* Support for buffer filling without user interaction */ + me->stomach_byte_n = stomach_byte_n; + me->stomach_clear = stomach_clear; + me->input_lexatom_tell = QUEX_NAME(LexatomLoader_lexatom_index_tell); + me->input_lexatom_seek = QUEX_NAME(LexatomLoader_lexatom_index_seek); + me->derived.load_lexatoms = derived_load_lexatoms; + me->derived.destruct_self = derived_destruct_self; + me->delete_self = QUEX_NAME(LexatomLoader_delete_self); + + /* Support for manual buffer filling. */ + me->derived.fill_prepare = derived_fill_prepare; + me->derived.fill_finish = derived_fill_finish; + me->derived.get_fill_boundaries = derived_get_fill_boundaries; + + me->byte_loader = byte_loader; + + me->_byte_order_reversion_active_f = false; + me->lexatom_index_next_to_fill = 0; + me->byte_n_per_lexatom = ByteNPerCharacter; + + /* Default: External ownership */ + me->ownership = E_Ownership_EXTERNAL; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_reset)(QUEX_NAME(LexatomLoader)* me, QUEX_NAME(ByteLoader)* new_byte_loader) +/* Resets the LexatomLoader with a new QUEX_NAME(ByteLoader). */ +{ + if( new_byte_loader != me->byte_loader ) { + if( QUEX_NAME(ByteLoader_is_equivalent)(new_byte_loader, me->byte_loader) ) { + __QUEX_STD_printf("Upon 'reset': current and new QUEX_NAME(ByteLoader )objects contain same input handle.\n"); + } + if( me->byte_loader && me->byte_loader->ownership == E_Ownership_LEXICAL_ANALYZER ) { + QUEX_NAME(ByteLoader_delete)(&me->byte_loader); + me->byte_loader = new_byte_loader; + } + } + QUEX_NAME(LexatomLoader_lexatom_index_reset)(me); +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_load)(QUEX_NAME(LexatomLoader)* me, + QUEX_TYPE_LEXATOM* LoadP, + const ptrdiff_t LoadN, + QUEX_TYPE_STREAM_POSITION StartLexatomIndex, + bool* end_of_stream_f, + bool* encoding_error_f) +/* Seeks the input position StartLexatomIndex and loads 'LoadN' + * lexatoms into the engine's buffer starting from 'LoadP'. + * + * RETURNS: Number of loaded lexatoms. */ +{ + ptrdiff_t loaded_n; + + /* (1) Seek to the position where loading shall start. + * */ + if( ! me->input_lexatom_seek(me, StartLexatomIndex) ) { + return 0; + } + __quex_assert(me->lexatom_index_next_to_fill == StartLexatomIndex); + + /* (2) Load content into the given region. + * */ + loaded_n = (ptrdiff_t)me->derived.load_lexatoms(me, LoadP, (size_t)LoadN, + end_of_stream_f, encoding_error_f); +# ifdef QUEX_OPTION_DEBUG_LOAD + { + const QUEX_TYPE_LEXATOM* p; + /* The buffer limit code is not to appear inside the loaded content. */ + for(p=LoadP; p != &LoadP[loaded_n]; ++p) { + __quex_assert(*p != QUEX_SETTING_BUFFER_LIMIT_CODE); + } + } +# endif + + __quex_assert(loaded_n <= LoadN); + me->lexatom_index_next_to_fill += loaded_n; + + /* (3) Optionally reverse the byte order. + * */ + if( me->_byte_order_reversion_active_f ) { + QUEX_NAME(LexatomLoader_reverse_byte_order)(LoadP, &LoadP[loaded_n]); + } + + return loaded_n; +} + + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_reverse_byte_order)(QUEX_TYPE_LEXATOM* Begin, + const QUEX_TYPE_LEXATOM* End) +{ + uint8_t tmp = 0xFF; + QUEX_TYPE_LEXATOM* iterator = 0x0; + + switch( sizeof(QUEX_TYPE_LEXATOM) ) { + default: + __quex_assert(false); + break; + case 1: + /* Nothing to be done */ + break; + case 2: + for(iterator=Begin; iterator != End; ++iterator) { + tmp = *(((uint8_t*)iterator) + 0); + *(((uint8_t*)iterator) + 0) = *(((uint8_t*)iterator) + 1); + *(((uint8_t*)iterator) + 1) = tmp; + } + break; + case 4: + for(iterator=Begin; iterator != End; ++iterator) { + tmp = *(((uint8_t*)iterator) + 0); + *(((uint8_t*)iterator) + 0) = *(((uint8_t*)iterator) + 3); + *(((uint8_t*)iterator) + 3) = tmp; + tmp = *(((uint8_t*)iterator) + 1); + *(((uint8_t*)iterator) + 1) = *(((uint8_t*)iterator) + 2); + *(((uint8_t*)iterator) + 2) = tmp; + } + break; + } +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#include "Buffer.i" +#include "ByteLoader.i" +#include "LexatomLoader_navigation.i" +#include "LexatomLoader_Converter.i" +#include "LexatomLoader_Plain.i" + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFERFILLER_I */ + diff --git a/src/parser/LexatomLoader_Converter b/src/parser/LexatomLoader_Converter @@ -0,0 +1,170 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2007-2008 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER + +/* + * PURPOSE: (NOTE: This has to be reworked) + * + * Reads data from a stream and converts the incoming lexatoms into a + * lexatom format required by the user. The user can specify the coding + * format of the input stream as well as the coding format in which he + * wants it to be put into his buffer. + * + * NOTE: Streams for the quex::buffer comply to three simple requirements: + * + * tell() returning a value of the current input position + * seek(pos) sets the the current input position in the stream + * read_lexatoms(buffer, N) fills the buffer with N lexatoms from the stream. + * returns the number of actually filled lexatoms. + * + * + * MAIN GOAL: The main goal of a 'FixedSizeCharacterStream' class is to + * fill a buffer with N lexatoms starting from consecutive + * stream positions. + * + * ASSUMPTION: + * + * -- The input lexatom format is arbitrary. It can be anything that is + * supported by 'iconv'. Flexible lexatom length codings are supported. + * + * -- The user's lexatoms format has a fixed lexatom size for each + * lexatom. Any coding that involves different byte numbers for different + * lexatoms or 'history' cannot be provided as user format. + * + * PRINCIPLE: + * + * ________ _______ ________ + * | | | ¦ | | + * | FILE | ------> | raw | ------> | Buffer | + * |________| |_______| |________| + * + * A data stream (FILE) delivers lexatoms in an arbitrary coding format. + * These lexatoms are stored bytewise inside a 'raw buffer'. Then this data is + * transformed into the users coding format. The result is directly put into + * the user's buffer. + * + * (1) Fill as many bytes from the stream into the raw buffer + * stream_position + * | + * Stream: ||aa.aa.aa.bb.cc.cc.cc.cc.dd.dd.ee.ee.ee.ee.ff.ff.gg.|| + * + * raw_buffer.iterator + * | + * Raw Buffer: ||aa.aa.aa.bb.cc.cc.cc.cc.dd.dd.ee.ee.ee|| + * + * + * (2) Convert lexatoms in the raw buffer and store into users buffer + * + * + * User's Buffer: ||AA.AA.BB.BB.CC.CC________________________|| + * + * + * yes + * (2b) User's buffer is filled? --------> **EXIT/DONE** + * | + * | no + * * + * (3a) Copy unconverted bytes to the beginning of the raw buffer + * + * Raw Buffer: ||ee.ee.ee______________________________|| + * + * + * (3b) Load remaining bytes from the stream into raw buffer + * + * raw_buffer.iterator + * | + * Raw Buffer: ||ee.ee.ee.ee.ff.ff.gg.hh.ii.ii.________|| + * + * Goto (2) + * + * (4) Convert lexatoms from raw buffer and store them into user's buffer + * + * User's Buffer: ||AA.AA.BB.BB.CC.CC.DD.DD.EE.EE.FF.FF.GG.GG|| + * + * (4b) goto (2b) + * + * NOTE: The 'raw_buffer.iterator' remains between calls to "read_lexatoms()". + * This is equivalent to having some bytes in the pipeline. + **********************************************************************************/ +#if ! defined (__QUEX_OPTION_PLAIN_C) +# include <iostream> +# include <cerrno> +# include <stdexcept> +# include <cstddef> +#else +# include <stddef.h> /* gets: ptrdiff_t */ +#endif +#include "definitions" +#include "bufferBuffer" +#include "LexatomLoader" +#include "Converter" + +QUEX_NAMESPACE_MAIN_OPEN + + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + E_Ownership ownership; + + uint8_t* begin; + uint8_t* fill_end_p; + uint8_t* memory_end; + + uint8_t* next_to_convert_p; + + } QUEX_NAME(RawBuffer); + + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + /* LexatomLoader_Converter: + * *---------------------> QUEX_NAME(ByteLoader + )* *---------------------> Converter + * */ + QUEX_NAME(LexatomLoader) base; + + QUEX_NAME(ByteLoader)* byte_loader; + QUEX_NAME(Converter)* converter; + QUEX_NAME(RawBuffer) raw_buffer; + + } QUEX_NAME(LexatomLoader_Converter); + + + QUEX_INLINE QUEX_NAME(LexatomLoader)* + QUEX_NAME(LexatomLoader_Converter_new)(QUEX_NAME(ByteLoader)* byte_loader, + QUEX_NAME(Converter)* converter, + size_t RawBufferSize); + + QUEX_INLINE void QUEX_NAME(LexatomLoader_Converter_move_away_passed_content)(QUEX_NAME(LexatomLoader_Converter)*); + QUEX_INLINE size_t QUEX_NAME(__LexatomLoader_Converter_fill_raw_buffer)(QUEX_NAME(LexatomLoader_Converter)*); + + QUEX_INLINE void QUEX_NAME(RawBuffer_init)(QUEX_NAME(RawBuffer)* me, + uint8_t* Begin, size_t SizeInBytes); + +#ifdef QUEX_OPTION_ASSERTS +# define QUEX_ASSERT_RAW_BUFFER(BI) \ + __quex_assert(BI); \ + __quex_assert((BI)->next_to_convert_p >= (BI)->begin); \ + __quex_assert((BI)->next_to_convert_p <= (BI)->fill_end_p);\ + __quex_assert((BI)->fill_end_p >= (BI)->begin); \ + __quex_assert((BI)->fill_end_p <= (BI)->memory_end); + +# define QUEX_ASSERT_RAW_BUFFER_EASY(BI) \ + __quex_assert(BI); \ + __quex_assert((BI)->next_to_convert_p >= (BI)->begin); \ + __quex_assert((BI)->next_to_convert_p <= (BI)->fill_end_p); + +#else +# define QUEX_ASSERT_RAW_BUFFER(BI) /* empty */ +# define QUEX_ASSERT_RAW_BUFFER_EASY(BI) /* empty */ +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + + +#ifdef QUEX_OPTION_CONVERTER_ICONV +# include <quex/code_base/buffer/lexatoms/converter/iconv/Converter_IConv> +#endif +#ifdef QUEX_OPTION_CONVERTER_ICU +# include <quex/code_base/buffer/lexatoms/converter/icu/Converter_ICU> +#endif + + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER */ diff --git a/src/parser/LexatomLoader_Converter.i b/src/parser/LexatomLoader_Converter.i @@ -0,0 +1,428 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2007-2015 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER_I +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER_I + +#include "MemoryManager" +#include "LexatomLoader" +#include "LexatomLoader_Converter" +#include "iconv-argument-types.h" + + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_construct)(QUEX_NAME(LexatomLoader_Converter)* me, + QUEX_NAME(ByteLoader)* byte_loader, + QUEX_NAME(Converter)* converter, + size_t RawMemorySize); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_stomach_clear)(QUEX_NAME(LexatomLoader)* alter_ego); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_destruct_self)(QUEX_NAME(LexatomLoader)* alter_ego); + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Converter_stomach_byte_n)(QUEX_NAME(LexatomLoader)* alter_ego); + +QUEX_INLINE size_t +QUEX_NAME(LexatomLoader_Converter_load_lexatoms)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* RegionBeginP, + const size_t N, + bool* end_of_stream_f, + bool* encoding_error_f); +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_fill_prepare)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_get_fill_boundaries)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p); + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Converter_fill_finish)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* insertion_p, + const QUEX_TYPE_LEXATOM* BufferEnd, + const void* ContentEnd); + +QUEX_INLINE E_LoadResult +QUEX_NAME(LexatomLoader_call_converter)(QUEX_NAME(LexatomLoader_Converter)* me, + QUEX_TYPE_LEXATOM** insertion_p, + QUEX_TYPE_LEXATOM* RegionBeginP, + const QUEX_TYPE_LEXATOM* RegionEndP); +QUEX_INLINE void +QUEX_NAME(LexatomLoader_remove_spurious_BOM)(QUEX_NAME(LexatomLoader_Converter)* me, + QUEX_TYPE_LEXATOM** buffer_insertion_p, + QUEX_TYPE_LEXATOM* RegionBeginP); + +QUEX_INLINE void +QUEX_NAME(RawBuffer_init)(QUEX_NAME(RawBuffer)* me, + uint8_t* Begin, size_t SizeInBytes); +QUEX_INLINE void +QUEX_NAME(RawBuffer_move_away_passed_content)(QUEX_NAME(RawBuffer)* me); + +QUEX_INLINE bool +QUEX_NAME(RawBuffer_load)(QUEX_NAME(RawBuffer)* me, + QUEX_NAME(ByteLoader)* byte_loader, + bool* end_of_stream_f); + +QUEX_INLINE QUEX_NAME(LexatomLoader)* +QUEX_NAME(LexatomLoader_Converter_new)(QUEX_NAME(ByteLoader)* byte_loader, + QUEX_NAME(Converter)* converter, + size_t RawMemorySize) +{ + QUEX_NAME(LexatomLoader_Converter)* me; + __quex_assert(RawMemorySize >= 6); /* UTF-8 char can be 6 bytes long */ + + if( ! converter ) { + return (QUEX_NAME(LexatomLoader)*)0; + } +# if 0 /* No longer a constraint: */ + else if( byte_loader && ! byte_loader->binary_mode_f ) { + /* Binary mode is ABSOLUTELY REQUIRED for converters, otherwise the + * positioning with respect to the raw buffer becomes unreliable. */ + __QUEX_STD_printf("! LexatomLoader_Converter_new: QUEX_NAME(ByteLoader )is not in binary mode. !\n"); + __QUEX_STD_printf("! Has file been opened in binary mode? !\n"); + return (QUEX_NAME(LexatomLoader)*)0; + } +# endif + + /* The 'LexatomLoader_Converter' is the same host for all converters. + * Converters are pointed to by 'converter', */ + me = (QUEX_NAME(LexatomLoader_Converter)*) \ + QUEXED(MemoryManager_allocate)(sizeof(QUEX_NAME(LexatomLoader_Converter)), + E_MemoryObjectType_BUFFER_FILLER); + if( ! me) return (QUEX_NAME(LexatomLoader)*)0; + + QUEX_NAME(LexatomLoader_Converter_construct)(me, byte_loader, converter, RawMemorySize); + + return &me->base; + +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_construct)(QUEX_NAME(LexatomLoader_Converter)* me, + QUEX_NAME(ByteLoader)* byte_loader, + QUEX_NAME(Converter)* converter, + size_t RawMemorySize) +{ + /* A linear relationship between stream position and lexatom index + * requires that: (1) The input stream is in 'binary mode'. That is, the + * stream position is proportional to the number of bytes that lie + * behind. (2) The input codec is of fixed size, i.e. + * converter->byte_n_per_lexatom != -1. */ + ptrdiff_t byte_n_per_lexatom = byte_loader && byte_loader->binary_mode_f ? + converter->byte_n_per_lexatom : -1; + uint8_t* raw_memory; + + /* NO LONGER VALID: "Binary mode is absolutely required for converters, + * otherwise the positioning with respect to the raw + * buffer becomes unreliable." */ + /* __quex_assert( ! byte_loader || byte_loader->binary_mode_f ); */ + + QUEX_NAME(LexatomLoader_setup)(&me->base, + QUEX_NAME(LexatomLoader_Converter_load_lexatoms), + QUEX_NAME(LexatomLoader_Converter_stomach_byte_n), + QUEX_NAME(LexatomLoader_Converter_stomach_clear), + QUEX_NAME(LexatomLoader_Converter_destruct_self), + QUEX_NAME(LexatomLoader_Converter_fill_prepare), + QUEX_NAME(LexatomLoader_Converter_fill_finish), + QUEX_NAME(LexatomLoader_Converter_get_fill_boundaries), + byte_loader, + byte_n_per_lexatom); + + /* Initialize the conversion operations */ + me->converter = converter; + me->converter->virginity_f = true; + + /* Initialize the raw buffer that holds the plain bytes of the input file + * (setup to trigger initial reload) */ + raw_memory = QUEXED(MemoryManager_allocate)(RawMemorySize, + E_MemoryObjectType_BUFFER_RAW); + QUEX_NAME(RawBuffer_init)(&me->raw_buffer, raw_memory, RawMemorySize); + + QUEX_ASSERT_RAW_BUFFER(&me->raw_buffer); +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Converter_stomach_byte_n)(QUEX_NAME(LexatomLoader)* alter_ego) +/* RETURNS: Number of bytes that were read from the input stream, but remained + * inside the 'stomach' without being filled into the drain. + * '-1' reports that the LexatomLoader cannot tell how many bytes are + * in the stomach. */ +{ + QUEX_NAME(LexatomLoader_Converter)* me = (QUEX_NAME(LexatomLoader_Converter)*)alter_ego; + ptrdiff_t byte_n; + ptrdiff_t converter_byte_n; + + byte_n = me->raw_buffer.fill_end_p - me->raw_buffer.next_to_convert_p; + + /* me->converter->stomach_byte_n == 0 => converter does NOT keep any + * bytes in stomach. + * me->converter->stomach_byte_n() == -1 => converter CANNOT tell how + * many bytes in stomach. */ + if( me->converter->stomach_byte_n ) { + converter_byte_n = me->converter->stomach_byte_n(me->converter); + if( converter_byte_n == - 1) return (ptrdiff_t)-1; + byte_n += converter_byte_n; + } + + return byte_n; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_stomach_clear)(QUEX_NAME(LexatomLoader)* alter_ego) +{ + QUEX_NAME(LexatomLoader_Converter)* me = (QUEX_NAME(LexatomLoader_Converter)*)alter_ego; + QUEX_NAME(RawBuffer_init)(&me->raw_buffer, 0, 0); + if( me->converter->stomach_clear ) me->converter->stomach_clear(me->converter); +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_destruct_self)(QUEX_NAME(LexatomLoader)* alter_ego) +/* destruct_self: Free resources occupied by 'me' BUT NOT 'myself'. + * delete_self: Free resources occupied by 'me' AND 'myself'. */ +{ + QUEX_NAME(LexatomLoader_Converter)* me = (QUEX_NAME(LexatomLoader_Converter)*)alter_ego; + + if( ! me ) return; + + QUEX_ASSERT_RAW_BUFFER(&me->raw_buffer); + + if( me->converter && me->converter->ownership == E_Ownership_LEXICAL_ANALYZER ) { + me->converter->delete_self(me->converter); + } + + QUEXED(MemoryManager_free)((void*)me->raw_buffer.begin, + E_MemoryObjectType_BUFFER_RAW); +} + +QUEX_INLINE size_t +QUEX_NAME(LexatomLoader_Converter_load_lexatoms)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* RegionBeginP, + const size_t N, + bool* end_of_stream_f, + bool* encoding_error_f) +/* Loads content into the raw buffer, convert it and write it to the engine's + * buffer. The region where to write into the engine's buffer expands from + * 'RegionBeginP' to 'N' lexatoms after it. + * + * RETURNS: Number of loaded lexatoms into the given region. */ +{ + QUEX_NAME(LexatomLoader_Converter)* me = (QUEX_NAME(LexatomLoader_Converter)*)alter_ego; + QUEX_NAME(RawBuffer)* raw = &me->raw_buffer; + QUEX_TYPE_LEXATOM* buffer_insertion_p = RegionBeginP; + const QUEX_TYPE_LEXATOM* BufferRegionEnd = &RegionBeginP[N]; + E_LoadResult load_result; + bool raw_load_complete_f; + bool raw_end_of_stream_f; +# if 0 + int i; + QUEX_TYPE_LEXATOM* buffer_insertion_begin_p; +# endif + (void)encoding_error_f; + (void)raw; + + __quex_assert(me->converter); + __quex_assert(alter_ego); + __quex_assert(RegionBeginP); + QUEX_ASSERT_RAW_BUFFER(raw); + + /* NOT: QUEX_IF_ASSERTS_poison(RegionBeginP, &RegionBeginP[N]); + * The buffer must remain intact, in case that not all is loaded. */ + + /* Some converters keep some content internally. So, it is a more general + * solution to convert first and reload new bytes upon need. */ + load_result = QUEX_NAME(LexatomLoader_call_converter)(me, &buffer_insertion_p, + RegionBeginP, + BufferRegionEnd); + + /* Convert, as long as the following two hold: + * (i) Drain is not totally filled. + * (ii) Loading of 'to-be-converted bytes' received enough to fill the + * raw buffer to its limits. The contrary indicates that there is + * an transmission interuption, or even and end-of-stream. In both + * cases, the analyser may continue, before the next try. */ + raw_end_of_stream_f = false; + raw_load_complete_f = true; + while( load_result == E_LoadResult_INCOMPLETE && raw_load_complete_f ) { + __quex_assert(buffer_insertion_p < BufferRegionEnd); /* '==' break */ + + if( ! raw_end_of_stream_f ) { + raw_load_complete_f = QUEX_NAME(RawBuffer_load)(&me->raw_buffer, + me->base.byte_loader, + &raw_end_of_stream_f); + } else { + raw_load_complete_f = false; + } + + /* next_to_convert_p == raw->fill_end_p => nothing happens. */ + load_result = QUEX_NAME(LexatomLoader_call_converter)(me, &buffer_insertion_p, + RegionBeginP, + BufferRegionEnd); + } + + __quex_assert(BufferRegionEnd >= buffer_insertion_p); + /* NOT: QUEX_IF_ASSERTS_poison(buffer_insertion_p, BufferRegionEnd); + * Buffer MUST be left as is, in case of ERROR! */ + + switch( load_result ) { + case E_LoadResult_COMPLETE: + break; + case E_LoadResult_INCOMPLETE: + /* Some ByteLoader-s (socket based ones, for example) may not be + * able to fill the whole raw buffer, but still the end of stream + * is not reached. Only, if the raw buffer detected end of stream + * the end of stream can be claimed. */ + if( raw_end_of_stream_f ) { + *end_of_stream_f = true; + } + /* __quex_assert(raw->next_to_convert_p == raw->fill_end_p); */ + /* Nothing can be loaded; Everything is converted. */ + + break; + case E_LoadResult_BAD_LEXATOM: + *encoding_error_f = true; + break; + + case E_LoadResult_NO_MORE_DATA: + /* A converter does not load--when called, there should be data. + * => Cannot complain 'NO_MORE_DATA' (end of stream). */ + default: + __quex_assert(false); + } + + /* 'buffer_insertion_p' was updated by 'convert' and points behind the + * last byte that was converted. */ + return (size_t)(buffer_insertion_p - RegionBeginP); +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_fill_prepare)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p) +{ + (void)buffer; + QUEX_NAME(LexatomLoader_Converter)* me = (QUEX_NAME(LexatomLoader_Converter)*)alter_ego; + + QUEX_NAME(RawBuffer_move_away_passed_content)(&me->raw_buffer); + + alter_ego->derived.get_fill_boundaries(alter_ego, buffer, begin_p, end_p); +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Converter_get_fill_boundaries)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p) +{ + QUEX_NAME(LexatomLoader_Converter)* me = (QUEX_NAME(LexatomLoader_Converter)*)alter_ego; + (void)buffer; + + *begin_p = (void*)me->raw_buffer.fill_end_p; + *end_p = (void*)me->raw_buffer.memory_end; +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Converter_fill_finish)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* RegionBeginP, + const QUEX_TYPE_LEXATOM* RegionEndP, + const void* FilledEndP_raw) +/* Converts what has been filled into the 'raw_buffer' until 'FilledEndP + * and stores it into the buffer. */ +{ + QUEX_NAME(LexatomLoader_Converter)* me = (QUEX_NAME(LexatomLoader_Converter)*)alter_ego; + QUEX_NAME(RawBuffer)* raw = &me->raw_buffer; + QUEX_TYPE_LEXATOM* insertion_p = RegionBeginP; + uint8_t* FilledEndP = (uint8_t*)FilledEndP_raw; + E_LoadResult load_result; + + __quex_assert(FilledEndP >= raw->next_to_convert_p); + __quex_assert(FilledEndP <= raw->memory_end); + + /* Assert triggers => FilledEndP points WRONGLY BEHIND terminating zero. + * (FilledEndP, may point to it, at max.) */ + __quex_assert( FilledEndP <= raw->next_to_convert_p + || FilledEndP[-1] != QUEX_SETTING_BUFFER_LIMIT_CODE); + + raw->fill_end_p = FilledEndP; + QUEX_ASSERT_RAW_BUFFER(raw); + + load_result = QUEX_NAME(LexatomLoader_call_converter)(me, &insertion_p, + RegionBeginP, + RegionEndP); + (void)load_result; + + QUEX_ASSERT_RAW_BUFFER(raw); + return insertion_p - RegionBeginP; +} + +QUEX_INLINE E_LoadResult +QUEX_NAME(LexatomLoader_call_converter)(QUEX_NAME(LexatomLoader_Converter)* me, + QUEX_TYPE_LEXATOM** insertion_p, + QUEX_TYPE_LEXATOM* RegionBeginP, + const QUEX_TYPE_LEXATOM* RegionEndP) +{ + QUEX_NAME(RawBuffer)* raw = &me->raw_buffer; + E_LoadResult load_result; + (void)load_result; + + load_result = me->converter->convert(me->converter, + &raw->next_to_convert_p, raw->fill_end_p, + insertion_p, RegionEndP); + + QUEX_NAME(LexatomLoader_remove_spurious_BOM)(me, insertion_p, RegionBeginP); + me->converter->virginity_f = false; + + /* A converter does not load => It cannot report 'end of stream' */ + __quex_assert( load_result == E_LoadResult_COMPLETE + || load_result == E_LoadResult_INCOMPLETE + || load_result == E_LoadResult_BAD_LEXATOM); + return load_result; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_remove_spurious_BOM)(QUEX_NAME(LexatomLoader_Converter)* me, + QUEX_TYPE_LEXATOM** buffer_insertion_p, + QUEX_TYPE_LEXATOM* RegionBeginP) +{ + uint32_t first_lexatom; + + if( *buffer_insertion_p == RegionBeginP ) return; + + first_lexatom = (uint32_t)RegionBeginP[0]; /* avoid warning */ + if( first_lexatom != 0xFEFF ) return; + + if( ! me->converter->virginity_f ) { + QUEX_ERROR_EXIT("Converter produced BOM upon not-first call to 'convert'\n" + "Better make sure that converter NEVER produces BOM.\n" + "(May be, by specifiying the endianness of 'FromCoding' or 'ToCoding')\n"); + } + + __QUEX_STD_memmove(RegionBeginP, &RegionBeginP[1], + (size_t)(*buffer_insertion_p - &RegionBeginP[1]) * sizeof(QUEX_TYPE_LEXATOM)); + + *buffer_insertion_p = &(*buffer_insertion_p)[-1]; +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#include "LexatomLoader.i" +#include "LexatomLoader_Converter_RawBuffer.i" +#include "Converter.i" + +#ifdef QUEX_OPTION_CONVERTER_ICONV +# include <quex/code_base/buffer/lexatoms/converter/iconv/Converter_IConv.i> +#endif +#ifdef QUEX_OPTION_CONVERTER_ICU +# include <quex/code_base/buffer/lexatoms/converter/icu/Converter_ICU.i> +#endif + + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER_I */ diff --git a/src/parser/LexatomLoader_Converter_RawBuffer.i b/src/parser/LexatomLoader_Converter_RawBuffer.i @@ -0,0 +1,118 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2007-2015 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER_RAW_BUFFER_I +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER_RAW_BUFFER_I + +#include "MemoryManager" +#include "LexatomLoader" +#include "LexatomLoader_Converter" +#include "iconv-argument-types.h" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_NAME(RawBuffer_init)(QUEX_NAME(RawBuffer)* me, + uint8_t* Begin, + size_t SizeInBytes) +/* Initialize raw buffer. + * (1) Begin != 0 => Assign memory. + * (2) Begin == 0 => Only reset pointers, so buffer is 'empty'. */ +{ + if( Begin ) { + me->begin = Begin; + me->memory_end = &Begin[(ptrdiff_t)SizeInBytes]; + } + me->fill_end_p = &me->begin[0]; + me->next_to_convert_p = &me->begin[0]; /* --> trigger reload. */ + + QUEX_IF_ASSERTS_poison(me->begin, me->memory_end); +} + +QUEX_INLINE void +QUEX_NAME(RawBuffer_move_away_passed_content)(QUEX_NAME(RawBuffer)* me) +/* Consider any content in the raw buffer from begin to 'next_to_convert_p' as + * passed and useless. Thus, move what comes behind to the beginning of the + * buffer. Adapt: + * + * -- '.fill_end_p' + * -- '.next_to_convert_p' + * + * The relation of '.next_to_convert_p' and '.next_to_convert_character_index' + * remains unaffected. The pointer still points to the same character index. */ +{ + uint8_t* move_begin_p; + ptrdiff_t move_size; + ptrdiff_t move_distance; + + __quex_assert(me->next_to_convert_p <= me->fill_end_p); + QUEX_ASSERT_RAW_BUFFER(me); + + move_begin_p = me->next_to_convert_p; + move_size = me->fill_end_p - me->next_to_convert_p; + move_distance = me->next_to_convert_p - me->begin; + + if( ! move_distance ) { + return; + } + else if( move_size ) { + __QUEX_STD_memmove((void*)me->begin, (void*)move_begin_p, (size_t)move_size); + } + + me->next_to_convert_p = me->begin; + me->fill_end_p -= move_distance; + + QUEX_IF_ASSERTS_poison(me->fill_end_p, me->memory_end); + QUEX_ASSERT_RAW_BUFFER(me); +} + +QUEX_INLINE bool +QUEX_NAME(RawBuffer_load)(QUEX_NAME(RawBuffer)* me, + QUEX_NAME(ByteLoader)* byte_loader, + bool* end_of_stream_f) +/* Try to fill the me buffer to its limits with data from the file. The + * filling starts from its current position, thus the remaining bytes to be + * translated are exactly the number of bytes in the buffer. + * + * '*end_of_stream_f' = true, if the ByteLoader reported 'END OF STREAM', + * or if it returned ZERO BYTES. + * false, else. + * + * NOTE: Some ByteLoaders (such as the POSIX ByteLoader) are not capable of + * telling whether the end of stream occurred. + * + * END OF STREAM NOT => 'end_of_stream_f = true' + * + * But, + * + * 'end_of_stream_f == true' => END OF STREAM + * */ +{ + uint8_t* fill_begin_p; + size_t load_request_n; + size_t loaded_byte_n; + + QUEX_ASSERT_RAW_BUFFER(me); + + /* Move content that has not yet been converted to the buffer's begin. */ + QUEX_NAME(RawBuffer_move_away_passed_content)(me); + + fill_begin_p = me->fill_end_p; + load_request_n = (size_t)(me->memory_end - fill_begin_p); + /* load(): Blocks until either bytes are received, or the end-of-stream + * occurs. In the latter case zero bytes are received. The end- + * of-stream, may also be detected in other cases--as hint. */ + loaded_byte_n = byte_loader->load(byte_loader, fill_begin_p, load_request_n, + end_of_stream_f); + me->fill_end_p = &fill_begin_p[loaded_byte_n]; + + if( ! loaded_byte_n ) { + *end_of_stream_f = true; + } + + QUEX_ASSERT_RAW_BUFFER(me); + return loaded_byte_n == load_request_n; +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_CONVERTER_RAW_BUFFER_I */ diff --git a/src/parser/LexatomLoader_Plain b/src/parser/LexatomLoader_Plain @@ -0,0 +1,32 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +/* (C) 2008 Frank-Rene Schaefer*/ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_PLAIN +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_PLAIN +/**/ + +#if ! defined (__QUEX_OPTION_PLAIN_C) +# include <iostream> +# include <cerrno> +# include <stdexcept> +#endif +#include "definitions" +#include "bufferBuffer" +#include "LexatomLoader" +#include "ByteLoader" + +QUEX_NAMESPACE_MAIN_OPEN + + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(LexatomLoader_Plain_tag) { + /* Derived LexatomLoader from implemented as 'first member is base class'. + * (This is the 'C' way to express derivation) */ + QUEX_NAME(LexatomLoader) base; + } QUEX_NAME(LexatomLoader_Plain); + + QUEX_INLINE QUEX_NAME(LexatomLoader)* + QUEX_NAME(LexatomLoader_Plain_new)(QUEX_NAME(ByteLoader)* byte_loader); + /* input_handle is the file handle or pointer to the input stream from where the + * incoming characters are to be read. */ + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __INCLUDE_GUARD__QUEX_BUFFER_INPUT_STRATEGY_PLAIN__ */ diff --git a/src/parser/LexatomLoader_Plain.i b/src/parser/LexatomLoader_Plain.i @@ -0,0 +1,198 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +/* (C) 2008 Frank-Rene Schaefer*/ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_PLAIN_I +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_PLAIN_I +/**/ + +#if ! defined (__QUEX_OPTION_PLAIN_C) +# include <iostream> +# include <cerrno> +# include <stdexcept> +#endif +#include "definitions" +#include "bufferBuffer" +#include "LexatomLoader" +#include "MemoryManager" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_construct)(QUEX_NAME(LexatomLoader_Plain)*, QUEX_NAME(ByteLoader)* byte_loader); + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Plain_stomach_byte_n)(QUEX_NAME(LexatomLoader)* alter_ego); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_stomach_clear)(QUEX_NAME(LexatomLoader)* alter_ego); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_destruct_self)(QUEX_NAME(LexatomLoader)* alter_ego); + +QUEX_INLINE size_t +QUEX_NAME(LexatomLoader_Plain_load_lexatoms)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* RegionBeginP, + const size_t N, + bool* end_of_stream_f, + bool* encoding_error_f); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_fill_prepare)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p); + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Plain_fill_finish)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* insertion_p, + const QUEX_TYPE_LEXATOM* BufferEnd, + const void* ContentEnd); + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_get_fill_boundaries)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p); + +QUEX_INLINE QUEX_NAME(LexatomLoader)* +QUEX_NAME(LexatomLoader_Plain_new)(QUEX_NAME(ByteLoader)* byte_loader) +{ + QUEX_NAME(LexatomLoader_Plain)* me = \ + (QUEX_NAME(LexatomLoader_Plain)*) \ + QUEXED(MemoryManager_allocate)(sizeof(QUEX_NAME(LexatomLoader_Plain)), + E_MemoryObjectType_BUFFER_FILLER); + __quex_assert(me); + /* __quex_assert(byte_loader); not for manual filling. */ + + QUEX_NAME(LexatomLoader_Plain_construct)(me, byte_loader); + + return &me->base; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_construct)(QUEX_NAME(LexatomLoader_Plain)* me, + QUEX_NAME(ByteLoader)* byte_loader) +{ + /* A linear relationship between stream position and lexatom index + * requires that the input stream is in 'binary mode'. That is, the + * stream position is proportional to the number of bytes that lie + * behind. */ + ptrdiff_t byte_n_per_lexatom = byte_loader && byte_loader->binary_mode_f ? + (ptrdiff_t)sizeof(QUEX_TYPE_LEXATOM) : -1; + QUEX_NAME(LexatomLoader_setup)(&me->base, + QUEX_NAME(LexatomLoader_Plain_load_lexatoms), + QUEX_NAME(LexatomLoader_Plain_stomach_byte_n), + QUEX_NAME(LexatomLoader_Plain_stomach_clear), + QUEX_NAME(LexatomLoader_Plain_destruct_self), + QUEX_NAME(LexatomLoader_Plain_fill_prepare), + QUEX_NAME(LexatomLoader_Plain_fill_finish), + QUEX_NAME(LexatomLoader_Plain_get_fill_boundaries), + byte_loader, + byte_n_per_lexatom); +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Plain_stomach_byte_n)(QUEX_NAME(LexatomLoader)* alter_ego) +{ + (void)alter_ego; + return (ptrdiff_t)0; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_stomach_clear)(QUEX_NAME(LexatomLoader)* alter_ego) +{ + (void)alter_ego; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_destruct_self)(QUEX_NAME(LexatomLoader)* alter_ego) +/* destruct_self: Free resources occupied by 'me' BUT NOT 'myself'. + * delete_self: Free resources occupied by 'me' AND 'myself'. */ +{ + (void)alter_ego; + /* There is nothing allocated by a LexatomLoader_Plain. + * Nothing to do. */ +} + +QUEX_INLINE size_t +QUEX_NAME(LexatomLoader_Plain_load_lexatoms)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* RegionBeginP, + const size_t N, + bool* end_of_stream_f, + bool* encoding_error_f) +/* Loads content into a region of memory. Does NOT effect any of the buffer's + * variables. + * + * RETURNS: Number of loaded lexatoms into the given region. */ +{ + QUEX_NAME(LexatomLoader_Plain)* me = (QUEX_NAME(LexatomLoader_Plain)*)alter_ego; + size_t loaded_byte_n = (size_t)-1; + size_t loaded_n; + (void)encoding_error_f; + + __quex_assert(alter_ego); + __quex_assert(RegionBeginP); + __quex_assert(me->base.byte_loader); + /* NOT: QUEX_IF_ASSERTS_poison(RegionBeginP, &RegionBeginP[N]); + * The buffer must remain intact, in case that not all is loaded. */ + loaded_byte_n = me->base.byte_loader->load(me->base.byte_loader, + RegionBeginP, + N * sizeof(QUEX_TYPE_LEXATOM), + end_of_stream_f); + + if( loaded_byte_n % sizeof(QUEX_TYPE_LEXATOM) ) { + __QUEX_STD_printf("Error: End of file cuts in the middle a multi-byte character."); + } + loaded_n = loaded_byte_n / sizeof(QUEX_TYPE_LEXATOM); + + return loaded_n; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_fill_prepare)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p) +{ + /* Move-away of passed content in engine's buffer is done by caller. */ + alter_ego->derived.get_fill_boundaries(alter_ego, buffer, begin_p, end_p); +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_Plain_get_fill_boundaries)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_NAME(Buffer)* buffer, + void** begin_p, + const void** end_p) +{ + (void)alter_ego; + + *begin_p = (void*)buffer->input.end_p; + *end_p = (void*)buffer->_memory._back; +} + +QUEX_INLINE ptrdiff_t +QUEX_NAME(LexatomLoader_Plain_fill_finish)(QUEX_NAME(LexatomLoader)* alter_ego, + QUEX_TYPE_LEXATOM* insertion_p, + const QUEX_TYPE_LEXATOM* BufferEnd, + const void* FilledEndP_raw) +{ + const QUEX_TYPE_LEXATOM* FilledEndP = (const QUEX_TYPE_LEXATOM*)FilledEndP_raw; + (void)alter_ego; + (void)BufferEnd; + + __quex_assert(FilledEndP >= insertion_p); + __quex_assert(FilledEndP <= BufferEnd); + /* Assert triggers => FilledEndP points WRONGLY BEHIND terminating zero. + * (FilledEndP, may point to it, at max.) */ + __quex_assert( FilledEndP <= insertion_p + || FilledEndP[-1] != QUEX_SETTING_BUFFER_LIMIT_CODE); + + /* Copying of content is done, already, by caller. */ + /* Inserted number of lexatoms = End - Begin. */ + return (ptrdiff_t)(FilledEndP - insertion_p); +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#include "LexatomLoader.i" + +#endif /* __INCLUDE_GUARD__QUEX_BUFFER_INPUT_STRATEGY_PLAIN_I__ */ diff --git a/src/parser/LexatomLoader_navigation.i b/src/parser/LexatomLoader_navigation.i @@ -0,0 +1,195 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_NAVIGATION_I +#define __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_NAVIGATION_I +/* PURPOSE: LexatomLoader's seek: + * + * .--------------------------------------------------------------. + * | Setting the lexatom index of the next lexatom to be filled | + * | into the buffer. | + * '--------------------------------------------------------------' + * + * NOT TO CONFUSE with two other forms of seek: + * + * -- Buffer's seek sets the '_read_p' of the analyzer to a lexatom + * that is to be treated next. + * -- QUEX_NAME(ByteLoader)'s seek sets the position in the low level input + * stream. + * + * A LexatomLoader's seek has NO direct influence on the content or the pointers + * of the Buffer object that it fills. + * + * The difference between the QUEX_NAME(ByteLoader)'s seeking (stream seeking) and the + * LexatomLoader's seeking is that the QUEX_NAME(ByteLoader )understands the position + * independently of its meaning. The LexatomLoader already interprets the stream + * as 'lexatoms'. A QUEX_NAME(ByteLoader )sets the stream to a particular byte position. + * A LexatomLoader prepare the input of a lexatom. + * + * (C) Frank-Rene Schaefer */ + +#include "definitions" +#include "bufferBuffer" +#include "MemoryManager" +#include "LexatomLoader" +#include "Buffer_debug" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE QUEX_TYPE_STREAM_POSITION +QUEX_NAME(LexatomLoader_lexatom_index_tell)(QUEX_NAME(LexatomLoader)* me) +{ + return me->lexatom_index_next_to_fill; +} + + +QUEX_INLINE bool +QUEX_NAME(LexatomLoader_lexatom_index_seek)(QUEX_NAME(LexatomLoader)* me, + const QUEX_TYPE_STREAM_POSITION CharacterIndex) +/* LexatomLoader's seek sets the input position for the next lexatom load in + * the stream. That is, it adapts: + * + * 'lexatom_index_next_to_fill = CharacterIndex' + * + * and the byte loader is brought into a position so that this will happen. + * + * RETURNS: true upon success, false else. */ +{ + ptrdiff_t backup_stomach_byte_n; + QUEX_TYPE_STREAM_POSITION backup_byte_loader_position; + QUEX_TYPE_STREAM_POSITION backup_lexatom_index_next_to_fill; + QUEX_TYPE_STREAM_POSITION target_byte_pos; + + if( me->lexatom_index_next_to_fill == CharacterIndex ) return true; + + /* Converter reports '-1' => unable to determine the number of bytes in + * the stomach. + * => When backup position is to setup, start stepping from beginning. + * (This is currently only an issue with ICU; IConv behaves well) */ + backup_stomach_byte_n = me->stomach_byte_n(me); + backup_byte_loader_position = me->byte_loader->tell(me->byte_loader); + backup_lexatom_index_next_to_fill = me->lexatom_index_next_to_fill; + + if( me->byte_n_per_lexatom != -1 ) { + /* LINEAR RELATION between lexatom index and stream position + * (It is not safe to assume that it can be computed) */ + target_byte_pos = CharacterIndex * me->byte_n_per_lexatom + + me->byte_loader->initial_position; + + me->byte_loader->seek(me->byte_loader, target_byte_pos); + if( me->byte_loader->tell(me->byte_loader) != target_byte_pos ) { + me->byte_loader->seek(me->byte_loader, backup_byte_loader_position); + return false; + } + me->lexatom_index_next_to_fill = CharacterIndex; + me->stomach_clear(me); + return true; + } + + /* STEPPING (WITHOUT COMPUTING) to the input position. */ + if( CharacterIndex < me->lexatom_index_next_to_fill ) { + /* Character index lies backward, so stepping needs to start from + * the initial position. */ + QUEX_NAME(LexatomLoader_lexatom_index_reset)(me); + } + + /* step_forward_n_lexatoms() calls derived.load_lexatoms() + * which increments 'lexatom_index_next_to_fill'. */ + if( ! QUEX_NAME(LexatomLoader_lexatom_index_step_to)(me, (ptrdiff_t)CharacterIndex) ) { + QUEX_NAME(LexatomLoader_lexatom_index_reset_backup)(me, + backup_lexatom_index_next_to_fill, + backup_stomach_byte_n, + backup_byte_loader_position); + return false; + } + __quex_assert(me->lexatom_index_next_to_fill == CharacterIndex); + return true; +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_lexatom_index_reset)(QUEX_NAME(LexatomLoader)* me) +/* Set the lexatom index position to '0' and the byte loader to the initial + * position. The 'stomach' of derived buffer fillers is cleared, so that + * filling may start from the beginning. */ +{ + if( me->byte_loader ) { + me->byte_loader->seek(me->byte_loader, me->byte_loader->initial_position); + if( me->byte_loader->tell(me->byte_loader) != me->byte_loader->initial_position ) { + QUEX_ERROR_EXIT("QUEX_NAME(ByteLoader )failed to seek to initial position.\n"); + } + } + me->lexatom_index_next_to_fill = 0; + me->stomach_clear(me); +} + +QUEX_INLINE void +QUEX_NAME(LexatomLoader_lexatom_index_reset_backup)(QUEX_NAME(LexatomLoader)* me, + QUEX_TYPE_STREAM_POSITION Backup_lexatom_index_next_to_fill, + ptrdiff_t BackupStomachByteN, + QUEX_TYPE_STREAM_POSITION BackupByteLoaderPosition) +/* Reset a previous state of the LexatomLoader and its QUEX_NAME(ByteLoader). */ +{ + QUEX_TYPE_STREAM_POSITION backup_byte_pos; + + if( BackupStomachByteN == -1 ) { + /* Since it was not possible to determine the number of bytes in + * the converter's stomach, the backup position must be reached + * by starting from the begining. */ + QUEX_NAME(LexatomLoader_lexatom_index_reset)(me); + if( ! QUEX_NAME(LexatomLoader_lexatom_index_step_to)(me, (ptrdiff_t)Backup_lexatom_index_next_to_fill) ) { + QUEX_ERROR_EXIT("LexatomLoader failed to seek previously reached lexatom.\n"); + } + return; + } + + backup_byte_pos = BackupByteLoaderPosition - BackupStomachByteN; + me->byte_loader->seek(me->byte_loader, backup_byte_pos); + me->stomach_clear(me); + me->lexatom_index_next_to_fill = Backup_lexatom_index_next_to_fill; +} + +QUEX_INLINE bool +QUEX_NAME(LexatomLoader_lexatom_index_step_to)(QUEX_NAME(LexatomLoader)* me, + const QUEX_TYPE_STREAM_POSITION TargetCI) +/* From the given 'lexatom_index_next_to_fill' (i.e. the return value of + * 'input_lexatom_tell()') step forward to lexatom index 'TargetCI'. This + * function is used to reach a target input position in cases where computing + * is impossible. + * + * THIS FUNCTION DOES NOT BACKUP OR RE-INIT ANYTHING. + * => Must be done upon failure in the caller's function. + * + * RETURNS: true - success; false - else. */ +{ + const QUEX_TYPE_STREAM_POSITION ChunkSize = QUEX_SETTING_BUFFER_FILLER_SEEK_TEMP_BUFFER_SIZE; + QUEX_TYPE_LEXATOM chunk[QUEX_SETTING_BUFFER_FILLER_SEEK_TEMP_BUFFER_SIZE]; + QUEX_TYPE_STREAM_POSITION remaining_n = TargetCI - me->lexatom_index_next_to_fill; + bool end_of_stream_f = false; + bool encoding_error_f = false; + size_t loaded_n; + + __quex_assert(QUEX_SETTING_BUFFER_FILLER_SEEK_TEMP_BUFFER_SIZE >= 1); + + for(; remaining_n > ChunkSize; remaining_n -= ChunkSize ) { + loaded_n = me->derived.load_lexatoms(me, &chunk[0], (size_t)ChunkSize, + &end_of_stream_f, &encoding_error_f); + me->lexatom_index_next_to_fill += (QUEX_TYPE_STREAM_POSITION)loaded_n; + if( ChunkSize > (QUEX_TYPE_STREAM_POSITION)loaded_n ) { + return false; + } + } + if( remaining_n ) { + loaded_n = me->derived.load_lexatoms(me, &chunk[0], (size_t)remaining_n, + &end_of_stream_f, &encoding_error_f); + me->lexatom_index_next_to_fill += (QUEX_TYPE_STREAM_POSITION)loaded_n; + if( remaining_n > (QUEX_TYPE_STREAM_POSITION)loaded_n ) { + return false; + } + } + + __quex_assert(me->lexatom_index_next_to_fill == TargetCI); + return true; +} + + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__LEXATOMS__LEXATOM_LOADER_NAVIGATION_I */ diff --git a/src/parser/MemoryManager b/src/parser/MemoryManager @@ -0,0 +1,47 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__MEMORY_MANAGER +#define __QUEX_INCLUDE_GUARD__MEMORY_MANAGER + +#include <stddef.h> +#include "compatStdint.h" +#include "definitions" + +#ifndef QUEX_TYPE_DEFINITIONS_MEMORY_MANAGER +#define QUEX_TYPE_DEFINITIONS_MEMORY_MANAGER +typedef enum { + E_MemoryObjectType_BUFFER, + E_MemoryObjectType_BUFFER_MEMORY, + E_MemoryObjectType_BYTE_LOADER, + E_MemoryObjectType_BUFFER_FILLER, + E_MemoryObjectType_BUFFER_RAW, + E_MemoryObjectType_CONVERTER, + E_MemoryObjectType_MEMENTO, + E_MemoryObjectType_POST_CATEGORIZER_NODE, + E_MemoryObjectType_TEXT, + E_MemoryObjectType_TOKEN_ARRAY +} E_MemoryObjectType; + +typedef enum { + E_Ownership_LEXICAL_ANALYZER, + E_Ownership_EXTERNAL +} E_Ownership; +#endif + +QUEX_NAMESPACE_QUEX_OPEN + +extern uint8_t* +QUEXED_DEF(MemoryManager_allocate)(const size_t ByteN, E_MemoryObjectType); + +extern void +QUEXED_DEF(MemoryManager_free)(void* Obj, E_MemoryObjectType); + +extern size_t +QUEXED_DEF(MemoryManager_insert)(uint8_t* drain_begin_p, uint8_t* drain_end_p, + uint8_t* source_begin_p, uint8_t* source_end_p); + +extern bool +QUEXED_DEF(system_is_little_endian)(void); + +QUEX_NAMESPACE_QUEX_CLOSE + +#endif /* __INCLUDE_GUARD_QUEX__CODE_BASE__MEMORY_MANAGER__ */ diff --git a/src/parser/MemoryManager.i b/src/parser/MemoryManager.i @@ -0,0 +1,82 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ + +/* This file contains an implementation which can potentially be shared between + * multiple different lexical analyzers. See 'multi.i' for further info. */ + +#ifndef __QUEX_INCLUDE_GUARD__MEMORY_MANAGER_I +#define __QUEX_INCLUDE_GUARD__MEMORY_MANAGER_I + +#include "definitions" +#include "MemoryManager" + +QUEX_NAMESPACE_QUEX_OPEN + +uint8_t* +QUEXED_DEF(MemoryManager_allocate)(const size_t ByteN, + E_MemoryObjectType Type) +{ + uint8_t* me = (uint8_t*)__QUEX_STD_malloc((size_t)ByteN); + + (void)Type; +# ifdef QUEX_OPTION_ASSERTS + __QUEX_STD_memset((void*)me, 0xFF, ByteN); +# endif + return me; +} + +void +QUEXED_DEF(MemoryManager_free)(void* alter_ego, + E_MemoryObjectType Type) +{ + void* me = (void*)alter_ego; + (void)Type; + /* The de-allocator shall never be called for LexemeNull object. */ + if( me ) { + __QUEX_STD_free(me); + } +} + +size_t +QUEXED_DEF(MemoryManager_insert)(uint8_t* drain_begin_p, uint8_t* drain_end_p, + uint8_t* source_begin_p, uint8_t* source_end_p) +/* Inserts as many bytes as possible into the array from 'drain_begin_p' + * to 'drain_end_p'. The source of bytes starts at 'source_begin_p' and + * ends at 'source_end_p'. + * + * RETURNS: Number of bytes that have been copied. */ +{ + /* Determine the insertion size. */ + const size_t DrainSize = (size_t)(drain_end_p - drain_begin_p); + size_t size = (size_t)(source_end_p - source_begin_p); + __quex_assert(drain_end_p >= drain_begin_p); + __quex_assert(source_end_p >= source_begin_p); + + if( DrainSize < size ) size = DrainSize; + + /* memcpy() might fail if the source and drain domain overlap! */ +# ifdef QUEX_OPTION_ASSERTS + if( drain_begin_p > source_begin_p ) __quex_assert(drain_begin_p >= source_begin_p + size); + else __quex_assert(drain_begin_p <= source_begin_p - size); +# endif + __QUEX_STD_memcpy(drain_begin_p, source_begin_p, size); + + return size; +} + +bool +QUEXED_DEF(system_is_little_endian)(void) +{ + union { + long int multi_bytes; + char c[sizeof (long int)]; + } u; + u.multi_bytes = 1; + return u.c[sizeof(long int)-1] != 1; +} + + +QUEX_NAMESPACE_QUEX_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__MEMORY_MANAGER_I */ + + diff --git a/src/parser/Mode.i b/src/parser/Mode.i @@ -0,0 +1,39 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * + * (C) 2004-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MODE_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__MODE_I + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE __QUEX_TYPE_ANALYZER_RETURN_VALUE + QUEX_NAME(Mode_uncallable_analyzer_function)(QUEX_TYPE_ANALYZER* me) + { + __quex_assert(0); + (void)me; +# if defined (QUEX_OPTION_TOKEN_POLICY_QUEUE) + return; +# else + return (__QUEX_TYPE_ANALYZER_RETURN_VALUE)0; +# endif + } + +# if ! defined(QUEX_OPTION_INDENTATION_DEFAULT_HANDLER) + QUEX_INLINE void + QUEX_NAME(Mode_on_indentation_null_function)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_LEXATOM* LexemeBegin, + QUEX_TYPE_LEXATOM* LexemeEnd) + { (void)me; (void)LexemeBegin; (void)LexemeEnd; } +# endif + + QUEX_INLINE void + QUEX_NAME(Mode_on_entry_exit_null_function)(QUEX_TYPE_ANALYZER* me, + const QUEX_NAME(Mode)* TheMode) + { (void)me; (void)TheMode; } + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MODE_I */ diff --git a/src/parser/TokenPolicy b/src/parser/TokenPolicy @@ -0,0 +1,158 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2009 Frank-Rene Schaefer + * + * NO INCLUDE GUARDS -- THIS FILE MIGHT BE INCLUDED TWICE FOR MULTIPLE + * LEXICAL ANALYZERS + * + * NOT: #ifndef __QUEX_INCLUDE_GUARD__TOKEN__TOKEN_POLICY + * NOT: #define __QUEX_INCLUDE_GUARD__TOKEN__TOKEN_POLICY + * + * Instead of an include guard, there is an include indicator + * + * __QUEX_INCLUDE_INDICATOR__TOKEN_POLICY__ + * + * If the indicator is defined at the entry of this file, all internally + * defined macros are undefined right at the beginning, so they can be + * safely redefined. */ +#ifdef __QUEX_INCLUDE_INDICATOR__TOKEN_POLICY__ +# undef QUEX_ASSERT_NO_TOKEN_SENDING_AFTER_TOKEN_TERMINATION +# undef QUEX_TOKEN_POLICY_PREPARE_NEXT +# undef __QUEX_TOKEN_POLICY_SET_ID +# undef __QUEX_ASSERT_SEND_ENTRY +# undef __QUEX_CURRENT_TOKEN_P +# undef __QUEX_STAMP_COLUMN_NUMBER +# undef __QUEX_STAMP_LINE_NUMBER +# undef self_token_get_id +# undef self_token_set_id +#else +# define __QUEX_INCLUDE_INDICATOR__TOKEN_POLICY__ +#endif +/*_______________________________________________________________________*/ + +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + +# define __QUEX_CURRENT_TOKEN_P (self._token_queue.write_iterator) + +# define QUEX_TOKEN_POLICY_PREPARE_NEXT() \ + ++(self._token_queue.write_iterator); + +# if defined(__QUEX_OPTION_PLAIN_C) +# define self_token_get_id() __QUEX_CURRENT_TOKEN_P->_id +# else +# define self_token_get_id() __QUEX_CURRENT_TOKEN_P->type_id() +# endif +# define self_token_set_id(ID) __QUEX_TOKEN_POLICY_SET_ID(ID) + +#else + +# define __QUEX_CURRENT_TOKEN_P (self.token) + +# define QUEX_TOKEN_POLICY_PREPARE_NEXT() \ + /* empty */ + +/* Important: Currently the token class needs to contain a token identifier. + * When this changes, the 'get_id' function can rely solely on + * __self_result_token_id. HOWEVER, then 'on_entry', 'on_exit', + * and 'on_indent', 'on_dedent' need to be revised-->test then carefully. */ +/* # define self_token_get_id() (__self_result_token_id) */ +# if defined(__QUEX_OPTION_PLAIN_C) +# define self_token_get_id() __QUEX_CURRENT_TOKEN_P->_id +# else +# define self_token_get_id() __QUEX_CURRENT_TOKEN_P->type_id() +# endif +# define self_token_set_id(ID) do { __self_result_token_id = ID; __QUEX_TOKEN_POLICY_SET_ID(ID); } while( 0 ) + +#endif + +/* Option: QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN + * + * This option enables the stamping of tokens at the time that they are sent + * with the current position of the lexeme in terms of line and column + * numbers. Note, that if line or column numbering is disabled than also + * the stamping of the corresponding value is disabled. + * + * In the default token class the members '_line_n' and '_column_n' only + * exist if the corresponding stamping is active. */ +#if defined(QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN) \ + && defined(QUEX_OPTION_LINE_NUMBER_COUNTING) +# define __QUEX_STAMP_LINE_NUMBER(TOKEN) TOKEN->_line_n = self.counter._line_number_at_begin; +#else +# define __QUEX_STAMP_LINE_NUMBER(TOKEN) /* empty */ +#endif + +#if defined(QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN) \ + && defined(QUEX_OPTION_COLUMN_NUMBER_COUNTING) +# define __QUEX_STAMP_COLUMN_NUMBER(TOKEN) TOKEN->_column_n = self.counter._column_number_at_begin; +#else +# define __QUEX_STAMP_COLUMN_NUMBER(TOKEN) /* empty */ +#endif + +/* We do not define QUEX_ACTION_TOKEN_STAMP in 'configuration/derived' since + * the derived configuration is included before the user's header. The user's + * header requires the configuration parameters. */ +#if ! defined(QUEX_ACTION_TOKEN_STAMP) +# define QUEX_ACTION_TOKEN_STAMP(TOKEN_P) \ + __QUEX_STAMP_LINE_NUMBER(TOKEN_P) \ + __QUEX_STAMP_COLUMN_NUMBER(TOKEN_P) +#endif + +/* Setting a token value. + * + * This may include the stamping of line and/or column numbers. The macros to + * do that are empty in case that the stamping is disabled (see the above + * definitions). The last element of the subsequent macro provides access to + * the current token. This access depends on whether the token policy 'users + * token' or a queue policy is used. */ + +#if defined(QUEX_TOKEN_CONTAINS_NO_ID) +# define __QUEX_TOKEN_POLICY_SET_ID(ID) \ + QUEX_ERROR_EXIT("TokenID can only be set in token objects with token ids."); +#else +# define __QUEX_TOKEN_POLICY_SET_ID(ID) \ + do { \ + QUEX_ACTION_TOKEN_STAMP(__QUEX_CURRENT_TOKEN_P); \ + (__QUEX_CURRENT_TOKEN_P)->_id = (ID); \ + } while(0) +#endif + +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + /* -- Assert consistency of the token queue + * -- Assert no token is sent after token 'TERMINATION'. + * If files are included the token queue is reset. */ +# if ! defined(QUEX_OPTION_SEND_AFTER_TERMINATION_ADMISSIBLE) +# define __QUEX_ASSERT_SEND_ENTRY() \ + do { \ + QUEX_TOKEN_QUEUE_ASSERT(&self._token_queue); \ + if( self._token_queue.write_iterator != self._token_queue.begin \ + && (self._token_queue.write_iterator-1)->_id == __QUEX_SETTING_TOKEN_ID_TERMINATION ) \ + QUEX_ERROR_EXIT("Detected attempt to send a token after 'TERMINATION'.\n" \ + "If this is intended, compile with -DQUEX_OPTION_SEND_AFTER_TERMINATION_ADMISSIBLE'.\n"); \ + } while( 0 ) +# else +# define __QUEX_ASSERT_SEND_ENTRY() \ + QUEX_TOKEN_QUEUE_ASSERT(&self._token_queue) +# endif +#else + /* No assert about token object */ + /* No assert on not __QUEX_SETTING_TOKEN_ID_TERMINATION */ +# define __QUEX_ASSERT_SEND_ENTRY() /* EMPTY */ +#endif + +#ifdef QUEX_OPTION_TOKEN_REPETITION_SUPPORT + +# define __QUEX_REPEATED_TOKEN_DECREMENT_N(TokenP) \ + QUEX_NAME_TOKEN(repetition_n_set)((TokenP), \ + (QUEX_NAME_TOKEN(repetition_n_get)(TokenP) - 1)) + +# ifdef QUEX_OPTION_ASSERTS +# define QUEX_ASSERT_REPEATED_TOKEN_NOT_ZERO(TokenP) \ + if( QUEX_NAME_TOKEN(repetition_n_get)(TokenP) == 0 ) { \ + QUEX_ERROR_EXIT("\nToken has been sent with zero repetitions.\n" \ + "Did you call self_send_n(N,T) with N = 0?\n"); \ + } +# else +# define QUEX_ASSERT_REPEATED_TOKEN_NOT_ZERO(TokenP) /* empty */ + +# endif + +#endif diff --git a/src/parser/TokenQueue b/src/parser/TokenQueue @@ -0,0 +1,84 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2004-2009 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__TOKEN__TOKEN_QUEUE +#define __QUEX_INCLUDE_GUARD__TOKEN__TOKEN_QUEUE + +#include "definitions" +#include "asserts" +#include "MemoryManager" + +#ifndef QUEX_TYPE_TOKEN +# error "QUEX_TYPE_TOKEN must be defined before including this file." +#endif + + +QUEX_NAMESPACE_MAIN_OPEN + + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + + QUEX_TYPE_TOKEN* begin; + QUEX_TYPE_TOKEN* read_iterator; /* pointer to next token to be read */ + QUEX_TYPE_TOKEN* write_iterator; /* pointer to next token to be written */ + QUEX_TYPE_TOKEN* end_minus_safety_border; + QUEX_TYPE_TOKEN* end; + /* A token might be 'N' times repeated. This is the only case where a token + * queue overflow might occur. When the token queue is full and there are still + * 'N' tokens to be repeated, then the remaining 'N' are stored in the following + * variable. */ + + } QUEX_NAME(TokenQueue); + + QUEX_INLINE void QUEX_NAME(TokenQueue_reset)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE void QUEX_NAME(TokenQueue_init)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN* Memory, + QUEX_TYPE_TOKEN* MemoryEnd); + QUEX_INLINE void QUEX_NAME(TokenQueue_construct)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN* Memory, + const size_t N); +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_INLINE void QUEX_NAME(TokenQueue_disfunctionality_set)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE bool QUEX_NAME(TokenQueue_disfunctionality_check)(QUEX_NAME(TokenQueue)* me); +# endif + QUEX_INLINE void QUEX_NAME(TokenQueue_destruct)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE void QUEX_NAME(TokenQueue_remainder_get)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN** begin, + QUEX_TYPE_TOKEN** end); + QUEX_INLINE void QUEX_NAME(TokenQueue_memory_get)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN** memory, + size_t* n); + QUEX_INLINE bool QUEX_NAME(TokenQueue_is_full)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE bool QUEX_NAME(TokenQueue_is_empty)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(TokenQueue_access_write_p)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(TokenQueue_pop)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(TokenQueue_begin)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(TokenQueue_back)(QUEX_NAME(TokenQueue)* me); + QUEX_INLINE size_t QUEX_NAME(TokenQueue_available_n)(QUEX_NAME(TokenQueue)* me); + + +# ifdef QUEX_OPTION_ASSERTS + QUEX_INLINE void + QUEX_ASSERT_TOKEN_QUEUE_AFTER_WRITE(QUEX_NAME(TokenQueue)* me); + + QUEX_INLINE void + QUEX_TOKEN_QUEUE_ASSERT(QUEX_NAME(TokenQueue)* me); +# else +# define QUEX_TOKEN_QUEUE_ASSERT(me) /* empty */ +# define QUEX_ASSERT_TOKEN_QUEUE_AFTER_WRITE(me) /* empty */ +# endif + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + QUEX_TYPE_TOKEN* token_list; + size_t size; +} QUEX_NAME(TokenQueueRemainder); + +#if 1 +QUEX_INLINE void QUEX_NAME(TokenQueueRemainder_save)(QUEX_NAME(TokenQueueRemainder)* me, + QUEX_NAME(TokenQueue)* token_queue); + +QUEX_INLINE void QUEX_NAME(TokenQueueRemainder_restore)(QUEX_NAME(TokenQueueRemainder)* me, + QUEX_NAME(TokenQueue)* token_queue); +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__TOKEN__TOKENQUEUE */ diff --git a/src/parser/TokenQueue.i b/src/parser/TokenQueue.i @@ -0,0 +1,320 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2004-2009 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__TOKEN__TOKEN_QUEUE_I +#define __QUEX_INCLUDE_GUARD__TOKEN__TOKEN_QUEUE_I + +#include "definitions" +#include "asserts" +#include "MemoryManager" + +/* NOTE: QUEX_TYPE_TOKEN must be defined at this place! */ + + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE void + QUEX_NAME(TokenQueue_construct)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN* Memory, + const size_t N) + /* me: The token queue. + * Memory: Pointer to memory of token queue, 0x0 --> no initial memory. + * N: Number of token objects that the array can carry. */ + { +# if ! defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_TYPE_TOKEN* iterator = 0x0; +# endif + QUEX_TYPE_TOKEN* memory_end = &Memory[N]; + + __quex_assert(Memory != 0x0); + __quex_assert(N > (size_t)QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER); + +# if ! defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + /* Call placement new (plain constructor) for all tokens in chunk. */ + for(iterator = Memory; iterator != memory_end; ++iterator) { + QUEX_NAME_TOKEN(construct)(iterator); + } +# endif + QUEX_NAME(TokenQueue_init)(me, Memory, memory_end); + } + + QUEX_INLINE void + QUEX_NAME(TokenQueue_reset)(QUEX_NAME(TokenQueue)* me) + { + me->read_iterator = (QUEX_TYPE_TOKEN*)me->begin; + me->write_iterator = (QUEX_TYPE_TOKEN*)me->begin; + + __quex_assert( me->end - me->begin + > (ptrdiff_t)QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER); + __quex_assert( me->end_minus_safety_border + == me->end - (ptrdiff_t)QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER); + } + + QUEX_INLINE void + QUEX_NAME(TokenQueue_init)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN* Memory, + QUEX_TYPE_TOKEN* MemoryEnd) + { + __quex_assert( MemoryEnd - Memory + > (ptrdiff_t)QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER); + me->begin = Memory; + me->end = MemoryEnd; + me->end_minus_safety_border = MemoryEnd - QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER; + QUEX_NAME(TokenQueue_reset)(me); + } + +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_INLINE void + QUEX_NAME(TokenQueue_disfunctionality_set)(QUEX_NAME(TokenQueue)* me) + { + me->begin = (QUEX_TYPE_TOKEN*)0; + me->end = (QUEX_TYPE_TOKEN*)0; + me->read_iterator = (QUEX_TYPE_TOKEN*)0; + me->write_iterator = (QUEX_TYPE_TOKEN*)0; + me->end_minus_safety_border = (QUEX_TYPE_TOKEN*)0; + } + + QUEX_INLINE bool + QUEX_NAME(TokenQueue_disfunctionality_check)(QUEX_NAME(TokenQueue)* me) + { + return me->begin == (QUEX_TYPE_TOKEN*)0 + && me->end == (QUEX_TYPE_TOKEN*)0 + && me->read_iterator == (QUEX_TYPE_TOKEN*)0 + && me->write_iterator == (QUEX_TYPE_TOKEN*)0 + && me->end_minus_safety_border == (QUEX_TYPE_TOKEN*)0; + } +# endif + + QUEX_INLINE void + QUEX_NAME(TokenQueue_destruct)(QUEX_NAME(TokenQueue)* me) + { +# if ! defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_TYPE_TOKEN* iterator = 0x0; + /* Call explicit destructors for all tokens in array */ + for(iterator = me->begin; iterator != me->end; ++iterator) { + QUEX_NAME_TOKEN(destruct)(iterator); + } + /* The memory chunk for the token queue itself is located + * inside the analyzer object. Thus, no explicit free is + * necessary. In case of user managed token queue memory + * the user takes care of the deletion. */ +# endif + } + + QUEX_INLINE void + QUEX_NAME(TokenQueue_remainder_get)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN** begin, + QUEX_TYPE_TOKEN** end) + { + *begin = me->read_iterator; + *end = me->write_iterator; + QUEX_NAME(TokenQueue_reset)(me); + } + + QUEX_INLINE void + QUEX_NAME(TokenQueue_memory_get)(QUEX_NAME(TokenQueue)* me, + QUEX_TYPE_TOKEN** memory, + size_t* n) + { + *memory = me->begin; + *n = (size_t)(me->end - me->begin); + } + + QUEX_INLINE QUEX_TYPE_TOKEN* + QUEX_NAME(TokenQueue_access_write_p)(QUEX_NAME(TokenQueue)* me) + { +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + __quex_assert( ! QUEX_NAME(TokenQueue_disfunctionality_check)(me) ); + __quex_assert( me->write_iterator < me->end_minus_safety_border ); + if( QUEX_NAME(TokenQueue_disfunctionality_check)(me) ) { + return (QUEX_TYPE_TOKEN*)0; + } + else if( me->write_iterator < me->end_minus_safety_border ) { + return (QUEX_TYPE_TOKEN*)0; + } +# endif + return me->write_iterator; + } + + QUEX_INLINE bool QUEX_NAME(TokenQueue_is_full)(QUEX_NAME(TokenQueue)* me) + { return me->write_iterator >= me->end_minus_safety_border; } + + QUEX_INLINE bool QUEX_NAME(TokenQueue_is_empty)(QUEX_NAME(TokenQueue)* me) + { return me->read_iterator == me->write_iterator; } + + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(TokenQueue_pop)(QUEX_NAME(TokenQueue)* me) + { return me->read_iterator++; } + + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(TokenQueue_begin)(QUEX_NAME(TokenQueue)* me) + { return me->begin; } + + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(TokenQueue_back)(QUEX_NAME(TokenQueue)* me) + { return me->end - 1; } + + QUEX_INLINE size_t QUEX_NAME(TokenQueue_available_n)(QUEX_NAME(TokenQueue)* me) + { return (size_t)(me->end - me->write_iterator); } + +#ifdef QUEX_OPTION_ASSERTS + QUEX_INLINE void + QUEX_ASSERT_TOKEN_QUEUE_AFTER_WRITE(QUEX_NAME(TokenQueue)* me) + { + __quex_assert(me->begin != 0x0); + __quex_assert(me->read_iterator >= me->begin); + __quex_assert(me->write_iterator >= me->read_iterator); + /* If the following breaks, it means that the given queue size was to small */ + __quex_assert(me->begin == 0x0 || me->end_minus_safety_border >= me->begin + 1); + if( me->write_iterator > me->end ) { + QUEX_ERROR_EXIT("Error: Token queue overflow. This happens if too many tokens are sent\n" + " as a reaction to one single pattern match. Use quex's command line\n" + " option --token-queue-safety-border, or define the macro\n" + " QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER with a greater value.\n"); + } + } + QUEX_INLINE void + QUEX_TOKEN_QUEUE_ASSERT(QUEX_NAME(TokenQueue)* me) + { + QUEX_ASSERT_TOKEN_QUEUE_AFTER_WRITE(me); + if( me->write_iterator == me->end ) { + QUEX_ERROR_EXIT("Error: Token queue overflow. This happens if too many tokens are sent\n" + " as a reaction to one single pattern match. Use quex's command line\n" + " option --token-queue-safety-border, or define the macro\n" + " QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER with a greater value.\n"); + } + } +#else +# define QUEX_TOKEN_QUEUE_ASSERT(me) /* empty */ +# define QUEX_ASSERT_TOKEN_QUEUE_AFTER_WRITE(me) /* empty */ +#endif + +#if 1 +QUEX_INLINE void +QUEX_NAME(TokenQueueRemainder_save)(QUEX_NAME(TokenQueueRemainder)* me, QUEX_NAME(TokenQueue)* token_queue) +{ + QUEX_TOKEN_QUEUE_ASSERT(token_queue); + /* State of the token queue at the entry of this function: + * + * [A0] [B0] [A1] [B1] [A2] [B2] + * | | | | | | + * | | | | | | | | | | + * [ token 1 ][ token 2 ][ token 3 ][ token 4 ][ token 5 ][ .... + * | | + * read_iterator write_iterator + * + * + * 1. Step: Allocate a plain chunk of memory, to carry the remaining tokens: + * + * [ store 1 ][ store 2 ][ store 3 ] + * + * The elements of this plain chunk of memory are neither subject + * to constructor nor destructor calls. + * + * 2. Step: Make a plain copy of the tokens of the remainder (from read_iterator + * to write_iterator. + * + * [A0] [B0] [A1] [B1] [A2] [B2] + * | | | | | | + * | | | | | | + * [ store 1 ][ store 2 ][ store 3 ] + * + * As a consequence, the objects to which the original tokens referred + * are now referred by the stored tokens. However, at the time of 'restore' + * the content is copied at the beginning of the queue. + * + * !! Thus, the following scenerio is conceivable: + * !! + * !! [A0] [B0] [A1] [B1] [A2] [B2] [A1] [B1] [A2] [B2] + * !! | | | | | | | | | | + * !! | | | | | | | | | | + * !! [ token 1 ][ token 2 ][ token 3 ][ token 4 ][ token 5 ][ .... + * !! | | + * !! begin | + * !! |<--------- store size ------------>| + * !! + * !! If this was happening, then the destructor for the objects A1, B1, ... + * !! would be called twice at the destruction time of the token queue! + * !! + * !! PREVENTION: See next step. + * + * 3. Step: Calling placement new on token objects that are saved: + * Resulting original token queue: + * + * [X1] [X1] [Y2] [Y2] [Z0] [Z0] + * | | | | | | + * | | | | | | | | | | + * [ token 1 ][ token 2 ][ token 3 ][ token 4 ][ token 5 ][ .... + * | | + * read_iterator write_iterator + * + * Note, that token 3 originally not subject to 'double occurence'. However, + * it may be overwritten by filling the queue, and then references to objects + * would get lost. */ + me->size = (size_t)(token_queue->write_iterator - token_queue->read_iterator); + if( me->size != 0 ) { + QUEX_TYPE_TOKEN* iterator = 0x0; + + /* Step 1: allocate plain chunk of memory. */ + me->token_list = (QUEX_TYPE_TOKEN*)QUEXED(MemoryManager_allocate)(sizeof(QUEX_TYPE_TOKEN) * me->size, + E_MemoryObjectType_TOKEN_ARRAY); + if( me->token_list == 0x0 ) { + QUEX_ERROR_EXIT("Memory allocation error on request for token array."); + } + + /* Step 2: copy plain chunk of memory */ + __QUEX_STD_memcpy((void*)me->token_list, (void*)token_queue->read_iterator, sizeof(QUEX_TYPE_TOKEN) * me->size); + + /* Step 3: Call cleaning placement new on objects which are subject to + * potential double deletion. */ + for(iterator = token_queue->read_iterator; + iterator != token_queue->write_iterator; ++iterator) { + QUEX_NAME_TOKEN(construct)(iterator); + } + } + QUEX_NAME(TokenQueue_reset)(token_queue); + + QUEX_TOKEN_QUEUE_ASSERT(token_queue); +} + +QUEX_INLINE void +QUEX_NAME(TokenQueueRemainder_restore)(QUEX_NAME(TokenQueueRemainder)* me, QUEX_NAME(TokenQueue)* token_queue) +{ + QUEX_TYPE_TOKEN* iterator = 0x0; + /* NOTE: When a token queue remainder is restored, this happens as a result + * of 'return from included file'. The return from an included file + * is triggered by a TERMINATION token. By definition, the TERMINATION + * is the last token to be sent. When the user detects a TERMINATION + * token, the read_iterator == write_iterator, which means that the + * token queue is empty. => Thus, the 'refill' can start from the beginning. + * THIS IS TRUE WHEN THE INLCUDE_PUSH, INCLUDE_POP HAPPENS FROM OUTSIDE + * THE LEXICAL ANALYZER ENGINE. */ + if( ! QUEX_NAME(TokenQueue_is_empty)(token_queue) ) { + QUEX_ERROR_EXIT("Token queue not empty on return from included file. This can\n" + "only happen if include handling was done from inside analyzer\n" + "actions. Please, consider directory demo/005 for an example to\n" + "handle file inclusion.\n"); + } + QUEX_TOKEN_QUEUE_ASSERT(token_queue); + + if( me->size != 0 ) { + /* Step 1: Call explicit destructors for token objects that are overwritten */ + for(iterator = token_queue->begin; + iterator != token_queue->begin + me->size; ++iterator) { + QUEX_NAME_TOKEN(destruct)(iterator); + } + /* Step 2: Plain copy of objects stored in the 'remainder store' */ + __QUEX_STD_memcpy((void*)token_queue->begin, (void*)me->token_list, sizeof(QUEX_TYPE_TOKEN) * me->size); + + /* Step 3: De-Allocate the remainder objects + * NO explicit destructor calls, since the referred objects are now + * referred from inside the 'real' token queue. */ + QUEXED(MemoryManager_free)(me->token_list, E_MemoryObjectType_TOKEN_ARRAY); + } + /* Reset the read and write iterators */ + token_queue->read_iterator = token_queue->begin; + token_queue->write_iterator = token_queue->begin + me->size; + + QUEX_TOKEN_QUEUE_ASSERT(token_queue); +} +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__TOKEN__TOKEN_QUEUE_I */ diff --git a/src/parser/analyzerAsserts b/src/parser/analyzerAsserts @@ -0,0 +1,43 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__ASSERTS +#define __QUEX_INCLUDE_GUARD__ANALYZER__ASSERTS + +#if ! defined(QUEX_OPTION_ASSERTS) +# define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) /* empty */ +#else +# if defined(QUEX_OPTION_LINE_NUMBER_COUNTING) && defined(QUEX_OPTION_COLUMN_NUMBER_COUNTING) +# define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) \ + { \ + /* The line number can never decrease. */ \ + __quex_assert((ME)->_line_number_at_begin <= (ME)->_line_number_at_end); \ + /* If line number remained the same, then column number **must** have increased. */ \ + /* There is not pattern of a length less than 1 */ \ + if((ME)->_line_number_at_begin == (ME)->_line_number_at_end ) { \ + __quex_assert((ME)->_column_number_at_begin < (ME)->_column_number_at_end); \ + } \ + } +# elif defined(QUEX_OPTION_LINE_NUMBER_COUNTING) && ! defined(QUEX_OPTION_COLUMN_NUMBER_COUNTING) +# define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) \ + { \ + __quex_assert((ME)->_line_number_at_begin <= (ME)->_line_number_at_end); \ + } +# else + /* If only column numbers are counted, then no assumptions can be made about increase */ + /* or decrease. If a newline appearse, for example, the column number may decrease. */ +# define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) /* empty */ +# endif + +# include "bufferBuffer" + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE QUEX_TYPE_LEXATOM* QUEX_NAME(access_Lexeme)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)*); + QUEX_INLINE size_t QUEX_NAME(access_LexemeL)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)*); + QUEX_INLINE QUEX_TYPE_LEXATOM* QUEX_NAME(access_LexemeEnd)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)*); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif + +#endif /* __INCLUDE_GUARD__QUEX_LEXER_CLASS_COUNT_LINE_COLUMN_COMMON */ + diff --git a/src/parser/analyzerAsserts.i b/src/parser/analyzerAsserts.i @@ -0,0 +1,64 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__ASSERTS_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__ASSERTS_I + +#include "bufferBuffer" + +#if defined(QUEX_OPTION_ASSERTS) + +#define __QUEX_LEXEME_VALID_BASIC_CHECK() \ + if( buffer->_read_p < buffer->_memory._front ) { \ + __QUEX_STD_printf("%s:%i:\n", FileName, (int)LineN); \ + QUEX_ERROR_EXIT("Lexeme out of buffer bounds.\n"); \ + } else if( buffer->_read_p > buffer->_memory._back ) { \ + __QUEX_STD_printf("%s:%i:\n", FileName, (int)LineN); \ + QUEX_ERROR_EXIT("Lexeme out of buffer bounds.\n"); \ + } + +#define __QUEX_LEXEME_VALID_CHECK() \ + __QUEX_LEXEME_VALID_BASIC_CHECK() \ + else if( *(buffer->_read_p) != (QUEX_TYPE_LEXATOM)0 ) { \ + __QUEX_STD_printf("%s:%i:\n", FileName, (int)LineN); \ + QUEX_ERROR_EXIT("Tried to access lexeme while terminating zero was not set.\n" \ + "This happens, for example, if navigation commands (undo, seek,\n" \ + "seek_forward, or seek_backward) are used **before** accessing\n" \ + "the lexeme via 'Lexeme' or 'LexemeBegin'.\n"); \ + } + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_NAME(access_Lexeme)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)* buffer) +{ + __QUEX_LEXEME_VALID_CHECK(); + return buffer->_lexeme_start_p; +} + +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_NAME(access_LexemeBegin)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)* buffer) +{ + __QUEX_LEXEME_VALID_BASIC_CHECK(); /* IMPORTANT: THAT IS THE DIFFERENCE TO 'accessLexeme()' */ + return buffer->_lexeme_start_p; +} + +QUEX_INLINE size_t +QUEX_NAME(access_LexemeL)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)* buffer) +{ + __QUEX_LEXEME_VALID_BASIC_CHECK(); + return (size_t)(buffer->_read_p - buffer->_lexeme_start_p); +} + +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_NAME(access_LexemeEnd)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)* buffer) +{ + __QUEX_LEXEME_VALID_BASIC_CHECK(); + return buffer->_read_p; +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__ASSERTS_I */ diff --git a/src/parser/analyzerBasic b/src/parser/analyzerBasic @@ -0,0 +1,25 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * + * (C) 2004-2009 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__BASIC +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__BASIC + +#include "definitions" +#include "bufferBuffer" + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE void + QUEX_NAME(destruct_basic)(QUEX_TYPE_ANALYZER* me); + + QUEX_INLINE void + QUEX_NAME(reset_basic)(QUEX_TYPE_ANALYZER* me, + QUEX_NAME(ByteLoader)* byte_loader, + const QUEX_NAME(Mode)* Mode, + const char* CharacterEncodingName, + const size_t TranslationBufferMemorySize); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__BASIC */ diff --git a/src/parser/analyzerConfigDerived b/src/parser/analyzerConfigDerived @@ -0,0 +1,436 @@ +#ifdef QUEX_OPTION_COMPUTED_GOTOS_DISABLED +# undef QUEX_OPTION_COMPUTED_GOTOS +#endif +#ifdef __QUEX_OPTION_ON_ENTRY_HANDLER_PRESENT_DISABLED +# undef __QUEX_OPTION_ON_ENTRY_HANDLER_PRESENT +#endif +#ifdef __QUEX_OPTION_ON_EXIT_HANDLER_PRESENT_DISABLED +# undef __QUEX_OPTION_ON_EXIT_HANDLER_PRESENT +#endif +#ifdef QUEX_OPTION_CONVERTER_ICONV_DISABLED +# undef QUEX_OPTION_CONVERTER_ICONV +#endif +#ifdef QUEX_OPTION_CONVERTER_ICU_DISABLED +# undef QUEX_OPTION_CONVERTER_ICU +#endif +#ifdef __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION_DISABLED +# undef __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION +#endif +#ifdef QUEX_OPTION_INCLUDE_STACK_DISABLED +# undef QUEX_OPTION_INCLUDE_STACK +#endif +#ifdef QUEX_OPTION_STRING_ACCUMULATOR_DISABLED +# undef QUEX_OPTION_STRING_ACCUMULATOR +#endif +#ifdef QUEX_OPTION_DEBUG_QUEX_PATTERN_MATCHES_DISABLED +# undef QUEX_OPTION_DEBUG_QUEX_PATTERN_MATCHES +#endif +#ifdef QUEX_OPTION_DEBUG_SHOW_MODES_DISABLED +# undef QUEX_OPTION_DEBUG_SHOW_MODES +#endif +#ifdef QUEX_OPTION_DEBUG_TOKEN_SENDING_DISABLED +# undef QUEX_OPTION_DEBUG_TOKEN_SENDING +#endif +#if ! defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE_DISABLED) +# define QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE +#endif +#ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK_DISABLED +# undef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK +#endif +#ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK_DISABLED +# undef QUEX_OPTION_POST_CATEGORIZER +#endif +#ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING_DISABLED +# undef QUEX_OPTION_COLUMN_NUMBER_COUNTING +#endif +#ifdef QUEX_OPTION_LINE_NUMBER_COUNTING_DISABLED +# undef QUEX_OPTION_LINE_NUMBER_COUNTING +#endif + +#if defined(QUEX_OPTION_TOKEN_POLICY_QUEUE) +# define __QUEX_PURE_RETURN do { return; } while(0) +#else +# define __QUEX_PURE_RETURN do { return __self_result_token_id; } while(0) +#endif + +#if ! defined (QUEX_SETTING_BUFFER_MIN_FALLBACK_N) +# if ! defined (QUEX_SETTING_BUFFER_SIZE) +# error "QUEX_SETTING_BUFFER_SIZE not defined at this place." + /* If your compiler brings you here to this position, then this may be because + * you defined the QUEX_SETTING_BUFFER_SIZE with something different than just + * an integer number. Indeed something like + * + * #define QUEX_SETTING_BUFFER_SIZE (size_t)4096 + * + * would be propper, but does not allow to do some math. So, please erase whatever + * is not a number in the definition (e.g. delete the '(size_t)' type cast. */ +# elif QUEX_SETTING_BUFFER_SIZE >= 1024 +# define QUEX_SETTING_BUFFER_MIN_FALLBACK_N (256) +# elif QUEX_SETTING_BUFFER_SIZE >= 16 +# define QUEX_SETTING_BUFFER_MIN_FALLBACK_N (size_t)(QUEX_SETTING_BUFFER_SIZE >> 5) +# else +# define QUEX_SETTING_BUFFER_MIN_FALLBACK_N (0) +# endif +#endif + +/* Tokens may be 'stamped' with the line an column number automatically. + * This happens by means of the option + * + * QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN_DISABLED + * + * It is active by default only for queue token policies, because after + * a call to .receive(), the lexical analyzer maintains only the position + * of the last token in the queue. The positions of other tokens would + * not be accessible once they are in the queue. + * + * The token policy 'users_token' only communicates one token at a time + * and the line and column numbers in the lexical analyzer are those + * of the last token. Thus, in this case the tokens do not need to be + * stamped with the position in the file. */ +#ifdef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN_DISABLED +# ifdef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN +# undef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN +# endif +#else +# ifndef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN +# define QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN +# endif +#endif + +#ifdef QUEX_OPTION_TOKEN_REPETITION_SUPPORT +# define __QUEX_IF_TOKEN_REPETITION_SUPPORT(EXPRESSION) EXPRESSION +# define __QUEX_IF_TOKEN_REPETITION_SUPPORT_DISABLED(EXPRESSION) /* empty */ +#else +# define __QUEX_IF_TOKEN_REPETITION_SUPPORT(EXPRESSION) /* empty */ +# define __QUEX_IF_TOKEN_REPETITION_SUPPORT_DISABLED(EXPRESSION) EXPRESSION +#endif + +#if defined (QUEX_OPTION_TOKEN_POLICY_QUEUE) +# define __QUEX_TYPE_ANALYZER_RETURN_VALUE void +# define __QUEX_RETURN return +# define QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN() CONTINUE +#else +# define __QUEX_TYPE_ANALYZER_RETURN_VALUE QUEX_TYPE_TOKEN_ID +# define __QUEX_RETURN return __self_result_token_id +# define QUEX_SETTING_AFTER_SEND_CONTINUE_OR_RETURN() RETURN +#endif + +#if defined(QUEX_OPTION_CONVERTER_ICONV) || defined(QUEX_OPTION_CONVERTER_ICU) +# ifndef __QUEX_OPTION_CONVERTER +# define __QUEX_OPTION_CONVERTER +# endif +# if defined(__QUEX_OPTION_ENGINE_RUNNING_ON_CODEC) +# error "Cannot specify QUEX_OPTION_CONVERTER_ICU or QUEX_OPTION_CONVERTER_ICU if the engine is running directly on a codec." +# endif +#endif +#if ! defined(QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW) +# if defined (QUEX_OPTION_CONVERTER_ICONV) +# define QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW QUEX_NAME(Converter_IConv_new) +# elif defined (QUEX_OPTION_CONVERTER_ICU) +# define QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW QUEX_NAME(Converter_ICU_new) +# else +# define QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW QUEX_NAME(__Converter_EMPTY_new) +# endif +#endif + +#ifndef __QUEX_OPTION_CONVERTER_HELPER +# if defined(QUEX_OPTION_INFORMATIVE_BUFFER_OVERFLOW_MESSAGE) \ + || defined(QUEX_OPTION_CONVERTER_ICU) \ + || defined(QUEX_OPTION_CONVERTER_ICONV) +# define __QUEX_OPTION_CONVERTER_HELPER +# endif +#endif + +#if defined(QUEX_OPTION_LINE_NUMBER_COUNTING) \ + || defined(QUEX_OPTION_COLUMN_NUMBER_COUNTING) \ + || defined(QUEX_OPTION_INDENTATION_TRIGGER) +# define __QUEX_OPTION_COUNTER +# define __QUEX_IF_COUNT(EXPRESSION) EXPRESSION +# define __QUEX_IF_COUNT_IF(EXPRESSION) if( EXPRESSION ) +# define __QUEX_IF_COUNT_SHIFT_VALUES() \ + __QUEX_COUNTER_SHIFT_COLUMNS(); \ + __QUEX_COUNTER_SHIFT_LINES(); +#else +# if defined(__QUEX_OPTION_COUNTER) +# undef __QUEX_OPTION_COUNTER +# endif +# define __QUEX_IF_COUNT(EXPRESSION) /* empty */ +# define __QUEX_IF_COUNT_IF(EXPRESSION) /* empty */ +# define __QUEX_IF_COUNT_SHIFT_VALUES() /* empty */ +#endif + +#if defined(QUEX_OPTION_LINE_NUMBER_COUNTING) +# define __QUEX_IF_COUNT_LINES(EXPRESSION) EXPRESSION +# define __QUEX_IF_COUNT_LINES_IF(EXPRESSION) if( EXPRESSION ) +# define __QUEX_IF_COUNT_LINES_ADD(X) \ + do { \ + me->counter._line_number_at_end += (X); \ + __quex_debug_counter(); \ + } while(0) +# define __QUEX_COUNTER_SHIFT_LINES() \ + me->counter._line_number_at_begin = me->counter._line_number_at_end; + +#else +# define __QUEX_IF_COUNT_LINES(EXPRESSION) /* empty */ +# define __QUEX_IF_COUNT_LINES_IF(EXPRESSION) /* empty */ +# define __QUEX_IF_COUNT_LINES_ADD(X) /* empty */ +# define __QUEX_COUNTER_SHIFT_LINES() /* empty */ +#endif + +#if defined(QUEX_OPTION_COLUMN_NUMBER_COUNTING) +# define __QUEX_IF_COUNT_COLUMNS(EXPRESSION) EXPRESSION +# define __QUEX_IF_COUNT_COLUMNS_SET(X) \ + do { \ + me->counter._column_number_at_end = (X); \ + __quex_debug_counter(); \ + } while(0) +# define __QUEX_IF_COUNT_COLUMNS_ADD(X) \ + do { \ + me->counter._column_number_at_end += (X); \ + __quex_debug_counter(); \ + } while(0) +# define __QUEX_COUNTER_SHIFT_COLUMNS() \ + me->counter._column_number_at_begin = me->counter._column_number_at_end; + +#else +# define __QUEX_IF_COUNT_COLUMNS(EXPRESSION) /* empty */ +# define __QUEX_IF_COUNT_COLUMNS_SET(X) /* empty */ +# define __QUEX_IF_COUNT_COLUMNS_ADD(X) /* empty */ +# define __QUEX_COUNTER_SHIFT_COLUMNS() /* empty */ +#endif + +#if defined(QUEX_OPTION_INDENTATION_TRIGGER) +# ifndef QUEX_OPTION_INDENTATION_DEFAULT_HANDLER_DISABLED +# define QUEX_OPTION_INDENTATION_DEFAULT_HANDLER +# endif +# define __QUEX_IF_COUNT_INDENTATION(EXPRESSION) EXPRESSION +#else +# define __QUEX_IF_COUNT_INDENTATION(EXPRESSION) /* empty */ +#endif + +/* Default Counter Rules */ +#if ! defined(__QUEX_COUNTER_RULES) + /* NOTE: 'x - x % 4' == 'x with the last two bits deleted' + * == 'x & (~3)' */ +# if QUEX_SETTING_CHAR_CODEC == utf8 +# define __QUEX_COUNTER_RULES(counter, iterator) \ + switch( (int)(*iterator) ) { \ + case (int)(QUEX_TYPE_LEXATOM)'\t': \ + (counter)._column_number_at_end &= (~(size_t)0x3) + 4; \ + ++(iterator); \ + break; \ + case (int)(QUEX_TYPE_LEXATOM)'\n': \ + (counter)._line_number_at_end += 1; \ + (counter)._column_number_at_end = 1; \ + ++(iterator); \ + break; \ + default: \ + if ( (*iterator & 0x80) == 0 ) { iterator += 1; } /* 1byte character */ \ + /* NOT ( (*iterator & 0x40) == 0 ) { iterator += 2; } 2byte character */ \ + else if( (*iterator & 0x20) == 0 ) { iterator += 2; } /* 3byte character */ \ + else if( (*iterator & 0x10) == 0 ) { iterator += 3; } /* 3byte character */ \ + else if( (*iterator & 0x08) == 0 ) { iterator += 4; } /* 4byte character */ \ + else if( (*iterator & 0x04) == 0 ) { iterator += 5; } /* 5byte character */ \ + else if( (*iterator & 0x02) == 0 ) { iterator += 6; } /* 6byte character */ \ + else if( (*iterator & 0x01) == 0 ) { iterator += 7; } /* 7byte character */ \ + else { iterator += 1; } /* default 1 */ \ + (counter)._column_number_at_end += 1; \ + break; \ + } +# elif QUEX_SETTING_CHAR_CODEC == utf16 +# define __QUEX_COUNTER_RULES(counter, iterator) \ + switch( (int)(QUEX_TYPE_LEXATOM)(*iterator) ) { \ + case (int)(QUEX_TYPE_LEXATOM)'\t': \ + (counter)._column_number_at_end &= (~(size_t)0x3) + 4;\ + ++(iterator); \ + break; \ + case (int)(QUEX_TYPE_LEXATOM)'\n': \ + (counter)._line_number_at_end += 1; \ + (counter)._column_number_at_end = 1; \ + ++(iterator); \ + break; \ + default: \ + if ( *iterator < 0xD800 ) { iterator += 1; } /* 1 chunk character */ \ + else if( *iterator > 0xDBFF ) { iterator += 1; } /* 1 chunk character */ \ + else { iterator += 2; } /* 2 chunk character */ \ + (counter)._column_number_at_end += 1; \ + break; \ + } +# else +# define __QUEX_COUNTER_RULES(counter, iterator) \ + switch( (int)(*iterator) ) { \ + case (int)(QUEX_TYPE_LEXATOM)'\t': \ + (counter)._column_number_at_end &= (~(size_t)0x3) + 4; break; \ + case (int)(QUEX_TYPE_LEXATOM)'\n': \ + (counter)._line_number_at_end += 1; \ + (counter)._column_number_at_end = 1; break; \ + default: \ + (counter)._column_number_at_end += 1; break; \ + } \ + ++(iterator); +# endif + +#endif + +/* Special Case MinGW: At the time of this writing (2009y09m23d) it does + * not support 'wchart_t'. */ +#if (defined (__GLIBCPP__) || defined(__GLIBCXX__)) \ + && ! defined (_GLIBCXX_USE_WCHAR_T) +# define __QUEX_OPTION_WCHAR_T_DISABLED +#endif +#ifndef __QUEX_OPTION_WCHAR_T_DISABLED +# define __QUEX_OPTION_WCHAR_T +#endif + +/* If you have a different setup, define the macros QUEX_SETTING_WCHAR_CODEC + * and QUEX_SETTING_CHAR_CODEC before the inclusion of this file. + * + * NOTE: '8' stands for UTF8, '16' stands for UTF16, and '32' for UTF32. + * Do not add anything around those numbers, otherwise the macros + * will not trigger the right mappings. */ +#if ! defined(QUEX_SETTING_WCHAR_CODEC) +# if defined(_WIN32) || defined(_WIN64) + /* Default: Map 'wchar' to 'utf16' */ +# define QUEX_SETTING_WCHAR_CODEC 16 +# else + /* Default: Map 'wchar' to 'utf32' */ +# define QUEX_SETTING_WCHAR_CODEC 32 +# endif +#endif + +/* Default: Map 'char' to 'utf8' */ +#if ! defined(QUEX_SETTING_CHAR_CODEC) +# define QUEX_SETTING_CHAR_CODEC utf8 +#endif + +#if ! defined(__QUEX_OPTION_PLAIN_C) + /* Cannot/must not go through '__QUEX_APPEND'. QUEX_FUNCTION_PREFIX ends + * with '::'. No '##' is required for concatination. */ +# define QUEX_FUNCTION_DEF(NAME) NAME +# define QUEX_FUNCTION(NAME) QUEX_FUNCTION_PREFIX NAME + + /* Avoid __VA_ARGS__ because some compilers still cannot handle it + * properly. */ +# define QUEX_SIGNATURE(CLASS, FUNCTION) CLASS ## :: ## FUNCTION +# define QUEX_THIS_IS_ME(C) C* me = this; +# define QUEX_MEMBERF(C, F) QUEX_SIGNATURE(C, F)() +# define QUEX_MEMBERF1(C, F, ARG0) QUEX_SIGNATURE(C, F)(ARG0) +# define QUEX_MEMBERF2(C, F, ARG0, ARG1) QUEX_SIGNATURE(C, F)(ARG0, ARG1) +# define QUEX_MEMBERF3(C, F, ARG0, ARG1, ARG2) QUEX_SIGNATURE(C, F)(ARG0, ARG1, ARG2) +# define QUEX_MEMBERF4(C, F, ARG0, ARG1, ARG2, ARG3) QUEX_SIGNATURE(C, F)(ARG0, ARG1, ARG2, ARG3) + +# define QUEX_DESTRUCTOR() QUEX_MEMBER(~QUEX_TYPE0_ANALYZER)() +# define QUEX_MEMBER_FUNCTION(N, SFX) QUEX_MEMBER(N)() +# define QUEX_MEMBER_FUNCTIONO(N) QUEX_MEMBER(N)() +# define QUEX_MEMBER_FUNCTION1(N, SFX, A) QUEX_MEMBER(N)(A) +# define QUEX_MEMBER_FUNCTIONO1(N, A) QUEX_MEMBER(N)(A) +# define QUEX_MEMBER_FUNCTION2(N, SFX, A, B) QUEX_MEMBER(N)(A, B) +# define QUEX_MEMBER_FUNCTIONO2(N, A, B) QUEX_MEMBER(N)(A, B) +# define QUEX_MEMBER_FUNCTION3(N, SFX, A, B, C) QUEX_MEMBER(N)(A, B, C) +# define QUEX_MEMBER_FUNCTION4(N, SFX, A, B, C, D) QUEX_MEMBER(N)(A, B, C, D) +# define QUEX_MEMBER_FUNCTION_CALL(N, SFX) this->N() +# define QUEX_MEMBER_FUNCTION_CALLO(N) this->N() +# define QUEX_MEMBER_FUNCTION_CALL1(N, SFX, A) this->N(A) +# define QUEX_MEMBER_FUNCTION_CALLO1(N, A) this->N(A) +# define QUEX_MEMBER_FUNCTION_CALL2(N, SFX, A, B) this->N(A, B) +# define QUEX_MEMBER_FUNCTION_CALLO2(N, A, B) this->N(A, B) +# define QUEX_MEMBER_FUNCTION_CALL3(N, SFX, A, B, C) this->N(A, B, C) +# define QUEX_MEMBER_FUNCTION_CALL4(N, SFX, A, B, C, D) this->N(A, B, C, D) + +#else + /* Go through '__QUEX_APPEND' to ensure macro expansion, before concatination. */ +# define QUEX_FUNCTION_DEF(NAME) __QUEX_APPEND(QUEX_FUNCTION_DEF_PREFIX, NAME) +# define QUEX_FUNCTION(NAME) __QUEX_APPEND(QUEX_FUNCTION_PREFIX, NAME) + +# define QUEX_SIGNATURE(CLASS, FUNCTION) CLASS ## _ ## FUNCTION +# define QUEX_THIS(C) struct C ## _tag* me +# define QUEX_THIS_IS_ME(C) /* Nothing To Do */ +# define QUEX_MEMBERF(C, F) QUEX_SIGNATURE(C, F)(QUEX_THIS(C)) +# define QUEX_MEMBERF1(C, F, ARG0) QUEX_SIGNATURE(C, F)(QUEX_THIS(C), ARG0) +# define QUEX_MEMBERF2(C, F, ARG0, ARG1) QUEX_SIGNATURE(C, F)(QUEX_THIS(C), ARG0, ARG1) +# define QUEX_MEMBERF3(C, F, ARG0, ARG1, ARG2) QUEX_SIGNATURE(C, F)(QUEX_THIS(C), ARG0, ARG1, ARG2) +# define QUEX_MEMBERF4(C, F, ARG0, ARG1, ARG2, ARG3) QUEX_SIGNATURE(C, F)(QUEX_THIS(C), ARG0, ARG1, ARG2, ARG3) + + /* Avoid __VA_ARGS__ because some compilers still cannot handle it + * properly. */ +# define QUEX_DESTRUCTOR() void QUEX_NAME(destruct)(QUEX_TYPE_ANALYZER* me) +# define QUEX_MEMBER_FUNCTION(N, SFX) QUEX_NAME(N ## _ ## SFX)(QUEX_TYPE_ANALYZER* me) +# define QUEX_MEMBER_FUNCTIONO(N) QUEX_NAME(N)(QUEX_TYPE_ANALYZER* me) +# define QUEX_MEMBER_FUNCTION1(N, SFX, A) QUEX_NAME(N ## _ ## SFX)(QUEX_TYPE_ANALYZER* me, A) +# define QUEX_MEMBER_FUNCTIONO1(N, A) QUEX_NAME(N)(QUEX_TYPE_ANALYZER* me, A) +# define QUEX_MEMBER_FUNCTION2(N, SFX, A, B) QUEX_NAME(N ## _ ## SFX)(QUEX_TYPE_ANALYZER* me, A, B) +# define QUEX_MEMBER_FUNCTIONO2(N, A, B) QUEX_NAME(N)(QUEX_TYPE_ANALYZER* me, A, B) +# define QUEX_MEMBER_FUNCTION3(N, SFX, A, B, C) QUEX_NAME(N ## _ ## SFX)(QUEX_TYPE_ANALYZER* me, A, B, C) +# define QUEX_MEMBER_FUNCTION4(N, SFX, A, B, C, D) QUEX_NAME(N ## _ ## SFX)(QUEX_TYPE_ANALYZER* me, A, B, C, D) +# define QUEX_MEMBER_FUNCTION_CALL(N, SFX) QUEX_NAME(N ## _ ## SFX)(me) +# define QUEX_MEMBER_FUNCTION_CALLO(N) QUEX_NAME(N)(me) +# define QUEX_MEMBER_FUNCTION_CALL1(N, SFX, A) QUEX_NAME(N ## _ ## SFX)(me, A) +# define QUEX_MEMBER_FUNCTION_CALLO1(N, A) QUEX_NAME(N)(me, A) +# define QUEX_MEMBER_FUNCTION_CALL2(N, SFX, A, B) QUEX_NAME(N ## _ ## SFX)(me, A, B) +# define QUEX_MEMBER_FUNCTION_CALLO2(N, A, B) QUEX_NAME(N)(me, A, B) +# define QUEX_MEMBER_FUNCTION_CALL3(N, SFX, A, B, C) QUEX_NAME(N ## _ ## SFX)(me, A, B, C) +# define QUEX_MEMBER_FUNCTION_CALL4(N, SFX, A, B, C, D) QUEX_NAME(N ## _ ## SFX)(me, A, B, C, D) + +#endif + +#define QUEX_A_MEMBERF (FUNCTION) QUEX_MEMBERF(QUEX_TYPE0_ANALYZER, FUNCTION) +#define QUEX_A_MEMBERF1(FUNCTION, ARG0) QUEX_MEMBERF1(QUEX_TYPE0_ANALYZER, FUNCTION, ARG0) +#define QUEX_A_MEMBERF2(FUNCTION, ARG0, ARG1) QUEX_MEMBERF2(QUEX_TYPE0_ANALYZER, FUNCTION, ARG0, ARG1) +#define QUEX_A_MEMBERF3(FUNCTION, ARG0, ARG1, ARG2) QUEX_MEMBERF3(QUEX_TYPE0_ANALYZER, FUNCTION, ARG0, ARG1, ARG2) +#define QUEX_A_MEMBERF4(FUNCTION, ARG0, ARG1, ARG2, ARG3) QUEX_MEMBERF4(QUEX_TYPE0_ANALYZER, FUNCTION, ARG0, ARG1, ARG2, ARG3) + +#define QUEX_T_MEMBERF (FUNCTION) QUEX_MEMBERF(QUEX_NAME_COMPLETE_TOKEN, FUNCTION) +#define QUEX_T_MEMBERF1(FUNCTION, ARG0) QUEX_MEMBERF1(QUEX_NAME_COMPLETE_TOKEN, FUNCTION, ARG0) +#define QUEX_T_MEMBERF2(FUNCTION, ARG0, ARG1) QUEX_MEMBERF2(QUEX_NAME_COMPLETE_TOKEN, FUNCTION, ARG0, ARG1) +#define QUEX_T_MEMBERF3(FUNCTION, ARG0, ARG1, ARG2) QUEX_MEMBERF3(QUEX_NAME_COMPLETE_TOKEN, FUNCTION, ARG0, ARG1, ARG2) +#define QUEX_T_MEMBERF4(FUNCTION, ARG0, ARG1, ARG2, ARG3) QUEX_MEMBERF4(QUEX_NAME_COMPLETE_TOKEN, FUNCTION, ARG0, ARG1, ARG2, ARG3) + +/* For function definitions, the 'namespace::' is not required. => QUEX_FUNCTION0 */ +#define __QUEX_CONVERTER_CHAR_DEF(FROM, TO) QUEX_FUNCTION_DEF(FROM ## _to_ ## TO ## _character) +#define __QUEX_CONVERTER_STRING_DEF(FROM, TO) QUEX_FUNCTION_DEF(FROM ## _to_ ## TO) +#define QUEX_CONVERTER_CHAR_DEF(FROM, TO) __QUEX_CONVERTER_CHAR_DEF(FROM, TO) +#define QUEX_CONVERTER_STRING_DEF(FROM, TO) __QUEX_CONVERTER_STRING_DEF(FROM, TO) + +/* For function calls, the 'namespace::' IS required. => QUEX_FUNCTION */ +#define __QUEX_CONVERTER_CHAR(FROM, TO) QUEX_FUNCTION(FROM ## _to_ ## TO ## _character) +#define __QUEX_CONVERTER_STRING(FROM, TO) QUEX_FUNCTION(FROM ## _to_ ## TO) +#define QUEX_CONVERTER_CHAR(FROM, TO) __QUEX_CONVERTER_CHAR(FROM, TO) +#define QUEX_CONVERTER_STRING(FROM, TO) __QUEX_CONVERTER_STRING(FROM, TO) + +/* If '--token-class-only' we need to restore overwritten macros. */ +#define __QUEX_CONVERTER_CHAR_DEF_BACKUP(FROM, TO) QUEX_FUNCTION_DEF(FROM ## _to_ ## TO ## _character) +#define __QUEX_CONVERTER_STRING_DEF_BACKUP(FROM, TO) QUEX_FUNCTION_DEF(FROM ## _to_ ## TO) +#define QUEX_CONVERTER_CHAR_DEF_BACKUP(FROM, TO) __QUEX_CONVERTER_CHAR_DEF(FROM, TO) +#define QUEX_CONVERTER_STRING_DEF_BACKUP(FROM, TO) __QUEX_CONVERTER_STRING_DEF(FROM, TO) +#define __QUEX_CONVERTER_CHAR_BACKUP(FROM, TO) QUEX_FUNCTION(FROM ## _to_ ## TO ## _character) +#define __QUEX_CONVERTER_STRING_BACKUP(FROM, TO) QUEX_FUNCTION(FROM ## _to_ ## TO) +#define QUEX_CONVERTER_CHAR_BACKUP(FROM, TO) __QUEX_CONVERTER_CHAR(FROM, TO) +#define QUEX_CONVERTER_STRING_BACKUP(FROM, TO) __QUEX_CONVERTER_STRING(FROM, TO) + +#if defined (QUEX_OPTION_ASSERTS) +# define __QUEX_IF_ASSERT(X) X +#else +# define __QUEX_IF_ASSERT(X) /* Ignore */ +#endif + +#ifdef QUEX_OPTION_STRING_ACCUMULATOR +# define __QUEX_IF_STRING_ACCUMULATOR(X) X +#else +# define __QUEX_IF_STRING_ACCUMULATOR(X) /* No operation */ +#endif +#ifdef QUEX_OPTION_POST_CATEGORIZER +# define __QUEX_IF_POST_CATEGORIZER(X) X +#else +# define __QUEX_IF_POST_CATEGORIZER(X) /* No operation */ +#endif +#ifdef QUEX_OPTION_INCLUDE_STACK +# define __QUEX_IF_INCLUDE_STACK(X) X +#else +# define __QUEX_IF_INCLUDE_STACK(X) /* No operation */ +#endif + +/* If the user does not define a class declaration epilog, + * define it as empty. */ +#ifndef QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG +# define QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG +#endif diff --git a/src/parser/analyzerConstructor b/src/parser/analyzerConstructor @@ -0,0 +1,87 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__CONSTRUCTOR +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__CONSTRUCTOR + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN +#ifdef __QUEX_OPTION_PLAIN_C + +/* The constructor 'core' function is implemented per analyzer. + * It's implementation happens inside the generated source file. */ + +/* Level (1) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(from_file_name)( + QUEX_TYPE_ANALYZER*, + const char* Filename, + const char* CodecName /* = 0x0 */); + +/* Level (2) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(from_FILE)( + QUEX_TYPE_ANALYZER*, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); + +#if ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE void QUEX_NAME(from_istream)( + QUEX_TYPE_ANALYZER*, + std::istream* istream_p, + const char* CodecName /* = 0x0 */); + bool BinaryModeF /* = false */); + +#endif + +#if defined(__QUEX_OPTION_WCHAR_T) && ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE void QUEX_NAME(from_wistream)( + QUEX_TYPE_ANALYZER*, + std::wistream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); +#endif + +/* Level (3) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(from_ByteLoader)( + QUEX_TYPE_ANALYZER*, + QUEX_NAME(ByteLoader)* byte_loader, + const char* CodecName); + +/* Level (4) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(from_LexatomLoader)( + QUEX_TYPE_ANALYZER*, + QUEX_NAME(LexatomLoader)*); + +/* Level (5) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(from_memory)( + QUEX_TYPE_ANALYZER*, + QUEX_TYPE_LEXATOM* BufferMemoryBegin, + size_t BufferMemorySize, + QUEX_TYPE_LEXATOM* BufferEndOfFileP); + +/* Basic constructions ________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(basic_constructor)(QUEX_TYPE_ANALYZER*, + const char*); +QUEX_INLINE void QUEX_NAME(user_constructor)(QUEX_TYPE_ANALYZER*); +QUEX_INLINE void QUEX_NAME(destruct)(QUEX_TYPE_ANALYZER*); + +#endif + +#ifdef __QUEX_OPTION_PLAIN_C +QUEX_INLINE const char* +QUEX_NAME(input_name)(QUEX_TYPE_ANALYZER*); +QUEX_INLINE bool +QUEX_NAME(input_name_set)(QUEX_TYPE_ANALYZER*, const char*); +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__CONSTRUCTOR */ + diff --git a/src/parser/analyzerCounter b/src/parser/analyzerCounter @@ -0,0 +1,61 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__COUNTER +#define __QUEX_INCLUDE_GUARD__ANALYZER__COUNTER + +#if ! defined(__QUEX_OPTION_PLAIN_C) +# include <cstddef> +#else +# include <stddef.h> +#endif +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +# if defined(QUEX_OPTION_INDENTATION_TRIGGER) + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + QUEX_TYPE_INDENTATION front[QUEX_SETTING_INDENTATION_STACK_SIZE]; + QUEX_TYPE_INDENTATION* back; /* pointer to last element */ + QUEX_TYPE_INDENTATION* memory_end; + } QUEX_NAME(IndentationStack); + + QUEX_INLINE void + QUEX_NAME(IndentationStack_init)(QUEX_NAME(IndentationStack)* me); +# endif + + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { +# ifdef QUEX_OPTION_LINE_NUMBER_COUNTING + size_t _line_number_at_begin; /* line where current pattern starts */ + size_t _line_number_at_end; /* line after current pattern */ +# endif +# ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING + size_t _column_number_at_begin; /* column where current pattern starts */ + size_t _column_number_at_end; /* column after current pattern */ +# endif +# ifdef QUEX_OPTION_INDENTATION_TRIGGER + QUEX_NAME(IndentationStack) _indentation_stack; +# endif + } QUEX_NAME(Counter); + + + QUEX_INLINE void QUEX_NAME(Counter_construct)(QUEX_NAME(Counter)* me); + QUEX_INLINE void QUEX_NAME(Counter_copy_construct)(QUEX_NAME(Counter)* me, + const QUEX_NAME(Counter)* That); + +#if 0 + /* General Count: All involved characters for column counting do have the same width. */ + QUEX_INLINE void QUEX_NAME(Counter_count)(QUEX_NAME(Counter)* me, + const QUEX_TYPE_LEXATOM* Lexeme, + const QUEX_TYPE_LEXATOM* LexemeEnd); + QUEX_INLINE void QUEX_NAME(Counter_count_newlines)(QUEX_NAME(Counter)* me, + const QUEX_TYPE_LEXATOM* Lexeme, + const QUEX_TYPE_LEXATOM* LexemeEnd); +#endif + + + QUEX_INLINE void QUEX_NAME(Counter_print_this)(QUEX_NAME(Counter)* me); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__COUNTER */ + diff --git a/src/parser/analyzerHeaders b/src/parser/analyzerHeaders @@ -0,0 +1,49 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__HEADERS +#define __QUEX_INCLUDE_GUARD__ANALYZER__HEADERS + +#include "aux-string" +#include "analyzerAsserts" + +#include "definitions" + +#ifdef __QUEX_OPTION_UNIT_TEST +# include <quex/code_base/test_environment/StrangeStream> +#endif + +#include "bufferBuffer" +#include "LexatomLoader" +#include "ByteLoader" + +#include "MemoryManager" +#include "analyzerMode" +# +#ifdef __QUEX_OPTION_COUNTER +#include "analyzerCounter" +#endif +#ifdef QUEX_OPTION_INCLUDE_STACK +# include "analyzerInclude-stack" +#endif +#ifdef QUEX_OPTION_STRING_ACCUMULATOR +# include "Accumulator" +#endif +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE +# include "TokenQueue" +#endif +#ifdef QUEX_OPTION_POST_CATEGORIZER +# include <quex/code_base/analyzer/PostCategorizer> +#endif + +#include "analyzerBasic" + +#include "analyzerConstructor" +#include "analyzerReset" +#include "misc" +#include "navigation" +#include "mode-handling" +#include "token-receiving" +#include "token-sending" + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__HEADERS */ diff --git a/src/parser/analyzerInclude-stack b/src/parser/analyzerInclude-stack @@ -0,0 +1,99 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__INCLUDE_STACK +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__INCLUDE_STACK + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +#ifdef __QUEX_OPTION_PLAIN_C + +/* The constructor 'core' function is implemented per analyzer. + * It's implementation happens inside the generated source file. */ + +/* Level (1) __________________________________________________________________ + * */ +QUEX_INLINE bool QUEX_NAME(include_push_file_name)(QUEX_TYPE_ANALYZER* me, + const char* Filename, + const char* CodecName /* = 0x0 */); + +/* Level (2) __________________________________________________________________ + * */ +QUEX_INLINE bool QUEX_NAME(include_push_FILE)(QUEX_TYPE_ANALYZER* me, + const char* InputName, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); + +#if defined(QUEX_OPTION_POSIX) +QUEX_INLINE bool QUEX_NAME(include_push_POSIX)(QUEX_TYPE_ANALYZER* me, + const char* InputName, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */); +#endif + +#ifndef __QUEX_OPTION_PLAIN_C +QUEX_INLINE bool +QUEX_NAME(include_push_istream)(QUEX_TYPE_ANALYZER* me, + const char* InputName, + std::istream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); +#endif + +#if defined(__QUEX_OPTION_WCHAR_T) && ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE bool +QUEX_NAME(include_push_wistream)(QUEX_TYPE_ANALYZER* me, + const char* InputName, + std::wistream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); +#endif + +/* Level (3) __________________________________________________________________ + * */ +QUEX_INLINE bool QUEX_NAME(include_push_ByteLoader)( + QUEX_TYPE_ANALYZER* me, + const char* InputName, + QUEX_NAME(ByteLoader)* byte_loader, + const char* CodecName); + +/* Level (4) __________________________________________________________________ + * */ +QUEX_INLINE bool QUEX_NAME(include_push_LexatomLoader)( + QUEX_TYPE_ANALYZER* me, + const char* InputName, + QUEX_NAME(LexatomLoader)* filler); + +/* Level (5) __________________________________________________________________ + * */ +QUEX_INLINE bool QUEX_NAME(include_push_memory)( + QUEX_TYPE_ANALYZER* me, + const char* InputName, + QUEX_TYPE_LEXATOM* BufferMemoryBegin, + size_t BufferMemorySize, + QUEX_TYPE_LEXATOM* BufferEndOfFileP); + +/* Basic constructions ________________________________________________________ + * */ +QUEX_INLINE bool QUEX_NAME(basic_include_push)(QUEX_TYPE_ANALYZER* me, + const char* InputName, + QUEX_NAME(Buffer)* new_buffer_setup); +QUEX_INLINE bool QUEX_NAME(user_memento_pack)(QUEX_TYPE_ANALYZER* me, + const char* InputName, + struct QUEX_NAME(Memento_tag)* memento); +QUEX_INLINE void QUEX_NAME(user_memento_unpack)(QUEX_TYPE_ANALYZER* me, + struct QUEX_NAME(Memento_tag)* memento); + +QUEX_INLINE bool QUEX_NAME(include_pop)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(include_stack_delete)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE bool QUEX_NAME(include_detect_recursion)(QUEX_TYPE_ANALYZER* me, + const char* InputName); + +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__INCLUDE_STACK */ diff --git a/src/parser/analyzerMode b/src/parser/analyzerMode @@ -0,0 +1,68 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * + * (C) 2004-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MODE +#define __QUEX_INCLUDE_GUARD__ANALYZER__MODE +#ifndef QUEX_TYPE_ANALYZER +# error "Macro QUEX_TYPE_ANALYZER must be defined before inclusion of this file." +#endif + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +# if ! defined(__QUEX_OPTION_PLAIN_C) + class QUEX_TYPE0_ANALYZER; +# else + QUEX_TYPE0_ANALYZER; +# endif + + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(Mode_tag) { + int id; + const char* name; + +# if defined(QUEX_OPTION_INDENTATION_TRIGGER) \ + && ! defined(QUEX_OPTION_INDENTATION_DEFAULT_HANDLER) + void (*on_indentation)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_INDENTATION Indentation, + QUEX_TYPE_LEXATOM* Begin); +# endif + void (*on_entry)(QUEX_TYPE_ANALYZER*, const struct QUEX_NAME(Mode_tag)* FromMode); + void (*on_exit)(QUEX_TYPE_ANALYZER*, const struct QUEX_NAME(Mode_tag)* ToMode); +# ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK + bool (*has_base)(const struct QUEX_NAME(Mode_tag)* Mode); + bool (*has_entry_from)(const struct QUEX_NAME(Mode_tag)* Mode); + bool (*has_exit_to)(const struct QUEX_NAME(Mode_tag)* Mode); +# endif + + /* Choose the analyzer function to be the last, because it has a unique + * signature. The function pointers are assigned in a table. If the + * content of this class changes, any mismatch of pointers is likely + * to trigger a compilation error, thus signalling that the setup is + * incorrect. */ + QUEX_NAME(AnalyzerFunctionP) analyzer_function; + } QUEX_NAME(Mode); + + QUEX_INLINE __QUEX_TYPE_ANALYZER_RETURN_VALUE + QUEX_NAME(Mode_uncallable_analyzer_function)(QUEX_TYPE_ANALYZER*); + +# if ! defined(QUEX_OPTION_INDENTATION_DEFAULT_HANDLER) + QUEX_INLINE void + QUEX_NAME(Mode_on_indentation_null_function)(QUEX_TYPE_ANALYZER*, + QUEX_TYPE_LEXATOM* LexemeBegin, + QUEX_TYPE_LEXATOM* LexemeEnd); +# endif + + QUEX_INLINE void + QUEX_NAME(Mode_on_entry_exit_null_function)(QUEX_TYPE_ANALYZER*, const QUEX_NAME(Mode)*); + + typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + QUEX_NAME(Mode)* (begin[QUEX_SETTING_MODE_STACK_SIZE]); + QUEX_NAME(Mode)** end; + QUEX_NAME(Mode)** memory_end; + } QUEX_NAME(ModeStack); +QUEX_NAMESPACE_MAIN_CLOSE + + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__QUEX_MODE */ diff --git a/src/parser/analyzerReset b/src/parser/analyzerReset @@ -0,0 +1,83 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__RESET +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__RESET + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +#ifdef __QUEX_OPTION_PLAIN_C + +/* The constructor 'core' function is implemented per analyzer. + * It's implementation happens inside the generated source file. */ + +/* Level (0) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(reset)(QUEX_TYPE_ANALYZER* me); + +/* Level (1) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(reset_file_name)(QUEX_TYPE_ANALYZER* me, + const char* Filename, + const char* CodecName /* = 0x0 */); + +/* Level (2) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(reset_FILE)(QUEX_TYPE_ANALYZER* me, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); + +#if defined(QUEX_OPTION_POSIX) +QUEX_INLINE void QUEX_NAME(reset_POSIX)(QUEX_TYPE_ANALYZER* me, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */); +#endif + +#if ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE void QUEX_NAME(reset_istream)(QUEX_TYPE_ANALYZER* me, + std::istream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); + +#endif + +#if defined(__QUEX_OPTION_WCHAR_T) && ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE void QUEX_NAME(reset_wistream)(QUEX_TYPE_ANALYZER* me, + std::wistream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */); +#endif + +/* Level (3) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(reset_ByteLoader)(QUEX_TYPE_ANALYZER* me, + QUEX_NAME(ByteLoader)* byte_loader, + const char* CodecName); + +/* Level (4) __________________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(reset_LexatomLoader)(QUEX_TYPE_ANALYZER* me, + QUEX_NAME(LexatomLoader)*); + +/* Level (5) __________________________________________________________________ + * */ +QUEX_INLINE QUEX_TYPE_LEXATOM* + QUEX_NAME(reset_memory)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_LEXATOM* BufferMemoryBegin, + size_t BufferMemorySize, + QUEX_TYPE_LEXATOM* BufferEndOfFileP); + +/* Basic constructions ________________________________________________________ + * */ +QUEX_INLINE void QUEX_NAME(basic_reset)(QUEX_TYPE_ANALYZER* me, + const char* InputName); +QUEX_INLINE void QUEX_NAME(user_reset)(QUEX_TYPE_ANALYZER* me); + +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__RESET */ diff --git a/src/parser/asserts b/src/parser/asserts @@ -0,0 +1,32 @@ +/* vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__ASSERTS +#define __QUEX_INCLUDE_GUARD__ASSERTS + +#ifdef QUEX_OPTION_ASSERTS +# if ! defined (__QUEX_OPTION_PLAIN_C) +# include <cassert> +# else +# include <assert.h> +# endif +# define __quex_assert(X) assert(X) +# define __quex_assert_no_passage() do { QUEX_ERROR_EXIT("Illegal 'drop-into' other state"); } while ( 0 ) +# define __quex_assert_msg(X, Y) if( ! (X) ) do { QUEX_ERROR_EXIT(Y); } while ( 0 ) +# define __QUEX_IF_ASSERTS(EXPRESSION) EXPRESSION +# define QUEX_IF_ASSERTS_poison(BEGIN, END) \ + do { \ + if( END > BEGIN ) \ + __QUEX_STD_memset((uint8_t*)(BEGIN), (uint8_t)0xFF, \ + (size_t)((const uint8_t*)END - (const uint8_t*)BEGIN)); \ + } while(0) +#else +# define __quex_assert(X) /* no assert */ +# define __quex_assert_msg(X, Y) /* no assert, no message */ +# define __quex_assert_no_passage() /* no assert */ +# define __QUEX_IF_ASSERTS(EXPRESSION) /* empty */ +# define QUEX_IF_ASSERTS_poison(BEGIN, END) /* empty */ +#endif + +#define __QUEX_INCLUDE_INDICATOR__ASSERTS + +#endif /* __QUEX_INCLUDE_GUARD__ASSERTS */ + diff --git a/src/parser/aux-string b/src/parser/aux-string @@ -0,0 +1,42 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * (C) 2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__AUX_STRING +#define __QUEX_INCLUDE_GUARD__AUX_STRING + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE size_t +QUEX_NAME(strlen)(const QUEX_TYPE_LEXATOM* Str); + + +QUEX_INLINE size_t +QUEX_NAME(strcmp)(const QUEX_TYPE_LEXATOM* it0, const QUEX_TYPE_LEXATOM* it1); + +QUEX_INLINE void +QUEX_NAME(to_utf8)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + uint8_t** drain_p, const uint8_t* DrainEnd); + +QUEX_INLINE void +QUEX_NAME(to_utf16)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + uint16_t** drain_p, const uint16_t* DrainEnd); + +QUEX_INLINE void +QUEX_NAME(to_utf32)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + uint32_t** drain_p, const uint32_t* DrainEnd); + +QUEX_INLINE void +QUEX_NAME(to_char)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + char** drain_p, const char* DrainEnd); + +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) +QUEX_INLINE void +QUEX_NAME(to_wchar)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + wchar_t** drain_p, const wchar_t* DrainEnd); +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__AUX_STRING */ diff --git a/src/parser/aux-string.i b/src/parser/aux-string.i @@ -0,0 +1,84 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * (C) Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__AUX_STRING_I +#define __QUEX_INCLUDE_GUARD__AUX_STRING_I + +#include "definitions" + +#ifndef QUEX_CHARACTER_CONVERTER_DECLARED +# error "A character converter must have been included before this file." +/* This file is unable to include the character converters since they + * may change or may even be autogenerated. So, wheresover this fils is + * included, a converter file must have been included before. + * + * Consider files in "code_base/converter_helper/" */ +#endif + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE size_t +QUEX_NAME(strlen)(const QUEX_TYPE_LEXATOM* Str) +{ + const QUEX_TYPE_LEXATOM* iterator = Str; + while( *iterator != 0 ) ++iterator; + return (size_t)(iterator - Str); +} + +QUEX_INLINE size_t +QUEX_NAME(strcmp)(const QUEX_TYPE_LEXATOM* it0, + const QUEX_TYPE_LEXATOM* it1) +{ + for(; *it0 == *it1; ++it0, ++it1) { + /* Both letters are the same and == 0? + * => both reach terminall zero without being different. */ + if( *it0 == 0 ) return 0; + } + return (size_t)(*it0) - (size_t)(*it1); +} + +QUEX_INLINE void +QUEX_NAME(to_utf8)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + uint8_t** drain_p, const uint8_t* DrainEnd) +{ + QUEX_CONVERTER_STRING(QUEX_SETTING_CHARACTER_CODEC,utf8)( + source_p, SourceEnd, drain_p, DrainEnd); +} + +QUEX_INLINE void +QUEX_NAME(to_utf16)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + uint16_t** drain_p, const uint16_t* DrainEnd) +{ + QUEX_CONVERTER_STRING(QUEX_SETTING_CHARACTER_CODEC,utf16)( + source_p, SourceEnd, drain_p, DrainEnd); +} + +QUEX_INLINE void +QUEX_NAME(to_utf32)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + uint32_t** drain_p, const uint32_t* DrainEnd) +{ + QUEX_CONVERTER_STRING(QUEX_SETTING_CHARACTER_CODEC,utf32)( + source_p, SourceEnd, drain_p, DrainEnd); +} + +QUEX_INLINE void +QUEX_NAME(to_char)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + char** drain_p, const char* DrainEnd) +{ + QUEX_CONVERTER_STRING(QUEX_SETTING_CHARACTER_CODEC,char)( + source_p, SourceEnd, drain_p, DrainEnd); +} + +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) +QUEX_INLINE void +QUEX_NAME(to_wchar)(const QUEX_TYPE_LEXATOM** source_p, const QUEX_TYPE_LEXATOM* SourceEnd, + wchar_t** drain_p, const wchar_t* DrainEnd) +{ + QUEX_CONVERTER_STRING(QUEX_SETTING_CHARACTER_CODEC,wchar)( + source_p, SourceEnd, drain_p, DrainEnd); +} +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__AUX_STRING_I */ diff --git a/src/parser/basic.i b/src/parser/basic.i @@ -0,0 +1,16 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__BASIC_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__BASIC_I + +#include "definitions" +#include "bufferBuffer" +#include "LexatomLoader" +#include "bufferAsserts" +#ifdef QUEX_OPTION_INCLUDE_STACK +# include "analyzerInclude-stack" +#endif + + +#include "Buffer.i" + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__BASIC_I */ diff --git a/src/parser/bom b/src/parser/bom @@ -0,0 +1,98 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * + * Byte Order Mark (BOM) Handling. + * + * The byte order mark (BOM) is a Unicode character used to signal + * the endianness (byte order) of a text file or stream. Its code + * point is U+FEFF. + * [Source: <http://en.wikipedia.org/wiki/Byte_order_mark>] + * + * This file implements a function to cut the BOM and tell about + * the encoding of the data stream. + * + * (C) 2010 Frank-Rene Schaefer + + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__BOM +#define __QUEX_INCLUDE_GUARD__BOM + +#include "definitions" + +typedef enum { + QUEX_BOM_NONE = 0x200, /* D9 --> NONE/NOT SURE */ + QUEX_BOM_UTF_8 = 0x001, /* D0 --> UTF 8 */ + QUEX_BOM_UTF_1 = 0x002, /* D1 --> UTF 1 */ + QUEX_BOM_UTF_EBCDIC = 0x004, /* D2 --> UTF EBCDIC */ + QUEX_BOM_BOCU_1 = 0x008, /* D3 --> BOCU 1 */ + QUEX_BOM_GB_18030 = 0x010, /* D4 --> GB_18030 */ + QUEX_BOM_UTF_7 = 0x220, /* D5 --> UTF 7; + * D9 --> May be not. */ + QUEX_BOM_UTF_16 = 0x040, /* D6 --> UTF 16 */ + QUEX_BOM_UTF_16_LE = 0x041, + QUEX_BOM_UTF_16_BE = 0x042, + QUEX_BOM_UTF_32 = 0x080, /* D7 --> UTF 32 */ + QUEX_BOM_UTF_32_LE = 0x081, + QUEX_BOM_UTF_32_BE = 0x082, + QUEX_BOM_SCSU = 0x100, /* D8 --> SCSU */ + QUEX_BOM_SCSU_TO_UCS = 0x101, + QUEX_BOM_SCSU_W0_TO_FE80 = 0x102, + QUEX_BOM_SCSU_W1_TO_FE80 = 0x103, + QUEX_BOM_SCSU_W2_TO_FE80 = 0x104, + QUEX_BOM_SCSU_W3_TO_FE80 = 0x105, + QUEX_BOM_SCSU_W4_TO_FE80 = 0x106, + QUEX_BOM_SCSU_W5_TO_FE80 = 0x107, + QUEX_BOM_SCSU_W6_TO_FE80 = 0x108, + QUEX_BOM_SCSU_W7_TO_FE80 = 0x109 +} QUEX_TYPE_BOM; + +/* Table of (known) BOMs _____________________________________________________ + * + * BOM_UTF_8 { 0xEF, 0xBB, 0xBF } + * UTF_16_BE { 0xFE, 0xFF } + * UTF_16_LE { 0xFF, 0xFE } + * UTF_32_BE { 0x00, 0x00, 0xFE, 0xFF } + * UTF_32_LE { 0xFF, 0xFE, 0x00, 0x00 } + * UTF_7_38 { 0x2B, 0x2F, 0x76, 0x38 } + * UTF_7_39 { 0x2B, 0x2F, 0x76, 0x39 } + * UTF_7_2B { 0x2B, 0x2F, 0x76, 0x2B } + * UTF_7_2F { 0x2B, 0x2F, 0x76, 0x2F } + * UTF_1 { 0xF7, 0x64, 0x4C } + * UTF_EBCDIC { 0xDD, 0x73, 0x66, 0x73 } + * SCSU { 0x0E, 0xFE, 0xFF } + * SCSU_TO_UCS { 0x0F, 0xFE, 0xFF } + * SCSU_W0_TO_FE80 { 0x18, 0xA5, 0xFF } + * SCSU_W1_TO_FE80 { 0x19, 0xA5, 0xFF } + * SCSU_W2_TO_FE80 { 0x1A, 0xA5, 0xFF } + * SCSU_W3_TO_FE80 { 0x1B, 0xA5, 0xFF } + * SCSU_W4_TO_FE80 { 0x1C, 0xA5, 0xFF } + * SCSU_W5_TO_FE80 { 0x1D, 0xA5, 0xFF } + * SCSU_W6_TO_FE80 { 0x1E, 0xA5, 0xFF } + * SCSU_W7_TO_FE80 { 0x1F, 0xA5, 0xFF } + * BOCU_1_x { 0xFB, 0xEE, 0x28, 0xFF } + * BOCU_1 { 0xFB, 0xEE, 0x28, } + * GB_18030 { 0x84, 0x31, 0x95, 0x33 } + *_____________________________________________________________________________*/ + +QUEX_NAMESPACE_QUEX_OPEN + +extern QUEX_TYPE_BOM +QUEXED_DEF(bom_snap)(__QUEX_STD_FILE* InputHandle); + +#if ! defined(__QUEX_OPTION_PLAIN_C) +template <class InputStream> QUEX_INLINE QUEX_TYPE_BOM +QUEXED_DEF(bom_snap)(InputStream* p_input_stream); +#endif + +extern QUEX_TYPE_BOM +QUEXED_DEF(__bom_snap_core)(uint8_t buffer[4], size_t read_n, size_t* byte_n); + +extern QUEX_TYPE_BOM +QUEXED_DEF(bom_identify)(const uint8_t* const Buffer, size_t* n); + +extern const char* +QUEXED_DEF(bom_name)(QUEX_TYPE_BOM BOM); + +QUEX_NAMESPACE_QUEX_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BOM */ + diff --git a/src/parser/bom.i b/src/parser/bom.i @@ -0,0 +1,183 @@ +/* This file contains an implementation which can potentially be shared between + * multiple different lexical analyzers. See 'multi.i' for further info. */ + +/* -*- C++ -*- vim:set syntax=cpp: + * + * Byte Order Mark (BOM) Handling. + * + * The byte order mark (BOM) is a Unicode character used to signal + * the endianness (byte order) of a text file or stream. Its code + * point is U+FEFF. + * [Source: <http://en.wikipedia.org/wiki/Byte_order_mark>] + * + * This file implements a function to cut the BOM and tell about + * the encoding of the data stream. + * + * (C) 2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ + +#ifndef __QUEX_INCLUDE_GUARD__BOM_I +#define __QUEX_INCLUDE_GUARD__BOM_I + +#include "bom" + +QUEX_NAMESPACE_QUEX_OPEN + +extern QUEX_TYPE_BOM +QUEXED_DEF(bom_snap)(__QUEX_STD_FILE* InputHandle) +/* This function can **only** be used with **normally** behaving streams + * where the position increases by one with every character being read. If + * this is not the case then use the **binary** option of your stream. */ +{ + uint8_t buffer[4] = { 0, 0, 0, 0}; + QUEX_TYPE_BOM result = QUEX_BOM_NONE; + size_t byte_n = 0; + size_t read_n = 0; + long p0 = __QUEX_STD_ftell(InputHandle); + + read_n = (size_t)__QUEX_STD_fread((uint8_t*)buffer, 1, 4, InputHandle); + result = QUEXED_DEF(__bom_snap_core)(buffer, read_n, &byte_n); + + /* Avoid temporary function argument. Store sum in p0. */ + p0 += (long)byte_n; + __QUEX_STD_fseek(InputHandle, p0, SEEK_SET); + + return result; +} + +#if ! defined(__QUEX_OPTION_PLAIN_C) +template <class InputStream> extern QUEX_TYPE_BOM +QUEXED_DEF(bom_snap)(InputStream* p_input_stream) +/* This function can **only** be used with **normally** behaving streams + * where the position increases by one with every character being read. If + * this is not the case then use the **binary** option of your stream. */ +{ + uint8_t buffer[4] = { 0, 0, 0, 0}; + QUEX_TYPE_BOM result = QUEX_BOM_NONE; + size_t byte_n = 0; + size_t read_n = 0; + /**/ + const size_t CharSize = sizeof(typename InputStream::char_type); + typename InputStream::pos_type p0 = p_input_stream->tellg() * CharSize; + + p_input_stream->read((typename InputStream::char_type*)buffer, 4 / CharSize); + read_n = (size_t)(p_input_stream->gcount()); + result = QUEXED_DEF(__bom_snap_core)(buffer, read_n, &byte_n); + + /* Avoid temporary function argument. Store sum in p0. */ + p0 += typename InputStream::pos_type(byte_n); + p_input_stream->seekg(p0 / CharSize); + + return result; +} +#endif + +extern QUEX_TYPE_BOM +QUEXED_DEF(__bom_snap_core)(uint8_t buffer[4], size_t read_n, size_t* byte_n) +{ + /* For non-existing bytes fill 0x77, because it does not occur + * anywhere as a criteria, see 'switch' after that. */ + switch( read_n ) { + case 0: return QUEX_BOM_NONE; + case 1: buffer[1] = 0x77; buffer[2] = 0x77; buffer[3] = 0x77; break; + case 2: buffer[2] = 0x77; buffer[3] = 0x77; break; + case 3: buffer[3] = 0x77; break; + } + + return QUEXED_DEF(bom_identify)(buffer, byte_n); +} + +extern QUEX_TYPE_BOM +QUEXED_DEF(bom_identify)(const uint8_t* const Buffer, size_t* n) + /* Assume, that the buffer contains at least 4 elements! */ +{ + /* Table of byte order marks (BOMs), see file 'quex/code_base/bom' */ + const uint8_t B0 = Buffer[0]; + const uint8_t B1 = Buffer[1]; + const uint8_t B2 = Buffer[2]; + const uint8_t B3 = Buffer[3]; + QUEX_TYPE_BOM x = QUEX_BOM_NONE; + + switch( B0 ) { + case 0x00: if( B1 == 0x00 && B2 == 0xFE && B3 == 0xFF ) { *n = 4; x = QUEX_BOM_UTF_32_BE; } break; + case 0x0E: if( B1 == 0xFE && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU; } break; + case 0x0F: if( B1 == 0xFE && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_TO_UCS; } break; + case 0x18: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W0_TO_FE80; } break; + case 0x19: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W1_TO_FE80; } break; + case 0x1A: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W2_TO_FE80; } break; + case 0x1B: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W3_TO_FE80; } break; + case 0x1C: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W4_TO_FE80; } break; + case 0x1D: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W5_TO_FE80; } break; + case 0x1E: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W6_TO_FE80; } break; + case 0x1F: if( B1 == 0xA5 && B2 == 0xFF ) { *n = 3; x = QUEX_BOM_SCSU_W7_TO_FE80; } break; + case 0x2B: + /* In any case, the UTF7 BOM is not eaten. + * This is too complicated, since it uses a base64 code. It would require + * to re-order the whole stream. This shall do the converter (if he wants). */ + *n = 0; + if( B1 == 0x2F && B2 == 0x76 ) { + switch( B3 ) + { case 0x2B: case 0x2F: case 0x38: case 0x39: x = QUEX_BOM_UTF_7; } + } + break; + case 0x84: if( B1 == 0x31 && B2 == 0x95 && B3 == 0x33 ) { *n = 4; x = QUEX_BOM_GB_18030; } break; + case 0xDD: if( B1 == 0x73 && B2 == 0x66 && B3 == 0x73 ) { *n = 4; x = QUEX_BOM_UTF_EBCDIC; } break; + case 0xEF: if( B1 == 0xBB && B2 == 0xBF ) { *n = 3; x = QUEX_BOM_UTF_8; } break; + case 0xF7: if( B1 == 0x64 && B2 == 0x4C ) { *n = 3; x = QUEX_BOM_UTF_1; } break; + case 0xFB: + if( B1 == 0xEE && B2 == 0x28 ) { + if( B3 == 0xFF ) { *n = 4; x = QUEX_BOM_BOCU_1; } + else { *n = 3; x = QUEX_BOM_BOCU_1; } + } + break; + case 0xFE: + if( B1 == 0xFF ) { *n = 2; x = QUEX_BOM_UTF_16_BE; } break; + case 0xFF: + if( B1 == 0xFE ) { + if( B2 == 0x00 && B3 == 0x00 ) { *n = 4; x = QUEX_BOM_UTF_32_LE; } + else { *n = 2; x = QUEX_BOM_UTF_16_LE; } + } + break; + default: + *n = 0; + } + + return x; +} + +extern const char* +QUEXED_DEF(bom_name)(QUEX_TYPE_BOM BOM) +{ + switch( BOM ) { + case QUEX_BOM_UTF_8: return "UTF_8"; + case QUEX_BOM_UTF_1: return "UTF_1"; + case QUEX_BOM_UTF_EBCDIC: return "UTF_EBCDIC"; + case QUEX_BOM_BOCU_1: return "BOCU_1"; + case QUEX_BOM_GB_18030: return "GB_18030"; + case QUEX_BOM_UTF_7: return "UTF_7"; + case QUEX_BOM_UTF_16: return "UTF_16"; + case QUEX_BOM_UTF_16_LE: return "UTF_16_LE"; + case QUEX_BOM_UTF_16_BE: return "UTF_16_BE"; + case QUEX_BOM_UTF_32: return "UTF_32"; + case QUEX_BOM_UTF_32_LE: return "UTF_32_LE"; + case QUEX_BOM_UTF_32_BE: return "UTF_32_BE"; + case QUEX_BOM_SCSU: return "SCSU"; + case QUEX_BOM_SCSU_TO_UCS: return "SCSU_TO_UCS"; + case QUEX_BOM_SCSU_W0_TO_FE80: return "SCSU_W0_TO_FE80"; + case QUEX_BOM_SCSU_W1_TO_FE80: return "SCSU_W1_TO_FE80"; + case QUEX_BOM_SCSU_W2_TO_FE80: return "SCSU_W2_TO_FE80"; + case QUEX_BOM_SCSU_W3_TO_FE80: return "SCSU_W3_TO_FE80"; + case QUEX_BOM_SCSU_W4_TO_FE80: return "SCSU_W4_TO_FE80"; + case QUEX_BOM_SCSU_W5_TO_FE80: return "SCSU_W5_TO_FE80"; + case QUEX_BOM_SCSU_W6_TO_FE80: return "SCSU_W6_TO_FE80"; + case QUEX_BOM_SCSU_W7_TO_FE80: return "SCSU_W7_TO_FE80"; + default: + case QUEX_BOM_NONE: return "NONE"; + } +} + +QUEX_NAMESPACE_QUEX_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__BOM_I */ + + diff --git a/src/parser/bufferAsserts b/src/parser/bufferAsserts @@ -0,0 +1,32 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__ASSERTS +#define __QUEX_INCLUDE_GUARD__BUFFER__ASSERTS + +#ifndef QUEX_OPTION_ASSERTS + +# define QUEX_BUFFER_ASSERT_pointers_in_range(B) /* empty */ +# define QUEX_BUFFER_ASSERT_CONSISTENCY(B) /* empty */ +# define QUEX_BUFFER_ASSERT_NO_BUFFER_LIMIT_CODE(Begin, End) /* empty */ + +#else +# include "definitions" +# include "bufferBuffer" + +QUEX_NAMESPACE_MAIN_OPEN + +#define QUEX_BUFFER_ASSERT_pointers_in_range QUEX_NAME(BUFFER_ASSERT_pointers_in_range_core) +#define QUEX_BUFFER_ASSERT_limit_codes_in_place QUEX_NAME(BUFFER_ASSERT_limit_codes_in_place_core) +#define QUEX_BUFFER_ASSERT_CONSISTENCY QUEX_NAME(BUFFER_ASSERT_CONSISTENCY_core) +#define QUEX_BUFFER_ASSERT_NO_BUFFER_LIMIT_CODE QUEX_NAME(BUFFER_ASSERT_NO_BUFFER_LIMIT_CODE_core) + +QUEX_INLINE void QUEX_NAME(BUFFER_ASSERT_pointers_in_range_core)(QUEX_NAME(Buffer)* B); +QUEX_INLINE void QUEX_NAME(BUFFER_ASSERT_limit_codes_in_place_core)(QUEX_NAME(Buffer)* B); +QUEX_INLINE void QUEX_NAME(BUFFER_ASSERT_CONSISTENCY_core)(QUEX_NAME(Buffer)* B); +QUEX_INLINE void QUEX_NAME(BUFFER_ASSERT_NO_BUFFER_LIMIT_CODE_core)(const QUEX_TYPE_LEXATOM* Begin, + const QUEX_TYPE_LEXATOM* End); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__ASSERTS */ diff --git a/src/parser/bufferAsserts.i b/src/parser/bufferAsserts.i @@ -0,0 +1,78 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__ASSERTS_I +#define __QUEX_INCLUDE_GUARD__BUFFER__ASSERTS_I + +#ifndef QUEX_OPTION_ASSERTS + +#else + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_NAME(BUFFER_ASSERT_pointers_in_range_core)(QUEX_NAME(Buffer)* B) +/* Check whether _read_p and _lexeme_start_p are in ther appropriate range. */ +{ + __quex_assert( (B) != 0x0 ); + if( ! (*B)._memory._front && ! (*B)._memory._back ) { + return; + } + + __quex_assert((*B)._memory._front < (*B)._memory._back); + __quex_assert((*B)._read_p >= (*B)._memory._front); + __quex_assert((*B)._lexeme_start_p >= (*B)._memory._front); + + __quex_assert((*B).input.end_p >= (*B)._memory._front + 1); + __quex_assert((*B).input.end_p <= (*B)._memory._back); + + __quex_assert((*B)._read_p <= (*B).input.end_p); + __quex_assert((*B)._lexeme_start_p <= (*B).input.end_p); +} + +QUEX_INLINE void +QUEX_NAME(BUFFER_ASSERT_limit_codes_in_place_core)(QUEX_NAME(Buffer)* B) +{ + if( ! (*B)._memory._front && ! (*B)._memory._back ) { + return; + } + __quex_assert(*((*B)._memory._front) == QUEX_SETTING_BUFFER_LIMIT_CODE); + __quex_assert(*((*B)._memory._back) == QUEX_SETTING_BUFFER_LIMIT_CODE); + __quex_assert(*(*B).input.end_p == QUEX_SETTING_BUFFER_LIMIT_CODE); +} + +QUEX_INLINE void +QUEX_NAME(BUFFER_ASSERT_CONSISTENCY_core)(QUEX_NAME(Buffer)* B) +{ + if( ! B ) return; + __quex_assert( B->input.lexatom_index_begin == -1 + || B->input.lexatom_index_begin >= 0); + __quex_assert( B->input.lexatom_index_end_of_stream == -1 + || B->input.lexatom_index_end_of_stream >= B->input.lexatom_index_begin); + QUEX_NAME(BUFFER_ASSERT_pointers_in_range_core)(B); + QUEX_NAME(BUFFER_ASSERT_limit_codes_in_place_core)(B); +} + +QUEX_INLINE void +QUEX_NAME(BUFFER_ASSERT_NO_BUFFER_LIMIT_CODE_core)(const QUEX_TYPE_LEXATOM* Begin, + const QUEX_TYPE_LEXATOM* End) +{ + const QUEX_TYPE_LEXATOM* iterator = 0x0; + __quex_assert(Begin <= End); + + for(iterator = Begin; iterator != End; ++iterator) { + if( *iterator != QUEX_SETTING_BUFFER_LIMIT_CODE ) continue; + + if( iterator == Begin ) { + QUEX_ERROR_EXIT("Buffer limit code character appeared as first character in buffer.\n" + "This is most probably a load failure.\n"); + } else { + QUEX_ERROR_EXIT("Buffer limit code character appeared as normal text content.\n"); + } + } +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__ASSERTS_I */ + diff --git a/src/parser/bufferBuffer b/src/parser/bufferBuffer @@ -0,0 +1,175 @@ +/* vim: set ft=cpp: -*- C++ -*- */ +#ifndef __QUEX_INCLUDE_GUARD__BUFFER__BUFFER +#define __QUEX_INCLUDE_GUARD__BUFFER__BUFFER + +#include"definitions" +#include"MemoryManager" + +QUEX_NAMESPACE_MAIN_OPEN + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { + E_Ownership ownership; + + /* (*) Buffer Memory Setup: + * memory[0] = lower buffer limit code lexatom + * memory[1] = first char of content + * ... + * memory[BUFFER_SIZE-2] = last char of content + * memory[BUFFER_SIZE-1] = upper buffer limit code lexatom */ + QUEX_TYPE_LEXATOM* _front; /* first lexatom in buffer (BLC) */ + QUEX_TYPE_LEXATOM* _back; /* last lexatom in buffer (BLC) */ + +} QUEX_NAME(BufferMemory); + +QUEX_INLINE size_t QUEX_NAME(BufferMemory_size)(QUEX_NAME(BufferMemory)*); +QUEX_INLINE void QUEX_NAME(BufferMemory_construct)(QUEX_NAME(BufferMemory)* me, + QUEX_TYPE_LEXATOM* Memory, + const size_t Size, + E_Ownership Ownership); +QUEX_INLINE void QUEX_NAME(BufferMemory_destruct)(QUEX_NAME(BufferMemory)* me); + +typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(Buffer_tag) { +/* Buffer of lexatoms on which the analyzer runs. + * + * Character Stream: + * (by LexatomLoader) + * + * lexatom_index_end_of_stream ------------------------. + * lexatom_index_begin -----------------. | + * | | + * lexatom index: 0 1 2 3 4 6 6 7 8 9 10 11 12 13 14 ... + * + * stream: [aa.bb.cc.dd.ee.ff:gg.hh.ii.jj.kk.ll:mm.nn.oo.pp.qq ... + * .---------' | + * Buffer: | .---------' + * [00|gg.hh.ii.jj.kk.ll|00.??.??.??.??|00] + * | | | + * _front ----------' | | + * input.end_p --------------------------' | + * _back -----------------------------------------------' + * + * 'lexatom_index_end_of_stream == -1' => end of stream has not yet been + * detected. */ + + QUEX_NAME(BufferMemory) _memory; + + /* (*) Iterator positions for lexical analysis */ + QUEX_TYPE_LEXATOM* _read_p; + QUEX_TYPE_LEXATOM* _lexeme_start_p; + + struct { + QUEX_TYPE_LEXATOM* end_p; + QUEX_TYPE_STREAM_POSITION lexatom_index_begin; + /* Character index + 1 of the last lexatom in the stream. */ + QUEX_TYPE_STREAM_POSITION lexatom_index_end_of_stream; + } input; + + /* (*) Information about previous content: + * + * _lexatom_at_lexeme_start: lexatom that has been covered by a + * terminating zero. Reset upon restart of + * analysis. + * _lexatom_at_lexeme_start: Used to check whether the lexeme's + * preceeding lexatom was newline. + * (i.e. for begin-of-line pre-context). */ + QUEX_TYPE_LEXATOM _lexatom_at_lexeme_start; +# ifdef __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION + QUEX_TYPE_LEXATOM _lexatom_before_lexeme_start; +# endif + + struct QUEX_NAME(LexatomLoader_tag)* filler; + + void* (*fill)(struct QUEX_NAME(Buffer_tag)* me, + const void* ContentBegin, + const void* ContentEnd); + void (*fill_prepare)(struct QUEX_NAME(Buffer_tag)* me, + void** begin_p, + const void** end_p); + void (*fill_finish)(struct QUEX_NAME(Buffer_tag)* me, + const void* FilledEndP); + + /* Event handlers: + * on_content_change: If the user maintained pointers into the buffer, + * this callback indicates that everything from 'BeginP' + * to 'EndP' needs to be copied somewhere else. + * on_overflow: Distance between current '_read_p' and the lexeme start + * plus the fallback region are too big for the current + * buffer's size. */ + void (*on_content_change)(const QUEX_TYPE_LEXATOM* BeginP, + const QUEX_TYPE_LEXATOM* EndP); + void (*on_overflow)(struct QUEX_NAME(Buffer_tag)*, bool ForwardF); + +} QUEX_NAME(Buffer); + +QUEX_INLINE void QUEX_NAME(Buffer_construct)(QUEX_NAME(Buffer)* me, + struct QUEX_NAME(LexatomLoader_tag)* filler, + QUEX_TYPE_LEXATOM* memory, + const size_t MemorySize, + QUEX_TYPE_LEXATOM* EndOfFileP, + E_Ownership Ownership); + +/* Constructor, destructor, reset. */ +QUEX_INLINE void QUEX_NAME(Buffer_reset)(QUEX_NAME(Buffer)* me, + struct QUEX_NAME(LexatomLoader_tag)* filler); + +QUEX_INLINE void QUEX_NAME(Buffer_destruct)(QUEX_NAME(Buffer)* me); + +/* Moving buffer content. */ +QUEX_INLINE ptrdiff_t QUEX_NAME(Buffer_move_away_passed_content)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_LEXATOM** position_register, + const size_t PositionRegisterN); +QUEX_INLINE ptrdiff_t QUEX_NAME(Buffer_move_away_upfront_content)(QUEX_NAME(Buffer)* me); + +/* Automatic loading of buffer content (during analysis). */ +QUEX_INLINE E_LoadResult + QUEX_NAME(Buffer_load_forward)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_LEXATOM** position_register, + const size_t PositionRegisterN); +QUEX_INLINE E_LoadResult + QUEX_NAME(Buffer_load_backward)(QUEX_NAME(Buffer)* me); +QUEX_INLINE bool QUEX_NAME(Buffer_move_and_load_backward)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_STREAM_POSITION NewCharacterIndexBegin); +QUEX_INLINE bool QUEX_NAME(Buffer_move_and_load_forward)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_STREAM_POSITION NewCharacterIndexBegin, + QUEX_TYPE_STREAM_POSITION MinCharacterIndexInBuffer); +/* User's manual buffer filling. */ +QUEX_INLINE void* QUEX_NAME(Buffer_fill)(QUEX_NAME(Buffer)* me, + const void* ContentBegin, + const void* ContentEnd); +QUEX_INLINE void QUEX_NAME(Buffer_fill_prepare)(QUEX_NAME(Buffer)* me, + void** begin_p, + const void** end_p); +QUEX_INLINE void QUEX_NAME(Buffer_fill_finish)(QUEX_NAME(Buffer)* me, + const void* FilledEndP); + +QUEX_INLINE void QUEX_NAME(Buffer_print_this)(QUEX_NAME(Buffer)*); +QUEX_INLINE void QUEX_NAME(Buffer_print_content)(QUEX_NAME(Buffer)*); + +/* Member attributes. */ +QUEX_INLINE bool QUEX_NAME(Buffer_is_empty)(QUEX_NAME(Buffer)* me); +QUEX_INLINE bool QUEX_NAME(Buffer_is_end_of_file)(QUEX_NAME(Buffer)*); +QUEX_INLINE bool QUEX_NAME(Buffer_is_begin_of_file)(QUEX_NAME(Buffer)*); + +QUEX_INLINE void QUEX_NAME(Buffer_register_content)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_LEXATOM* EndOfInputP, + QUEX_TYPE_STREAM_POSITION CharacterIndexBegin); +QUEX_INLINE void QUEX_NAME(Buffer_register_eos)(QUEX_NAME(Buffer)* me, + QUEX_TYPE_STREAM_POSITION CharacterIndexEndOfStream); +QUEX_INLINE QUEX_TYPE_STREAM_POSITION + QUEX_NAME(Buffer_input_lexatom_index_end)(QUEX_NAME(Buffer)* me); +QUEX_INLINE QUEX_TYPE_STREAM_POSITION + QUEX_NAME(Buffer_input_lexatom_index_begin)(QUEX_NAME(Buffer)* me); +QUEX_INLINE size_t QUEX_NAME(Buffer_content_size)(QUEX_NAME(Buffer)*); + +/* Tell & seek '_read_p' to/from lexatom index. */ +QUEX_INLINE QUEX_TYPE_STREAM_POSITION + QUEX_NAME(Buffer_tell)(QUEX_NAME(Buffer)*); +QUEX_INLINE void QUEX_NAME(Buffer_seek)(QUEX_NAME(Buffer)*, + const QUEX_TYPE_STREAM_POSITION CharacterIndex); +QUEX_INLINE bool QUEX_NAME(Buffer_seek_forward)(QUEX_NAME(Buffer)*, const ptrdiff_t CharacterN); +QUEX_INLINE bool QUEX_NAME(Buffer_seek_backward)(QUEX_NAME(Buffer)*, const ptrdiff_t CharacterN); + +QUEX_NAMESPACE_MAIN_CLOSE +#include "LexatomLoader" + +#endif /* __QUEX_INCLUDE_GUARD__BUFFER__BUFFER */ diff --git a/src/parser/character-converter-to-char-wchar_t.gi b/src/parser/character-converter-to-char-wchar_t.gi @@ -0,0 +1,71 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: Character converters towards 'char' and 'wchar_t'. + * + * Generate string converter functions which convert a string from one + * character codec into 'char' or 'wchar'. The conversion is implemented by + * means of a character converter function given by: + * + * QUEX_CONVERTER_CHAR(FROM, TO)(in, out); + * + * which converts only a single character. The converter function must + * be defined before the inclusion of this file. This file implements default + * converters for char and wchar. So for 'char' utf8 us used for 'wchar' utf16 + * or utf32 are used depending on the system's settings. + * + * (C) 2010-2012 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ + +#if ! defined(__QUEX_FROM) +# error "__QUEX_FROM must be defined!" +#elif ! defined(__QUEX_FROM_TYPE) +# error "__QUEX_FROM_TYPE must be defined!" +#elif defined(__QUEX_TO_TYPE) +# error "__QUEX_TO_TYPE must NOT be defined!" +#elif defined(__QUEX_TO) +# error "__QUEX_TO must NOT be defined!" +#elif defined(__QUEX_TO_CODEC) +# error "__QUEX_TO_CODEC must NOT be defined!" +#endif + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, char)(const __QUEX_FROM_TYPE** source_pp, + char** drain_pp) +{ + switch( sizeof(char) ) + { + case 1: + QUEX_CONVERTER_CHAR(__QUEX_FROM, utf8)(source_pp, (uint8_t**)drain_pp); + break; + case 2: + QUEX_CONVERTER_CHAR(__QUEX_FROM, utf16)(source_pp, (uint16_t**)drain_pp); + break; + case 4: + QUEX_CONVERTER_CHAR(__QUEX_FROM, utf32)(source_pp, (uint32_t**)drain_pp); + break; + default: + __quex_assert(false); /* Cannot be handled */ + } +} + +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) + QUEX_INLINE void + QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, wchar)(const __QUEX_FROM_TYPE** source_pp, + wchar_t** drain_pp) + { + switch( sizeof(wchar_t) ) + { + case 1: + QUEX_CONVERTER_CHAR(__QUEX_FROM, utf8)(source_pp, (uint8_t**)drain_pp); + break; + case 2: + QUEX_CONVERTER_CHAR(__QUEX_FROM, utf16)(source_pp, (uint16_t**)drain_pp); + break; + case 4: + QUEX_CONVERTER_CHAR(__QUEX_FROM, utf32)(source_pp, (uint32_t**)drain_pp); + break; + default: + __quex_assert(false); /* Cannot be handled */ + } + } +#endif + diff --git a/src/parser/compatStdbool-pseudo.h b/src/parser/compatStdbool-pseudo.h @@ -0,0 +1,36 @@ +/* PURPOSE: This header defines standard bool data types for use + * in plain 'C' lexical analyser engines. This is done + * here, in wise prediction that some compiler distributions + * may not provide this standard header. For the standard + * reference, please review: "The Open Group Base Specifications + * Issue 6, IEEE Std 1003.1, 2004 Edition". + * + * (C) 2008 Frank-Rene Schaefer */ +#ifndef __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDBOOL_PSEUDO_H +#define __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDBOOL_PSEUDO_H + +#if defined(__QUEX_OPTION_PLAIN_C) + +/* According to the C99 Standard 'bool' would have to be defined as equal to + * '_Bool' which is also defined in some standard. The author of this header, + * though, found it particularly hard to determine whether the compiler obeys + * these standards or not. Even prominent compilers, such as gcc at the time of + * this writing, did not provide __STDC_VERSION__. Thus, the 'easy' solution to + * simply define it as 'int' and call this file a 'stdbool-pseudo.h'. */ +#ifndef bool +# define bool int +#endif + +#ifndef true +#define true ((int)(1)) +#endif +#ifndef false +#define false ((int)(0)) +#endif + +#ifndef __bool_true_false_are_defined +#define __bool_true_false_are_defined ((int)(1)) +#endif + +#endif /* __QUEX_OPTION_PLAIN_C */ +#endif /* __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDBOOL_PSEUDO_H */ diff --git a/src/parser/compatStdint.h b/src/parser/compatStdint.h @@ -0,0 +1,27 @@ +#ifndef __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDINT_H +#define __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDINT_H +/* NOTE: At the time of this writing (Aug. 2007) there are still some + * compilers that do not support C99 Standard completely and + * do not provided 'stdint.h' and 'stdint.h' along with their + * compiler package (e.g. a major Redmondian Company). For this + * reason this header creates som adaptions. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (_MSC_VER) +# include <quex/code_base/compatibility/win/msc_stdint.h> +#elif defined(__BORLANDC__) +# include <quex/code_base/compatibility/win/borland_stdint.h> +#elif defined(__sun) && defined(__sparc) +# include <inttypes.h> /* Thanks to sbellon@users.sourceforge.net */ +#else +# include <stdint.h> +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDINT_H */ diff --git a/src/parser/constructor.i b/src/parser/constructor.i @@ -0,0 +1,409 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * (C) 2005-2015 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__CONSTRUCTOR_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__CONSTRUCTOR_I + +#include "Buffer.i" +#include "LexatomLoader.i" +#include "analyzerInclude-stack" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void QUEX_NAME(Asserts_user_memory)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_LEXATOM* BufferMemoryBegin, + size_t BufferMemorySize, + QUEX_TYPE_LEXATOM* BufferEndOfContentP /* = 0x0 */); +QUEX_INLINE void QUEX_NAME(Asserts_construct)(const char* CodecName); +QUEX_INLINE void QUEX_NAME(Tokens_construct)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(Tokens_reset)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(Tokens_destruct)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(ModeStack_construct)(QUEX_TYPE_ANALYZER* me); + + +/* Level (1) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION2(from, file_name, + const char* FileName, + const char* CodecName) +{ + QUEX_NAME(ByteLoader)* byte_loader; + + byte_loader = QUEX_NAME(ByteLoader_FILE_new_from_file_name)(FileName); + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(from, ByteLoader, byte_loader, CodecName); +} + +/* Level (2) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION3(from, FILE, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */) +/* 'BinaryModeF' tells whether the file has been opened in 'binary mode'. */ +{ + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( fh ); + + /* At the time of this writing 'stdin' as located in the C++ global + * namespace. This seemed suspicous to the author. To avoid compilation + * errors in the future the test for the standard input is only active in + * 'C'. It is only about user information anyway. So better no risks taken. + * <fschaef 2010y02m06d> */ + setbuf(fh, 0); /* turn off system based buffering! + ** ** this is essential to profit from the quex buffer! */ + byte_loader = QUEX_NAME(ByteLoader_FILE_new)(fh, BinaryModeF); + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(from, ByteLoader, byte_loader, CodecName); +} + +#ifndef __QUEX_OPTION_PLAIN_C +QUEX_INLINE void +QUEX_MEMBER_FUNCTION3(from, istream, + std::istream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */) +{ + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = BinaryModeF; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(from, ByteLoader, byte_loader, CodecName); +} +#endif + + +#if defined(__QUEX_OPTION_WCHAR_T) && ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE void +QUEX_MEMBER_FUNCTION3(from, wistream, + std::wistream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */) +{ + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = BinaryModeF; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + QUEX_MEMBER_FUNCTION_CALL2(from, ByteLoader, byte_loader, CodecName); +} +#endif + +#if defined(__QUEX_OPTION_UNIT_TEST) && ! defined (__QUEX_OPTION_PLAIN_C) +/* StrangeStreams are not for C-language stuff */ +template<class UnderlyingStreamT> QUEX_INLINE void +QUEX_MEMBER_FUNCTION2(from_StrangeStream, strange_stream, + quex::StrangeStream<UnderlyingStreamT>* istream_p, + const char* CodecName /* = 0x0 */) +{ + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = false; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + QUEX_MEMBER_FUNCTION_CALL2(from, ByteLoader, byte_loader, CodecName); +} +#endif + + +/* Level (3) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION2(from, ByteLoader, + QUEX_NAME(ByteLoader)* byte_loader, + const char* CodecName) +{ + QUEX_NAME(LexatomLoader)* filler; + QUEX_NAME(Asserts_construct)(CodecName); + + filler = QUEX_NAME(LexatomLoader_new_DEFAULT)(byte_loader, CodecName); + /* NOT: Abort/return if filler == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( filler ) { + filler->ownership = E_Ownership_LEXICAL_ANALYZER; + } + + QUEX_MEMBER_FUNCTION_CALL1(from, LexatomLoader, filler); +} + +/* Level (4) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION1(from, LexatomLoader, + QUEX_NAME(LexatomLoader)* filler) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_TYPE_LEXATOM* memory; + + memory = (QUEX_TYPE_LEXATOM*)QUEXED(MemoryManager_allocate)( + QUEX_SETTING_BUFFER_SIZE * sizeof(QUEX_TYPE_LEXATOM), + E_MemoryObjectType_BUFFER_MEMORY); + /* NOT: Abort/return if memory == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + + QUEX_NAME(Buffer_construct)(&me->buffer, filler, + memory, QUEX_SETTING_BUFFER_SIZE, + (QUEX_TYPE_LEXATOM*)0, + E_Ownership_LEXICAL_ANALYZER); + QUEX_MEMBER_FUNCTION_CALLO1(basic_constructor, (const char*)"<unknown>"); +} + +/* Level (5) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION3(from, memory, + QUEX_TYPE_LEXATOM* Memory, + const size_t MemorySize, + QUEX_TYPE_LEXATOM* EndOfFileP) + +/* When memory is provided from extern, the 'external entity' is responsible + * for filling it. There is no 'file/stream handle', no 'byte loader', and 'no + * buffer filler'. */ +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_ASSERT_MEMORY(Memory, MemorySize, EndOfFileP); + + QUEX_NAME(Buffer_construct)(&me->buffer, + (QUEX_NAME(LexatomLoader)*)0, + Memory, MemorySize, EndOfFileP, + E_Ownership_EXTERNAL); + QUEX_MEMBER_FUNCTION_CALLO1(basic_constructor, (const char*)"<memory>"); +} + +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO1(basic_constructor, const char* InputNameP) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(Tokens_construct)(me); + QUEX_NAME(ModeStack_construct)(me); + __QUEX_IF_INCLUDE_STACK( me->_parent_memento = (QUEX_NAME(Memento)*)0); + __QUEX_IF_STRING_ACCUMULATOR(QUEX_NAME(Accumulator_construct)(&me->accumulator, me)); + __QUEX_IF_POST_CATEGORIZER( QUEX_NAME(PostCategorizer_construct)(&me->post_categorizer)); + __QUEX_IF_COUNT( QUEX_NAME(Counter_construct)(&me->counter); ) + + /* A user's mode change callbacks may be called as a consequence of the + * call to 'set_mode_brutally_by_id()'. The current mode must be set to '0' + * so that the user may detect whether this is the first mode transition.*/ + me->__current_mode_p = (QUEX_NAME(Mode)*)0; + QUEX_NAME(set_mode_brutally_by_id)(me, __QUEX_SETTING_INITIAL_LEXER_MODE_ID); + + me->__input_name = (char*)0; + (void)QUEX_MEMBER_FUNCTION_CALLO1(input_name_set, InputNameP); + + QUEX_MEMBER_FUNCTION_CALLO(user_constructor); +} + +QUEX_INLINE +QUEX_DESTRUCTOR() +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(Tokens_destruct)(me); + + __QUEX_IF_INCLUDE_STACK(QUEX_MEMBER_FUNCTION_CALLO(include_stack_delete)); + /* IMPORTANT: THE ACCUMULATOR CAN ONLY BE DESTRUCTED AFTER THE INCLUDE + * STACK HAS BEEN DELETED. OTHERWISE, THERE MIGHT BE LEAKS. + * TODO: Why? I cannot see a reason <fschaef 15y08m03d> */ + __QUEX_IF_STRING_ACCUMULATOR( QUEX_NAME(Accumulator_destruct)(&me->accumulator)); + __QUEX_IF_POST_CATEGORIZER( QUEX_NAME(PostCategorizer_destruct)(&me->post_categorizer)); + + QUEX_NAME(Buffer_destruct)(&me->buffer); + + if( me->__input_name ) { + QUEXED(MemoryManager_free)(me->__input_name, E_MemoryObjectType_BUFFER_MEMORY); + } +} + +QUEX_INLINE void +QUEX_NAME(Asserts_user_memory)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_LEXATOM* BufferMemoryBegin, + size_t BufferMemorySize, + QUEX_TYPE_LEXATOM* BufferEndOfContentP /* = 0x0 */) +{ +# ifdef QUEX_OPTION_ASSERTS + size_t memory_size = BufferMemoryBegin ? BufferMemorySize + : QUEX_SETTING_BUFFER_SIZE; + QUEX_TYPE_LEXATOM* iterator = 0x0; + + __quex_assert(memory_size == 0 || memory_size > 2); + if( BufferMemoryBegin ) { + /* End of File must be inside the buffer, because we assume that the buffer + * contains all that is required. */ + if( BufferMemorySize <= QUEX_SETTING_BUFFER_MIN_FALLBACK_N + 2) { + QUEX_ERROR_EXIT("\nConstructor: Provided memory size must be more than 2 greater than\n" + "Constructor: QUEX_SETTING_BUFFER_MIN_FALLBACK_N. If in doubt, specify\n" + "Constructor: -DQUEX_SETTING_BUFFER_MIN_FALLBACK_N=0 as compile option.\n"); + } + if( BufferEndOfContentP < BufferMemoryBegin + || BufferEndOfContentP > (BufferMemoryBegin + BufferMemorySize - 1)) { + QUEX_ERROR_EXIT("\nConstructor: Argument 'BufferEndOfContentP' must be inside the provided memory\n" + "Constructor: buffer (speficied by 'BufferMemoryBegin' and 'BufferMemorySize').\n" + "Constructor: Note, that the last element of the buffer is to be filled with\n" + "Constructor: the buffer limit code character.\n"); + } + } + if( BufferEndOfContentP ) { + __quex_assert(BufferEndOfContentP > BufferMemoryBegin); + __quex_assert(BufferEndOfContentP <= BufferMemoryBegin + memory_size - 1); + + /* The memory provided must be initialized. If it is not, then that's wrong. + * Try to detect me by searching for BLC and PTC. */ + for(iterator = BufferMemoryBegin + 1; iterator != BufferEndOfContentP; ++iterator) { + if( *iterator == QUEX_SETTING_BUFFER_LIMIT_CODE + || *iterator == QUEX_SETTING_PATH_TERMINATION_CODE ) { + QUEX_ERROR_EXIT("\nConstructor: Buffer limit code and/or path termination code appeared in buffer\n" + "Constructor: when pointed to user memory. Note, that the memory pointed to must\n" + "Constructor: be initialized! You might redefine QUEX_SETTING_PATH_TERMINATION_CODE\n" + "Constructor: and/or QUEX_SETTING_PATH_TERMINATION_CODE; or use command line arguments\n" + "Constructor: '--buffer-limit' and '--path-termination'."); + } + } + } +# endif + + /* NOT: before ifdef, otherwise c90 issue: mixed declarations and code */ + (void)me; (void)BufferMemoryBegin; (void)BufferMemorySize; (void)BufferEndOfContentP; +} + +/* AUXILIARY FUNCTIONS FOR CONSTRUCTION _______________________________________ + * */ + +QUEX_INLINE void +QUEX_NAME(Asserts_construct)(const char* CodecName) +{ + (void)CodecName; + +# if defined(QUEX_OPTION_ASSERTS) \ + && ! defined(QUEX_OPTION_ASSERTS_WARNING_MESSAGE_DISABLED) + __QUEX_STD_printf(__QUEX_MESSAGE_ASSERTS_INFO); +# endif + +# if defined(QUEX_OPTION_ASSERTS) + if( QUEX_SETTING_BUFFER_LIMIT_CODE == QUEX_SETTING_PATH_TERMINATION_CODE ) { + QUEX_ERROR_EXIT("Path termination code (PTC) and buffer limit code (BLC) must be different.\n"); + } +# endif + +# if defined(__QUEX_OPTION_ENGINE_RUNNING_ON_CODEC) + if( CodecName ) { + __QUEX_STD_printf(__QUEX_MESSAGE_CHARACTER_ENCODING_SPECIFIED_WITHOUT_CONVERTER, CodecName); + } +# endif +} + +#if ! defined(QUEX_TYPE_TOKEN) +# error "QUEX_TYPE_TOKEN must be defined before inclusion of this file." +#endif +QUEX_INLINE void +QUEX_NAME(Tokens_construct)(QUEX_TYPE_ANALYZER* me) +{ +#if defined(QUEX_OPTION_TOKEN_POLICY_QUEUE) +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + /* Assume that the user will pass us a constructed token queue */ + QUEX_NAME(TokenQueue_disfunctionality_set)(&me->_token_queue); +# else + QUEX_NAME(TokenQueue_construct)(&me->_token_queue, + (QUEX_TYPE_TOKEN*)&me->__memory_token_queue, + QUEX_SETTING_TOKEN_QUEUE_SIZE); +# endif +#elif defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + /* Assume that the user will pass us a constructed token */ + me->token = (QUEX_TYPE_TOKEN*)0x0; +# else + me->token = &me->__memory_token; +# ifdef __QUEX_OPTION_PLAIN_C + QUEX_NAME_TOKEN(construct)(me->token); +# endif +#endif +} + +QUEX_INLINE void +QUEX_NAME(Tokens_destruct)(QUEX_TYPE_ANALYZER* me) +{ + /* Even if the token memory is user managed, the destruction (not the + * freeing of memory) must happen at this place. */ +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + QUEX_NAME(TokenQueue_destruct)(&me->_token_queue); +#else +# if defined(__QUEX_OPTION_PLAIN_C) \ + && ! defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_NAME_TOKEN(destruct)(me->token); +# endif +#endif +} + +QUEX_INLINE void +QUEX_NAME(Tokens_reset)(QUEX_TYPE_ANALYZER* me) +{ +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + QUEX_NAME(TokenQueue_reset)(&me->_token_queue); +#else + QUEX_NAME(Tokens_destruct(me)); + QUEX_NAME(Tokens_construct(me)); +#endif +} + +QUEX_INLINE void +QUEX_NAME(ModeStack_construct)(QUEX_TYPE_ANALYZER* me) +{ + me->_mode_stack.end = me->_mode_stack.begin; + me->_mode_stack.memory_end = &me->_mode_stack.begin[QUEX_SETTING_MODE_STACK_SIZE]; +} + +QUEX_INLINE const char* +QUEX_MEMBER_FUNCTIONO(input_name) +{ QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) return me->__input_name; } + +QUEX_INLINE bool +QUEX_MEMBER_FUNCTIONO1(input_name_set, const char* InputNameP) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + + if( me->__input_name ) { + QUEXED(MemoryManager_free)(me->__input_name, E_MemoryObjectType_BUFFER_MEMORY); + } + me->__input_name = (char*)QUEXED(MemoryManager_allocate)( + sizeof(char)*(__QUEX_STD_strlen(InputNameP)+1), + E_MemoryObjectType_BUFFER_MEMORY); + if( me->__input_name ) { + __QUEX_STD_strcpy(me->__input_name, InputNameP); + return true; + } + return false; +} + + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__CONSTRUCTOR_I */ diff --git a/src/parser/converterHelperCommon.h b/src/parser/converterHelperCommon.h @@ -0,0 +1,23 @@ +/* Common include headers for all converter functions. + * + * (C) Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__COMMON_H +#define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__COMMON_H + +#include "definitions" +#include "compatStdint.h" +#include "asserts" +#if ! defined(__QUEX_OPTION_PLAIN_C) +# include <string> +#endif + +/* Signalize: Converters are available! + * + * Since converters can come from multiple sources it is not possible to + * include in a header always the right converters. To get along, users of + * converters must at least check that before they are included, the converter + * headers have been made available--by inclusion before they were included */ +#define QUEX_CHARACTER_CONVERTER_DECLARED + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__COMMON_H */ diff --git a/src/parser/converterHelperGeneratorDeclarations.g b/src/parser/converterHelperGeneratorDeclarations.g @@ -0,0 +1,93 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * + * Declaration of all converter functions towards 'utf8', 'utf16', 'utf32', + * 'char', and 'wchar_t': + * + * QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, utf8)(...) + * QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, utf16)(...) + * QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, utf32)(...) + * QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, char)(...) + * QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, wchar_t)(...) + * + * QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf8)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf16)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf32)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, char)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, wchar_t)(...) for string and buffer + * + * (C) 2012 Frank-Rene Schaefer, ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_FROM) +# error "__QUEX_FROM must be defined!" +#elif ! defined(__QUEX_FROM_TYPE) +# error "__QUEX_FROM_TYPE must be defined!" +#elif ! defined(QUEX_INLINE) +# error "QUEX_INLINE must be defined!" +#endif + +/* (1) Character converters */ +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, utf8)(const __QUEX_FROM_TYPE** input_pp, + uint8_t** output_pp); +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, utf16)(const __QUEX_FROM_TYPE** input_pp, + uint16_t** output_pp); +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, utf32)(const __QUEX_FROM_TYPE** input_pp, + uint32_t** output_pp); +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, char)(const __QUEX_FROM_TYPE** input_pp, + char** output_pp); +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(__QUEX_FROM, wchar)(const __QUEX_FROM_TYPE** input_pp, + wchar_t** output_pp); +#endif + +/* (2) String converters */ +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf8)(const __QUEX_FROM_TYPE** source_pp, + const __QUEX_FROM_TYPE* SourceEnd, + uint8_t** drain_pp, + const uint8_t* DrainEnd); +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf16)(const __QUEX_FROM_TYPE** source_pp, + const __QUEX_FROM_TYPE* SourceEnd, + uint16_t** drain_pp, + const uint16_t* DrainEnd); +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf32)(const __QUEX_FROM_TYPE** source_pp, + const __QUEX_FROM_TYPE* SourceEnd, + uint32_t** drain_pp, + const uint32_t* DrainEnd); +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, char)(const __QUEX_FROM_TYPE** source_pp, + const __QUEX_FROM_TYPE* SourceEnd, + char** drain_pp, + const char* DrainEnd); + +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, wchar)(const __QUEX_FROM_TYPE** source_pp, + const __QUEX_FROM_TYPE* SourceEnd, + wchar_t** drain_pp, + const wchar_t* DrainEnd); +#endif + +#if ! defined(__QUEX_OPTION_PLAIN_C) + QUEX_INLINE std::basic_string<uint8_t> + QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf8)(const std::basic_string<__QUEX_FROM_TYPE>& Source); + QUEX_INLINE std::basic_string<uint16_t> + QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf16)(const std::basic_string<__QUEX_FROM_TYPE>& Source); + QUEX_INLINE std::basic_string<uint32_t> + QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, utf32)(const std::basic_string<__QUEX_FROM_TYPE>& Source); + QUEX_INLINE std::basic_string<char> + QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, char)(const std::basic_string<__QUEX_FROM_TYPE>& Source); +# if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) + QUEX_INLINE std::basic_string<wchar_t> + QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, wchar)(const std::basic_string<__QUEX_FROM_TYPE>& Source); +# endif +#endif + +#undef __QUEX_FROM +#undef __QUEX_FROM_TYPE + diff --git a/src/parser/definitions b/src/parser/definitions @@ -0,0 +1,426 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY + * + * NOTE: '__VA_ARGS__' in macros is avoided because at the time of + * this writing, even some prominent compilers choke on it. */ +#ifndef __QUEX_INCLUDE_GUARD__DEFINITIONS +#define __QUEX_INCLUDE_GUARD__DEFINITIONS + +#include"asserts" +#include"compatStdint.h" +#include"compatStdbool-pseudo.h" + +#ifndef QUEX_NAMESPACE_QUEX +# define QUEX_NAMESPACE_QUEX quex +#endif +#if ! defined(__QUEX_OPTION_PLAIN_C) +# define QUEX_NAMESPACE_QUEX_OPEN namespace QUEX_NAMESPACE_QUEX { +# define QUEX_NAMESPACE_QUEX_CLOSE } +# define QUEXED_AUX2(NSP, X) ::NSP::X +# define QUEXED_AUX(NSP, X) QUEXED_AUX2(NSP,X) +# define QUEXED(X) QUEXED_AUX(QUEX_NAMESPACE_QUEX,X) +# define QUEXED_DEF(X) X +#else +# define QUEX_NAMESPACE_QUEX_OPEN +# define QUEX_NAMESPACE_QUEX_CLOSE +# define QUEXED_AUX2(NSP, X) NSP ## _ ## X +# define QUEXED_AUX(NSP, X) QUEXED_AUX2(NSP, X) +# define QUEXED(X) QUEXED_AUX(QUEX_NAMESPACE_QUEX, X) +# define QUEXED_DEF(X) QUEXED_AUX(QUEX_NAMESPACE_QUEX, X) +#endif +#if defined( __cplusplus) && ! defined(__QUEX_OPTION_PLAIN_C) +# define QUEX_MAP_THIS_TO_ME(CLASS) CLASS* me = this; (void)me; +#else +# define QUEX_MAP_THIS_TO_ME(CLASS) /* 'me' already plays the role of 'this'. */ +#endif + +#ifndef QUEX_SETTING_DEBUG_OUTPUT_CHANNEL +# define QUEX_SETTING_DEBUG_OUTPUT_CHANNEL __QUEX_STD_STDERR +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1600 + /* Microsoft VisualStudio(tm) 2010, i.e. Version 1600: + * Forget about the 'CRT security enhancements' for sprintf, fopen, and setbuf. */ +# pragma warning(disable: 4996) +#endif + +#if ! defined(__QUEX_OPTION_PLAIN_C) +# include <cstddef> /* gets: size_t, ptrdiff_t */ +# include <cstring> /* gets: memmove, memcpy */ +# include <cstdio> /* gets: fprintf */ +# include <cstdlib> +# include <stdexcept> +# define __QUEX_STD_FILE std::FILE +# define __QUEX_STD_STDIN stdin +# define __QUEX_STD_STDERR stderr +# define __QUEX_STD_fopen std::fopen +# define __QUEX_STD_fclose std::fclose +# define __QUEX_STD_fprintf std::fprintf +# define __QUEX_STD_fread std::fread +# define __QUEX_STD_fseek std::fseek +# define __QUEX_STD_ftell std::ftell +# define __QUEX_STD_memcpy std::memcpy +# define __QUEX_STD_memmove std::memmove +# define __QUEX_STD_memset std::memset +# define __QUEX_STD_printf std::printf +# define __QUEX_STD_sprintf std::sprintf +# define __QUEX_STD_strcmp std::strcmp +# define __QUEX_STD_strcpy std::strcpy +# define __QUEX_STD_strlen std::strlen +# define __QUEX_STD_strncat std::strncat +# define __QUEX_STD_malloc std::malloc +# define __QUEX_STD_free std::free + +# define QUEX_INLINE inline + /* Input handle type is determined automagically via templates */ +#else +# include <stddef.h> +# include <string.h> /* gets: memmove, memcpy */ +# include <stdio.h> /* gets: fprintf */ +# include <stdlib.h> +# define __QUEX_STD_FILE FILE +# define __QUEX_STD_STDIN stdin +# define __QUEX_STD_STDERR stderr +# define __QUEX_STD_fopen fopen +# define __QUEX_STD_fclose fclose +# define __QUEX_STD_fprintf fprintf +# define __QUEX_STD_fread fread +# define __QUEX_STD_fseek fseek +# define __QUEX_STD_ftell ftell +# define __QUEX_STD_memcpy memcpy +# define __QUEX_STD_memmove memmove +# define __QUEX_STD_memset memset +# define __QUEX_STD_printf printf +# define __QUEX_STD_strcmp strcmp +# define __QUEX_STD_strcpy strcpy +# define __QUEX_STD_strlen strlen +# define __QUEX_STD_sprintf sprintf +# define __QUEX_STD_strncat strncat +# define __QUEX_STD_malloc malloc +# define __QUEX_STD_free free + +# define QUEX_INLINE /* static */ +# define QUEX_INPUT_HANDLE_TYPE /* stdio.h's */ FILE +#endif + +#ifndef QUEX_TYPE_DEFINITIONS_E_LOAD_RESULT +#define QUEX_TYPE_DEFINITIONS_E_LOAD_RESULT +typedef enum { + E_LoadResult_DONE, /* Complete or incomplete, load happened. */ + E_LoadResult_COMPLETE, /* Load filled drain completely. */ + E_LoadResult_INCOMPLETE, /* Drain not filled completely. */ + E_LoadResult_BAD_LEXATOM, /* Encoding error in stream. */ + E_LoadResult_NO_MORE_DATA, /* No more data to fill drain. */ + E_LoadResult_NO_SPACE_FOR_LOAD, /* No space to load content into. */ + E_LoadResult_FAILURE, /* General low-level load failure. */ + E_LoadResult_VOID /* General low-level load failure. */ +} E_LoadResult; +#endif + +#define E_LoadResult_NAME(LR) \ + ( (LR) == E_LoadResult_DONE ? "DONE" \ + : (LR) == E_LoadResult_COMPLETE ? "COMPLETE" \ + : (LR) == E_LoadResult_INCOMPLETE ? "INCOMPLETE" \ + : (LR) == E_LoadResult_BAD_LEXATOM ? "BAD LEXATOM" \ + : (LR) == E_LoadResult_NO_MORE_DATA ? "NO MORE DATA" \ + : (LR) == E_LoadResult_NO_SPACE_FOR_LOAD ? "NO SPACE FOR LOAD" \ + : (LR) == E_LoadResult_FAILURE ? "FAILURE" \ + : (LR) == E_LoadResult_VOID ? "VOID" \ + : "<error>") + +/* Define the QUEX_TYPE_STREAM_POSITION at a central place, so that it is the + * same when it is used in multiple analyzers compiled into one binary. */ +#ifndef QUEX_TYPE_STREAM_POSITION +# define QUEX_TYPE_STREAM_POSITION intmax_t +#endif + +#define QUEX_MIN(X, Y) ((X) < (Y) ? (X) : (Y)) +#define QUEX_MAX(X, Y) ((X) > (Y) ? (X) : (Y)) + +/* In cases, such as DLL compilation for some dedicated compilers, + * the classes need some epilog. If the user does not specify such + * a thing, it must be empty. */ +#ifndef QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG +# define QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG +#endif + +/* Hash Function: + * + * Using Dan Bernstein's 'dbj2' (published in comp.lang.c) which is extremely + * fast but still behaves well. See Linear Congruential Generators for further + * reading. */ +#define QUEX_HASH_INIT_VALUE 5381 +#define QUEX_HASH_NEXT(H, C) ((((H) << 5) + (H)) + (C)) + +/* Support of computed goto */ +#ifdef QUEX_OPTION_COMPUTED_GOTOS + typedef void* QUEX_TYPE_GOTO_LABEL; +# define QUEX_GOTO_LABEL_VOID (QUEX_TYPE_GOTO_LABEL)(0x0) +# define QUEX_LABEL(StateIndex) &&_##StateIndex + +# define QUEX_GOTO_TERMINAL(LABEL) do { goto *LABEL; } while(0) + + /* If no computed gotos are used, then there are two state routers, one for forward + * state routing and another for backward state routing. Thus, two macros for the same + * thing are required. */ +# define QUEX_GOTO_STATE(LABEL) do { goto *LABEL; } while(0) + + +#else + typedef int32_t QUEX_TYPE_GOTO_LABEL; /* > 0: State index + * < 0: Drop Out of a state abs(Label). */ +# define QUEX_GOTO_LABEL_VOID (QUEX_TYPE_GOTO_LABEL)(-1) +# define QUEX_LABEL(StateIndex) StateIndex + +# define QUEX_GOTO_TERMINAL(LABEL) \ + do { \ + last_acceptance = LABEL; \ + goto QUEX_TERMINAL_ROUTER; \ + } while(0) + +# define QUEX_GOTO_STATE(LABEL) \ + do { \ + target_state_index = LABEL; \ + goto QUEX_LABEL_STATE_ROUTER; \ + } while(0) +#endif + +/* DELETE QUEX_GOTO_RELOAD' when safe */ +#define QUEX_GOTO_RELOAD(RELOAD_LABEL, ON_SUCCESS, ON_FAIL) \ + do { \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%s:%i:\tUSE of QUEX_GOTO_RELOAD -- SUPPOSED TO BE SUPERFLUOUS", __FILE__, __LINE__); \ + target_state_index = QUEX_LABEL(ON_SUCCESS); \ + target_state_else_index = QUEX_LABEL(ON_FAIL); \ + goto RELOAD_LABEL; } while (0) + +#define __QUEX_PRINT_SOURCE_POSITION() \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%s:%i:\t", __FILE__, (int)__LINE__) + +#if ! defined(__QUEX_OPTION_PLAIN_C) +# define QUEX_ERROR_EXIT(Msg) \ + do { \ + __QUEX_PRINT_SOURCE_POSITION(); \ + throw std::runtime_error(Msg); \ + } while(0) +#else +# define QUEX_ERROR_EXIT(Msg) \ + do { \ + __QUEX_PRINT_SOURCE_POSITION(); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%s", Msg); exit(-1); \ + } while(0) +#endif + +#if defined(QUEX_OPTION_DEBUG_SHOW) + +# define __quex_debug(Str) \ + __QUEX_PRINT_SOURCE_POSITION(); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%s", (Str)) +# define __quex_debug1(Str) \ + __QUEX_PRINT_SOURCE_POSITION(); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%s\n", (Str)) +# define __quex_debug2(FormatStr, Arg) \ + __QUEX_PRINT_SOURCE_POSITION(); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, FormatStr "\n", Arg) +# define __quex_debug3(FormatStr, Arg0, Arg1) \ + __QUEX_PRINT_SOURCE_POSITION(); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, FormatStr "\n", Arg0, Arg1) +# define __quex_debug4(FormatStr, Arg0, Arg1, Arg2) \ + __QUEX_PRINT_SOURCE_POSITION(); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, FormatStr "\n", Arg0, Arg1, Arg2) + +# define __QUEX_PRINT_CHAR(C) \ + (C) == '\n' ? __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%02X '\\n'\n", (int)(C)) \ + : (C) == '\t' ? __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%02X '\\t'\n", (int)(C)) \ + : (C) == '\r' ? __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%02X '\\r'\n", (int)(C)) \ + : (C) == '\a' ? __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%02X '\\a'\n", (int)(C)) \ + : (C) == '\v' ? __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%02X '\\v'\n", (int)(C)) \ + : __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "%02X '%c'\n", (int)(C), (C) < 0xFF ? (char)(C) : '?') + +# define __quex_debug_core(StateIdx, Message) \ + __quex_debug3("state %i ____%s", (int)(StateIdx), (Message)) + +# define __quex_debug_input(StateIdx) \ + __quex_debug("input: "); \ + __QUEX_PRINT_CHAR(*(me->buffer._read_p)); \ + __quex_debug2("input position: %i", \ + (int)(me->buffer._read_p - me->buffer._memory._front)); \ + __quex_optional_statistics((StateIdx)) + +# define __quex_debug_path_walker_core(PathWalkerIdx, PathBase, PathIterator, Message) \ + __quex_debug_core(__QUEX_DEBUG_MAP_STATE_KEY_TO_STATE(PathIterator-PathBase), (Message)); \ + __quex_assert(PathIterator < &PathBase[sizeof(PathBase)/sizeof(QUEX_TYPE_LEXATOM)]); \ + __quex_assert(PathIterator >= &PathBase[0]); \ + __quex_debug4("(path walker: %i, path: %i, offset: %i)", \ + (int)PathWalkerIdx, \ + (int)__QUEX_DEBUG_MAP_PATH_BASE_TO_PATH_ID(PathBase), \ + (int)(PathIterator-PathBase)); + +# define __quex_debug_template_core(TemplateIdx, StateKey, Message) \ + __quex_debug_core(__QUEX_DEBUG_MAP_STATE_KEY_TO_STATE(StateKey), (Message)); \ + __quex_assert(__QUEX_DEBUG_MAP_STATE_KEY_TO_STATE(StateKey) != 0); \ + __quex_debug3("(template: %i, state key=%i)", (int)TemplateIdx, (int)StateKey) + +# define __quex_debug_state(StateIdx) \ + __quex_debug_core(StateIdx, "__________"); \ + __quex_debug_input(StateIdx) + +# define __quex_debug_path_walker_state(PathWalkerIdx, PathBase, PathIterator) \ + __quex_debug_path_walker_core(PathWalkerIdx, PathBase, PathIterator, "__________"); \ + __quex_debug_input(__QUEX_DEBUG_MAP_STATE_KEY_TO_STATE(PathIterator-PathBase)) + +# define __quex_debug_template_state(TemplateIdx, StateKey) \ + __quex_debug_template_core(TemplateIdx, StateKey, "__________"); \ + __quex_debug_input(__QUEX_DEBUG_MAP_STATE_KEY_TO_STATE(StateIdx)) + +# define __quex_debug_drop_out(StateIdx) \ + __quex_debug_core(StateIdx, "<DROP OUT>"); + +# define __quex_debug_path_walker_drop_out(PathWalkerIdx, PathBase, PathIterator) \ + __quex_debug_path_walker_core(PathWalkerIdx, PathBase, PathIterator, "<DROP OUT>") + +# define __quex_debug_template_drop_out(TemplateIdx, StateKey) \ + __quex_debug_template_core(TemplateIdx, StateKey, "<DROP OUT>") + +# define __quex_debug_buffer_info(B) \ + __quex_debug2("input position: %i", \ + (int)((B)._read_p - (B)._memory._front + 1)); \ + __quex_debug2("lexeme start: %i", \ + (int)((B)._lexeme_start_p - (B)._memory._front + 1)); \ + __quex_debug2("buffer size: %i", \ + (int)((B)._memory._back - (B)._memory._front)); + +# define __quex_debug_reload_before() \ + __quex_debug1("reload ________________"); \ + __quex_debug2("fallback bytes: %i", \ + (int)(QUEX_SETTING_BUFFER_MIN_FALLBACK_N)); \ + __quex_debug1("(before)\n"); \ + __quex_debug_buffer_info(me->buffer); + +# define __quex_debug_reload_after(LR) \ + __quex_debug2("(after): %s", E_LoadResult_NAME(LR)); \ + __quex_debug_buffer_info(me->buffer); \ + __quex_debug1("reload terminated _____"); + +# define __quex_debug_counter() \ + QUEX_NAME(Counter_print_this)(&self.counter) + + +#else /* not defined(QUEX_OPTION_DEBUG_SHOW) */ + +# define __quex_debug(FormatStr) /* empty */ +# define __quex_debug1(Str) /* empty */ +# define __quex_debug2(FormatStr, Arg) /* empty */ +# define __quex_debug3(FormatStr, Arg0, Arg1) /* empty */ + +# define __quex_debug_state(StateIdx) \ + __quex_optional_statistics(StateIdx) +# define __quex_debug_path_walker_state(PathWalkerIdx, PathBase, PathIterator) \ + __quex_optional_statistics(StateIdx) +# define __quex_debug_template_state(TemplateID, StateKey) \ + __quex_optional_statistics(StateIdx) + +# define __quex_debug_drop_out(StateIdx) /* empty */ +# define __quex_debug_path_walker_drop_out(PathWalkerIdx, PathBase, PathIterator) /* empty */ +# define __quex_debug_template_drop_out(TemplateID, StateKey) /* empty */ + +# define __quex_debug_reload_before() /* empty */ +# define __quex_debug_reload_after(LR) /* empty */ +# define __quex_debug_counter() /* empty */ + +#endif /* ! QUEX_OPTION_DEBUG_SHOW */ + +#define QUEX_ASSERT_MEMORY(BEGIN, SIZE, EOF_P) \ + __quex_assert((! (BEGIN)) || (SIZE) > 2); \ + __quex_assert((! (BEGIN)) || ((EOF_P) > (BEGIN) && (EOF_P) <= &(BEGIN)[(SIZE)-1])); \ + __quex_assert(( (BEGIN)) || ((SIZE) == 0 && (EOF_P) == (QUEX_TYPE_LEXATOM*)0)); \ + /* (BEGIN) MUST contain the limitting elements set to BUFFER LIMIT CODE */ \ + __quex_assert(! (BEGIN) || (BEGIN)[0] == QUEX_SETTING_BUFFER_LIMIT_CODE); \ + __quex_assert(! (BEGIN) || (BEGIN)[(SIZE)-1] == QUEX_SETTING_BUFFER_LIMIT_CODE); \ + __quex_assert(! (EOF_P) || (EOF_P)[0] == QUEX_SETTING_BUFFER_LIMIT_CODE) + +#if defined(QUEX_OPTION_DEBUG_SHOW_LOADS) + +# include <quex/code_base/buffer/Buffer_debug> +# define __quex_debug_buffer_load(BUFFER, Msg) \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, Msg); \ + QUEX_NAME(Buffer_show_debug_content)(BUFFER); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "\n"); + +#elif defined(__QUEX_OPTION_UNIT_TEST_QUEX_BUFFER_LOADS) + +# include <quex/code_base/buffer/Buffer_debug> +# define __quex_debug_buffer_load(BUFFER, Msg) \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, Msg); \ + QUEX_NAME(Buffer_show_content)(BUFFER); \ + __QUEX_STD_fprintf(QUEX_SETTING_DEBUG_OUTPUT_CHANNEL, "\n"); +#else + +# define __quex_debug_buffer_load(BUFFER, Msg) /* empty */ + +#endif /* __QUEX_OPTION_UNIT_TEST_QUEX_BUFFER_LOADS */ + +#ifdef QUEX_OPTION_STATISTICS +# define __quex_optional_statistics(StateIdx) \ + QUEX_NAME(statistics_state_count)(QUEX_NAME(statistics_state_ ## StateIdx), \ + *(me->buffer._read_p)); +#else +# define __quex_optional_statistics(StateIdx) /* empty */ +#endif + +#define __QUEX_MESSAGE_CHARACTER_ENCODING_SPECIFIED_WITHOUT_CONVERTER \ + "A character encoding name '%s' has been specified while the analyzer is not\n" \ + "setup to run with a converter (icu or iconv).\n" + +#define __QUEX_MESSAGE_ASSERTS_INFO \ + "## Disable this message by compile option\n" \ + "## '-DQUEX_OPTION_ASSERTS_WARNING_MESSAGE_DISABLED'\n" \ + "##\n" \ + "## Asserts activated! Lexical analyzer is 'paranoid'!\n" \ + "## => Even smallest misbehavior causes program exit.\n" \ + "## This helps to find subtile errors.\n" \ + "##\n" \ + "## Note however: the paranoia is a heavy load on performance!\n" \ + "##\n" \ + "## Disable asserts by '-DQUEX_OPTION_ASSERTS_DISABLED'\n" \ + "##\n" \ + "## Report any bug at\n" \ + "## http://sourceforge.net/tracker/?group_id=168259&atid=846112\n" + +#define __QUEX_MESSAGE_MODE_STACK_OVERFLOW \ + "Error: Mode stack overflow. Adapt size of mode stack via the macro\n" \ + "Error: QUEX_SETTING_MODE_STACK_SIZE, or review mode transitions.\n" \ + "Error: I.e. check that for every GOSUB (push), there is a correspondent\n" \ + "Error: GOUP (pop)." + +#define QUEX_ERROR_DEPRECATED(NAME, REPLACEMENT) \ + QUEX_ERROR_EXIT(NAME " has been deprecated\n" \ + "Please, use " REPLACEMENT ".") + +#define ____QUEX_APPEND(X, Y) X ## Y +#define __QUEX_APPEND(X, Y) ____QUEX_APPEND(X, Y) + +#define QUEX_STRING(X) #X +#define QUEX_NUMBER_TO_STRING(x) QUEX_STRING(x) +#define QUEX_SOURCE_POS() __FILE__ ":" QUEX_NUMBER_TO_STRING(__LINE__) ": " + +#if ! defined(QUEX_OPTION_TERMINATION_ZERO_DISABLED) + +# define QUEX_LEXEME_TERMINATING_ZERO_SET(BUFFER) \ + (BUFFER)->_lexatom_at_lexeme_start = *((BUFFER)->_read_p); \ + *((BUFFER)->_read_p) = '\0'; + +# define QUEX_LEXEME_TERMINATING_ZERO_UNDO(BUFFER) \ + /* only need to reset, in case that the terminating zero was set*/ \ + if( (BUFFER)->_lexatom_at_lexeme_start != (QUEX_TYPE_LEXATOM)'\0' ) { \ + *((BUFFER)->_read_p) = (BUFFER)->_lexatom_at_lexeme_start; \ + (BUFFER)->_lexatom_at_lexeme_start = (QUEX_TYPE_LEXATOM)'\0'; \ + } +#else + +# define QUEX_LEXEME_TERMINATING_ZERO_SET(BUFFER) /* empty */ +# define QUEX_LEXEME_TERMINATING_ZERO_UNDO(BUFFER) /* empty */ + +#endif + +#endif /* __QUEX_INCLUDE_GUARD__DEFINITIONS */ diff --git a/src/parser/from-unicode-buffer b/src/parser/from-unicode-buffer @@ -0,0 +1,44 @@ +/* vim: set filetype=cpp: -*- C++ -*- + * + * Declaration of all converter functions from a buffer in unicode + * towards 'utf8', 'utf16', 'utf32', * 'char', and 'wchar_t': + * + * QUEX_CONVERTER_CHAR_DEF(unicode, utf8)(...) + * QUEX_CONVERTER_CHAR_DEF(unicode, utf16)(...) + * QUEX_CONVERTER_CHAR_DEF(unicode, utf32)(...) + * QUEX_CONVERTER_CHAR_DEF(unicode, char)(...) + * QUEX_CONVERTER_CHAR_DEF(unicode, wchar_t)(...) + * + * QUEX_CONVERTER_STRING_DEF(unicode, utf8)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(unicode, utf16)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(unicode, utf32)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(unicode, char)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(unicode, wchar_t)(...) for string and buffer + * + * The declarations are generated by the file: + * + * ../generator/declarations.g + * + * These functions ARE DEPENDENT on QUEX_TYPE_LEXATOM. + * => Thus, they are placed in the analyzer's namespace. + * + * (C) 2012 Frank-Rene Schaefer. + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UNICODE_BUFFER) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UNICODE_BUFFER +#endif + +#include "converterHelperCommon.h" + +QUEX_NAMESPACE_MAIN_OPEN + +#define __QUEX_FROM unicode +#define __QUEX_FROM_TYPE QUEX_TYPE_LEXATOM + +#include "converterHelperGeneratorDeclarations.g" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UNICODE_BUFFER */ diff --git a/src/parser/from-unicode-buffer.i b/src/parser/from-unicode-buffer.i @@ -0,0 +1,108 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: + * + * Provide the implementation of character and string converter functions + * FROM the buffer's unicode to utf8, utf16, utf32, char, and wchar_t. + * + * STEPS: + * + * (1) Include the COMPLETE implementation of a reference transformation. + * + * "character-converter-from-utf8.i" + * "character-converter-from-utf16.i" + * "character-converter-from-utf32.i" + * + * Sometimes the size of QUEX_TYPE_LEXATOM could not be determined at + * code generation time, therefore all need to be included. + * + * (2) Map the functions of the pattern + * + * QUEX_CONVERTER_CHAR(unicode, *)(....) + * + * to what is appropriate from the given headers, e.g. + * + * QUEX_CONVERTER_CHAR(utf8, *)(....) + * + * (2b) Generate converters towards 'char' and 'wchar_t' + * + * generator/character-converter-to-char-wchar_t.gi + * + * (3) Derive string converter functions from character converters. + * + * generator/implementations.gi + * + * These functions ARE DEPENDENT on QUEX_TYPE_LEXATOM. + * => Thus, they are placed in the analyzer's namespace. + * + * 2010 (C) Frank-Rene Schaefer; + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UNICODE_BUFFER_I) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UNICODE_BUFFER_I +#endif + +#include "from-unicode-buffer" + +/* (1) Access the implementation of the converter that will implement + * the unicode conversion. */ +#include "from-utf8.i" +#include "from-utf16.i" +#include "from-utf32.i" + +QUEX_NAMESPACE_MAIN_OPEN + +/* (2) Route the converters from 'unicode' to the implementing converter. */ +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(unicode, utf8)(const QUEX_TYPE_LEXATOM** input_pp, + uint8_t** output_pp) +{ + switch( sizeof(QUEX_TYPE_LEXATOM) ) + { + case 1: QUEX_CONVERTER_CHAR(utf8, utf8)((const uint8_t**)input_pp, output_pp); break; + case 2: QUEX_CONVERTER_CHAR(utf16, utf8)((const uint16_t**)input_pp, output_pp); break; + case 4: QUEX_CONVERTER_CHAR(utf32, utf8)((const uint32_t**)input_pp, output_pp); break; + default: QUEX_ERROR_EXIT("Cannot derive converter for given element size."); + } +} + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(unicode, utf16)(const QUEX_TYPE_LEXATOM** input_pp, + uint16_t** output_pp) +{ + switch( sizeof(QUEX_TYPE_LEXATOM) ) + { + case 1: QUEX_CONVERTER_CHAR(utf8, utf16)((const uint8_t**)input_pp, output_pp); break; + case 2: QUEX_CONVERTER_CHAR(utf16, utf16)((const uint16_t**)input_pp, output_pp); break; + case 4: QUEX_CONVERTER_CHAR(utf32, utf16)((const uint32_t**)input_pp, output_pp); break; + default: QUEX_ERROR_EXIT("Cannot derive converter for given element size."); + } +} + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(unicode, utf32)(const QUEX_TYPE_LEXATOM** input_pp, + uint32_t** output_pp) +{ + switch( sizeof(QUEX_TYPE_LEXATOM) ) + { + case 1: QUEX_CONVERTER_CHAR(utf8, utf32)((const uint8_t**)input_pp, output_pp); break; + case 2: QUEX_CONVERTER_CHAR(utf16, utf32)((const uint16_t**)input_pp, output_pp); break; + case 4: QUEX_CONVERTER_CHAR(utf32, utf32)((const uint32_t**)input_pp, output_pp); break; + default: QUEX_ERROR_EXIT("Cannot derive converter for given element size."); + } +} + + +/* (2b) Derive converters to char and wchar_t from the given set + * of converters. (Generator uses __QUEX_FROM and QUEX_FROM_TYPE) */ +#define __QUEX_FROM unicode +#define __QUEX_FROM_TYPE QUEX_TYPE_LEXATOM +#include "character-converter-to-char-wchar_t.gi" + +/* (3) Generate string converters to utf8, utf16, utf32 based on the + * definitions of the character converters. */ +#include "implementations.gi" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UNICODE_BUFFER_I */ diff --git a/src/parser/from-utf16 b/src/parser/from-utf16 @@ -0,0 +1,44 @@ +/* vim: set filetype=cpp: -*- C++ -*- + * + * Declaration of all converter functions towards 'utf8', 'utf16', 'utf32', + * 'char', and 'wchar_t': + * + * QUEX_CONVERTER_CHAR(utf16, utf8)(...) + * QUEX_CONVERTER_CHAR(utf16, utf16)(...) + * QUEX_CONVERTER_CHAR(utf16, utf32)(...) + * QUEX_CONVERTER_CHAR(utf16, char)(...) + * QUEX_CONVERTER_CHAR(utf16, wchar_t)(...) + * + * QUEX_CONVERTER_STRING(utf16, utf8)(...) for string and buffer + * QUEX_CONVERTER_STRING(utf16, utf16)(...) for string and buffer + * QUEX_CONVERTER_STRING(utf16, utf32)(...) for string and buffer + * QUEX_CONVERTER_STRING(utf16, char)(...) for string and buffer + * QUEX_CONVERTER_STRING(utf16, wchar_t)(...) for string and buffer + * + * The declarations are generated by the file: + * + * ../generator/declarations.g + * + * All functions are placed in the analyzer's namespace. + * + * (C) 2012 Frank-Rene Schaefer. + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF16) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF16 +#endif + +#include "converterHelperCommon.h" + +QUEX_NAMESPACE_MAIN_OPEN + +#define __QUEX_FROM utf16 +#define __QUEX_FROM_TYPE uint16_t + +#include "converterHelperGeneratorDeclarations.g" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF16 */ + diff --git a/src/parser/from-utf16.i b/src/parser/from-utf16.i @@ -0,0 +1,133 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: + * + * Provide the implementation of character and string converter functions + * FROM utf16 to utf8, utf16, utf32, char, and wchar_t. + * + * STEPS: + * + * (1) Include the implementation of the character converters from utf16 + * to utf8, utf16, utf32, char, and wchar_t. + * + * Use: "character-converter/from-utf16.i" + * --> implementation for utf16 + * + * "../generator/character-converter-char-wchar_t.gi" + * --> route 'char' and 'wchar_t' conversion to + * one of the converters defined before. + * + * (2) Generate the implementation of the string converters in terms + * of those character converters. + * + * Use: "../generator/implementation-string-converters.gi" + * + * which uses + * + * "../generator/string-converter.gi" + * + * to implement each string converter from the given + * character converters. + * + * All functions are placed in the analyzer's namespace. + * + * 2010 (C) Frank-Rene Schaefer; + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF16_I) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF16_I +#endif + +#include "from-utf16" + +#define __QUEX_FROM utf16 +#define __QUEX_FROM_TYPE uint16_t + +/* (1) Implement the character converters utf8, utf16, utf32. + * (Note, that character converters are generated into namespace 'quex'.)*/ +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(utf16, utf8)(const uint16_t** input_pp, uint8_t** output_pp) +{ + uint32_t x0 = (uint16_t)0; + uint32_t x1 = (uint16_t)0; + uint32_t unicode = (uint32_t)0; + + if ( **input_pp <= (uint16_t)0x7f ) { + *((*output_pp)++) = (uint8_t)*(*input_pp); + ++(*input_pp); + + } else if ( **input_pp <= (uint16_t)0x7ff ) { + *((*output_pp)++) = (uint8_t)(0xC0 | (*(*input_pp) >> 6)); + *((*output_pp)++) = (uint8_t)(0x80 | (*(*input_pp) & (uint16_t)0x3F)); + ++(*input_pp); + + } else if ( **input_pp < (uint16_t)0xD800 ) { + *((*output_pp)++) = (uint8_t)(0xE0 | *(*input_pp) >> 12); + *((*output_pp)++) = (uint8_t)(0x80 | (*(*input_pp) & (uint16_t)0xFFF) >> 6); + *((*output_pp)++) = (uint8_t)(0x80 | (*(*input_pp) & (uint16_t)0x3F)); + ++(*input_pp); + + } else if ( **input_pp < (uint16_t)0xE000 ) { + /* Characters > 0xFFFF need to be coded in two bytes by means of surrogates. */ + x0 = (uint32_t)(*(*input_pp)++ - (uint32_t)0xD800); + x1 = (uint32_t)(*(*input_pp)++ - (uint32_t)0xDC00); + unicode = (x0 << 10) + x1 + 0x10000; + + /* Assume that only character appear, that are defined in unicode. */ + __quex_assert(unicode <= (uint16_t)0x1FFFFF); + + *((*output_pp)++) = (uint8_t)(0xF0 | unicode >> 18); + *((*output_pp)++) = (uint8_t)(0x80 | (unicode & (uint32_t)0x3FFFF) >> 12); + *((*output_pp)++) = (uint8_t)(0x80 | (unicode & (uint32_t)0xFFF) >> 6); + *((*output_pp)++) = (uint8_t)(0x80 | (unicode & (uint32_t)0x3F)); + + } else { + /* Always true: **input_pp <= 0xFFFF */ + *((*output_pp)++) = (uint8_t)(0xE0 | *(*input_pp) >> 12); + *((*output_pp)++) = (uint8_t)(0x80 | (*(*input_pp) & (uint16_t)0xFFF) >> 6); + *((*output_pp)++) = (uint8_t)(0x80 | (*(*input_pp) & (uint16_t)0x3F)); + ++(*input_pp); + } +} + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(utf16, utf16)(const uint16_t** input_pp, + uint16_t** output_pp) +{ + if( **input_pp < (uint16_t)0xD800 || **input_pp >= (uint16_t)0xE000 ) { + *((*output_pp)++) = *(*input_pp)++; + } else { + *((*output_pp)++) = *(*input_pp)++; + *((*output_pp)++) = *(*input_pp)++; + } +} + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(utf16, utf32)(const uint16_t** input_pp, + uint32_t** output_pp) +{ + uint32_t x0 = (uint32_t)0; + uint32_t x1 = (uint32_t)0; + + if( **input_pp < (uint16_t)0xD800 || **input_pp >= (uint16_t)0xE000 ) { + *((*output_pp)++) = *(*input_pp)++; + } else { + x0 = (uint32_t)(*(*input_pp)++) - (uint32_t)0xD800; + x1 = (uint32_t)(*(*input_pp)++) - (uint32_t)0xDC00; + *((*output_pp)++) = (x0 << 10) + x1 + (uint32_t)0x10000; + } +} + +/* (1b) Derive converters to char and wchar_t from the given set + * of converters. (Generator uses __QUEX_FROM and QUEX_FROM_TYPE) */ +#include "character-converter-to-char-wchar_t.gi" + +/* (2) Generate string converters to utf8, utf16, utf32 based on the + * definitions of the character converters. */ +#include "implementations.gi" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF16_I */ diff --git a/src/parser/from-utf32 b/src/parser/from-utf32 @@ -0,0 +1,44 @@ +/* vim: set filetype=cpp: -*- C++ -*- + * + * Declaration of all converter functions towards 'utf8', 'utf16', 'utf32', + * 'char', and 'wchar_t': + * + * QUEX_CONVERTER_CHAR_DEF(utf32, utf8)(...) + * QUEX_CONVERTER_CHAR_DEF(utf32, utf16)(...) + * QUEX_CONVERTER_CHAR_DEF(utf32, utf32)(...) + * QUEX_CONVERTER_CHAR_DEF(utf32, char)(...) + * QUEX_CONVERTER_CHAR_DEF(utf32, wchar_t)(...) + * + * QUEX_CONVERTER_STRING_DEF(utf32, utf8)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf32, utf16)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf32, utf32)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf32, char)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf32, wchar_t)(...) for string and buffer + * + * The declarations are generated by the file: + * + * ../generator/declarations.g + * + * All functions are placed in the analyzer's namespace. + * + * (C) 2012 Frank-Rene Schaefer. + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF32) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF32 +#endif + +#include "converterHelperCommon.h" + +QUEX_NAMESPACE_MAIN_OPEN + +#define __QUEX_FROM utf32 +#define __QUEX_FROM_TYPE uint32_t + +#include "converterHelperGeneratorDeclarations.g" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF32 */ + diff --git a/src/parser/from-utf32.i b/src/parser/from-utf32.i @@ -0,0 +1,126 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: + * + * Provide the implementation of character and string converter functions + * FROM utf32 to utf8, utf16, utf32, char, and wchar_t. + * + * STEPS: + * + * (1) Include the implementation of the character converters from utf32 + * to utf8, utf16, utf32, char, and wchar_t. + * + * Use: "character-converter/from-utf32.i" + * --> implementation for utf32 + * + * "../generator/character-converter-char-wchar_t.gi" + * --> route 'char' and 'wchar_t' conversion to + * one of the converters defined before. + * + * (2) Generate the implementation of the string converters in terms + * of those character converters. + * + * Use: "../generator/implementation-string-converters.gi" + * + * which uses + * + * "../generator/string-converter.gi" + * + * to implement each string converter from the given + * character converters. + * + * All functions are placed in the analyzer's namespace. + * + * 2010 (C) Frank-Rene Schaefer; + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF32_I) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF32_I +#endif + +#include "from-utf32" + +#define __QUEX_FROM utf32 +#define __QUEX_FROM_TYPE uint32_t + +QUEX_NAMESPACE_MAIN_OPEN + +/* (1) Implement the character converters utf8, utf16, utf32. + * (Note, that character converters are generated into namespace 'quex'.)*/ +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(utf32, utf8)(const uint32_t** input_pp, + uint8_t** output_pp) +{ + /* PURPOSE: This function converts the specified unicode character + * into its utf8 representation. The result is stored + * at the location where utf8_result points to. Thus, the + * user has to make sure, that enough space is allocated! + * + * NOTE: For general applicability let utf8_result point to a space + * of 7 bytes! This way you can store always a terminating + * zero after the last byte of the representation. + * + * RETURNS: Pointer to the fist position after the last character. */ + uint32_t Unicode = **input_pp; + /**/ + + if (Unicode <= 0x0000007f) { + *((*output_pp)++) = (uint8_t)Unicode; + } else if (Unicode <= 0x000007ff) { + *((*output_pp)++) = (uint8_t)(0xC0 | (Unicode >> 6)); + *((*output_pp)++) = (uint8_t)(0x80 | (Unicode & (uint32_t)0x3f)); + } else if (Unicode <= 0x0000ffff) { + *((*output_pp)++) = (uint8_t)(0xE0 | Unicode >> 12); + *((*output_pp)++) = (uint8_t)(0x80 | (Unicode & (uint32_t)0xFFF) >> 6); + *((*output_pp)++) = (uint8_t)(0x80 | (Unicode & (uint32_t)0x3F)); + } else { + /* Assume that only character appear, that are defined in unicode. */ + __quex_assert(Unicode <= (uint32_t)0x1FFFFF); + /* No surrogate pairs (They are reserved even in non-utf16). */ + __quex_assert(! (Unicode >= 0xd800 && Unicode <= 0xdfff) ); + + *((*output_pp)++) = (uint8_t)(0xF0 | Unicode >> 18); + *((*output_pp)++) = (uint8_t)(0x80 | (Unicode & (uint32_t)0x3FFFF) >> 12); + *((*output_pp)++) = (uint8_t)(0x80 | (Unicode & (uint32_t)0xFFF) >> 6); + *((*output_pp)++) = (uint8_t)(0x80 | (Unicode & (uint32_t)0x3F)); + } + /* NOTE: Do not check here for forbitten UTF-8 characters. + * They cannot appear here because we do proper conversion. */ + ++(*input_pp); +} + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(utf32, utf16)(const uint32_t** input_pp, + uint16_t** output_pp) +{ + uint32_t tmp = 0; + + if( **input_pp < 0x10000 ) { + *((*output_pp)++) = (uint16_t)**input_pp; + } else { + tmp = (uint32_t)(**input_pp - (uint32_t)0x10000); + + *(((*output_pp)++)) = (uint16_t)((tmp >> 10) | (uint16_t)0xD800); + *(((*output_pp)++)) = (uint16_t)((tmp & (uint32_t)0x3FF) | (uint16_t)0xDC00); + } + ++(*input_pp); +} + +QUEX_INLINE void +QUEX_CONVERTER_CHAR_DEF(utf32, utf32)(const uint32_t** input_pp, + uint32_t** output_pp) +{ + *((*output_pp)++) = (uint32_t)(*(*input_pp)++); +} + +/* (1b) Derive converters to char and wchar_t from the given set + * of converters. (Generator uses __QUEX_FROM and QUEX_FROM_TYPE) */ +#include "character-converter-to-char-wchar_t.gi" + +/* (2) Generate string converters to utf8, utf16, utf32 based on the + * definitions of the character converters. */ +#include "implementations.gi" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF32_I */ diff --git a/src/parser/from-utf8 b/src/parser/from-utf8 @@ -0,0 +1,44 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * + * Declaration of all converter functions towards 'utf8', 'utf16', 'utf32', + * 'char', and 'wchar_t': + * + * QUEX_CONVERTER_CHAR_DEF(utf8, utf8)(...) + * QUEX_CONVERTER_CHAR_DEF(utf8, utf16)(...) + * QUEX_CONVERTER_CHAR_DEF(utf8, utf32)(...) + * QUEX_CONVERTER_CHAR_DEF(utf8, char)(...) + * QUEX_CONVERTER_CHAR_DEF(utf8, wchar_t)(...) + * + * QUEX_CONVERTER_STRING_DEF(utf8, utf8)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf8, utf16)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf8, utf32)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf8, char)(...) for string and buffer + * QUEX_CONVERTER_STRING_DEF(utf8, wchar_t)(...) for string and buffer + * + * The declarations are generated by the file: + * + * ../generator/declarations.g + * + * All functions are placed in the analyzer's namespace. + * + * (C) 2012 Frank-Rene Schaefer. + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF8) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF8 +#endif + +#include "converterHelperCommon.h" + +QUEX_NAMESPACE_MAIN_OPEN + +#define __QUEX_FROM utf8 +#define __QUEX_FROM_TYPE uint8_t + +#include "converterHelperGeneratorDeclarations.g" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF8 */ + diff --git a/src/parser/from-utf8.i b/src/parser/from-utf8.i @@ -0,0 +1,181 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: + * + * Provide the implementation of character and string converter functions + * FROM utf8 to utf8, utf16, utf32, char, and wchar_t. + * + * STEPS: + * + * (1) Include the implementation of the character converters from utf8 + * to utf8, utf16, utf32, char, and wchar_t. + * + * Use: "character-converter/from-utf8.i" + * --> implementation for utf8 + * + * "../generator/character-converter-char-wchar_t.gi" + * --> route 'char' and 'wchar_t' conversion to + * one of the converters defined before. + * + * (2) Generate the implementation of the string converters in terms + * of those character converters. + * + * Use: "../generator/implementation-string-converters.gi" + * + * which uses + * + * "../generator/string-converter.gi" + * + * to implement each string converter from the given + * character converters. + * + * All functions are placed in the analyzer's namespace. + * + * ACKNOWLEDGEMENT: Parts of the following utf8 conversion have been derived from + * segments of the utf8 conversion library of Alexey Vatchenko + * <av@bsdua.org>. + * + * 2010 (C) Frank-Rene Schaefer; + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF8_I) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF8_I +#endif + +#include "from-utf8" + +#define __QUEX_FROM utf8 +#define __QUEX_FROM_TYPE uint8_t + +QUEX_NAMESPACE_MAIN_OPEN + +/* (1) Implement the character converters utf8 to utf8, utf16, utf32. + * (Note, that character converters are generated into namespace 'quex'.)*/ +QUEX_INLINE void +/* DrainEnd pointer is not returned, since the increment is always '1' */ +QUEX_CONVERTER_CHAR_DEF(utf8, utf8)(const uint8_t** input_pp, uint8_t** output_pp) +{ + /* Just for comformity with other encodings: Do nothing but copying. */ + if( (**input_pp & (uint8_t)0x80) == (uint8_t)0 ) { + *((*output_pp)++) = *(*input_pp)++; + } + else if( **input_pp < (uint8_t)0xE0 ) { + *((*output_pp)++) = *(*input_pp)++; + *((*output_pp)++) = *(*input_pp)++; + } + else if( **input_pp < (uint8_t)0xF0 ) { + *((*output_pp)++) = *(*input_pp)++; + *((*output_pp)++) = *(*input_pp)++; + *((*output_pp)++) = *(*input_pp)++; + } + else { + *((*output_pp)++) = *(*input_pp)++; + *((*output_pp)++) = *(*input_pp)++; + *((*output_pp)++) = *(*input_pp)++; + *((*output_pp)++) = *(*input_pp)++; + } +} + +QUEX_INLINE void +/* DrainEnd pointer is not returned, since the increment is always '1' */ +QUEX_CONVERTER_CHAR_DEF(utf8, utf16)(const uint8_t** input_pp, uint16_t** output_pp) +{ + const uint8_t* iterator = *input_pp; + uint32_t tmp = 0; + + if( (*iterator & (uint8_t)0x80) == (uint8_t)0 ) { + /* Header: 0xxx.xxxx */ + **output_pp = (uint16_t)*(iterator++); + + ++(*output_pp); + } + else if( *iterator < (uint8_t)0xE0 ) { /* ... max: 1101.1111 --> 0xDF, next: 0xE0 */ + /* 110x.xxxx 10yy.yyyy + * => 0000.0xxx:xxyy.yyyy */ + **output_pp = (uint16_t)(( ((uint16_t)*(iterator++)) & (uint16_t)0x1F ) << 6); + **output_pp = (uint16_t)((**output_pp) | (( ((uint16_t)*(iterator++)) & (uint16_t)0x3F ))); + + ++(*output_pp); + } + else if( *iterator < (uint8_t)0xF0 ) { /* ... max: 1110.1111 --> 0xEF, next: 0xF0 */ + /* 1110.xxxx 10yy.yyyy 10zz.zzzz + * => xxxx.yyyy:yyzz.zzzz */ + **output_pp = (uint16_t)(( ((uint16_t)*(iterator++)) & (uint16_t)0x0F ) << 12); + **output_pp = (uint16_t)((**output_pp) | (( ((uint16_t)*(iterator++)) & (uint16_t)0x3F ) << 6)); + **output_pp = (uint16_t)((**output_pp) | (( ((uint16_t)*(iterator++)) & (uint16_t)0x3F ))); + + ++(*output_pp); + } + else { + /* Unicode standard defines only chars until 0x10ffff, so max(len(utf8char)) == 4. + * + * NO CHECK: if( *iterator < 0xF8 ) { ... max: 1111.0111 --> 0xF7, next: 0xF8 + * + * 1111.0uuu 10xx.xxxx 10yy.yyyy 10zz.zzzz + * => 000u.uuxx:xxxx.yyyy:yyzz.zzzz */ + + /* It happens that the UTF8 domain with 4 bytes is >= 0x10000 which is the + * starting domain for surrogates (i.e. what is mapped into 0xD800-0xE000 */ + tmp = (uint32_t)( (((uint32_t)*(iterator++)) & (uint32_t)0x07 ) << 18); + tmp = (uint32_t)(tmp | (((uint32_t)*(iterator++)) & (uint32_t)0x3F ) << 12); + tmp = (uint32_t)(tmp | (((uint32_t)*(iterator++)) & (uint32_t)0x3F ) << 6); + tmp = (uint32_t)(tmp | (((uint32_t)*(iterator++)) & (uint32_t)0x3F )); + + tmp = (uint32_t)(tmp - (uint32_t)0x10000); + *((*output_pp)++) = (uint16_t)((tmp >> 10) | (uint32_t)0xD800); + *((*output_pp)++) = (uint16_t)((tmp & (uint32_t)0x3FF) | (uint32_t)0xDC00); + } + *input_pp = iterator; +} + +QUEX_INLINE void +/* DrainEnd pointer is not returned, since the increment is always '1' */ +QUEX_CONVERTER_CHAR_DEF(utf8, utf32)(const uint8_t** input_pp, uint32_t** output_pp) +{ + const uint8_t* iterator = *input_pp; + + if( (*iterator & (uint8_t)0x80) == (uint8_t)0 ) { + /* Header: 0xxx.xxxx */ + **output_pp = (uint32_t)*(iterator++); + } + else if( *iterator < (uint8_t)0xE0 ) { /* ... max: 1101.1111 --> 0xDF, next: 0xE0 */ + /* 110x.xxxx 10yy.yyyy + * => 0000.0xxx:xxyy.yyyy */ + **output_pp = ( ( ((uint32_t)*(iterator++)) & (uint32_t)0x1F ) << 6); + **output_pp = (uint32_t)((**output_pp) | ( ((uint32_t)*(iterator++)) & (uint32_t)0x3F )); + } + else if( *iterator < (uint8_t)0xF0 ) { /* ... max: 1110.1111 --> 0xEF, next: 0xF0 */ + /* 1110.xxxx 10yy.yyyy 10zz.zzzz + * => xxxx.yyyy:yyzz.zzzz */ + **output_pp = ( ( ((uint32_t)*(iterator++)) & (uint32_t)0x0F ) << 12); + **output_pp = (uint32_t)((**output_pp) | ( ((uint32_t)*(iterator++)) & (uint32_t)0x3F ) << 6); + **output_pp = (uint32_t)((**output_pp) | ( ((uint32_t)*(iterator++)) & (uint32_t)0x3F )); + } + else { + /* Unicode standard defines only chars until 0x10ffff, so max(len(utf8char)) == 4. + * + * NO CHECK: if( *iterator < 0xF8 ) { ... max: 1111.0111 --> 0xF7, next: 0xF8 + * + * 1111.0uuu 10xx.xxxx 10yy.yyyy 10zz.zzzz + * => 000u.uuxx:xxxx.yyyy:yyzz.zzzz */ + **output_pp = ( ( ((uint32_t)*(iterator++)) & (uint32_t)0x07 ) << 18); + **output_pp = (uint32_t)((**output_pp) | ( ((uint32_t)*(iterator++)) & (uint32_t)0x3F ) << 12); + **output_pp = (uint32_t)((**output_pp) | ( ((uint32_t)*(iterator++)) & (uint32_t)0x3F ) << 6); + **output_pp = (uint32_t)((**output_pp) | ( ((uint32_t)*(iterator++)) & (uint32_t)0x3F )); + } + ++(*output_pp); + *input_pp = iterator; +} + + +/* (1b) Derive converters to char and wchar_t from the given set + * of converters. (Generator uses __QUEX_FROM and QUEX_FROM_TYPE) */ +#include "character-converter-to-char-wchar_t.gi" + +/* (2) Generate string converters to utf8, utf16, utf32 based on the + * definitions of the character converters. */ +#include "implementations.gi" + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__FROM_UTF8_I */ diff --git a/src/parser/headers.i b/src/parser/headers.i @@ -0,0 +1,54 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__HEADERS_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__HEADERS_I + +#if ! defined(__QUEX_INCLUDE_INDICATOR__ANALYZER__CONFIGURATION) +# error "No configuration header included before this header." +#endif + +#include "aux-string.i" + +#include "analyzerAsserts.i" +#include "bufferAsserts.i" + +/* Token sending happens only via macros, for flexibility. */ +#include "token-receiving.i" +#include "mode-handling.i" +#include "misc.i" +#include "navigation.i" +#include "constructor.i" +#include "reset.i" + +#include "basic.i" +#include "Mode.i" + +#include "Buffer.i" +#include "LexatomLoader.i" +#include "ByteLoader" + +#if defined(__QUEX_OPTION_CONVERTER) +# include <quex/code_base/buffer/lexatoms/LexatomLoader_Converter.i> +#endif + +#ifdef __QUEX_OPTION_COUNTER +# include "Counter.i" +#endif +#ifdef QUEX_OPTION_INCLUDE_STACK +# include "include-stack.i" +#endif +#ifdef QUEX_OPTION_STRING_ACCUMULATOR +# include "Accumulator.i" +#endif +#ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE +# include "TokenQueue.i" +#endif +#ifdef QUEX_OPTION_POST_CATEGORIZER +# include <quex/code_base/analyzer/PostCategorizer.i> +#endif +#ifdef QUEX_OPTION_INDENTATION_TRIGGER +# include "on_indentation.i" +#endif + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__HEADERS_I */ diff --git a/src/parser/iconv-argument-types.h b/src/parser/iconv-argument-types.h @@ -0,0 +1,28 @@ +#ifndef __QUEX_INCLUDE_GUARD__COMPATIBILITY__ICONV_ARGUMENT_TYPES_H +#define __QUEX_INCLUDE_GUARD__COMPATIBILITY__ICONV_ARGUMENT_TYPES_H + + +#if ! defined (__QUEX_OPTION_PLAIN_C) + /* NOTE: At the time of this writing 'iconv' is delivered on different + * systems with different definitions for the second argument. The + * following 'hack' by Howard Jeng does the adaption automatically. */ + struct __Adapter_FuncIconv_SecondArgument { + __Adapter_FuncIconv_SecondArgument(uint8_t ** in) : data(in) {} + uint8_t ** data; + operator const char **(void) const { return (const char **)(data); } + operator char **(void) const { return ( char **)(data); } + }; + +# define __QUEX_ADAPTER_ICONV_2ND_ARG(ARG) (__Adapter_FuncIconv_SecondArgument(ARG)) + +#else + /* For 'C' things do not work out that elegantly ... */ +# if defined(QUEX_SETTING_ICONV_2ND_ARG_CONST_CHARPP) +# define __QUEX_ADAPTER_ICONV_2ND_ARG(ARG) ((const char**)(ARG)) +# else +# define __QUEX_ADAPTER_ICONV_2ND_ARG(ARG) ((char**)(ARG)) +# endif + +#endif + +#endif /* __QUEX_INCLUDE_GUARD__COMPATIBILITY__ICONV_ARGUMENT_TYPES_H */ diff --git a/src/parser/identity b/src/parser/identity @@ -0,0 +1,52 @@ +/* vim: set filetype=cpp: -*- C++ -*- + * + * Declaration of converter functions which implement pure identity operations + * for 'char', and 'wchar_t': + * + * QUEX_NAME(identical_string)(...) for string and buffer + * QUEX_NAME(identical_wstring)(...) for string and buffer + * + * They exist mainly so that generalized code can be written in a homogenous + * manner with the other converter functions. See 'token/CDefault.qx' for example. + * + * These functions ARE DEPENDENT on QUEX_TYPE_LEXATOM. + * => Thus, they are placed in the analyzer's namespace. + * + * (C) 2012 Frank-Rene Schaefer. + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__IDENTITY) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__IDENTITY +#endif + +#include "converterHelperCommon.h" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(identical, char)(const QUEX_TYPE_LEXATOM** source_pp, + const QUEX_TYPE_LEXATOM* SourceEnd, + char** drain_pp, + const char* DrainEnd); + +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(identical, wchar)(const QUEX_TYPE_LEXATOM** source_pp, + const QUEX_TYPE_LEXATOM* SourceEnd, + wchar_t** drain_pp, + const wchar_t* DrainEnd); +#endif + +#if ! defined(__QUEX_OPTION_PLAIN_C) + QUEX_INLINE std::basic_string<char> + QUEX_CONVERTER_STRING_DEF(identical, char)(const std::basic_string<QUEX_TYPE_LEXATOM>& Source); +# if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) + QUEX_INLINE std::basic_string<wchar_t> + QUEX_CONVERTER_STRING_DEF(identical, wchar)(const std::basic_string<QUEX_TYPE_LEXATOM>& Source); +# endif +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__IDENTITY */ diff --git a/src/parser/identity.i b/src/parser/identity.i @@ -0,0 +1,78 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: + * + * Provide the implementation of identity string converter functions + * for 'char' and 'wchar_t'. + * + * QUEX_NAME(identical_string)(...) for string and buffer + * QUEX_NAME(identical_wstring)(...) for string and buffer + * + * They exist mainly so that generalized code can be written in a homogenous + * manner with the other converter functions. See 'token/CDefault.qx' for example. + * + * These functions ARE DEPENDENT on QUEX_TYPE_LEXATOM. + * => Thus, they are placed in the analyzer's namespace. + * + * 2010 (C) Frank-Rene Schaefer; + * ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__IDENTITY_I) \ + || defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +#if ! defined(__QUEX_INCLUDE_GUARD__CONVERTER_HELPER__TMP_DISABLED) +# define __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__IDENTITY_I +#endif + +#include "identity" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(identical, char)(const QUEX_TYPE_LEXATOM** source_pp, + const QUEX_TYPE_LEXATOM* SourceEnd, + char** drain_pp, + const char* DrainEnd) +{ + const QUEX_TYPE_LEXATOM* from_p = *source_pp; + char* to_p = *drain_pp; + + while( from_p != SourceEnd && to_p != DrainEnd ) + { + *to_p++ = (char)*from_p++; + } + *source_pp = from_p; + *drain_pp = to_p; +} + +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(identical, wchar)(const QUEX_TYPE_LEXATOM** source_pp, + const QUEX_TYPE_LEXATOM* SourceEnd, + wchar_t** drain_pp, + const wchar_t* DrainEnd) +{ + const QUEX_TYPE_LEXATOM* from_p = *source_pp; + wchar_t* to_p = *drain_pp; + + while( from_p != SourceEnd && to_p != DrainEnd ) + { + *to_p++ = (wchar_t)*from_p++; + } + *source_pp = from_p; + *drain_pp = to_p; +} + +#endif + +#if ! defined(__QUEX_OPTION_PLAIN_C) + QUEX_INLINE std::basic_string<char> + QUEX_CONVERTER_STRING_DEF(identical, char)(const std::basic_string<QUEX_TYPE_LEXATOM>& Source) + { return std::string((const char*)Source.c_str()); } +# if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) + QUEX_INLINE std::basic_string<wchar_t> + QUEX_CONVERTER_STRING_DEF(identical, wchar)(const std::basic_string<QUEX_TYPE_LEXATOM>& Source) + { return std::wstring((const wchar_t*)Source.c_str()); } +# endif +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__CONVERTER_HELPER__IDENTITY_I */ diff --git a/src/parser/implementations.gi b/src/parser/implementations.gi @@ -0,0 +1,50 @@ +/* PURPOSE: + * + * Generate function implementations for all string converters FROM + * a given codec: + * + * QUEX_CONVERTER_STRING(FROM, utf8)(...) + * QUEX_CONVERTER_STRING(FROM, utf16)(...) + * QUEX_CONVERTER_STRING(FROM, utf32)(...) + * QUEX_CONVERTER_STRING(FROM, char)(...) + * QUEX_CONVERTER_STRING(FROM, wchar_t)(...) + * + * It is Assumed that the character converters for each function are + * available! + * + * PARAMETERS: + * + * __QUEX_FROM Name of the input character codec. + * __QUEX_FROM_TYPE Type of the input characters. + * + * (C) 2012 Frank-Rene Schaefer; ABSOLUTELY NO WARRANTY */ +#if ! defined(__QUEX_FROM) +# error "__QUEX_FROM must be defined!" +#elif ! defined(__QUEX_FROM_TYPE) +# error "__QUEX_FROM_TYPE must be defined!" +#endif + +#define __QUEX_TO utf8 +#define __QUEX_TO_TYPE uint8_t +#include "string-converter.gi" +#define __QUEX_TO utf16 +#define __QUEX_TO_TYPE uint16_t +#include "string-converter.gi" +#define __QUEX_TO utf32 +#define __QUEX_TO_TYPE uint32_t +#include "string-converter.gi" +#define __QUEX_TO char +#define __QUEX_TO_TYPE char +#include "string-converter.gi" + +#if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) +# define __QUEX_TO wchar +# define __QUEX_TO_TYPE wchar_t +# include "string-converter.gi" +# undef __QUEX_TO +# undef __QUEX_TO_TYPE +#endif + +#undef __QUEX_FROM +#undef __QUEX_FROM_TYPE + diff --git a/src/parser/include-stack.i b/src/parser/include-stack.i @@ -0,0 +1,409 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * + * (C) 2004-2009 Frank-Rene Schaefer + * + * __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__INCLUDE_STACK_I may be undefined in case + * that multiple lexical analyzers are used. Then, the name of the + * QUEX_NAME(Accumulator) must be different. */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__INCLUDE_STACK_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__INCLUDE_STACK_I + +#ifndef QUEX_TYPE_ANALYZER +# error "Macro QUEX_TYPE_ANALYZER must be defined before inclusion of this file." +#endif + + +QUEX_NAMESPACE_MAIN_OPEN + +/* Level (1) __________________________________________________________________ + * */ +QUEX_INLINE bool +QUEX_MEMBER_FUNCTION2(include_push, file_name, + const char* FileName, + const char* CodecName /* = 0x0 */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool verdict_f; + QUEX_NAME(ByteLoader)* byte_loader; + + byte_loader = QUEX_NAME(ByteLoader_FILE_new_from_file_name)(FileName); + if( ! byte_loader ) { + return false; + } + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + verdict_f = QUEX_MEMBER_FUNCTION_CALL3(include_push, ByteLoader, FileName, byte_loader, CodecName); + if( ! verdict_f ) { + QUEX_NAME(ByteLoader_delete)(&byte_loader); + } + return verdict_f; +} + +/* Level (2) __________________________________________________________________ + * */ +QUEX_INLINE bool +QUEX_MEMBER_FUNCTION4(include_push, FILE, + const char* InputName, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */, + bool BinaryModeF) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool verdict_f; + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( fh ); + + /* At the time of this writing 'stdin' as located in the C++ global + * namespace. This seemed suspicous to the author. To avoid compilation + * errors in the future the test for the standard input is only active in + * 'C'. It is only about user information anyway. So better no risks taken. + * <fschaef 2010y02m06d> */ + + setbuf(fh, 0); /* turn off system based buffering! + ** ** this is essential to profit from the quex buffer! */ + byte_loader = QUEX_NAME(ByteLoader_FILE_new)(fh, BinaryModeF); + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( ! byte_loader ) { + return false; + } + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + verdict_f = QUEX_MEMBER_FUNCTION_CALL3(include_push, ByteLoader, InputName, + byte_loader, CodecName); + if( ! verdict_f ) { + QUEX_NAME(ByteLoader_delete)(&byte_loader); + } + return verdict_f; +} + +#ifndef __QUEX_OPTION_PLAIN_C +QUEX_INLINE bool +QUEX_MEMBER_FUNCTION4(include_push, istream, + const char* InputName, + std::istream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool verdict_f; + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = BinaryModeF; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( ! byte_loader ) { + return false; + } + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + verdict_f = QUEX_MEMBER_FUNCTION_CALL3(include_push, ByteLoader, InputName, + byte_loader, CodecName); + if( ! verdict_f ) { + QUEX_NAME(ByteLoader_delete)(&byte_loader); + } + return verdict_f; +} +#endif + + +#if defined(__QUEX_OPTION_WCHAR_T) && ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE bool +QUEX_MEMBER_FUNCTION4(include_push, wistream, + const char* InputName, + std::wistream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool verdict_f; + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = BinaryModeF; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( ! byte_loader ) { + return false; + } + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + verdict_f = QUEX_MEMBER_FUNCTION_CALL3(include_push, ByteLoader, InputName, + byte_loader, CodecName); + if( ! verdict_f ) { + QUEX_NAME(ByteLoader_delete)(&byte_loader); + } + return verdict_f; +} +#endif + +#if defined(__QUEX_OPTION_UNIT_TEST) && ! defined (__QUEX_OPTION_PLAIN_C) +/* StrangeStreams are not for C-language stuff */ +template<class UnderlyingStreamT> QUEX_INLINE bool +QUEX_MEMBER_FUNCTION3(include_push, strange_stream, + const char* InputName, + quex::StrangeStream<UnderlyingStreamT>* istream_p, + const char* CodecName /* = 0x0 */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool verdict_f; + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = false; + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( ! byte_loader ) { + return false; + } + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + verdict_f = QUEX_MEMBER_FUNCTION_CALL3(include_push, ByteLoader, InputName, + byte_loader, CodecName); + if( ! verdict_f ) { + QUEX_NAME(ByteLoader_delete)(&byte_loader); + } + return verdict_f; +} +#endif + + +/* Level (3) __________________________________________________________________ + * */ +QUEX_INLINE bool +QUEX_MEMBER_FUNCTION3(include_push, ByteLoader, + const char* InputName, + QUEX_NAME(ByteLoader)* byte_loader, + const char* CodecName) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool verdict_f; + QUEX_NAME(LexatomLoader)* filler; + QUEX_NAME(Asserts_construct)(CodecName); + + filler = QUEX_NAME(LexatomLoader_new_DEFAULT)(byte_loader, CodecName); + /* NOT: Abort/return if filler == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( filler ) { + filler->ownership = E_Ownership_LEXICAL_ANALYZER; + } + verdict_f = QUEX_MEMBER_FUNCTION_CALL2(include_push, LexatomLoader, InputName, + filler); + if( ! verdict_f && filler->ownership == E_Ownership_LEXICAL_ANALYZER ) { + me->buffer.filler->delete_self(me->buffer.filler); + me->buffer.filler = (QUEX_NAME(LexatomLoader)*)0; + } + return verdict_f; +} + +/* Level (4) __________________________________________________________________ + * */ +QUEX_INLINE bool +QUEX_MEMBER_FUNCTION2(include_push, LexatomLoader, + const char* InputName, + QUEX_NAME(LexatomLoader)* filler) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool verdict_f; + QUEX_TYPE_LEXATOM* memory; + QUEX_NAME(Buffer) new_buffer_setup; + + memory = (QUEX_TYPE_LEXATOM*)QUEXED(MemoryManager_allocate)( + QUEX_SETTING_BUFFER_SIZE * sizeof(QUEX_TYPE_LEXATOM), + E_MemoryObjectType_BUFFER_MEMORY); + /* NOT: Abort/return if memory == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + + QUEX_NAME(Buffer_construct)(&new_buffer_setup, filler, + memory, QUEX_SETTING_BUFFER_SIZE, + (QUEX_TYPE_LEXATOM*)0, + E_Ownership_LEXICAL_ANALYZER); + + /* The 'new_buffer_setup' is only copied including the reference to the + * new memory. However, the box object 'new_buffer_setup' is left alone. */ + verdict_f = QUEX_MEMBER_FUNCTION_CALLO2(basic_include_push, InputName, + &new_buffer_setup); + if( ! verdict_f ) { + QUEXED(MemoryManager_free)(memory, E_MemoryObjectType_BUFFER_MEMORY); + } + return verdict_f; +} + +/* Level (5) __________________________________________________________________ + * */ +QUEX_INLINE bool +QUEX_MEMBER_FUNCTION4(include_push, memory, + const char* InputName, + QUEX_TYPE_LEXATOM* Memory, + const size_t MemorySize, + QUEX_TYPE_LEXATOM* EndOfFileP) +/* When memory is provided from extern, the 'external entity' is + * responsible for filling it. There is no 'file/stream handle', no 'byte + * loader', and 'no buffer filler'. */ +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(Buffer) new_buffer_setup; + QUEX_ASSERT_MEMORY(Memory, MemorySize, EndOfFileP); + + QUEX_NAME(Buffer_construct)(&new_buffer_setup, + (QUEX_NAME(LexatomLoader)*)0, + Memory, MemorySize, EndOfFileP, + E_Ownership_EXTERNAL); + + /* The 'new_buffer_setup' is only copied including the reference to the + * new memory. However, the box object 'new_buffer_setup' is left alone. */ + return QUEX_MEMBER_FUNCTION_CALLO2(basic_include_push, InputName, + &new_buffer_setup); +} + +QUEX_INLINE bool +QUEX_MEMBER_FUNCTIONO2(basic_include_push, + const char* InputNameP, + QUEX_NAME(Buffer)* new_buffer_setup) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(Memento)* memento; + + memento = (QUEX_NAME(Memento)*)QUEXED(MemoryManager_allocate)( + sizeof(QUEX_NAME(Memento)), + E_MemoryObjectType_MEMENTO); + if( ! memento ) { + return false; + } +# ifndef __QUEX_OPTION_PLAIN_C + /* Use placement 'new' for explicit call of constructor. + * Necessary in C++: Call to constructor for user defined members. */ + new ((void*)memento) QUEX_NAME(Memento); +# endif + + if( me->buffer.filler ) + { + /* By default overtake the byte order reversion behavior of the + * including buffer. */ + new_buffer_setup->filler->_byte_order_reversion_active_f = \ + me->buffer.filler->_byte_order_reversion_active_f; + } + + /* 'memento->__input_name' points to previously allocated memory. */ + memento->__input_name = me->__input_name; + me->__input_name = (char*)0; /* Release ownership. */ + memento->_parent_memento = me->_parent_memento; + memento->buffer = me->buffer; + memento->__current_mode_p = me->__current_mode_p; + memento->current_analyzer_function = me->current_analyzer_function; +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) \ + || defined(QUEX_OPTION_ASSERTS) + memento->DEBUG_analyzer_function_at_entry = me->DEBUG_analyzer_function_at_entry; +# endif + __QUEX_IF_COUNT(memento->counter = me->counter); + + me->buffer = *new_buffer_setup; + __QUEX_IF_COUNT(QUEX_NAME(Counter_construct)(&me->counter); ) + + /* Deriberately not subject to include handling: + * -- Mode stack. + * -- Token and token queues. + * -- Post categorizer. */ + if( ! QUEX_MEMBER_FUNCTION_CALLO2(user_memento_pack, InputNameP, memento) ) { + QUEXED(MemoryManager_free)(memento, E_MemoryObjectType_MEMENTO); + return false; + } + + if( ! QUEX_MEMBER_FUNCTION_CALLO1(input_name_set, InputNameP) ) { + QUEXED(MemoryManager_free)(memento, E_MemoryObjectType_MEMENTO); + return false; + } + + /* Put memento on stack AFTER user has done to it its duties. */ + me->_parent_memento = memento; + + return true; +} + +QUEX_INLINE bool +QUEX_MEMBER_FUNCTIONO(include_pop) +/* RETURNS: true, if there was a memento that has been restored. + * false, else. */ +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(Memento)* memento; + /* Not included? return 'false' to indicate we're on the top level */ + if( ! me->_parent_memento ) return false; + + /* Buffer_destruct() takes care of propper destructor calls for byte- + * loaders, buffer fillers, and converters. */ + QUEX_NAME(Buffer_destruct)(&me->buffer); + + memento = me->_parent_memento; + me->_parent_memento = memento->_parent_memento; + /* memento_unpack(): + * => Current mode + * => __current_mode_p + * current_analyzer_function + * DEBUG_analyzer_function_at_entry + * => Line/Column Counters + * + * Unchanged by memento_unpack(): + * -- Mode stack + * -- Tokens and token queues. + * -- Accumulator. + * -- Post categorizer. + * -- File handle by constructor */ + + /* Copy Back of content that was stored upon inclusion. */ + + if( me->__input_name ) { + QUEXED(MemoryManager_free)(me->__input_name, E_MemoryObjectType_BUFFER_MEMORY); + } + /* 'memento->__input_name' points to previously allocated memory. + * 'me->__input_name' takes ownership again over allocated memory. */ + me->__input_name = memento->__input_name; + me->buffer = memento->buffer; + me->__current_mode_p = memento->__current_mode_p; + me->current_analyzer_function = memento->current_analyzer_function; +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) \ + || defined(QUEX_OPTION_ASSERTS) + me->DEBUG_analyzer_function_at_entry = memento->DEBUG_analyzer_function_at_entry; +# endif + __QUEX_IF_COUNT(me->counter = memento->counter); + + QUEX_MEMBER_FUNCTION_CALLO1(user_memento_unpack,memento); + +# ifndef __QUEX_OPTION_PLAIN_C + /* Counterpart to placement new: Explicit destructor call. + * Necessary in C++: Trigger call to destructor for user defined members.*/ + memento->~QUEX_NAME(Memento_tag)(); +# endif + + QUEXED(MemoryManager_free)((void*)memento, E_MemoryObjectType_MEMENTO); + + /* Return to including file succesful */ + return true; +} + +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO(include_stack_delete) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + while( QUEX_MEMBER_FUNCTION_CALLO(include_pop) ); +} + +QUEX_INLINE bool +QUEX_MEMBER_FUNCTIONO1(include_detect_recursion, + const char* InputName) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(Memento)* iterator; + for(iterator = me->_parent_memento; iterator ; + iterator = iterator->_parent_memento ) { + if( __QUEX_STD_strcmp(iterator->__input_name, InputName) == 0 ) { + return true; + } + } + return false; +} + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__INCLUDE_STACK_I */ diff --git a/src/parser/misc b/src/parser/misc @@ -0,0 +1,72 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2016 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MISC +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MISC + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +/* Callback on buffer content change --> user may safe its lexeme's away. */ +QUEX_INLINE void +QUEX_NAME(set_callback_on_buffer_content_change)(QUEX_TYPE_ANALYZER* me, + void (*callback)(const QUEX_TYPE_LEXATOM*, + const QUEX_TYPE_LEXATOM*)); +#if defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_NAME(lexeme_start_pointer_get)(QUEX_TYPE_ANALYZER*); +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_NAME(input_pointer_get)(QUEX_TYPE_ANALYZER*); +QUEX_INLINE void +QUEX_NAME(input_pointer_set)(QUEX_TYPE_ANALYZER*, QUEX_TYPE_LEXATOM* Adr); +#endif + +/* Activate/deactivate byte order reversion (big-/little-endian) */ +QUEX_INLINE bool QUEX_NAME(byte_order_reversion)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(byte_order_reversion_set)(QUEX_TYPE_ANALYZER* me, + bool Value); +/* Version information */ +QUEX_INLINE const char* QUEX_NAME(version)(QUEX_TYPE_ANALYZER* me); + +/* Token handling. */ +QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(token_p)(QUEX_TYPE_ANALYZER* me); + +#if defined(QUEX_OPTION_TOKEN_POLICY_SINGLE) + QUEX_INLINE QUEX_TYPE_TOKEN* QUEX_NAME(token_p_swap)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN* TokenP); + +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_INLINE void QUEX_NAME(token_p_set)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN* TokenP); +# endif + +#elif defined(QUEX_OPTION_TOKEN_POLICY_QUEUE) + QUEX_INLINE bool QUEX_NAME(token_queue_is_empty)(QUEX_TYPE_ANALYZER* me); + QUEX_INLINE void QUEX_NAME(token_queue_remainder_get)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN** begin, + QUEX_TYPE_TOKEN** end); + QUEX_INLINE void QUEX_NAME(token_queue_swap)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN** memory, + size_t* n); + +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_INLINE void QUEX_NAME(token_queue_get)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN** begin, size_t* size); + + QUEX_INLINE void QUEX_NAME(token_queue_set)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN* Begin, + size_t Size); +# endif + +#else +# error "This section should never be compiled." +#endif + +/* Print */ +QUEX_INLINE void QUEX_NAME(print_this)(QUEX_TYPE_ANALYZER* me); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MISC */ + diff --git a/src/parser/misc.i b/src/parser/misc.i @@ -0,0 +1,215 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) Frankt-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MISC_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MISC_I + +#if defined(__QUEX_OPTION_COUNTER) +# include "analyzerCounter" +#endif +#include "TokenPolicy" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_MEMBER_FUNCTIONO(lexeme_start_pointer_get) +{ QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) return me->buffer._lexeme_start_p; } + +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_MEMBER_FUNCTIONO(input_pointer_get) +{ QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) return me->buffer._read_p; } + +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO1(input_pointer_set, QUEX_TYPE_LEXATOM* Adr) +{ QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) me->buffer._read_p = Adr; } + +QUEX_INLINE void +QUEX_NAME(set_callback_on_buffer_content_change)(QUEX_TYPE_ANALYZER* me, + void (*callback)(const QUEX_TYPE_LEXATOM*, + const QUEX_TYPE_LEXATOM*)) +{ me->buffer.on_content_change = callback; } + +QUEX_INLINE QUEX_TYPE_TOKEN* +QUEX_NAME(token_p)(QUEX_TYPE_ANALYZER* me) +{ +# define self (*(QUEX_TYPE_DERIVED_ANALYZER*)me) + return __QUEX_CURRENT_TOKEN_P; +# undef self +} + +#ifdef QUEX_OPTION_TOKEN_POLICY_SINGLE + QUEX_INLINE QUEX_TYPE_TOKEN* + QUEX_NAME(token_p_swap)(QUEX_TYPE_ANALYZER* me, QUEX_TYPE_TOKEN* TokenP) + { + QUEX_TYPE_TOKEN* prev_token_p = me->token; + me->token = TokenP; + return prev_token_p; + } + +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_INLINE void + QUEX_NAME(token_p_set)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN* TokenP) + { me->token = TokenP; } + +# endif +#else + QUEX_INLINE bool + QUEX_NAME(token_queue_is_empty)(QUEX_TYPE_ANALYZER* me) + { + return QUEX_NAME(TokenQueue_is_empty)(&me->_token_queue); + } + + QUEX_INLINE void + QUEX_NAME(token_queue_remainder_get)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN** begin, + QUEX_TYPE_TOKEN** end) + { QUEX_NAME(TokenQueue_remainder_get)(&me->_token_queue, begin, end); } + + QUEX_INLINE void + QUEX_NAME(token_queue_swap)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN** memory, size_t* n) + { + QUEX_TYPE_TOKEN* prev_memory = 0x0; + size_t prev_n = (size_t)-1; + QUEX_NAME(TokenQueue_memory_get)(&me->_token_queue, &prev_memory, &prev_n); + QUEX_NAME(TokenQueue_init)(&me->_token_queue, *memory, *memory + *n); + *memory = prev_memory; + *n = prev_n; + } +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_INLINE void QUEX_NAME(token_queue_get)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN** begin, size_t* size) + { + QUEX_NAME(TokenQueue_memory_get)(&me->_token_queue, begin, size); + } + + QUEX_INLINE void QUEX_NAME(token_queue_set)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_TOKEN* Begin, + size_t Size) + { + QUEX_NAME(TokenQueue_init)(&me->_token_queue, Begin, Begin + Size); + } + +# endif + +#endif + + +QUEX_INLINE const char* +QUEX_NAME(version)(QUEX_TYPE_ANALYZER* me) +{ + (void)me; + return QUEX_STRING(QUEX_TYPE_ANALYZER) \ + ": Version " QUEX_SETTING_ANALYZER_VERSION \ + ". Date " QUEX_SETTING_BUILD_DATE \ + "Generated by Quex " QUEX_SETTING_VERSION "."; +} + +QUEX_INLINE bool +QUEX_NAME(byte_order_reversion)(QUEX_TYPE_ANALYZER* me) +{ + __quex_assert(me->buffer.filler); + return me->buffer.filler->_byte_order_reversion_active_f; +} + +QUEX_INLINE void +QUEX_NAME(byte_order_reversion_set)(QUEX_TYPE_ANALYZER* me, bool Value) +{ + __quex_assert(me->buffer.filler); + me->buffer.filler->_byte_order_reversion_active_f = Value; +} + + +QUEX_INLINE void +QUEX_NAME(print_this)(QUEX_TYPE_ANALYZER* me) +{ + QUEX_NAME(Mode)** iterator = 0x0; + + __QUEX_STD_printf(" CurrentMode = %s;\n", + me->__current_mode_p == 0x0 ? "0x0" : me->__current_mode_p->name); + + QUEX_NAME(Buffer_print_this)(&me->buffer); + +# ifdef QUEX_OPTION_STRING_ACCUMULATOR + QUEX_NAME(Accumulator_print_this)(&me->accumulator); +# endif + + __QUEX_IF_COUNT( QUEX_NAME(Counter_print_this)(&me->counter); ) + +# ifdef QUEX_OPTION_POST_CATEGORIZER + QUEX_NAME(PostCategorizer_print_this)(&me->post_categorizer); +# endif + + __QUEX_STD_printf(" Mode Stack (%i/%i) = [", + (int)(me->_mode_stack.end - me->_mode_stack.begin), + (int)(me->_mode_stack.memory_end - me->_mode_stack.begin)); + for(iterator=me->_mode_stack.end-1; iterator >= me->_mode_stack.begin; --iterator) + __QUEX_STD_printf("%s, ", (*iterator)->name); + + __QUEX_STD_printf("]\n"); + __QUEX_STD_printf(" ByteOrderInversion = %s;\n", + QUEX_NAME(byte_order_reversion)(me) ? "true" : "false"); +} + +#if ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE void +QUEX_MEMBER(set_callback_on_buffer_content_change)(void (*callback)(const QUEX_TYPE_LEXATOM*, + const QUEX_TYPE_LEXATOM*)) +{ QUEX_NAME(set_callback_on_buffer_content_change)(this, callback); } + +QUEX_INLINE QUEX_TYPE_TOKEN* +QUEX_MEMBER(token_p)() +{ return QUEX_NAME(token_p)(this); } + +#if defined(QUEX_OPTION_TOKEN_POLICY_SINGLE) + + QUEX_INLINE QUEX_TYPE_TOKEN* + QUEX_MEMBER(token_p_swap)(QUEX_TYPE_TOKEN* TokenP) + { return QUEX_NAME(token_p_swap)(this, TokenP); } + +#else + QUEX_INLINE bool + QUEX_MEMBER(token_queue_is_empty)() + { return QUEX_NAME(token_queue_is_empty)(this); } + + QUEX_INLINE void + QUEX_MEMBER(token_queue_remainder_get)(QUEX_TYPE_TOKEN** begin, + QUEX_TYPE_TOKEN** end) + { QUEX_NAME(token_queue_remainder_get)(this, begin, end); } + + QUEX_INLINE void + QUEX_MEMBER(token_queue_swap)(QUEX_TYPE_TOKEN** memory, size_t* n) + { QUEX_NAME(token_queue_swap)(this, memory, n); } + +# if defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + QUEX_INLINE void + QUEX_MEMBER(token_queue_get)(QUEX_TYPE_TOKEN** begin, size_t* size) + { QUEX_NAME(token_queue_get)(this, begin, size); } + + QUEX_INLINE void + QUEX_MEMBER(token_queue_set)(QUEX_TYPE_TOKEN* Begin, size_t Size) + { QUEX_NAME(token_queue_set)(this, Begin, Size); } +# endif +#endif + +QUEX_INLINE const char* +QUEX_MEMBER(version)() const +{ return QUEX_NAME(version)((QUEX_TYPE_ANALYZER*)this); } + +QUEX_INLINE void +QUEX_MEMBER(print_this)() +{ QUEX_NAME(print_this)(this); } + +QUEX_INLINE bool +QUEX_MEMBER(byte_order_reversion)() +{ return QUEX_NAME(byte_order_reversion)(this); } + +QUEX_INLINE void +QUEX_MEMBER(byte_order_reversion_set)(bool Value) +{ QUEX_NAME(byte_order_reversion_set)(this, Value); } +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MISC_I */ diff --git a/src/parser/mode-handling b/src/parser/mode-handling @@ -0,0 +1,38 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +/* Read Access */ +QUEX_INLINE QUEX_NAME(Mode)* QUEX_NAME(mode)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE int QUEX_NAME(mode_id)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE const char* QUEX_NAME(mode_name)(QUEX_TYPE_ANALYZER* me); + +/* Map: mode id to mode and vice versa */ +QUEX_INLINE QUEX_NAME(Mode)* QUEX_NAME(map_mode_id_to_mode)(QUEX_TYPE_ANALYZER* me, + const int ModeID); +QUEX_INLINE int QUEX_NAME(map_mode_to_mode_id)(const QUEX_TYPE_ANALYZER* me, + const QUEX_NAME(Mode)* Mode); + +/* Changing Modes */ +QUEX_INLINE void QUEX_NAME(set_mode_brutally_by_id)(QUEX_TYPE_ANALYZER* me, + const int LexerMode); +QUEX_INLINE void QUEX_NAME(set_mode_brutally)(QUEX_TYPE_ANALYZER* me, + QUEX_NAME(Mode)* Mode); +QUEX_INLINE void QUEX_NAME(enter_mode)(QUEX_TYPE_ANALYZER* me, + /* NOT const*/ QUEX_NAME(Mode)* TargetMode); + +/* Changing Modes with stack */ +QUEX_INLINE void QUEX_NAME(pop_mode)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(pop_drop_mode)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(push_mode)(QUEX_TYPE_ANALYZER* me, QUEX_NAME(Mode)* new_mode); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING */ + diff --git a/src/parser/mode-handling.i b/src/parser/mode-handling.i @@ -0,0 +1,163 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * (C) Frankt-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING_I + +#include "definitions" +#include "analyzerMode" + +QUEX_NAMESPACE_MAIN_OPEN + + QUEX_INLINE QUEX_NAME(Mode)* + QUEX_NAME(get_mode)(QUEX_TYPE_ANALYZER* me) + { return me->__current_mode_p; } + + QUEX_INLINE int + QUEX_NAME(get_mode_id)(const QUEX_TYPE_ANALYZER* me) + { return me->__current_mode_p->id; } + + QUEX_INLINE const char* + QUEX_NAME(get_mode_name)(const QUEX_TYPE_ANALYZER* me) + { return me->__current_mode_p->name; } + + QUEX_INLINE void + QUEX_NAME(set_mode_brutally)(QUEX_TYPE_ANALYZER* me, QUEX_NAME(Mode)* ModeP) + { +# ifdef QUEX_OPTION_DEBUG_SHOW_MODES + if( me->__current_mode_p != 0x0 ) { + __QUEX_STD_fprintf(stderr, "| Mode change from %s\n", me->__current_mode_p->name); + __QUEX_STD_fprintf(stderr, "| to %s\n", ModeP->name); + } else { + __QUEX_STD_fprintf(stderr, "| Mode change to %s\n", ModeP->name); + } +# endif + + me->__current_mode_p = ModeP; + me->current_analyzer_function = ModeP->analyzer_function; + } + + QUEX_INLINE void + QUEX_NAME(set_mode_brutally_by_id)(QUEX_TYPE_ANALYZER* me, const int ModeID) + { + __quex_assert(ModeID < __QUEX_SETTING_MAX_MODE_CLASS_N); + QUEX_NAME(set_mode_brutally)(me, QUEX_NAME(mode_db)[ModeID]); + } + + QUEX_INLINE void + QUEX_NAME(enter_mode)(QUEX_TYPE_ANALYZER* me, /* NOT const*/ QUEX_NAME(Mode)* TargetMode) + { +# ifdef __QUEX_OPTION_ON_ENTRY_HANDLER_PRESENT + QUEX_NAME(Mode)* SourceMode = me->__current_mode_p; +# endif + +# ifdef __QUEX_OPTION_ON_EXIT_HANDLER_PRESENT + me->__current_mode_p->on_exit(me, TargetMode); +# endif + + QUEX_NAME(set_mode_brutally)(me, TargetMode); + +# ifdef __QUEX_OPTION_ON_ENTRY_HANDLER_PRESENT + TargetMode->on_entry(me, SourceMode); +# endif + } + + QUEX_INLINE QUEX_NAME(Mode)* + QUEX_NAME(map_mode_id_to_mode)(QUEX_TYPE_ANALYZER* me, const int ModeID) + { + (void)me; + __quex_assert(ModeID >= 0); + __quex_assert(ModeID < __QUEX_SETTING_MAX_MODE_CLASS_N); + return QUEX_NAME(mode_db)[ModeID]; + } + + QUEX_INLINE int + QUEX_NAME(map_mode_to_mode_id)(const QUEX_TYPE_ANALYZER* me, const QUEX_NAME(Mode)* Mode) + { (void)me; return Mode->id; } + + QUEX_INLINE void + QUEX_NAME(pop_mode)(QUEX_TYPE_ANALYZER* me) + { + __quex_assert(me->_mode_stack.end != me->_mode_stack.begin); + --(me->_mode_stack.end); + QUEX_NAME(enter_mode)(me, *me->_mode_stack.end); + } + + QUEX_INLINE void + QUEX_NAME(pop_drop_mode)(QUEX_TYPE_ANALYZER* me) + { + __quex_assert(me->_mode_stack.end != me->_mode_stack.begin); + --(me->_mode_stack.end); + /* do not care about what was popped */ + } + + QUEX_INLINE void + QUEX_NAME(push_mode)(QUEX_TYPE_ANALYZER* me, QUEX_NAME(Mode)* new_mode) + { +# ifdef QUEX_OPTION_ASSERTS + if( me->_mode_stack.end == me->_mode_stack.memory_end ) + QUEX_ERROR_EXIT(__QUEX_MESSAGE_MODE_STACK_OVERFLOW); +# endif + *me->_mode_stack.end = me->__current_mode_p; + ++(me->_mode_stack.end); + QUEX_NAME(enter_mode)(me, new_mode); + } + +# ifndef __QUEX_OPTION_PLAIN_C + QUEX_INLINE QUEX_NAME(Mode)& + QUEX_MEMBER(mode)() + { return *QUEX_NAME(get_mode)(this); } + + QUEX_INLINE int + QUEX_MEMBER(mode_id)() const + { return QUEX_NAME(get_mode_id)(this); } + + QUEX_INLINE const char* + QUEX_MEMBER(mode_name)() const + { return QUEX_NAME(get_mode_name)(this); } + + QUEX_INLINE void + QUEX_MEMBER(set_mode_brutally)(const int ModeID) + { QUEX_NAME(set_mode_brutally_by_id)(this, ModeID); } + + QUEX_INLINE void + QUEX_MEMBER(set_mode_brutally)(const QUEX_NAME(Mode)& TheMode) + { QUEX_NAME(set_mode_brutally)(this, ((QUEX_NAME(Mode)*)&TheMode)); } + + QUEX_INLINE void + QUEX_MEMBER(enter_mode)(/* NOT const*/ QUEX_NAME(Mode)& TargetMode) + { QUEX_NAME(enter_mode)(this, &TargetMode); } + + QUEX_INLINE QUEX_NAME(Mode)& + QUEX_MEMBER(map_mode_id_to_mode)(const int ModeID) + { return *(QUEX_NAME(map_mode_id_to_mode)(this, ModeID)); } + + QUEX_INLINE int + QUEX_MEMBER(map_mode_to_mode_id)(const QUEX_NAME(Mode)& TheMode) const + { return QUEX_NAME(map_mode_to_mode_id)(this, &TheMode); } + + QUEX_INLINE void + QUEX_MEMBER(operator)<<(const int ModeID) + { enter_mode(*(QUEX_NAME(map_mode_id_to_mode)(this, ModeID))); } + + QUEX_INLINE void + QUEX_MEMBER(operator)<<(/* NOT const*/ QUEX_NAME(Mode)& TheMode) + { enter_mode(TheMode); } + + QUEX_INLINE void + QUEX_MEMBER(pop_mode)() + { QUEX_NAME(pop_mode)(this); } + + QUEX_INLINE void + QUEX_MEMBER(pop_drop_mode)() + { QUEX_NAME(pop_drop_mode)(this); } + + QUEX_INLINE void + QUEX_MEMBER(push_mode)(QUEX_NAME(Mode)& new_mode) + { QUEX_NAME(push_mode)(this, &new_mode); } + +# endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING_I */ diff --git a/src/parser/multi.i b/src/parser/multi.i @@ -0,0 +1,51 @@ +#ifndef __QUEX_INCLUDE_GUARD__MULTI_I +#define __QUEX_INCLUDE_GUARD__MULTI_I +/* PURPOSE: + * + * Solving the problem of multiple definitions of same functions when multiple + * analyzers are linked together. + * + * HOWTO: + * + * Compile all files of the lexical analyzer(s) with option + * + * -DQUEX_OPTION_MULTI + * + * must be defined. In one single file include + * + * #include <quex/code_base/multi.i> + * + * Option 'QUEX_OPTION_MULTI' avoids the inclusion of some critical files + * during the implementation of all files. Instead, the explicit inclusion of + * 'multi.i' in one file delivers the reqired implementations. A good candidate + * for '#includ'-ing is the interface module where the lexical analyzers are + * called. + * + * If the global quex namespace is chosen to be different from 'quex', the + * define option + * -DQUEX_NAMESPACE_QUEX=mySpace + * + * In the above example the user's quex namespace is 'mySpace'. + * + * EXPLANATION: + * + * This file includes implementations of functions which supposedly are exactly + * the same for any instance of a lexical analyzer. They do not depend on an + * analyzer's configuration--except for the definition of the global namespace + * of 'quex'. + * + * All of the functions below are located in the namespace quex. This may cause + * problems when multiple analyzers are linked together. The option + * QUEX_OPTION_MULTI prevents those common headers from being included in any + * file. Including this file, however, allows for one single file to get all + * implementations required. + * + * (C) Frank-Rene Schaefer */ +#if ! defined(QUEX_OPTION_MULTI) && ! defined(QUEX_OPTION_MULTI_ALLOW_IMPLEMENTATION) +# error "This file can only be included if option 'QUEX_OPTION_MULTI' has been set." +#endif + +#include "bom.i" +#include "MemoryManager.i" + +#endif /* __QUEX_INCLUDE_GUARD__MULTI_I__ */ diff --git a/src/parser/navigation b/src/parser/navigation @@ -0,0 +1,21 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__NAVIGATION +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__NAVIGATION + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +/* Tell/Seek/Move on basis of character index */ +QUEX_INLINE size_t QUEX_NAME(tell)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(seek)(QUEX_TYPE_ANALYZER* me, const size_t); +QUEX_INLINE void QUEX_NAME(seek_forward)(QUEX_TYPE_ANALYZER* me, const size_t); +QUEX_INLINE void QUEX_NAME(seek_backward)(QUEX_TYPE_ANALYZER* me, const size_t); +QUEX_INLINE void QUEX_NAME(undo)(QUEX_TYPE_ANALYZER* me); +QUEX_INLINE void QUEX_NAME(undo_n)(QUEX_TYPE_ANALYZER* me, size_t DeltaN_Backward); + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__NAVIGATION */ diff --git a/src/parser/navigation.i b/src/parser/navigation.i @@ -0,0 +1,97 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__NAVIGATION_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__NAVIGATION_I + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +QUEX_INLINE size_t +QUEX_NAME(tell)(QUEX_TYPE_ANALYZER* me) +{ + /* No 'undo terminating zero' -- we do not change the lexeme pointer here. */ + return (size_t)QUEX_NAME(Buffer_tell)(&me->buffer); +} + +QUEX_INLINE void +QUEX_NAME(seek)(QUEX_TYPE_ANALYZER* me, const size_t CharacterIndex) +{ + QUEX_LEXEME_TERMINATING_ZERO_UNDO(&me->buffer); + QUEX_NAME(Buffer_seek)(&me->buffer, (ptrdiff_t)CharacterIndex); +} + +QUEX_INLINE void +QUEX_NAME(seek_forward)(QUEX_TYPE_ANALYZER* me, const size_t CharacterN) +{ + QUEX_LEXEME_TERMINATING_ZERO_UNDO(&me->buffer); + QUEX_NAME(Buffer_seek_forward)(&me->buffer, (ptrdiff_t)CharacterN); +} + +QUEX_INLINE void +QUEX_NAME(seek_backward)(QUEX_TYPE_ANALYZER* me, const size_t CharacterN) +{ + QUEX_LEXEME_TERMINATING_ZERO_UNDO(&me->buffer); + QUEX_NAME(Buffer_seek_backward)(&me->buffer, (ptrdiff_t)CharacterN); +} + +QUEX_INLINE void +QUEX_NAME(undo)(QUEX_TYPE_ANALYZER* me) +{ + __QUEX_IF_COUNT_LINES(me->counter._line_number_at_end = me->counter._line_number_at_begin); + __QUEX_IF_COUNT_COLUMNS(me->counter._column_number_at_end = me->counter._column_number_at_begin); + + QUEX_LEXEME_TERMINATING_ZERO_UNDO(&me->buffer); + + me->buffer._read_p = me->buffer._lexeme_start_p; + + QUEX_LEXEME_TERMINATING_ZERO_SET(&me->buffer); +} + +QUEX_INLINE void +QUEX_NAME(undo_n)(QUEX_TYPE_ANALYZER* me, size_t DeltaN_Backward) +{ + __QUEX_IF_COUNT_LINES(me->counter._line_number_at_end = me->counter._line_number_at_begin); + __QUEX_IF_COUNT_COLUMNS(me->counter._column_number_at_end = me->counter._column_number_at_begin); + + QUEX_LEXEME_TERMINATING_ZERO_UNDO(&me->buffer); + + me->buffer._read_p -= (ptrdiff_t)DeltaN_Backward; + + QUEX_LEXEME_TERMINATING_ZERO_SET(&me->buffer); + + __quex_assert(me->buffer._read_p >= me->buffer._lexeme_start_p); +} + + +#if ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE size_t +QUEX_MEMBER(tell)() +{ return QUEX_NAME(tell)(this); } + +QUEX_INLINE void +QUEX_MEMBER(seek)(const size_t CharacterIndex) +{ QUEX_NAME(seek)(this, CharacterIndex); } + +QUEX_INLINE void +QUEX_MEMBER(seek_forward)(const size_t CharacterN) +{ QUEX_NAME(seek_forward)(this, CharacterN); } + +QUEX_INLINE void +QUEX_MEMBER(seek_backward)(const size_t CharacterN) +{ QUEX_NAME(seek_backward)(this, CharacterN); } + +QUEX_INLINE void +QUEX_MEMBER(undo)() +{ return QUEX_NAME(undo)(this); } + +QUEX_INLINE void +QUEX_MEMBER(undo)(size_t DeltaN_Backward) +{ return QUEX_NAME(undo_n)(this, DeltaN_Backward); } + +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__NAVIGATION_I */ diff --git a/src/parser/on_indentation.i b/src/parser/on_indentation.i @@ -0,0 +1,57 @@ +/* (C) 2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__ON_INDENTATION_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__ON_INDENTATION_I + +QUEX_NAMESPACE_MAIN_OPEN + +#include "token-sending" +#include "analyzerCounter" + +QUEX_INLINE __QUEX_TYPE_ANALYZER_RETURN_VALUE +QUEX_NAME(on_indentation)(QUEX_TYPE_ANALYZER* me, + QUEX_TYPE_INDENTATION Indentation, + QUEX_TYPE_LEXATOM* Begin) +{ +# define self (*me) + QUEX_NAME(IndentationStack)* stack = &me->counter._indentation_stack; +# if defined(QUEX_OPTION_TOKEN_POLICY_SINGLE) + register QUEX_TYPE_TOKEN_ID __self_result_token_id + = (QUEX_TYPE_TOKEN_ID)__QUEX_SETTING_TOKEN_ID_UNINITIALIZED; +# endif + __QUEX_IF_TOKEN_REPETITION_SUPPORT(QUEX_TYPE_INDENTATION* start = 0); + (void)Begin; + + if( Indentation > *(stack->back) ) { + self_send(__QUEX_SETTING_TOKEN_ID_INDENT); + ++(stack->back); + if( stack->back == stack->memory_end ) QUEX_ERROR_EXIT("Indentation stack overflow."); + *(stack->back) = Indentation; + __QUEX_RETURN; + } + else if( Indentation == *(stack->back) ) { + self_send(__QUEX_SETTING_TOKEN_ID_NODENT); + } + else { + __QUEX_IF_TOKEN_REPETITION_SUPPORT(start = stack->back); + /* From Above: (NOT Indentation > *back) and (NOT Indentation == *back), + * Thus: Indentation < *back. */ + do { + __QUEX_IF_TOKEN_REPETITION_SUPPORT_DISABLED(self_send(__QUEX_SETTING_TOKEN_ID_DEDENT)); + --(stack->back); + } while( Indentation < *(stack->back) ); + + if( Indentation == *(stack->back) ) { /* 'Landing' must happen on indentation border. */ + __QUEX_IF_TOKEN_REPETITION_SUPPORT(self_send_n((size_t)(start - stack->back), + __QUEX_SETTING_TOKEN_ID_DEDENT)); + } else { + QUEX_ERROR_EXIT("Indentation Error"); + } + } + __QUEX_RETURN; +# undef self +} +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__ON_INDENTATION_I */ + diff --git a/src/parser/parser.c b/src/parser/parser.c @@ -0,0 +1,958 @@ +// TO READ THIS FILE: +// see grammar.txt +// see the stateFt STATEF[FINAL] array +// and see the functions + +#include "parser.h" + +// TODO remove global variables to be able to run multithreaded +int stateM = IDLE; + +smallArrayt *generatedC = NULL; +smallArrayt *sheepyC = NULL; +smallArrayt *stateStack = NULL; +smallArrayt *textStack = NULL; + +char *STATESSTR[FINAL] = { + "IDLE", + "TYPE", + "TYPEID", + "POINTERTYPE", + "TYPEINIT", + "TYPEINITSTR", + "TYPEEND", + "CONST_", + "EXTERN_", + "VOLATILE_", + "STATIC_", + "UNSIGNED_", + "SIGNED_", + "ENUM_", + "ENUM_END", + "TYPEDEF_", + "TDSTRUCT", + "STRUCTBLOCK", + "STRUCTINBLOCK", + "UNIONINSTRUCT", + "STRUCTTYPE", + "STRUCTTYPEID", + "STRUCTTYPEEND", + "STRUCTID", + "STRUCTBLOCKEND", + "UNIONBLOCK", + "STRUCTINUNION", + "UNIONINBLOCK", + "UNIONTYPE", + "UNIONTYPEID", + "UNIONTYPEEND", + "UNIONID", + "UNIONBLOCKEND", + "FUNCOPEN", + "FUNCCLOSE", + "PROTOTYPE", + "CODEBLOCK", + "CONTINUE_", + "CODEBLOCKID", + "CALL", + "CALLSTR", + "CALLCLOSE", + "CALLEND", + "CALLENDNPOP", + "INCREMENT", + "GOTO_", + "GOTO_ID", + "GOTO_END", + "GOTO_ENDNPOP", + "COLON", + "COLONEND", + "ARRAYINDEX", + "ARRAYINDEXEND", + "ASSIGNMENT", + "NUMBER", + "ASSIGNID", + "QUOTED_CHAR", + "QUOTED_CHAR_SEMICOLON", + "SIZEOF_", + "IF_", + "ELSE_", + "FOR_", + "DO_", + "SWITCH_", + "SWITCH_BLOCK", + "CASE_", + "CASE_ID", + "CASE_BLOCK", + "BREAK_", + "SWITCH_BLOCKEND", + "RETURN_", + "RETURN_STR", + "RETURN_END", + "CODEBLOCKEND", + "DO_END", + "DO_FOR", + "DO_CLOSE", + "USE", + "USEID", + "USEDOT", + "USECOMMA", + "USEEND", +}; + +// extra -1 -1 to run a default function when a token is not found +int STATES[FINAL][TRANSITIONS*2] = { +/*IDLE*/ {QUEX_TKN_PP_USE, USE, QUEX_TKN_CONST, CONST_, QUEX_TKN_TYPE_INT, TYPE, QUEX_TKN_TYPE_VOID, TYPE, QUEX_TKN_EXTERN, EXTERN_, QUEX_TKN_ENUM, ENUM_, QUEX_TKN_TYPE, TYPEDEF_, -1, -1}, +/*TYPE*/ {QUEX_TKN_IDENTIFIER, TYPEID, QUEX_TKN_MULT, POINTERTYPE, -1, -1}, +/*TYPEID*/ {QUEX_TKN_BRACKET_O, FUNCOPEN, QUEX_TKN_NODENT, TYPEEND, QUEX_TKN_OP_ASSIGNMENT, TYPEINIT, -1, -1}, +/*POINTERTYPE*/ {QUEX_TKN_IDENTIFIER, TYPEID, -1, -1}, +/*TYPEINIT*/ {QUEX_TKN_STRING, TYPEINITSTR, QUEX_TKN_NODENT, TYPEEND, -1, -1}, +/*TYPEINITSTR*/ {-1, -1, -1, -1}, +/*TYPEEND*/ {-1, -1, -1, -1}, +/*CONST_*/ {QUEX_TKN_TYPE_CHAR, TYPE, -1, -1}, +/*EXTERN_*/ {QUEX_TKN_TYPE_INT, TYPE, -1, -1}, +/*VOLATILE_*/ {QUEX_TKN_TYPE_INT, TYPE, -1, -1}, +/*STATIC_*/ {QUEX_TKN_TYPE_INT, TYPE, QUEX_TKN_TYPE_UNSIGNED, UNSIGNED_, -1, -1}, +/*UNSIGNED_*/ {QUEX_TKN_TYPE_LONG, TYPE, -1, -1}, +/*SIGNED_*/ {QUEX_TKN_TYPE_SHORT, TYPE, -1, -1}, +/*ENUM_*/ {QUEX_TKN_NODENT, ENUM_END, -1, -1}, +/*ENUM_END*/ {-1, -1, -1, -1}, +/*TYPEDEF_*/ {QUEX_TKN_STRUCT, TDSTRUCT, -1, -1}, +/*TDSTRUCT*/ {QUEX_TKN_INDENT, STRUCTBLOCK, -1, -1}, +/*STRUCTBLOCK*/ {QUEX_TKN_TYPE_INT, STRUCTTYPE, QUEX_TKN_IDENTIFIER, STRUCTID, QUEX_TKN_STRUCT, STRUCTINBLOCK, QUEX_TKN_UNION, UNIONINSTRUCT, -1, -1}, +/*STRUCTINBLOCK*/ {QUEX_TKN_INDENT, STRUCTBLOCK, -1, -1}, +/*UNIONINSTRUCT*/ {QUEX_TKN_INDENT, UNIONBLOCK, -1, -1}, +/*STRUCTTYPE*/ {QUEX_TKN_IDENTIFIER, STRUCTTYPEID, -1, -1}, +/*STRUCTTYPEID*/ {QUEX_TKN_NODENT, STRUCTTYPEEND, -1, -1}, +/*STRUCTTYPEEND*/ {-1, -1, -1, -1}, +/*STRUCTID*/ {QUEX_TKN_DEDENT, STRUCTBLOCKEND, -1, -1}, +/*STRUCTBLOCKEND*/ {-1, -1, -1, -1}, +/*UNIONBLOCK*/ {QUEX_TKN_TYPE_CHAR, UNIONTYPE, QUEX_TKN_TYPE_INT, UNIONTYPE, QUEX_TKN_IDENTIFIER, UNIONID, QUEX_TKN_STRUCT, STRUCTINUNION, QUEX_TKN_UNION, UNIONINBLOCK, -1, -1}, +/*STRUCTINUNION*/ {QUEX_TKN_INDENT, STRUCTBLOCK, -1, -1}, +/*UNIONINBLOCK*/ {QUEX_TKN_INDENT, UNIONBLOCK, -1, -1}, +/*UNIONTYPE*/ {QUEX_TKN_IDENTIFIER, UNIONTYPEID, -1, -1}, +/*UNIONTYPEID*/ {QUEX_TKN_NODENT, UNIONTYPEEND, -1, -1}, +/*UNIONTYPEEND*/ {-1, -1, -1, -1}, +/*UNIONID*/ {QUEX_TKN_DEDENT, UNIONBLOCKEND, -1, -1}, +/*UNIONBLOCKEND*/ {-1, -1, -1, -1}, +/*FUNCOPEN*/ {QUEX_TKN_BRACKET_C, FUNCCLOSE, -1, -1}, +/*FUNCCLOSE*/ {QUEX_TKN_INDENT, CODEBLOCK, QUEX_TKN_NODENT, PROTOTYPE, -1, -1}, +/*PROTOTYPE*/ {-1, -1, -1, -1}, +/*CODEBLOCK*/ {QUEX_TKN_CONST, CONST_, QUEX_TKN_CONTINUE, CONTINUE_, QUEX_TKN_VOLATILE, VOLATILE_, QUEX_TKN_STATIC, STATIC_, QUEX_TKN_TYPE_SIGNED, SIGNED_, QUEX_TKN_TYPE_CHAR, TYPE, QUEX_TKN_TYPE_DOUBLE, TYPE, QUEX_TKN_TYPE_FLOAT, TYPE, QUEX_TKN_TYPE_INT, TYPE, QUEX_TKN_IDENTIFIER, CODEBLOCKID, QUEX_TKN_DO, DO_, QUEX_TKN_ELSE, ELSE_, QUEX_TKN_FOR, FOR_, QUEX_TKN_GOTO, GOTO_, QUEX_TKN_IF, IF_, QUEX_TKN_RETURN, RETURN_, QUEX_TKN_SWITCH, SWITCH_, QUEX_TKN_DEDENT, CODEBLOCKEND, -1, -1}, +/*CONTINUE_*/ {QUEX_TKN_DEDENT, CODEBLOCKEND, -1, -1}, +/*CODEBLOCKID*/ {QUEX_TKN_BRACKET_O, CALL, QUEX_TKN_COLON, COLON, QUEX_TKN_CORNER_BRACKET_O, ARRAYINDEX, QUEX_TKN_OP_ASSIGNMENT, ASSIGNMENT, QUEX_TKN_INCREMENT, INCREMENT, -1, -1}, +/*CALL*/ {QUEX_TKN_STRING, CALLSTR, QUEX_TKN_BRACKET_C, CALLCLOSE, -1, -1}, +/*CALLSTR*/ {-1, -1, -1, -1}, +/*CALLCLOSE*/ {QUEX_TKN_NODENT, CALLEND, QUEX_TKN_DEDENT, CALLENDNPOP, -1, -1}, +/*CALLEND*/ {-1, -1, -1, -1}, +/*CALLENDNPOP*/ {-1, -1, -1, -1}, +/*INCREMENT*/ {QUEX_TKN_NODENT, CALLEND, QUEX_TKN_DEDENT, CALLENDNPOP, -1, -1}, +/*GOTO_*/ {QUEX_TKN_IDENTIFIER, GOTO_ID, -1, -1}, +/*GOTO_ID*/ {QUEX_TKN_NODENT, GOTO_END, QUEX_TKN_DEDENT, GOTO_ENDNPOP, -1, -1}, +/*GOTO_END*/ {-1, -1, -1, -1}, +/*GOTO_ENDNPOP*/ {-1, -1, -1, -1}, +/*COLON*/ {QUEX_TKN_NODENT, COLONEND, -1, -1}, +/*COLONEND*/ {-1, -1, -1, -1}, +/*ARRAYINDEX*/ {QUEX_TKN_CORNER_BRACKET_C, ARRAYINDEXEND, -1, -1}, +/*ARRAYINDEXEND*/ {QUEX_TKN_OP_ASSIGNMENT, ASSIGNMENT, -1, -1}, +/*ASSIGNMENT*/ {QUEX_TKN_NUMBER, NUMBER, QUEX_TKN_QUOTED_CHAR, QUOTED_CHAR, QUEX_TKN_SIZEOF, SIZEOF_, QUEX_TKN_IDENTIFIER, ASSIGNID, -1, -1}, +/*NUMBER*/ {QUEX_TKN_NODENT, CALLEND, QUEX_TKN_DEDENT, CALLENDNPOP, -1, -1}, +/*ASSIGNID*/ {QUEX_TKN_BRACKET_O, CALL, -1, -1}, +/*QUOTED_CHAR*/ {QUEX_TKN_SEMICOLON, QUOTED_CHAR_SEMICOLON, QUEX_TKN_NODENT, CALLEND, -1, -1}, +/*QUOTED_CHAR_SEMICOLON*/ {QUEX_TKN_NODENT, CALLEND, -1, -1}, +/*SIZEOF_*/ {QUEX_TKN_BRACKET_O, CALL, -1, -1}, +/*IF_*/ {QUEX_TKN_INDENT, CODEBLOCK, -1, -1}, +/*ELSE_*/ {QUEX_TKN_INDENT, CODEBLOCK, -1, -1}, +/*FOR_*/ {QUEX_TKN_INDENT, CODEBLOCK, -1, -1}, +/*DO_*/ {QUEX_TKN_INDENT, CODEBLOCK, -1, -1}, +/*SWITCH_*/ {QUEX_TKN_INDENT, SWITCH_BLOCK, -1, -1}, +/*SWITCH_BLOCK*/ {QUEX_TKN_CASE, CASE_, QUEX_TKN_DEFAULT, CASE_ID, QUEX_TKN_DEDENT, SWITCH_BLOCKEND, -1, -1}, +/*CASE_*/ {QUEX_TKN_IDENTIFIER, CASE_ID, QUEX_TKN_NUMBER, CASE_ID, -1, -1}, +/*CASE_ID*/ {QUEX_TKN_INDENT, CASE_BLOCK, -1, -1}, +/*CASE_BLOCK*/ {QUEX_TKN_IDENTIFIER, CODEBLOCKID, QUEX_TKN_BREAK, BREAK_, QUEX_TKN_DO, DO_, QUEX_TKN_ELSE, ELSE_, QUEX_TKN_FOR, FOR_, QUEX_TKN_GOTO, GOTO_, QUEX_TKN_IF, IF_, QUEX_TKN_RETURN, RETURN_, QUEX_TKN_SWITCH, SWITCH_, QUEX_TKN_DEDENT, CODEBLOCKEND, -1, -1}, +/*BREAK_*/ {QUEX_TKN_DEDENT, CODEBLOCKEND, -1, -1}, +/*SWITCH_BLOCKEND*/ {-1, -1, -1, -1}, +/*RETURN_*/ {QUEX_TKN_STRING, RETURN_STR, QUEX_TKN_DEDENT, RETURN_END, -1, -1}, +/*RETURN_STR*/ {-1, -1, -1, -1}, +/*RETURN_END*/ {-1, -1, -1, -1}, +/*CODEBLOCKEND*/ {-1, -1, -1, -1}, +/*DO_END*/ {QUEX_TKN_FOR, DO_FOR, -1, -1}, +/*DO_FOR*/ {QUEX_TKN_NODENT, DO_CLOSE, -1, -1}, +/*DO_CLOSE*/ {-1, -1, -1, -1}, +/*USE*/ {QUEX_TKN_IDENTIFIER, USEID, -1, -1}, +/*USEID*/ {QUEX_TKN_DOT, USEDOT, QUEX_TKN_COMMA, USECOMMA, QUEX_TKN_NODENT, USEEND, -1, -1}, +/*USEDOT*/ {QUEX_TKN_IDENTIFIER, USEID, -1, -1}, +/*USECOMMA*/ {QUEX_TKN_IDENTIFIER, USEID, -1, -1}, +/*USEEND*/ {-1, -1, -1, -1}, +}; + +void toCString(char *text) { + // convert to C string + char *tmp = dupS(text); + setS(tmp, 0, '\"'); + setS(tmp, -1, '\"'); + // TODO regular expression + iReplaceS_max(&tmp, "\'", "'"); + pushNFreeG(sheepyC, tmp); + return; +} + +void generateCodeL() { + smallStringt *tmp = joinG(sheepyC, ""); + pushNFreeG(generatedC, tmp); + freeG(sheepyC); + //initiateAllocateSmallString(&sheepyC); +} + +void defaultInState(int ste, char *text) { + //printf("%s %s %s\n",__func__,STATESSTR[ste], text); +} + +void defaultInStateCopy(int ste, char *text) { + pushG(sheepyC, " "); + pushG(sheepyC, text); +} + +void idle(int ste, char *text) { +} + +void type(int ste, char *text) { + pushG(sheepyC, " "); + pushG(sheepyC, text); + // set next state + pushG(stateStack, stateM); + stateM = ste; +} + +void typeid(int ste, char *text) { + // set next state + stateM = ste; +} + +void pointertype(int ste, char *text) { + // set next state + stateM = ste; +} + +void typeinit(int ste, char *text) { + // set next state + stateM = ste; +} + +void typeinitstr(int ste, char *text) { + toCString(text); + // set next state + stateM = TYPEINIT; +} + +void typeend(int ste, char *text) { + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + stateM = popG(stateStack, rtInt32_t); + if ((stateM == IDLE)||(stateM == CODEBLOCK)||(stateM == CASE_BLOCK)) { + return; + } + if (stateM == EXTERN_) { + stateM = IDLE; + return; + } + // TODO pop until block is found + stateM = popG(stateStack, rtInt32_t); + if ((stateM == CODEBLOCK)||(stateM == CASE_BLOCK)) { + return; + } + stateM = popG(stateStack, rtInt32_t); +} + +void extern_(int ste, char *text) { + // set next state + stateM = ste; +} + +void volatile_(int ste, char *text) { + // set next state + stateM = ste; +} + +void static_(int ste, char *text) { + // set next state + stateM = ste; +} + +void unsigned_(int ste, char *text) { + // set next state + stateM = ste; +} + +void signed_(int ste, char *text) { + // set next state + stateM = ste; +} + +void enum_(int ste, char *text) { + pushG(sheepyC, "enum {"); + // set next state + stateM = ste; +} + +void enum_end(int ste, char *text) { + pushG(sheepyC, "};"); + generateCodeL(); + // set next state + stateM = IDLE; +} + +void typedef_(int ste, char *text) { + pushG(sheepyC, "typedef"); + // set next state + stateM = ste; +} + +void tdstruct(int ste, char *text) { + // set next state + stateM = ste; +} + +void structblock(int ste, char *text) { + pushG(sheepyC, " {"); + generateCodeL(); + pushG(stateStack, stateM); + // set next state + stateM = ste; +} + +void structinblock(int ste, char *text) { + // set next state + stateM = ste; +} + +void unioninstruct(int ste, char *text) { + // set next state + stateM = ste; +} + +void structtype(int ste, char *text) { + // set next state + stateM = ste; +} + +void structtypeid(int ste, char *text) { + // set next state + stateM = ste; +} + +void structtypeend(int ste, char *text) { + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + stateM = STRUCTBLOCK; +} + +void structid(int ste, char *text) { + pushG(textStack, text); + // set next state + stateM = ste; +} + +void structblockend(int ste, char *text) { + char *id = popG(textStack, rtChar); + pushG(sheepyC, "} "); + pushNFreeG(sheepyC, id); + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + stateM = popG(stateStack, rtInt32_t); + switch(stateM) { + case TDSTRUCT: + stateM = IDLE; + break; + case STRUCTINBLOCK: + stateM = STRUCTBLOCK; + break; + case STRUCTINUNION: + stateM = UNIONBLOCK; + break; + } +} + +void unionblock(int ste, char *text) { + // set next state + stateM = ste; +} + +void structinunion(int ste, char *text) { + // set next state + stateM = ste; +} + +void unioninblock(int ste, char *text) { + // set next state + stateM = ste; +} + +void uniontype(int ste, char *text) { + // set next state + stateM = ste; +} + +void uniontypeid(int ste, char *text) { + // set next state + stateM = ste; +} + +void uniontypeend(int ste, char *text) { + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + stateM = UNIONBLOCK; +} + +void unionid(int ste, char *text) { + // set next state + stateM = ste; +} + +void unionblockend(int ste, char *text) { + char *id = popG(textStack, rtChar); + pushG(sheepyC, "} "); + pushNFreeG(sheepyC, id); + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + stateM = popG(stateStack, rtInt32_t); + switch(stateM) { + /* case TDUNION: */ + /* stateM = IDLE; */ + /* break; */ + case UNIONINBLOCK: + stateM = UNIONBLOCK; + break; + case UNIONINSTRUCT: + stateM = STRUCTBLOCK; + break; + } +} + +void funcopen(int ste, char *text) { + // set next state + stateM = ste; +} + +void funcclose(int ste, char *text) { + // do nothing the bracket ) and curly bracket are in the + // codeblock function + // set next state + stateM = ste; +} + +void prototype(int ste, char *text) { + pushG(sheepyC, ");"); + generateCodeL(); + // set next state + stateM = IDLE; +} + +void codeblock(int ste, char *text) { + if ((stateM == DO_)||(stateM == ELSE_)) { + pushG(sheepyC, " {"); + } + else { + // close condition statement + pushG(sheepyC, ") {"); + } + generateCodeL(); + pushG(stateStack, stateM); + // set next state + stateM = ste; +} + +void codeblockid(int ste, char *text) { + pushG(sheepyC, text); + // set next state + pushG(stateStack, stateM); + stateM = ste; +} + +void call(int ste, char *text) { + pushG(sheepyC, "("); + // set next state + stateM = ste; +} + +void callstr(int ste, char *text) { + toCString(text); + // set next state + stateM = CALL; +} + +void callclose(int ste, char *text) { + pushG(sheepyC, ")"); + // set next state + stateM = ste; +} + +void callend(int ste, char *text) { + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + // pop to return to CODEBLOCK or CASE_BLOCK + stateM = popG(stateStack, rtInt32_t); +} + +void callendnpop(int ste, char *text) { + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + // pop to return to CODEBLOCK or CASE_BLOCK + stateM = popG(stateStack, rtInt32_t); + codeblockend(ste, text); +} + +void increment(int ste, char *text) { + // set next state + stateM = ste; +} + +void goto_(int ste, char *text) { + // set next state + stateM = ste; +} + +void goto_id(int ste, char *text) { + // set next state + stateM = ste; +} + +void goto_end(int ste, char *text) { + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + stateM = CODEBLOCK; +} + +void goto_endnpop(int ste, char *text) { + pushG(sheepyC, ";"); + generateCodeL(); + // set next state + codeblockend(ste, text); +} + +void colon(int ste, char *text) { + pushG(sheepyC, ":"); + generateCodeL(); + // set next state + // pop stateM pushed in codeblockid + // discard because goto labels are always in codeblocks + popG(stateStack, rtInt32_t); + stateM = ste; +} + +void colonend(int ste, char *text) { + // set next state + stateM = CODEBLOCK; +} + +void arrayindex(int ste, char *text) { + // set next state + stateM = ste; +} + +void arrayindexend(int ste, char *text) { + // set next state + stateM = ste; +} + +void assignment(int ste, char *text) { + // set next state + stateM = ste; +} + +void quoted_char(int ste, char *text) { + // convert to C char + text = dupS(text); + iReplaceS(&text, "'", "\\'", 1); + setS(text, 0, '\''); + iAppendS(&text, "'"); + iReplaceS(&text, "\\@", "@", 1); + pushNFreeG(sheepyC, text); + // set next state + stateM = ste; +} + +void quoted_char_semicolon(int ste, char *text) { + // change last string in sheepyC + // add space in char + // tabs should be \t + smallStringt *txt = getG(sheepyC, rtSmallStringt, -1); + setG(txt, 1, ' '); + pushG(txt, "'"); + // pointer in sheepyC should be updated with setPG sheepyC + // but this string is always short + // the pointer doesn't change + smashG(txt); + // set next state + stateM = ste; +} + +void sizeof_(int ste, char *text) { + // set next state + stateM = ste; +} + +void assignmentend(int ste, char *text) { + // set next state + stateM = ste; +} + +void if_(int ste, char *text) { + pushG(sheepyC, text); + pushG(sheepyC, " ("); + // set next state + stateM = ste; +} + +void else_(int ste, char *text) { + // set next state + stateM = ste; +} + +void for_(int ste, char *text) { + // set next state + stateM = ste; +} + +void do_(int ste, char *text) { + // set next state + stateM = ste; +} + +void switch_(int ste, char *text) { + // set next state + stateM = ste; +} + +void switch_block(int ste, char *text) { + pushG(sheepyC, ") {"); + generateCodeL(); + // TODO push stateM >> use structblock function + // set next state + stateM = ste; +} + +void case_(int ste, char *text) { + // set next state + stateM = ste; +} + +void case_id(int ste, char *text) { + // set next state + stateM = ste; +} + +void case_block(int ste, char *text) { + // add curly brackets around code for case labels + pushG(sheepyC, ": {"); + generateCodeL(); + pushG(stateStack, stateM); + // set next state + stateM = ste; +} + +void break_(int ste, char *text) { + pushG(sheepyC, text); + pushG(sheepyC, ";"); + // set next state + stateM = ste; +} + +void switch_blockend(int ste, char *text) { + pushG(sheepyC, "}"); + // TODO pop stateM + // set next state + stateM = CODEBLOCK; +} + +void return_(int ste, char *text) { + // set next state + stateM = ste; +} + +void return_str(int ste, char *text) { + // convert to C string + toCString(text); + // set next state + stateM = RETURN_; +} + +void return_end(int ste, char *text) { + // when return doesnt have parameters + // replace bracket with semicolon + char *tmp = getG(sheepyC, rtChar, -1); + if (getS(tmp, -1) == '(') { + setS(tmp, -1, ';'); + } + else { + pushG(sheepyC, ");"); + } + generateCodeL(); + // set next state + stateM = CODEBLOCKEND; + codeblockend(ste, text); +} + +void codeblockend(int ste, char *text) { + pushG(sheepyC, "}"); + // set next state + stateM = popG(stateStack, rtInt32_t); + switch(stateM) { + case FUNCCLOSE: + generateCodeL(); + stateM = IDLE; + break; + case IF_: + generateCodeL(); + stateM = CODEBLOCK; + break; + case ELSE_: + generateCodeL(); + stateM = CODEBLOCK; + break; + case FOR_: + generateCodeL(); + stateM = CODEBLOCK; + break; + case DO_: + // dont generate code because the conditional + // statement is after that + stateM = DO_END; + break; + case CASE_ID: + generateCodeL(); + stateM = SWITCH_BLOCK; + break; + } +} + +void do_end(int ste, char *text) { + // set next state + stateM = ste; +} + +void do_for(int ste, char *text) { + pushG(sheepyC, " while ("); + // set next state + stateM = ste; +} + +void do_close(int ste, char *text) { + pushG(sheepyC, ");"); + generateCodeL(); + // set next state + stateM = CODEBLOCK; +} + +void use(int ste, char *text) { + pushG(sheepyC, "#include \""); + // set next state + stateM = ste; +} + +void addT(int ste, char *text) { + pushG(sheepyC, text); + // set next state + stateM = ste; +} + +void usecomma(int ste, char *text) { + pushG(sheepyC, "\""); + generateCodeL(); + // expecting more use + use(ste, text); +} + +void useend(int ste, char *text) { + pushG(sheepyC, "\""); + generateCodeL(); + stateM = IDLE; +} + +void addSpaceNT(int ste, char *text) { + pushG(sheepyC, " "); + pushG(sheepyC, text); + // set next state + stateM = ste; +} + + +// ste is the state it is transitioning to +// text is the token +typedef void (*stateFt)(int ste, char *text); +stateFt STATEF[FINAL] = { +/*IDLE*/ idle, +/*TYPE*/ type, +/*TYPEID*/ addSpaceNT, +/*POINTERTYPE*/ addSpaceNT, +/*TYPEINIT*/ addT, +/*TYPEINITSTR*/ typeinitstr, +/*TYPEEND*/ typeend, +/*CONST_*/ type, +/*EXTERN_*/ addSpaceNT, +/*VOLATILE_*/ type, +/*STATIC_*/ type, +/*UNSIGNED_*/ type, +/*SIGNED_*/ type, +/*ENUM_*/ enum_, +/*ENUM_END*/ enum_end, +/*TYPEDEF_*/ typedef_, +/*TDSTRUCT*/ addSpaceNT, +/*STRUCTBLOCK*/ structblock, +/*STRUCTINBLOCK*/ addT, +/*UNIONINSTRUCT*/ addT, +/*STRUCTTYPE*/ addSpaceNT, +/*STRUCTTYPEID*/ addSpaceNT, +/*STRUCTTYPEEND*/ structtypeend, +/*STRUCTID*/ structid, +/*STRUCTBLOCKEND*/ structblockend, +/*UNIONBLOCK*/ structblock, +/*STRUCTINUNION*/ addT, +/*UNIONINBLOCK*/ addT, +/*UNIONTYPE*/ addSpaceNT, +/*UNIONTYPEID*/ addSpaceNT, +/*UNIONTYPEEND*/ uniontypeend, +/*UNIONID*/ structid, +/*UNIONBLOCKEND*/ unionblockend, +/*FUNCOPEN*/ addSpaceNT, +/*FUNCCLOSE*/ funcclose, +/*PROTOTYPE*/ prototype, +/*CODEBLOCK*/ codeblock, +/*CONTINUE_*/ break_, +/*CODEBLOCKID*/ codeblockid, +/*CALL*/ call, +/*CALLSTR*/ callstr, +/*CALLCLOSE*/ callclose, +/*CALLEND*/ callend, +/*CALLENDNPOP*/ callendnpop, +/*INCREMENT*/ addT, +/*GOTO_*/ addT, +/*GOTO_ID*/ addSpaceNT, +/*GOTO_END*/ goto_end, +/*GOTO_ENDNPOP*/ goto_endnpop, +/*COLON*/ colon, +/*COLONEND*/ colonend, +/*ARRAYINDEX*/ addT, +/*ARRAYINDEXEND*/ addT, +/*ASSIGNMENT*/ addSpaceNT, +/*NUMBER*/ addSpaceNT, +/*ASSIGNID*/ addT, +/*QUOTED_CHAR*/ quoted_char, +/*QUOTED_CHAR_SEMICOLON*/ quoted_char_semicolon, +/*SIZEOF_*/ addT, +/*IF_*/ if_, +/*ELSE_*/ addT, +/*FOR_*/ if_, +/*DO_*/ addT, +/*SWITCH_*/ if_, +/*SWITCH_BLOCK*/ switch_block, +/*CASE_*/ addT, +/*CASE_ID*/ addSpaceNT, +/*CASE_BLOCK*/ case_block, +/*BREAK_*/ break_, +/*SWITCH_BLOCKEND*/ switch_blockend, +/*RETURN_*/ if_, +/*RETURN_STR*/ return_str, +/*RETURN_END*/ return_end, +/*CODEBLOCKEND*/ codeblockend, +/*DO_END*/ do_end, +/*DO_FOR*/ do_for, +/*DO_CLOSE*/ do_close, +/*USE*/ use, +/*USEID*/ addT, +/*USEDOT*/ addT, +/*USECOMMA*/ usecomma, +/*USEEND*/ useend, +}; + +stateFt STATEDEFAULTF[FINAL] = { +/*IDLE*/ idle, +/*TYPE*/ defaultInState, +/*TYPEID*/ defaultInState, +/*POINTERTYPE*/ defaultInState, +/*TYPEINIT*/ defaultInStateCopy, +/*TYPEINITSTR*/ defaultInState, +/*TYPEEND*/ defaultInState, +/*CONST_*/ defaultInState, +/*EXTERN_*/ defaultInState, +/*VOLATILE_*/ defaultInState, +/*STATIC_*/ defaultInState, +/*UNSIGNED_*/ defaultInState, +/*SIGNED_*/ defaultInState, +/*ENUM_*/ defaultInStateCopy, +/*ENUM_END*/ defaultInState, +/*TYPEDEF_*/ defaultInState, +/*TDSTRUCT*/ defaultInState, +/*STRUCTBLOCK*/ defaultInState, +/*STRUCTINBLOCK*/ defaultInState, +/*UNIONINSTRUCT*/ defaultInState, +/*STRUCTTYPE*/ defaultInState, +/*STRUCTTYPEID*/ defaultInState, +/*STRUCTTYPEEND*/ defaultInState, +/*STRUCTID*/ defaultInState, +/*STRUCTBLOCKEND*/ defaultInState, +/*UNIONBLOCK*/ defaultInState, +/*STRUCTINUNION*/ defaultInState, +/*UNIONINBLOCK*/ defaultInState, +/*UNIONTYPE*/ defaultInState, +/*UNIONTYPEID*/ defaultInState, +/*UNIONTYPEEND*/ defaultInState, +/*UNIONID*/ defaultInState, +/*UNIONBLOCKEND*/ defaultInState, +/*FUNCOPEN*/ defaultInStateCopy, +/*FUNCCLOSE*/ defaultInState, +/*PROTOTYPE*/ defaultInState, +/*CODEBLOCK*/ defaultInState, +/*CONTINUE_*/ defaultInState, +/*CODEBLOCKID*/ defaultInState, +/*CALL*/ defaultInStateCopy, +/*CALLSTR*/ defaultInState, +/*CALLCLOSE*/ defaultInState, +/*CALLEND*/ defaultInState, +/*CALLENDNPOP*/ defaultInState, +/*INCREMENT*/ defaultInState, +/*GOTO_*/ defaultInState, +/*GOTO_ID*/ defaultInState, +/*GOTO_END*/ defaultInState, +/*GOTO_ENDNPOP*/ defaultInState, +/*COLON*/ defaultInState, +/*COLONEND*/ defaultInState, +/*ARRAYINDEX*/ defaultInStateCopy, +/*ARRAYINDEXEND*/ defaultInState, +/*ASSIGNMENT*/ defaultInState, +/*NUMBER*/ defaultInState, +/*ASSIGNID*/ defaultInState, +/*QUOTED_CHAR*/ defaultInState, +/*QUOTED_CHAR_SEMICOLON*/ defaultInState, +/*SIZEOF_*/ defaultInState, +/*IF_*/ defaultInStateCopy, +/*ELSE_*/ defaultInState, +/*FOR_*/ defaultInStateCopy, +/*DO_*/ defaultInState, +/*SWITCH_*/ defaultInStateCopy, +/*SWITCH_BLOCK*/ defaultInState, +/*CASE_*/ defaultInState, +/*CASE_ID*/ defaultInState, +/*CASE_BLOCK*/ defaultInState, +/*BREAK_*/ defaultInState, +/*SWITCH_BLOCKEND*/ defaultInState, +/*RETURN_*/ defaultInStateCopy, +/*RETURN_STR*/ defaultInState, +/*RETURN_END*/ defaultInState, +/*CODEBLOCKEND*/ defaultInState, +/*DO_END*/ defaultInState, +/*DO_FOR*/ defaultInStateCopy, +/*DO_CLOSE*/ defaultInState, +/*USE*/ defaultInState, +/*USEID*/ defaultInState, +/*USEDOT*/ defaultInState, +/*USECOMMA*/ defaultInState, +/*USEEND*/ defaultInState, +}; + diff --git a/src/parser/parser.h b/src/parser/parser.h @@ -0,0 +1,118 @@ +#ifndef PARSERH +#define PARSERH + +#include "EasyLexer.h" +#include "libsheepyObject.h" + +// FINAL is the state count for the array definitions +enum {IDLE,TYPE,TYPEID,POINTERTYPE,TYPEINIT,TYPEINITSTR,TYPEEND,CONST_,EXTERN_,VOLATILE_,STATIC_,UNSIGNED_,SIGNED_,ENUM_,ENUM_END,TYPEDEF_,TDSTRUCT,STRUCTBLOCK,STRUCTINBLOCK,UNIONINSTRUCT,STRUCTTYPE,STRUCTTYPEID,STRUCTTYPEEND,STRUCTID,STRUCTBLOCKEND,UNIONBLOCK,STRUCTINUNION,UNIONINBLOCK,UNIONTYPE,UNIONTYPEID,UNIONTYPEEND,UNIONID,UNIONBLOCKEND,FUNCOPEN,FUNCCLOSE,PROTOTYPE,CODEBLOCK,CONTINUE_,CODEBLOCKID,CALL,CALLSTR,CALLCLOSE,CALLEND,CALLENDNPOP,INCREMENT,GOTO_,GOTO_ID,GOTO_END,GOTO_ENDNPOP,COLON,COLONEND,ARRAYINDEX,ARRAYINDEXEND,ASSIGNMENT,NUMBER,ASSIGNID,QUOTED_CHAR,QUOTED_CHAR_SEMICOLON,SIZEOF_,IF_,ELSE_,FOR_,DO_,SWITCH_,SWITCH_BLOCK,CASE_,CASE_ID,CASE_BLOCK,BREAK_,SWITCH_BLOCKEND,RETURN_,RETURN_STR,RETURN_END,CODEBLOCKEND,DO_END,DO_FOR,DO_CLOSE,USE,USEID,USEDOT,USECOMMA,USEEND,FINAL}; + +extern int stateM; + +extern smallArrayt *generatedC; +extern smallArrayt *sheepyC; +extern smallArrayt *stateStack; +extern smallArrayt *textStack; + +extern char *STATESSTR[FINAL]; + +#define TRANSITIONS 19 + +extern int STATES[FINAL][TRANSITIONS*2]; + +#define stateTkn(ste) STATES[stateM][ste*2] +#define stateNxt(ste) STATES[stateM][ste*2+1] +#define callNxt(ste) STATEF[stateNxt(ste)](stateNxt(ste), text) + +void defaultInState(int ste, char *text); +void idle(int ste, char *text); +void type(int ste, char *text); +void typeid(int ste, char *text); +void pointertype(int ste, char *text); +void typeinit(int ste, char *text); +void typeinitstr(int ste, char *text); +void typeend(int ste, char *text); +void const_(int ste, char *text); +void extern_(int ste, char *text); +void volatile_(int ste, char *text); +void static_(int ste, char *text); +void unsigned_(int ste, char *text); +void signed_(int ste, char *text); +void enum_(int ste, char *text); +void enum_end(int ste, char *text); +void typedef_(int ste, char *text); +void tdstruct(int ste, char *text); +void structblock(int ste, char *text); +void structinblock(int ste, char *text); +void unioninstruct(int ste, char *text); +void structtype(int ste, char *text); +void structtypeid(int ste, char *text); +void structtypeend(int ste, char *text); +void structid(int ste, char *text); +void structblockend(int ste, char *text); +void unionblock(int ste, char *text); +void structinunion(int ste, char *text); +void unioninblock(int ste, char *text); +void uniontype(int ste, char *text); +void uniontypeid(int ste, char *text); +void uniontypeend(int ste, char *text); +void unionid(int ste, char *text); +void unionblockend(int ste, char *text); +void funcopen(int ste, char *text); +void funcclose(int ste, char *text); +void prototype(int ste, char *text); +void codeblock(int ste, char *text); +void continue_(int ste, char *text); +void codeblockid(int ste, char *text); +void call(int ste, char *text); +void callstr(int ste, char *text); +void callclose(int ste, char *text); +void callend(int ste, char *text); +void callendnpop(int ste, char *text); +void increment(int ste, char *text); +void goto_(int ste, char *text); +void goto_id(int ste, char *text); +void goto_end(int ste, char *text); +void goto_endnpop(int ste, char *text); +void colon(int ste, char *text); +void colonend(int ste, char *text); +void arrayindex(int ste, char *text); +void arrayindexend(int ste, char *text); +void assignment(int ste, char *text); +void number(int ste, char *text); +void assignid(int ste, char *text); +void quoted_char(int ste, char *text); +void quoted_char_semicolon(int ste, char *text); +void sizeof_(int ste, char *text); +void if_(int ste, char *text); +void else_(int ste, char *text); +void for_(int ste, char *text); +void do_(int ste, char *text); +void switch_(int ste, char *text); +void switch_block(int ste, char *text); +void case_(int ste, char *text); +void case_id(int ste, char *text); +void case_block(int ste, char *text); +void break_(int ste, char *text); +void switch_blockend(int ste, char *text); +void return_(int ste, char *text); +void return_str(int ste, char *text); +void return_end(int ste, char *text); +void codeblockend(int ste, char *text); +void do_end(int ste, char *text); +void do_for(int ste, char *text); +void do_close(int ste, char *text); +void use(int ste, char *text); +void useid(int ste, char *text); +void usedot(int ste, char *text); +void usecomma(int ste, char *text); +void useend(int ste, char *text); + +// ste is the state it is transitioning to +// text is the token +typedef void (*stateFt)(int ste, char *text); +extern stateFt STATEF[FINAL]; + +extern stateFt STATEDEFAULTF[FINAL]; + +#endif //ifndef PARSERH diff --git a/src/parser/reset.i b/src/parser/reset.i @@ -0,0 +1,260 @@ +/* -*- C++ -*- vim:set syntax=cpp: + * (C) Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__RESET_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__RESET_I + +#include "Buffer.i" +#include "analyzerReset" + +QUEX_NAMESPACE_MAIN_OPEN + +/* Level (0) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO(reset) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(LexatomLoader)* filler = me->buffer.filler; + + if( filler ) { + QUEX_NAME(LexatomLoader_reset)(filler, filler->byte_loader); + } + + QUEX_MEMBER_FUNCTION_CALL1(reset, LexatomLoader, filler); +} + +/* Level (1) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION2(reset, file_name, + const char* FileName, + const char* CodecName /* = 0x0 */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(ByteLoader)* byte_loader; + + byte_loader = QUEX_NAME(ByteLoader_FILE_new_from_file_name)(FileName); + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(reset, ByteLoader, byte_loader, CodecName); +} + +/* Level (2) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION3(reset, FILE, + __QUEX_STD_FILE* fh, + const char* CodecName /* = 0x0 */, + bool BinaryModeF) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( fh ); + + /* At the time of this writing 'stdin' as located in the C++ global + * namespace. This seemed suspicous to the author. To avoid compilation + * errors in the future the test for the standard input is only active in + * 'C'. It is only about user information anyway. So better no risks taken. + * <fschaef 2010y02m06d> */ + setbuf(fh, 0); /* turn off system based buffering! + ** ** this is essential to profit from the quex buffer! */ + byte_loader = QUEX_NAME(ByteLoader_FILE_new)(fh, BinaryModeF); + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(reset, ByteLoader, byte_loader, CodecName); +} + +#ifndef __QUEX_OPTION_PLAIN_C +QUEX_INLINE void +QUEX_MEMBER_FUNCTION3(reset, istream, + std::istream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = BinaryModeF; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(reset, ByteLoader, byte_loader, CodecName); +} +#endif + + +#if defined(__QUEX_OPTION_WCHAR_T) && ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE void +QUEX_MEMBER_FUNCTION3(reset, wistream, + std::wistream* istream_p, + const char* CodecName /* = 0x0 */, + bool BinaryModeF /* = false */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = BinaryModeF; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(reset, ByteLoader, byte_loader, CodecName); +} +#endif + +#if defined(__QUEX_OPTION_UNIT_TEST) && ! defined (__QUEX_OPTION_PLAIN_C) +/* StrangeStreams are not for C-language stuff */ +template<class UnderlyingStreamT> QUEX_INLINE void +QUEX_MEMBER_FUNCTION2(reset_StrangeStream, strange_stream, + quex::StrangeStream<UnderlyingStreamT>* istream_p, + const char* CodecName /* = 0x0 */) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(ByteLoader)* byte_loader; + __quex_assert( istream_p ); + byte_loader = QUEX_NAME(ByteLoader_stream_new)(istream_p); + byte_loader->binary_mode_f = false; + + /* NOT: Abort/return if byte_loader == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( byte_loader ) { + byte_loader->ownership = E_Ownership_LEXICAL_ANALYZER; + } + QUEX_MEMBER_FUNCTION_CALL2(reset, ByteLoader, byte_loader, CodecName); +} +#endif + + +/* Level (3) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION2(reset, ByteLoader, + QUEX_NAME(ByteLoader)* byte_loader, + const char* CodecName) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_NAME(LexatomLoader)* filler = me->buffer.filler; + QUEX_NAME(Asserts_construct)(CodecName); + + if( filler ) { + QUEX_NAME(LexatomLoader_reset)(filler, byte_loader); + } + else { + filler = QUEX_NAME(LexatomLoader_new_DEFAULT)(byte_loader, CodecName); + /* NOT: Abort/return if filler == 0 !! + * Incomplete construction => propper destruction IMPOSSIBLE! */ + if( filler ) { + filler->ownership = E_Ownership_LEXICAL_ANALYZER; + } + } + + QUEX_MEMBER_FUNCTION_CALL1(reset, LexatomLoader, filler); +} + +/* Level (4) __________________________________________________________________ + * */ +QUEX_INLINE void +QUEX_MEMBER_FUNCTION1(reset, LexatomLoader, + QUEX_NAME(LexatomLoader)* filler) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + if( filler != me->buffer.filler ) { + if( me->buffer.filler && me->buffer.filler->ownership == E_Ownership_LEXICAL_ANALYZER ) { + me->buffer.filler->delete_self(me->buffer.filler); + } + me->buffer.filler = filler; + } + else { + /* Assume, that buffer filler has been reset. */ + } + QUEX_NAME(Buffer_init_content)(&me->buffer, (QUEX_TYPE_LEXATOM*)0); + QUEX_NAME(Buffer_init_analyzis)(&me->buffer); + QUEX_MEMBER_FUNCTION_CALLO1(basic_reset, (const char*)"<unknown>"); +} + +/* Level (5) __________________________________________________________________ + * */ +QUEX_INLINE QUEX_TYPE_LEXATOM* +QUEX_MEMBER_FUNCTION3(reset, memory, + QUEX_TYPE_LEXATOM* Memory, + const size_t MemorySize, + QUEX_TYPE_LEXATOM* EndOfFileP) +/* When memory is provided from extern, the 'external entity' is + * responsible for filling it. There is no 'file/stream handle', no 'byte + * loader', and 'no buffer filler'. + * + * RETURN: != 0, previous buffer memory, in case that the user is responsible + * for deleting it. + * == 0 if the previous memory was owned by the lexical analyzer and + * accordingly, it deleted it itself. */ +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + QUEX_TYPE_LEXATOM* previous_buffer_memory; + QUEX_ASSERT_MEMORY(Memory, MemorySize, EndOfFileP); + + QUEX_NAME(Buffer_destruct)(&me->buffer); + /* In case, that the memory was owned by the analyzer, the destructor did + * not delete it and did not set 'me->buffer._memory._front' to zero. */ + previous_buffer_memory = me->buffer._memory._front; + QUEX_NAME(Buffer_construct)(&me->buffer, + (QUEX_NAME(LexatomLoader)*)0, + Memory, MemorySize, EndOfFileP, + E_Ownership_EXTERNAL); + QUEX_MEMBER_FUNCTION_CALLO1(basic_reset, (const char*)"<memory>"); + + return previous_buffer_memory; +} + +QUEX_INLINE void +QUEX_MEMBER_FUNCTIONO1(basic_reset, const char* InputNameP) +{ + QUEX_MAP_THIS_TO_ME(QUEX_TYPE_ANALYZER) + bool byte_order_reversion_f = me->buffer.filler ? + me->buffer.filler->_byte_order_reversion_active_f + : false; + QUEX_NAME(Tokens_destruct)(me); + QUEX_NAME(Tokens_construct)(me); + + QUEX_NAME(ModeStack_construct)(me); + + __QUEX_IF_INCLUDE_STACK( QUEX_MEMBER_FUNCTION_CALLO(include_stack_delete)); + + __QUEX_IF_STRING_ACCUMULATOR(QUEX_NAME(Accumulator_destruct)(&me->accumulator)); + __QUEX_IF_STRING_ACCUMULATOR(QUEX_NAME(Accumulator_construct)(&me->accumulator, me)); + + __QUEX_IF_POST_CATEGORIZER( QUEX_NAME(PostCategorizer_destruct)(&me->post_categorizer)); + __QUEX_IF_POST_CATEGORIZER( QUEX_NAME(PostCategorizer_construct)(&me->post_categorizer)); + + __QUEX_IF_COUNT( QUEX_NAME(Counter_construct)(&me->counter); ) + + QUEX_NAME(set_mode_brutally_by_id)(me, __QUEX_SETTING_INITIAL_LEXER_MODE_ID); + + if( me->buffer.filler && byte_order_reversion_f ) + { + me->buffer.filler->_byte_order_reversion_active_f = true; + } + + (void)QUEX_MEMBER_FUNCTION_CALLO1(input_name_set, InputNameP); + + QUEX_MEMBER_FUNCTION_CALLO(user_reset); +} + + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__STRUCT__RESET_I */ diff --git a/src/parser/single.i b/src/parser/single.i @@ -0,0 +1,30 @@ +/* This file does: + * + * (1) QUEX_OPTION_MULTI is defined => Do nothing! + * + * (2) Is is not defined => 'single analyzer mode'. That is, the application + * is only linked to one quex-generated analyzer. + * + * There are parts of the code which are the same for all quex-generated + * analyzers. Those are included with the analyzer engine, if the engine is + * the only one generated by quex. They are included manually by the user + * if there are multiple engines. + * + * Single mode: 'quex/code_base/Single.i' is included along with the generated + * engine. + * QUEX_OPTION_MULTI is NOT defined. + * + * Multiple analyzer mode: The user includes 'quex/code_base/multi.i' in one of + * his files. + * QUEX_OPTION_MULTI IS defined. + * + * (C) Frank-Rene Schaefer */ + +#if ! defined(QUEX_OPTION_MULTI) +#ifndef __QUEX_INCLUDE_GUARD__SINGLE_I +#define __QUEX_INCLUDE_GUARD__SINGLE_I +# define QUEX_OPTION_MULTI_ALLOW_IMPLEMENTATION +# include "multi.i" +# undef QUEX_OPTION_MULTI_ALLOW_IMPLEMENTATION +#endif /* __QUEX_INCLUDE_GUARD__SINGLE_I */ +#endif diff --git a/src/parser/string-converter.gi b/src/parser/string-converter.gi @@ -0,0 +1,111 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * PURPOSE: + * + * Generate string converter functions which convert a string from one + * character codec into another. The conversion is implemented by means + * of a character converter function given by: + * + * QUEX_CONVERTER_CHAR(FROM, TO)(in, out); + * + * which converts only a single character. The converter function must + * be defined before the inclusion of this file. + * + * PARAMETERS (must be defined macros): + * + * __QUEX_FROM -- Name of the source character encoding. + * __QUEX_FROM_TYPE -- Type of characters that carry the source. + * __QUEX_TO_MAX_LENGTH -- Maximum number of 'chunks' which a character + * may occupy. A 'chunk' is a 'unit' in which + * a codec is interpreted. See below for + * the definition of chunks per codec. + * + * of a code element (== sizeof(__QUEX_FROM_TYPE)). + * This is important to maintain a safety margin. + * __QUEX_TO -- Name of the target encoding. + * __QUEX_TO_TYPE -- Type of characters that carry the drain. + * + * (C) 2010-2012 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ + +#if ! defined(__QUEX_FROM) +# error "__QUEX_FROM must be defined!" +#elif ! defined(__QUEX_FROM_TYPE) +# error "__QUEX_FROM_TYPE must be defined!" +#elif ! defined(__QUEX_TO_TYPE) +# error "__QUEX_TO_TYPE must be defined!" +#elif ! defined(__QUEX_TO) +# error "__QUEX_TO must be defined!" +#endif + +/* UTF8 element = 1 byte. UCS character range => max. 4 chunks / char. */ +#define __QUEX_TO_MAX_LENGTH_utf8 4 +/* UTF16 element = 2 bytes. Max. 2 chunks per character. */ +#define __QUEX_TO_MAX_LENGTH_utf16 2 +/* UTF32 element = 4 bytes. Always 1 chunk per character. */ +#define __QUEX_TO_MAX_LENGTH_utf32 1 +/* Assume the worst case for 'char' and 'wchar_t': Both are encoded in + * UTF8 (!?). Thus, we would need 4 elements per character for UCS. */ +#define __QUEX_TO_MAX_LENGTH_char __QUEX_TO_MAX_LENGTH_utf8 +#define __QUEX_TO_MAX_LENGTH_wchar __QUEX_TO_MAX_LENGTH_utf8 + +/* Define max. length in terms of the given output codec. */ +#define ____QUEX_TO_MAX_LENGTH(X) __QUEX_TO_MAX_LENGTH_ ## X +#define __QUEX_TO_MAX_LENGTH(X) ____QUEX_TO_MAX_LENGTH(X) + +QUEX_INLINE void +QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, __QUEX_TO)(const __QUEX_FROM_TYPE** source_pp, + const __QUEX_FROM_TYPE* SourceEnd, + __QUEX_TO_TYPE** drain_pp, + const __QUEX_TO_TYPE* DrainEnd) +{ + const __QUEX_FROM_TYPE* source_iterator; + __QUEX_TO_TYPE* drain_iterator; + + __quex_assert(source_pp != 0x0); + __quex_assert(*source_pp != 0x0); + __quex_assert(drain_pp != 0x0); + __quex_assert(*drain_pp != 0x0); + + drain_iterator = *drain_pp; + source_iterator = *source_pp; + + while( 1 + 1 == 2 ) { + if( source_iterator == SourceEnd ) break; + if( DrainEnd - drain_iterator < (ptrdiff_t)__QUEX_TO_MAX_LENGTH(__QUEX_TO) ) break; + QUEX_CONVERTER_CHAR(__QUEX_FROM, __QUEX_TO)(&source_iterator, &drain_iterator); + __quex_assert(source_iterator > *source_pp); + __quex_assert(source_iterator <= SourceEnd); + } + + *drain_pp = drain_iterator; + *source_pp = source_iterator; +} + +#if ! defined(__QUEX_OPTION_PLAIN_C) +QUEX_INLINE std::basic_string<__QUEX_TO_TYPE> +QUEX_CONVERTER_STRING_DEF(__QUEX_FROM, __QUEX_TO)(const std::basic_string<__QUEX_FROM_TYPE>& Source) +{ + const __QUEX_FROM_TYPE* source_iterator = (__QUEX_FROM_TYPE*)Source.c_str(); + const __QUEX_FROM_TYPE* source_end = source_iterator + Source.length(); + __QUEX_TO_TYPE drain[__QUEX_TO_MAX_LENGTH(__QUEX_TO) + 1]; + __QUEX_TO_TYPE* drain_iterator = 0; + std::basic_string<__QUEX_TO_TYPE> result; + + while( source_iterator != source_end ) { + drain_iterator = drain; + QUEX_CONVERTER_CHAR(__QUEX_FROM, __QUEX_TO)(&source_iterator, &drain_iterator); + __quex_assert(source_iterator > (__QUEX_FROM_TYPE*)Source.c_str()); + __quex_assert(source_iterator <= source_end); + result.append((__QUEX_TO_TYPE*)drain, (size_t)(drain_iterator - drain)); + } + return result; +} +#endif + +#undef __QUEX_TO +#undef __QUEX_TO_TYPE +#undef __QUEX_TO_MAX_LENGTH_utf8 +#undef __QUEX_TO_MAX_LENGTH_utf16 +#undef __QUEX_TO_MAX_LENGTH_utf32 +#undef ____QUEX_TO_MAX_LENGTH +#undef __QUEX_TO_MAX_LENGTH diff --git a/src/parser/token-receiving b/src/parser/token-receiving @@ -0,0 +1,28 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_RECEIVING +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_RECEIVING + +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +#if defined(QUEX_OPTION_TOKEN_POLICY_QUEUE) + /* Command line options: --token-policy queue */ + QUEX_INLINE void + QUEX_NAME(receive)(QUEX_TYPE_ANALYZER* me, QUEX_TYPE_TOKEN**); + +#elif defined(QUEX_OPTION_TOKEN_POLICY_SINGLE) + /* Command line options: --token-policy single */ + QUEX_INLINE QUEX_TYPE_TOKEN_ID + QUEX_NAME(receive)(QUEX_TYPE_ANALYZER* me); + +#else +# error "This section should never be compiled." +#endif + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_RECEIVING */ + diff --git a/src/parser/token-receiving.i b/src/parser/token-receiving.i @@ -0,0 +1,143 @@ +/* -*- C++ -*- vim: set syntax=cpp: */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_RECEIVING_I +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_RECEIVING_I + +#ifndef QUEX_TYPE_ANALYZER +# error "This file requires the macro 'QUEX_TYPE_ANALYZER' to be defined." +#endif + +#include "TokenPolicy" +#include "definitions" + +QUEX_NAMESPACE_MAIN_OPEN + +# define self (*me) + +# ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + QUEX_INLINE void + QUEX_NAME(receive)(QUEX_TYPE_ANALYZER* me, QUEX_TYPE_TOKEN** result_pp) + { + __QUEX_IF_TOKEN_REPETITION_SUPPORT(register QUEX_TYPE_TOKEN* result_p = 0x0); + +# if defined(QUEX_OPTION_ASSERTS) && defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + if( QUEX_NAME(TokenQueue_begin)(&me->_token_queue) == 0x0 ) { + QUEX_ERROR_EXIT("Token queue has not been set before call to .receive().\n" + "Please, consider function 'token_queue_memory_set()'."); + } +# endif + +# if defined(QUEX_OPTION_TOKEN_REPETITION_SUPPORT) + if( __QUEX_SETTING_TOKEN_ID_REPETITION_TEST(self_token_p()->_id) ) { + if( QUEX_NAME_TOKEN(repetition_n_get)(self_token_p()) != 0 ) { + __QUEX_REPEATED_TOKEN_DECREMENT_N(self_token_p()); + *result_pp = self_token_p(); + return; + } else { + /* Pop the repeated token from the queue */ + (void)QUEX_NAME(TokenQueue_pop)(&me->_token_queue); + } + } +# endif + /* Tokens are in queue --> take next token from queue */ + if( QUEX_NAME(TokenQueue_is_empty)(&me->_token_queue) == false ) { + *result_pp = QUEX_NAME(TokenQueue_pop)(&me->_token_queue); + return; + } + + /* Restart filling the queue from begin */ + QUEX_NAME(TokenQueue_reset)(&me->_token_queue); + + /* Analyze until there is some content in the queue */ + do { + me->current_analyzer_function(me); + QUEX_ASSERT_TOKEN_QUEUE_AFTER_WRITE(&me->_token_queue); +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) + } while( QUEX_NAME(TokenQueue_is_empty)(&self._token_queue) ); +# else + } while( false ); +# endif + + +# if defined(QUEX_OPTION_TOKEN_REPETITION_SUPPORT) + result_p = self_token_p(); + if( __QUEX_SETTING_TOKEN_ID_REPETITION_TEST(result_p->_id) ) { + QUEX_ASSERT_REPEATED_TOKEN_NOT_ZERO(result_p); + /* First rep. is sent below. */ + if( QUEX_NAME_TOKEN(repetition_n_get)(result_p) == 1 ) { + (void)QUEX_NAME(TokenQueue_pop)(&me->_token_queue); + } else { + __QUEX_REPEATED_TOKEN_DECREMENT_N(result_p); + } + *result_pp = result_p; + return; + } else +# endif + { + *result_pp = QUEX_NAME(TokenQueue_pop)(&me->_token_queue); + return; + } + } + +# else + + QUEX_INLINE QUEX_TYPE_TOKEN_ID + QUEX_NAME(receive)(QUEX_TYPE_ANALYZER* me) + { + register QUEX_TYPE_TOKEN_ID __self_result_token_id = (QUEX_TYPE_TOKEN_ID)-1; + +# if defined(QUEX_OPTION_ASSERTS) && defined(QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY) + if( &me->token == 0x0 ) { + QUEX_ERROR_EXIT("Token has not been set before call to .receive().\n" + "Please, consider function 'token_p_set()'."); + } +# endif + +# if defined(QUEX_OPTION_TOKEN_REPETITION_SUPPORT) + if( __QUEX_SETTING_TOKEN_ID_REPETITION_TEST(self_token_p()->_id) + && (QUEX_NAME_TOKEN(repetition_n_get)(self_token_p()) != 0) ) { + __QUEX_REPEATED_TOKEN_DECREMENT_N(self_token_p()); + return self_token_p()->_id; + } +# endif + + __quex_assert(me->token != 0x0); + me->token->_id = __QUEX_SETTING_TOKEN_ID_UNINITIALIZED; + do { + __self_result_token_id = me->current_analyzer_function(me); + /* Currently it is necessary to check whether the return value + * is appropriate, since event handlers may have set the token + * identifier, without setting __self_result_token_id. */ + if( __self_result_token_id != me->token->_id ) { + __self_result_token_id = me->token->_id; + } +# if defined(QUEX_OPTION_AUTOMATIC_ANALYSIS_CONTINUATION_ON_MODE_CHANGE) + } while( __self_result_token_id == __QUEX_SETTING_TOKEN_ID_UNINITIALIZED ); +# else + } while( false ); +# endif + +# if defined(QUEX_OPTION_TOKEN_REPETITION_SUPPORT) + if( __QUEX_SETTING_TOKEN_ID_REPETITION_TEST(self_token_p()->_id) ) { + QUEX_ASSERT_REPEATED_TOKEN_NOT_ZERO(self_token_p()); + __QUEX_REPEATED_TOKEN_DECREMENT_N(self_token_p()); /* First rep. is sent now. */ + } +# endif + + return __self_result_token_id; + } +# endif + +# ifndef __QUEX_OPTION_PLAIN_C +# ifdef QUEX_OPTION_TOKEN_POLICY_QUEUE + QUEX_INLINE void QUEX_MEMBER(receive)(QUEX_TYPE_TOKEN** token_pp) + { QUEX_NAME(receive)(this, token_pp); } +# else + QUEX_INLINE QUEX_TYPE_TOKEN_ID QUEX_MEMBER(receive)() + { return QUEX_NAME(receive)(this); } +# endif +# endif + +# undef self + +QUEX_NAMESPACE_MAIN_CLOSE +#endif diff --git a/src/parser/token-sending b/src/parser/token-sending @@ -0,0 +1,70 @@ +/* -*- C++ -*- vim: set syntax=cpp: + * (C) 2005-2010 Frank-Rene Schaefer + * ABSOLUTELY NO WARRANTY */ +#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_SENDING +#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_SENDING + +#include "TokenPolicy" + +QUEX_NAMESPACE_MAIN_OPEN + +#define self (*this) + +#if defined(QUEX_OPTION_TOKEN_POLICY_SINGLE) +# define self_token_p() (self.token) +# define self_write_token_p() (self.token) +#else +# define self_token_p() (self._token_queue.read_iterator) +# define self_write_token_p() QUEX_NAME(TokenQueue_access_write_p)(&self._token_queue) +#endif + +#define self_send(ID) \ + do { \ + __QUEX_ASSERT_SEND_ENTRY(); \ + self_token_set_id(ID); \ + QUEX_TOKEN_POLICY_PREPARE_NEXT(); \ + } while ( 0 ) + +#define self_send1(ID, Str) \ + do { \ + __QUEX_ASSERT_SEND_ENTRY(); \ + self_token_set_id(ID); \ + QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, \ + (Str), \ + (Str) + QUEX_NAME(strlen)(Str)); \ + QUEX_TOKEN_POLICY_PREPARE_NEXT(); \ + } while ( 0 ) + +#define self_send2(ID, StrBegin, StrEnd) \ + do { \ + __QUEX_ASSERT_SEND_ENTRY(); \ + self_token_set_id(ID); \ + QUEX_NAME_TOKEN(take_text)(self_write_token_p(), &self, \ + (StrBegin), (StrEnd)); \ + QUEX_TOKEN_POLICY_PREPARE_NEXT(); \ + } while ( 0 ) + +#ifdef QUEX_OPTION_TOKEN_REPETITION_SUPPORT +# define self_send_n(RepetitionN, ID) \ + do { \ + __quex_assert_msg(__QUEX_SETTING_TOKEN_ID_REPETITION_TEST(ID), \ + "send_send_n() applied to token id which was not mentioned\n" \ + "in a 'repeated_token { ... }' section in the .qx file."); \ + self_token_set_id(ID); \ + __quex_assert(RepetitionN != 0); \ + QUEX_NAME_TOKEN(repetition_n_set)(self_write_token_p(), RepetitionN); \ + QUEX_TOKEN_POLICY_PREPARE_NEXT(); \ + } while ( 0 ) +#else +# define self_send_n(RepetitionN, ID) \ + QUEX_ERROR_EXIT("\n" \ + QUEX_SOURCE_POS() "Use of self_send_n() without repetition support.\n" \ + QUEX_SOURCE_POS() "Define at least one id in 'repeated_token' section in the .qx file.") +#endif + +#undef self + +QUEX_NAMESPACE_MAIN_CLOSE + +#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__TOKEN_SENDING */ + diff --git a/src/sha256/bconSha256.c b/src/sha256/bconSha256.c @@ -0,0 +1,158 @@ +/********************************************************************* +* Filename: sha256.c +* Author: Brad Conte (brad AT bradconte.com) +* Copyright: +* Disclaimer: This code is presented "as is" without any guarantees. +* Details: Implementation of the SHA-256 hashing algorithm. + SHA-256 is one of the three algorithms in the SHA2 + specification. The others, SHA-384 and SHA-512, are not + offered in this implementation. + Algorithm specification can be found here: + * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf + This implementation uses little endian byte order. +*********************************************************************/ + +/*************************** HEADER FILES ***************************/ +#include <stdlib.h> +#include <memory.h> +#include "sha256.h" + +/****************************** MACROS ******************************/ +#define ROTLEFT(a,b) (((a) << (b)) | ((a) >> (32-(b)))) +#define ROTRIGHT(a,b) (((a) >> (b)) | ((a) << (32-(b)))) + +#define CH(x,y,z) (((x) & (y)) ^ (~(x) & (z))) +#define MAJ(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) +#define EP0(x) (ROTRIGHT(x,2) ^ ROTRIGHT(x,13) ^ ROTRIGHT(x,22)) +#define EP1(x) (ROTRIGHT(x,6) ^ ROTRIGHT(x,11) ^ ROTRIGHT(x,25)) +#define SIG0(x) (ROTRIGHT(x,7) ^ ROTRIGHT(x,18) ^ ((x) >> 3)) +#define SIG1(x) (ROTRIGHT(x,17) ^ ROTRIGHT(x,19) ^ ((x) >> 10)) + +/**************************** VARIABLES *****************************/ +static const WORD k[64] = { + 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5, + 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174, + 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da, + 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967, + 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85, + 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070, + 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3, + 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 +}; + +/*********************** FUNCTION DEFINITIONS ***********************/ +void sha256_transform(SHA256_CTX *ctx, const BYTE data[]) +{ + WORD a, b, c, d, e, f, g, h, i, j, t1, t2, m[64]; + + for (i = 0, j = 0; i < 16; ++i, j += 4) + m[i] = (data[j] << 24) | (data[j + 1] << 16) | (data[j + 2] << 8) | (data[j + 3]); + for ( ; i < 64; ++i) + m[i] = SIG1(m[i - 2]) + m[i - 7] + SIG0(m[i - 15]) + m[i - 16]; + + a = ctx->state[0]; + b = ctx->state[1]; + c = ctx->state[2]; + d = ctx->state[3]; + e = ctx->state[4]; + f = ctx->state[5]; + g = ctx->state[6]; + h = ctx->state[7]; + + for (i = 0; i < 64; ++i) { + t1 = h + EP1(e) + CH(e,f,g) + k[i] + m[i]; + t2 = EP0(a) + MAJ(a,b,c); + h = g; + g = f; + f = e; + e = d + t1; + d = c; + c = b; + b = a; + a = t1 + t2; + } + + ctx->state[0] += a; + ctx->state[1] += b; + ctx->state[2] += c; + ctx->state[3] += d; + ctx->state[4] += e; + ctx->state[5] += f; + ctx->state[6] += g; + ctx->state[7] += h; +} + +void sha256_init(SHA256_CTX *ctx) +{ + ctx->datalen = 0; + ctx->bitlen = 0; + ctx->state[0] = 0x6a09e667; + ctx->state[1] = 0xbb67ae85; + ctx->state[2] = 0x3c6ef372; + ctx->state[3] = 0xa54ff53a; + ctx->state[4] = 0x510e527f; + ctx->state[5] = 0x9b05688c; + ctx->state[6] = 0x1f83d9ab; + ctx->state[7] = 0x5be0cd19; +} + +void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len) +{ + WORD i; + + for (i = 0; i < len; ++i) { + ctx->data[ctx->datalen] = data[i]; + ctx->datalen++; + if (ctx->datalen == 64) { + sha256_transform(ctx, ctx->data); + ctx->bitlen += 512; + ctx->datalen = 0; + } + } +} + +void sha256_final(SHA256_CTX *ctx, BYTE hash[]) +{ + WORD i; + + i = ctx->datalen; + + // Pad whatever data is left in the buffer. + if (ctx->datalen < 56) { + ctx->data[i++] = 0x80; + while (i < 56) + ctx->data[i++] = 0x00; + } + else { + ctx->data[i++] = 0x80; + while (i < 64) + ctx->data[i++] = 0x00; + sha256_transform(ctx, ctx->data); + memset(ctx->data, 0, 56); + } + + // Append to the padding the total message's length in bits and transform. + ctx->bitlen += ctx->datalen * 8; + ctx->data[63] = ctx->bitlen; + ctx->data[62] = ctx->bitlen >> 8; + ctx->data[61] = ctx->bitlen >> 16; + ctx->data[60] = ctx->bitlen >> 24; + ctx->data[59] = ctx->bitlen >> 32; + ctx->data[58] = ctx->bitlen >> 40; + ctx->data[57] = ctx->bitlen >> 48; + ctx->data[56] = ctx->bitlen >> 56; + sha256_transform(ctx, ctx->data); + + // Since this implementation uses little endian byte ordering and SHA uses big endian, + // reverse all the bytes when copying the final state to the output hash. + for (i = 0; i < 4; ++i) { + hash[i] = (ctx->state[0] >> (24 - i * 8)) & 0x000000ff; + hash[i + 4] = (ctx->state[1] >> (24 - i * 8)) & 0x000000ff; + hash[i + 8] = (ctx->state[2] >> (24 - i * 8)) & 0x000000ff; + hash[i + 12] = (ctx->state[3] >> (24 - i * 8)) & 0x000000ff; + hash[i + 16] = (ctx->state[4] >> (24 - i * 8)) & 0x000000ff; + hash[i + 20] = (ctx->state[5] >> (24 - i * 8)) & 0x000000ff; + hash[i + 24] = (ctx->state[6] >> (24 - i * 8)) & 0x000000ff; + hash[i + 28] = (ctx->state[7] >> (24 - i * 8)) & 0x000000ff; + } +} diff --git a/src/sha256/bconSha256.h b/src/sha256/bconSha256.h diff --git a/src/sha256/package.yml b/src/sha256/package.yml @@ -0,0 +1,14 @@ +--- + name: sha256 + version: 0.0.1 + description: "Simple C SHA256 implementation. Author: Brad Conte" + repository: + type: git + url: git+https://github.com/B-Con/crypto-algorithms + keywords: + - cryptography + author: remy + license: MIT + bugs: + url: https://github.com/B-Con/crypto-algorithms/issues + homepage: http://bradconte.com/sha256_c diff --git a/src/sha256/sha256.c b/src/sha256/sha256.c @@ -0,0 +1,37 @@ +/* + * Author: Remy Noulin + * License: MIT + */ + +#include "bconSha256.h" +#include "sha256.h" +#include "stdlib.h" +#include "string.h" + +char *sha256S(const char *bufferToHash); +char *sha256_byteToHexString(BYTE data[]); + +char *sha256S(const char *bufferToHash) { + if (!bufferToHash) return NULL; + + SHA256_CTX ctx; + sha256_init(&ctx); + sha256_update(&ctx, bufferToHash, strlen(bufferToHash)); + BYTE result[32]; + sha256_final(&ctx, result); + + char *hexS = sha256_byteToHexString(result); + return hexS; +} + +char *sha256_byteToHexString(BYTE data[]) { + char *hexC = "0123456789abcdef"; + char *hexS = malloc(65); + if (!hexS) return NULL; + for(BYTE i; i<32; i++) { + hexS[i*2] = hexC[data[i]>>4]; + hexS[i*2+1] = hexC[data[i]&0xF]; + } + hexS[64] = 0; + return hexS; +} diff --git a/src/sha256/sha256.h b/src/sha256/sha256.h @@ -0,0 +1,39 @@ +/********************************************************************* +* Filename: sha256.h +* Author: Brad Conte (brad AT bradconte.com) +* Copyright: +* Disclaimer: This code is presented "as is" without any guarantees. +* Details: Defines the API for the corresponding SHA1 implementation. +*********************************************************************/ + +#ifndef SHA256_H +#define SHA256_H + +/** + * sha256S returns the hash in the form of a hex string + */ +char *sha256S(const char *bufferToHash); + +/*************************** HEADER FILES ***************************/ +#include <stddef.h> + +/****************************** MACROS ******************************/ +#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest + +/**************************** DATA TYPES ****************************/ +typedef unsigned char BYTE; // 8-bit byte +typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines + +typedef struct { + BYTE data[64]; + WORD datalen; + unsigned long long bitlen; + WORD state[8]; +} SHA256_CTX; + +/*********************** FUNCTION DECLARATIONS **********************/ +void sha256_init(SHA256_CTX *ctx); +void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len); +void sha256_final(SHA256_CTX *ctx, BYTE hash[]); + +#endif // SHA256_H diff --git a/src/sha256/test.c b/src/sha256/test.c @@ -0,0 +1,14 @@ +#! /usr/bin/env sheepy + +#include "libsheepyObject.h" +#include "sha256.h" + +int main(int ARGC, char** ARGV) { + + char *clear = "a random password"; + + char *result = sha256S(clear); + + puts(result); + free(result); +} diff --git a/src/sheepy.c b/src/sheepy.c @@ -0,0 +1,2140 @@ +// MIT License +// +// Copyright (c) 2019 Remy Noulin +// +// 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. +// +// +// sheepy compilation system + +#include "libsheepyObject.h" +#undef inc +#include "sheepy.h" +#include "common.h" + +#define internal static + +#include <sys/stat.h> +#include <ctype.h> +#include <stdio.h> +#include <dirent.h> +#include <libgen.h> +#include <stdbool.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> + +#undef inc +#if (__TERMUX__) +#elif (__sun__) +#else +#endif +#if (__HAIKU__) +#else +#endif +#ifndef unitTest +#endif +int MAIN(int ARGC, char** ARGV); +char *getInclude(smallStringt *L); +void addFileToCompile(char *actualDir, const char *cFileName, char *oPath, smallDictt *toCompile); +void copyHeaderToBuildPath(char *actualDir, const char *cFileName, char *oPath, smallDictt *toCompile, char *bPath, struct stat hst); +void copyHeaderDates(char *actualDir, smallArrayt *hDeps, char *buildPath); +bool symlinkFile(char *path, char *buildPath); +bool isC(const char *path); +bool isH(const char *path); +bool isCP(const char *path); +bool isCH(const char *path); +void generateC(char *src, char *bpath); +void generateCBuffers(smallArrayt *sheepySrc, smallArrayt *cCode); +void splash(void); + +int argc; char **argv; + +#include "parser/EasyLexer.h" +#include "parser/parser.h" + +// when the LIBSHEEPY environment variable exists, it replaces the default libsheepy location +#if (__TERMUX__) +#define LIBSHEEPY_DIR "/data/data/com.termux/files/usr/lib" +#define LIBSHEEPY_INC_DIR "/data/data/com.termux/files/usr/include" +#elif (__sun__) +#define LIBSHEEPY_DIR "/usr/lib" +#define LIBSHEEPY_INC_DIR "/usr/include" +#else +#define LIBSHEEPY_DIR "/usr/local/lib" +#define LIBSHEEPY_INC_DIR "/usr/local/include" +#endif + +#define GCC "gcc" + +#if (__HAIKU__) +#define PTHREAD "" +#else +#define PTHREAD "-pthread" +#endif + +int programResult; + +/** + * build and execute program + * sheepy help lists the options + * + * The program is built in ~/.sheepy/build/realpathToMain + */ +#ifndef unitTest +// Remove main when running the unit tests +#define MAIN main +#endif +int MAIN(int ARGC, char** ARGV) { + char *dum = NULL; + char *mainFilename = NULL; + char *homedir = NULL; + char *libsheepyDir = NULL; + char *libsheepyIncDir = NULL; + smallStringt *bin = NULL; + + argc = ARGC; argv = ARGV; + char *libsheepy = "libsheepy.a"; + + // variables: + // dum: temporary string for selecting type in generics + // mainFilename: main filename as given on the command line + // homedir: real sheepy homedir path + // libsheepyDir: runtime libsheepy location. Default LIBSHEEPY_DIR or env("LIBSHEEPY") + // programResult: result from compilation, linking, program execution, 0 is success, not 0 is failure + + // TODO + // split main into smaller functions + // + // Steps + // load sheepy configuration + // set libsheepy location + // process parameters for sheepy + // get basename (rootMain) + // main source folder (dir) + // load main source (mainCode) + // detect execute bit + // if yes then run (run) + // compile + // link and run + // clean executable + + // load sheepy configuration - to create config.yml even when there is no command + smallJsont *cfgJ = loadSheepyConfig(&homedir); + smallDictt *cfgD = getTopG(cfgJ, rtSmallDictt); + //putsG(cfgJ); + + // set libsheepy location + libsheepyDir = getenv("LIBSHEEPY"); + + if (!libsheepyDir) { + // set default libsheepy location + libsheepyDir = LIBSHEEPY_DIR; + libsheepyIncDir = LIBSHEEPY_INC_DIR; + } + else { + libsheepyIncDir = libsheepyDir; + } + + dum = catS(libsheepyDir, "/libsheepy.a"); + if (!fileExists(dum)) { + printf(BLD RED "Libsheepy not found: %s not accessible" RST "\nIf libsheepy in another directory, set LIBSHEEPY to libsheepy path, for example: export LIBSHEEPY=/home/$USER/libsheepy/release/\n", dum); { + free(dum); + XFAILURE + } + } + freen(dum); + + // success result by default + programResult = 0; + + // process parameters for sheepy + // when any compile parameter is given, dont execute the program + // -l compileLib=1 build the dynamic and static libraries + sheepyParams.compileLib = 0; + // -c compileOnly=1 build and dont execute the program + sheepyParams.compileOnly = 0; + // set to 0 when main is detected in main source file + // 1 - only objects are compiled, linking is not done + // no effect when compileLib=0 + sheepyParams.dontCompileExe = 1; + sheepyParams.clean = 0; + sheepyParams.test = 0; + sheepyParams.memcheck = 0; + sheepyParams.libsheepyMemcheck = 0; + sheepyParams.new = 0; + sheepyParams.showExe = 0; + sheepyParams.removeBuild = 0; + sheepyParams.parallel = 1; + sheepyParams.genTest = 0; + + // parallel has to be defined and 0 to disable parallel compilation + if (hasG(cfgD, "parallelSheepy") && !getG(cfgD, rtI32, "parallelSheepy")) { + sheepyParams.parallel = 0; + } + + // enable crash debug + initLibsheepy(argv[0]); + setLogMode(LOG_PROGNDATE); + + // initialize child process list + staticArrayInit(jobs); + + if (argc < 2 || (argv[1][0] == '-' && argc == 2)) { + // no argument or one option argument + // read package.yml + if (fileExists(PACKAGE)) { + createSmallJson(packageyml); + readFileG(&packageyml, PACKAGE); + bin = getNDupG(&packageyml, rtSmallStringt, "bin"); + freeG(&packageyml); + } + } + + if (argc < 2) { + // default run program or compile the library in package.yml + if (bin) { + var libHeader = dupG(bin); + if (fileExistsG(setG(libHeader, -1, 'h'))) { + // compile lib + sheepyParams.compileLib = 1; + } + else { + // compile program + sheepyParams.compileOnly = 1; + } + terminateG(libHeader); + mainFilename = normalizePath(ssGet(bin)); + terminateG(bin); + goto sheepyRun; + } + splash(); + printf("Nothing to do. sheepy -h for help"); { + printf("\n"); + XFAILURE + } + } + + // after this line, argc > 1, there is at least one argument + + if (eqS(argv[1], "-h")) { + terminateG(bin); + splash(); + putsG(BLD GRN "Sheepy Help (build system)" RST); + putsG(" " UDL YLW "Environment" RST); + if (!startsWithG(argv[0], "/usr/local/bin/")) { + putsG(" sheepy is not running from /usr/local/bin/. To run this sheepy, the path to the sheepy executable needs to be in $PATH:"); + char *dir = shDirname(getRealProgPath()); + printf(YLW" export PATH=%s:$PATH or setenv PATH %s:$PATH\n"RST, dir, dir); + free(dir); + } + + putsG(" when the LIBSHEEPY environment variable exists, it replaces the default libsheepy location"); + if (libsheepyIncDir != libsheepyDir) { + // give an example setup + putsG(YLW " export LIBSHEEPY=/home/user/git/tmp/libsheepy/release or setenv LIBSHEEPY /usr/home/user/git/tmp/libsheepy/release" RST); + printf(" Current libsheepy location is " UDL "%s" RST " and " UDL "%s" RST "\n", libsheepyDir, libsheepyIncDir); + } + else { + // give current setup + printf(YLW " export LIBSHEEPY=%s or setenv LIBSHEEPY %s\n" RST, libsheepyDir, libsheepyDir); + printf(" Current libsheepy location is " UDL "%s" RST "\n", libsheepyDir); + } + putsG(" The configuration is located in " UDL HOME_DIR CONFIG_NAME RST); + char *dum = expandHome(HOME_DIR CONFIG_NAME);; + if (!fileExists(dum)) { + printf(" %s missing.", dum); + } + printf(" The build directory is located in " UDL "%sbuild/" RST "\n", HOME_DIR); + printf(" The local package repository is located in " UDL "%s" RST "\n", findLocalPackageDir(cfgD)); + if (dum) { + char *p = formatS("%s/%s", getG(cfgD, rtChar, "system"), PACKAGE_DIR); + iNormalizePath(&p); + iExpandHome(&p); + printf(" The global package repository is located in " UDL "%s" RST "\n", p); + free(p); + p = formatS("%s/%s", getG(cfgD, rtChar, "system"), "bin"); + iNormalizePath(&p); + iExpandHome(&p); + printf(" Commands from packages are added in " UDL "%s" RST "\n", p); + free(p); + } + free(dum); + if (hasG(cfgD, "parallelSpm") && !getG(cfgD, rtI32, "parallelSpm")) { + puts(BLD RED " Parallel package processing is disabled." RST); + } + if (hasG(cfgD, "parallelSheepy") && !getG(cfgD, rtI32, "parallelSheepy")) { + puts(BLD RED " Parallel compilation is disabled." RST); + } + put + putsG("For spm package manager help, run: spm help"); + put + putsG(" NO ARGUMENT Compile bin executable or compile library from package.yml"); + putsG(" PROGNAME.c No option: compile and run executable"); + put + putsG(" -c (PROGNAME.c) Compile executable in argument or bin from package"); + putsG(" -e (PROGNAME.c) Show executable path for argument or bin from package"); { + putsG(" -l (PROGNAME.c) Compile static and dynamic libraries for argument or bin from package"); { + putsG(" -d (PROGNAME.c) Delete intermediary files for argument or bin from package"); { + putsG(" -t (PROGNAME.c) Compile executable in argument or testBin from package using the test compiler and test linker flags"); + putsG(" -m (PROGNAME.c) Compile executable in argument or memcheckBin from package using the memcheck compiler and memcheck linker flags"); + putsG(" -n PROGNAME New source program from template"); + putsG(" -r Remove all temporary build files in ~/.sheepy/build"); + putsG(" -C CLASSNAME Generate C templates for classname (classnames start with lowercase letters, the first char in classname is lowered)"); { + putsG(" -T Generate C unit test templates (using the libcheck test library), the generated filename is set with testBin in "PACKAGE); + putsG(" -D Show default " HOME_DIR CONFIG_NAME " configuration"); + putsG(" -h Show this help text"); + XSUCCESS + } + } + } + } + } + + if (eqS(argv[1], "-D")) { + terminateG(bin); + puts(defaultSpC); + XSUCCESS + } + + // bin is allocated when there is package.yml and there is only one argmument + // when there is one arguments and the argument is an option, take the program name from package.yml + // when there are 2 arguments and first argument is an option, second argument is the program name + // else run normally argv[1] is main filename + if (eqG(argv[1], "-l")) { + sheepyParams.compileLib = 1; + dum = bin ? ssGet(bin) : argv[2]; + } + else if (eqG(argv[1], "-c")) { + sheepyParams.compileOnly = 1; + dum = bin ? ssGet(bin) : argv[2]; + } + else if (eqG(argv[1], "-e")) { + sheepyParams.showExe = 1; + dum = bin ? ssGet(bin) : argv[2]; + } + else if (eqG(argv[1], "-d")) { + sheepyParams.clean = 1; + dum = bin ? ssGet(bin) : argv[2]; + } + else if (eqG(argv[1], "-t")) { + sheepyParams.test = 1; + if (bin) { + terminateG(bin); + createSmallJson(packageyml); + readFileG(&packageyml, PACKAGE); + bin = getNDupG(&packageyml, rtSmallStringt, "testBin"); + freeG(&packageyml); + dum = bin ? ssGet(bin) : argv[2]; + } + else { + dum = argv[2]; + } + } + else if (eqG(argv[1], "-m")) { + sheepyParams.memcheck = 1; + sheepyParams.libsheepyMemcheck = 1; + // check if libsheepyMemcheck exists + dum = catS(libsheepyDir, "/libsheepyMemcheck.a"); + if (!fileExists(dum)) { + printf(BLD RED "LibsheepyMemcheck not found: %s not accessible" RST "\nIf libsheepy in another directory, set LIBSHEEPY to libsheepy path, for example: export LIBSHEEPY=/home/$USER/libsheepy/release/\nAnd compile libsheepyMemcheck with buildMemcheck.sh in the libsheepy git repo\n", dum); { + terminateG(bin); + free(dum); + XFAILURE + } + } + freen(dum); + // select main c file + if (bin) { + terminateG(bin); + createSmallJson(packageyml); + readFileG(&packageyml, PACKAGE); + bin = getNDupG(&packageyml, rtSmallStringt, "memcheckBin"); + freeG(&packageyml); + dum = bin ? ssGet(bin) : argv[2]; + } + else { + dum = argv[2]; + } + } + else if (eqG(argv[1], "-n")) { + sheepyParams.new = 1; + dum = argv[2]; + } + else if (eqG(argv[1], "-C")) { + sheepyParams.cclass = 1; + dum = argv[2]; + } + else if (eqG(argv[1], "-r")) { + sheepyParams.removeBuild = 1; + dum = argv[1]; + } + else if (eqG(argv[1], "-T")) { + sheepyParams.genTest = 1; + dum = argv[1]; + } + else { + dum = argv[1]; + } + + if (!dum) { + terminateG(bin); + putsG(BLD RED "Missing program name argument." RST); + XFAILURE + } + + + if (sheepyParams.new) { + terminateG(bin); + rangeFrom(i, 2, argc) + sourceFromTemplate(argv[i]); + XSUCCESS + } + + if (sheepyParams.removeBuild) { + terminateG(bin); + char *build = catS(homedir, "build"); + if (fileExists(build)) { + rmAll(build); + mkdirParents(build); + } + free(build); + XSUCCESS + } + + if (sheepyParams.genTest) { + terminateG(bin); + if (!fileExists(PACKAGE)) { + putsG(BLD RED PACKAGE " is missing. Test templates not generated." RST); + XFAILURE + } + createSmallJson(pkgInfo); + readFileG(&pkgInfo, PACKAGE); + //logVarG(&pkgInfo); + + // generate testBin + char *testBin = getG(&pkgInfo, rtChar, "testBin"); + if (!testBin) { + putsG(BLD RED "testBin is not set in " UDL PACKAGE RST BLD RED ", add a line with ' testBin: test.c'. Test templates not generated." RST); + XFAILURE + } + if (fileExists(testBin)) { + printf(BLD RED "test template %s already exists. Test templates not generated." RST, testBin); + XFAILURE + } + char *s = replaceG(C_TEST_TEMPLATE, "testTemplate", getG(&pkgInfo, rtChar, "name"), 0); + writeFileG(s, testBin); + free(s); + + // generate memcheckBin + char *memcheckBin = getG(&pkgInfo, rtChar, "memcheckBin"); + if (!memcheckBin) { + putsG(BLD RED "memcheckBin is not set in " UDL PACKAGE RST BLD RED ", add a line with ' memcheckBin: testMem.c'. Memcheck test templates not generated." RST); + XFAILURE + } + + if (!fileExists(MEMTEST_C_TEMPLATE_NAME)) { + writeFileG(MEMTEST_C_TEMPLATE, MEMTEST_C_TEMPLATE_NAME); + putsG("Generated: "BLD GRN MEMTEST_C_TEMPLATE_NAME RST); + } + if (!fileExists(RUNMEMTEST_TEMPLATE_NAME)) { + s = replaceG(RUNMEMTEST_TEMPLATE, "memcheckBin", memcheckBin, 0); + writeFileG(s, RUNMEMTEST_TEMPLATE_NAME); + free(s); + fileChmod(RUNMEMTEST_TEMPLATE_NAME, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + putsG("Generated: "BLD GRN RUNMEMTEST_TEMPLATE_NAME RST); + } + char *shell = NULL; + if (isC(testBin)) { + setG(testBin, -2, 0); + shell = catS(testBin, "Mem.sh"); + // restore original testBin + testBin[strlen(testBin)] = '.'; + if (!fileExists(shell)) { + s = replaceG(MEMCHECK_SH_TEMPLATE, "testBin", testBin, 0); + writeFileG(s, shell); + free(s); + fileChmod(shell, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + printf("Generated: "BLD GRN "%s" RST"\n", shell); + } + } + + printf("Generated: "BLD GRN "%s" RST " " UDL "< add the test cases in this file" RST "\nTo run the test, execute: " BLD WHT "spm test" RST "\n" + "To run the memcheck test, execute: " BLD WHT "%s" RST "\n" + BLD YLW "Warning" RST ": do not call " UDL "initLibsheepy" RST " in " UDL "%s" RST ", it conflicts with libcheck", testBin, shell, testBin); + free(shell); + freeG(&pkgInfo); + XSUCCESS + } + + if (sheepyParams.test or sheepyParams.memcheck) { + sheepyParams.compileOnly = 1; + } + + if (sheepyParams.cclass) { + terminateG(bin); + // make sure first char is lower case + dum[0] = tolower(dum[0]); + + // generate template filenames + char *fn = catS(dum, ".h"); + char *fn1 = catS(dum, ".c"); + char *fn2 = catS(dum, "Internal.h"); + + if (fileExists(fn)) { + printf(BLD RED "class file '%s' already exists." RST, fn); + XFAILURE + } + if (fileExists(fn1)) { + printf(BLD RED "class file '%s' already exists." RST, fn1); + XFAILURE + } + if (fileExists(fn2)) { + printf(BLD RED "class file '%s' already exists." RST, fn2); + XFAILURE + } + + char *s = replaceS(H_CLASS_TEMPLATE, "classTemplate", dum, 0); + char *s1 = replaceS(C_CLASS_TEMPLATE, "classTemplate", dum, 0); + char *s2 = replaceS(INTERNAL_H_CLASS_TEMPLATE, "classTemplate", dum, 0); + dum[0] = toupper(dum[0]); + iReplaceS(&s, "ClassTemplate", dum, 0); + iReplaceS(&s1, "ClassTemplate", dum, 0); + iReplaceS(&s2, "ClassTemplate", dum, 0); + + char *DUM = upperS(dum);; + iReplaceS(&s, "CLASSTEMPLATE", DUM, 0); + free(DUM); + + writeFileG(s, fn); + writeFileG(s1, fn1); + writeFileG(s2, fn2); + + dum[0] = tolower(dum[0]); + printf("Created files for class "BLD GRN"%s"RST":\n%s\n%s\n%s", dum, fn, fn1, fn2); { + freeManyS(s, s1, s2, fn, fn1, fn2); + XSUCCESS + } + } + + if (sheepyParams.libsheepyMemcheck) { + libsheepy = "libsheepyMemcheck.a"; + } + + mainFilename = normalizePath(dum); + + sheepyRun: + + if (!fileExists(mainFilename)) { + puts(BLD RED "File not found:" RST); + puts(mainFilename); + XFAILURE + } + + if (isLink(mainFilename)) { + char *tmp = endlink(mainFilename); + if (!tmp) { + printf(BLD RED "couldn't read link '%s'" RST, mainFilename); + free(mainFilename); + XFAILURE + } + free(mainFilename); + mainFilename = tmp; + } + + // get basename (rootMain) + // mainSrc is main filename without path + // rootMain is the main filename without path and extension + // exePath is the main filename without the extension + // dir is the relative path without the main filename + // actualDir is the real path to main + // sheepy ../bin/example.c p1 + // > mainSrc = example.c + // > rootMain = example + // > dir = ../bin + // > actualDir = /home/remy/bin + char *mainSrc = strdup(basename(mainFilename)); + if (isH(mainSrc) || isCH(mainSrc)) { + // print this message only when compiling + if (!sheepyParams.clean) { + puts("No compilation needed for header files."); + } { + XSUCCESS + } + } + if (!isC(mainSrc) && !isCP(mainSrc)) { + puts (BLD RED "Unknown extension. Stop." RST); + puts(mainSrc); + XFAILURE + } + + char *exePath = strdup(mainFilename); + if (isC(mainSrc)) { + setS(exePath, -2, 0); + } + else { + setS(exePath, -3, 0); + } + + char *mainH = strdup(mainSrc); + setS(mainH, -1, 'h'); + + // [0] root name [1] extension + char **rootMain_l = split(mainSrc, "."); + char *rootMain = rootMain_l[0]; + + // main source folder (dir) + // Ex: dir = ../bin + char *dir = shDirname(mainFilename); + + // find out real path for main source + char actualpath[PATH_MAX+1]; + char *actualDir; + realpath(mainFilename, actualpath); + actualDir = shDirname(actualpath); + //logVarG(actualDir); + + char *buildPath = catS(homedir, "build", actualDir); + + char *buildExePath = catS(buildPath, "/", rootMain);; + //logVarG(buildPath); + if (sheepyParams.showExe) { + printf("The executable path is: " GRN "%s" RST + "\nThe executable directory is: " GRN "%s" RST, buildExePath, shDirname(buildExePath)); + XSUCCESS + } + if (!fileExists(buildPath)) { + mkdirParents(buildPath); + } + + // load main source (mainCode) + // Steps + // detect hash bang and remove + // find dependencies + // recursively search dependencies + // search for other includes + createAllocateSmallArray(mainFile); + readFileG(mainFile, mainFilename); + + // detect hash bang and remove + char *hBang = NULL;; + hBang = getG(mainFile, hBang, 0); + if (hBang && hBang[0] == '#' && hBang[1] == '!' && findS(hBang, "sheepy")) { + setG(mainFile, 0, ""); + } + + // if main is cp, convert to c in buildpath + smallArrayt *cCode; + if (isC(mainSrc)) { + cCode = dupG(mainFile); + } + else { + // main is cp, convert to c in buildpath + // generate c + initiateG(&cCode); + generateCBuffers(mainFile, cCode); + } + /* forEachSmallArray(mainFile, lO) */ + /* // convert ch include to h */ + /* castS(l, duplicateG(lO)) */ + /* if hasG(l, ".ch\"") */ + /* replaceG(l, ".ch\"", ".h\"", 0); */ + /* pushNFreeG(cCode, l); */ + /* free lO */ + + // create generated main path and save the main c code in it + char *mainCPath = catS(buildPath, "/", mainSrc); + if (isCP(mainSrc)) { + // cp file + setS(mainCPath, -2, 'c'); + setS(mainCPath, -1, 0); + } + writeTextO(cCode, mainCPath); + terminateG(cCode); + + // find dependencies + // recursively search dependencies + // TODO remove/ignore comments before searching for includes + // inc is the list of all includes from all h and c files + // the c files associated with the includes are compiled + // create dependency dictionary + createAllocateSmallDict(dependencies); + // dependencies dict: + // keys: h files + // values: first level header dependencies + createAllocateSmallArray(inc); + // TODO check if the h is already in dependencies + createAllocateSmallArray(mainDepFiles); + iter(mainFile, l) { + castS(L, l) + // TODO improve main function detecttion + if (hasG(L, "main") && (hasG(L, "int") || hasG(L, "define")) && !sheepyParams.compileLib) { + // main function detected + // compile the executable if requested + sheepyParams.dontCompileExe = 0; + } + char *s = getInclude(L); + if (s) { + // check if c includes itself + char *fN; + fN = strdup(basename(s)); + // add new include to inc array + char *realFPath = catS(actualDir, "/", s);; + char *buildFPath = catS(buildPath, "/", s);; + iNormalizePath(&realFPath); + iNormalizePath(&buildFPath); + // create a link to header in buildPath + // because main.c is in buildPath and the compiler needs + // to find the headers + if (symlinkFile(realFPath, buildFPath)) { + pushG(inc, s); + pushG(mainDepFiles, s); + } + freeManyS(realFPath, buildFPath); + free(fN); + free(s); + } + } + terminateG(mainFile); + + // add mainFilename.h to dependencies for cases when mainFilename doesn't include the header + // (this handles empty main source files) + if (isC(mainFilename)) { + setG(mainFilename, -1, 'h'); + if (fileExistsG(mainFilename) && !hasG(inc, mainH)) { + pushG(inc, mainH); + pushG(mainDepFiles, mainH); + } + setG(mainFilename, -1, 'c'); + } + + setNFreeG(dependencies, mainSrc, mainDepFiles); + //logVarG(dependencies); + //print '**** inc ****' + //logVarG(inc); + + // search for other includes + forEachSmallArray(inc, otherIncs) { + castS(L, dupG(otherIncs)) + //logVarG(inc); + //logVarG(dependencies); + + createAllocateSmallArray(file); + char *fileDir = shDirname(ssGet(L)); + char *fileName; + fileName = strdup(basename(ssGet(L))); + + + if (hasG(L, PACKAGE_DIR)) { + // this include belongs to a package + // the package are already compiled + // stop searching for further includes + // check if the h is already in dependencies, process only new found sources + if (!hasG(dependencies, ssGet(L))) { + // scan the package header to symlink includes in the build path so that the compiler find them + // real path to h file + dum = catS(actualDir, "/", ssGet(L));; + readFileG(file, dum); + free(dum); + + iter(file, hl) { + castS(hL, hl) + char *s = getInclude(hL); + if (s) { + // check if c includes itself + char *fN; + fN = strdup(basename(s)); + // !hasG(inc, s): add to inc only new files to avoid infinite loops + if (!eqG(fN, fileName) && !hasG(inc, s)) { + // add new include to inc array + char *tmp = catS(fileDir, "/", s); + iNormalizePath(&tmp); + char *realFPath = catS(actualDir, "/", tmp);; + char *buildFPath = catS(buildPath, "/", tmp);; + iNormalizePath(&realFPath); + iNormalizePath(&buildFPath); + //logVarG(fileDir); + //logVarG(s); + //logVarG(realFPath); + // create a link to header in buildPath + // because main.c is in buildPath and the compiler needs + // to find the headers + symlinkFile(realFPath, buildFPath); + freeManyS(tmp, realFPath, buildFPath); + } + free(fN); + free(s); + } + } + freeG(file); + + // add the a libs to detect when the package dependencies are updated and recompile the source files + createAllocateSmallArray(libDep); + // TODO support ch and cp + // remove sub directories in packages, the a file is located at the package root + // shpPackages/ini/src/ini.h + // shpPackages/ini/ini.a + smallArrayt *spl = splitG(L, "shpPackages/");; + smallStringt *last = getG(spl, rtSmallStringt, -1);; + setG(last, -1, 'a'); + // last is "ini/src/ini.a" + smallArrayt *sslash = splitG(last, '/');; + finishG(last); + char *lib = catS(getG(sslash, rtChar, 0), "/", getG(sslash, rtChar, -1));; + setNFreeG(spl, -1, lib); + lib = joinSG(spl, "shpPackages/");; + terminateManyG(spl,sslash); + if (fileExists(lib)) { + // link library only when it exists, there is no library in header only packages + pushNFreeG(libDep, lib); + } + else { + free(lib); + } + setG(L, -1, 'h'); + setNFreeG(dependencies, ssGet(L), libDep); + } + terminateG(L); + finishG(otherIncs); + continue; + } + + smallArrayt *depFiles = NULL; + // check if the h is already in dependencies, process only new found sources + if (!hasG(dependencies, ssGet(L))) { + initiateAllocateSmallArray(&depFiles); + + // scan h + // real path to h file + dum = catS(actualDir, "/", ssGet(L));; + readFileG(file, dum); + free(dum); + + forEachSmallArray(file, hl) { + castS(hL, hl) + char *s = getInclude(hL); + if (s) { + // check if c includes itself + char *fN; + fN = strdup(basename(s)); + // !hasG(inc, s): add to inc only new files to avoid infinite loops + if (!eqG(fN, fileName) && !hasG(inc, s)) { + // add new include to inc array + char *tmp = catS(fileDir, "/", s); + iNormalizePath(&tmp); + char *realFPath = catS(actualDir, "/", tmp);; + char *buildFPath = catS(buildPath, "/", tmp);; + iNormalizePath(&realFPath); + iNormalizePath(&buildFPath); + //logVarG(fileDir); + //logVarG(s); + //logVarG(realFPath); + // create a link to header in buildPath + // because main.c is in buildPath and the compiler needs + // to find the headers + if (symlinkFile(realFPath, buildFPath)) { + pushG(inc, tmp); + pushG(depFiles, tmp); + } + freeManyS(tmp, realFPath, buildFPath); + } + free(fN); + free(s); + } + finishG(hL); + } + + normalizePathO(L); + setNFreeG(dependencies, ssGet(L), depFiles); + } + + // scan c or cp + freeG(file); + if (isH(fileName)) { + setG(L, -1, 'c'); + } + else { + // scan .cp + setG(L, -1, 'p'); + } + + // check if the c is already in dependencies, process only new found sources + if (!hasG(dependencies, ssGet(L))) { + initiateAllocateSmallArray(&depFiles); + + dum = catS(actualDir, "/", ssGet(L));; + if (fileExists(dum)) { + readFileG(file, dum); + + forEachSmallArray(file, cl) { + castS(cL, cl) + char *s = getInclude(cL); + // !hasG(inc, s): add to inc only new files to avoid infinite loops + if (s && !hasG(inc, s)) { + char *tmp = catS(fileDir, "/", s); + iNormalizePath(&tmp); + char *realFPath = catS(actualDir, "/", tmp);; + char *buildFPath = catS(buildPath, "/", tmp);; + iNormalizePath(&realFPath); + iNormalizePath(&buildFPath); + if (symlinkFile(realFPath, buildFPath)) { + pushG(depFiles, tmp); + // check if c includes itself + char *fN; + fN = strdup(basename(s)); + if (!eqG(fN, fileName)) { + // add new include to inc array + pushG(inc, tmp); + } + free(fN); + } + freeManyS(tmp, s, realFPath, buildFPath); + } + finishG(cL); + } + + setNFreeG(dependencies, ssGet(L), depFiles); + } + + free(dum); + } + freeManyS(fileName, fileDir, otherIncs); + terminateManyG(file, L); + } + + //logVarG(dependencies); + //print '**** inc ****' + //logVarG(inc); + + // uniquify inc list + // to avoid compiling and linking several times the same file + enumerateSmallArray(inc, hE, i) { + castS(h, hE) + normalizePathO(h); + setNFreePG(inc, i, h); + } + uniqG(inc, unusedV); + + //logVarG(inc); + + // parameters + createAllocateSmallArray(paramL); + + // run program with parameters on command line + // when argv[1] is an option (-l, -c ...) the program is not + // executed + rangeFrom(i, 2, argc) + pushG(paramL, argv[i]); + + // create parameter string + char *params = joinSG(paramL, " "); + if (!params) { + emptyS(params); + } + + // detect execute bit + // if yes then run (run) + char *run = emptySF();; + + if (!sheepyParams.compileLib && !sheepyParams.compileOnly && access(mainFilename, X_OK) == 0) { + // run + // -l is not in the parameters + iAppendManyS(&run, "; ", buildExePath, " ", params); + } + else if (!sheepyParams.clean) { + printf(BLD BLU "Compile only" RST " %s\n", rootMain); + } + + // compile options + char *m32bit; + char *ar32bit; + if (getG(cfgD, rtBool, "32bit")) { + m32bit = "-m32"; + ar32bit = "--target=elf32-i386"; + } + else { + m32bit = ""; + ar32bit = ""; + } + + //logVarG(dependencies); + // check updates in all dependencies + // create cDependencies dict + // key: c files + // value: array of direct/indirect includes + //puts("--- cDependencies"); + createAllocateSmallDict(cDependencies); + if (lenG(dependencies) > 0) { + const char *k; + iter(dependencies, depArray) { + k = iterKeyG(dependencies); + if (isC(k) || isCP(k)) { + cast(smallArrayt *, deps, dupG(depArray)) + cast(smallArrayt *, depsOrig, depArray) + // for each dep, append dep array to c dep array + // TODO check if the array is empty? + forEachSmallArray(depsOrig, dep) { + castS(depName, dep) + if (isH(ssGet(depName)) || isCH(ssGet(depName))) { + smallArrayt *thisDeps = getNDupG(dependencies, rtSmallArrayt, ssGet(depName));; + appendNSmashG(deps, thisDeps); + } + finishG(dep); + } + // uniquify deps + uniqG(deps, unusedV); + // add array to cDependencies + setG(cDependencies, k, deps); + } + } + } + + terminateG(dependencies); + + //logVarG(cDependencies); + + createAllocateSmallDict(toCompile); + + // check if h and c (not all of them are in the list) files are modified + if (lenG(cDependencies) > 0) { + const char *k; + iter(cDependencies, depValue) { + k = iterKeyG(cDependencies); + cast(smallArrayt *, hDeps, depValue) + + char *realCPath = catS(actualDir, "/", k);; + char *buildCPath = catS(buildPath, "/", k);; + // TODO free ^^ before continue and at the end + iNormalizePath(&realCPath); + iNormalizePath(&buildCPath); + // detect c file is updated + // get modification time for c file k + struct stat cst; + pError(stat(realCPath, &cst)) + free(realCPath); + + // check if object already exists in build path + if (isC(k)) { + setS(buildCPath, -1, 'o'); + } + else { + setS(buildCPath, -2, 'o'); + setS(buildCPath, -1, 0); + } + //puts(k); + //puts(buildCPath); + if (fileExists(buildCPath)) { + //puts("EXISTS"); + + struct stat ost; + pError(stat(buildCPath, &ost)) + if (cst.st_mtime != ost.st_mtime) { + //puts("DIFFERENT DATES RECOMPILE"); + addFileToCompile(actualDir, k, buildCPath, toCompile); + // copy header dates to not recompile unecesserarily next time + copyHeaderDates(actualDir, hDeps, buildPath); + free(buildCPath); + continue; + // else puts("C AND O HAVE SAME DATE SKIP COMPILATION - CHECK IF H FILES ARE UPDATED"); + // execute the code below + } + } + else { + // object file not found, compile c file + //puts("COMPILE"); + //puts(buildCPath); + addFileToCompile(actualDir, k, buildCPath, toCompile); + // copy header dates to not recompile unecesserarily next time + copyHeaderDates(actualDir, hDeps, buildPath); + free(buildCPath); + continue; + } + + // check if h files are modified + forEachSmallArray(hDeps, dep) { + castS(Dep, dep); + char *depName = ssGet(Dep); + + // get modification time for header depName + struct stat hst; + dum = catS(actualDir, "/", depName);; + pError(stat(dum, &hst)) + free(dum); + + dum = catS(buildPath, "/", depName, ".dep"); + //logVarG(depName); + //logVarG(dum); + if (fileExists(dum)) { + //puts("H EXISTS"); + // compare to header modification time in build path + struct stat bst; + pError(stat(dum, &bst)) + if (hst.st_mtime != bst.st_mtime) { + // header is updated + //puts("H UPDATED"); + char *hBP = catS(buildPath, "/", depName); + copyHeaderToBuildPath(actualDir, k, buildCPath, toCompile, hBP, hst); + // when h file is modified, recompile the associated C/CP file + if (!hasG(depName, PACKAGE_DIR)) { + char *cfile = dupG(depName); + if (isH(cfile)) { + setG(cfile, -1, 'c'); + } + else { + setG(cfile, -1, 'p'); + } + if (fileExists(cfile)) { + addFileToCompile(actualDir, cfile, buildCPath, toCompile); + } + free(cfile); + } + free(hBP); + } + else if (endsWithG(depName, ".a")) { + // check if package is newer than executable or library + // to handle case when several program/libraries use a common package + // (for example: 2 programs in the directory using a common package) + if (!sheepyParams.compileLib) { + // check buildExePath + if (fileExists(buildExePath)) { + struct stat bst; + pError(stat(buildExePath, &bst)) + if (bst.st_mtime < hst.st_mtime) { + // recompile source file k because the existing exe is older than the depName lib + if (!sheepyParams.clean) { + logI("recompile source file '%s' because the existing exe is older than %s", k, depName); + } + char *hBP = catS(buildPath, "/", depName); + copyHeaderToBuildPath(actualDir, k, buildCPath, toCompile, hBP, hst); + free(hBP); + } + } + } + else { + // check if package is newer than the library currently being built + char *libName = catS(rootMain, ".a");; + if (fileExists(libName)) { + struct stat bst; + pError(stat(libName, &bst)) + if (bst.st_mtime < hst.st_mtime) { + // recompile source file k because the existing exe is older than the depName lib + if (!sheepyParams.clean) { + logI("recompile source file '%s' because the existing exe is older than %s", k, depName); + } + char *hBP = catS(buildPath, "/", depName); + copyHeaderToBuildPath(actualDir, k, buildCPath, toCompile, hBP, hst); + free(hBP); + } + } + free(libName); + } + } + } + else { + // new h file: compile dependencies and copy h file to build path + char *hBP = catS(buildPath, "/", depName); + copyHeaderToBuildPath(actualDir, k, buildCPath, toCompile, hBP, hst); + free(hBP); + } + + free(dum); + finishG(dep); + } + } + } + + // add all c file to compile list + if (lenG(inc) > 0) { + smallArrayt *hList = duplicateG(inc); + forEachSmallArray(hList, incI) { + castS(L, incI) + + if (hasG(L, PACKAGE_DIR)) { + // the packages are already compiled + // dont need to compile corresponding c file + finishG(incI); + continue; + } + + if (isH(ssGet(L))) { + setG(L, -1, 'c'); + } + else { + setG(L, -1, 'p'); + } + + if (!fileExistsO(L)) { + // no corresponding c file + // skip + finishG(incI); + continue; + } + + // create object path + char *oPath; + + if (isC(ssGet(L))) { + setG(L, -1, 'o'); + oPath = catS(buildPath, "/", ssGet(L)); + // restore c extension + setG(L, -1, 'c'); + } + else { + char *tmp = toStringG(L); + setS(tmp, -2, 'o'); + setS(tmp, -1, 0); + oPath = catS(buildPath, "/", tmp); + free(tmp); + } + + + // compare c and o file dates + // get modification time for c file L + struct stat cst; + pError(stat(ssGet(L), &cst)) + + //putsG(L); + //puts(oPath); + if (fileExists(oPath)) { + //puts("EXISTS"); + + struct stat ost; + pError(stat(oPath, &ost)) + if (cst.st_mtime != ost.st_mtime) { + //puts("DIFFERENT DATES RECOMPILE"); + addFileToCompile(actualDir, ssGet(L), oPath, toCompile); + } + //else + // puts("C AND O HAVE SAME DATE SKIP COMPILATION"); + } + else { + // object file not found, compile c file + //puts("COMPILE"); + //puts(oPath); + addFileToCompile(actualDir, ssGet(L), oPath, toCompile); + } + + free(oPath); + finishG(incI); + } + terminateG(hList); + } + + //logVarG(toCompile); + + char **sourcesToCompile = keysG(toCompile); + + // TODO search index of mainSrc, delete from sourcesToCompile and remove if eqG(*src, mainSrc) + + // generate the h and c code from sheepy files + if (lenG(toCompile) > 0) { + forEachCharP(sourcesToCompile, src) { + if (eqG(*src, mainSrc)) { + // main c file is compiled seperately to take care of the hashbang + continue; + } + if (isCP(*src)) { + // convert cp to c + char *bpath = catS(buildPath, "/", *src); + setS(bpath, -1, 0); + // generate c + generateC(*src, bpath); + //copy(*src, bpath); + free(bpath); + + // convert ch to h + smallArrayt *deps = getG(cDependencies, rtSmallArrayt, *src); + if (deps != NULL && lenG(deps) > 0) { + forEachSmallArray(deps, dep) { + castS(depName, dep) + if (isCH(ssGet(depName))) { + bpath = catS(buildPath, "/", ssGet(depName)); + setS(bpath, -2, 'h'); + setS(bpath, -1, 0); + // generate h + copy(ssGet(depName), bpath); + free(bpath); + } + finishG(dep); + } + } + } + } + + // convert ch to h + forEachSmallArray(inc, INCF) { + castS(hFilename, INCF); + if (isCH(ssGet(hFilename))) { + char *bpath = catS(buildPath, "/", ssGet(hFilename)); + setS(bpath, -2, 'h'); + setS(bpath, -1, 0); + // generate h + copy(ssGet(hFilename), bpath); + free(bpath); + } + finishG(INCF); + } + } + + terminateG(cDependencies); + + // compile + + // modify dir when main is cp + // TODO remove -I dir not needed + if (isCP(mainSrc)) { + iPrependS(&dir, "/"); + iPrependS(&dir, buildPath); + } + + // create object path for main file to compile and link program + char *mainOPath = catS(buildPath, "/", mainSrc); + if (isC(mainSrc)) { + setS(mainOPath, -1, 'o'); + } + else { + // cp file + setS(mainOPath, -2, 'o'); + setS(mainOPath, -1, 0); + } + + + // load package.yml + dum = catS(dir,"/", PACKAGE); + smallDictt *pkgD = NULL;; + if (fileExists(dum)) { + createAllocateSmallJson(pkgInfo); + readFileG(pkgInfo, dum); + //putsG(pkgInfo); + + pkgD = getTopG(pkgInfo, rtSmallDictt); + finishG(pkgInfo); + } + free(dum); + + // continue after this when clean is set + if (!lenG(toCompile) && !sheepyParams.clean) { + // main doesnt need to be recompiled + //print 'main doesnt need to be recompiled' + if (sheepyParams.compileLib) { + // check if the library exists + char *libname = appendS(rootMain, ".so");; + if (!fileExists(libname)) { + free(libname); + goto linkOrClean; + } + free(libname); + libname = appendS(rootMain, ".a");; + if (!fileExists(libname)) { + free(libname); + goto linkOrClean; + } + // already compiled > finish + free(libname); + } + else if (!sheepyParams.dontCompileExe) { + if (!fileExists(buildExePath)) { + goto linkOrClean; + //TODO puts(BLD RED "Executable already compiled but not found in build folder!" RST); + //TODO XFAILURE + } + if (!isEmptyS(run)) { + // the exe is compiled and the user wants to run it + dum = malloc(strlen(buildExePath) + strlen(params) + 1 + 1); + sprintf(dum, "%s %s", buildExePath, params); + setMaxLogLevel(LOG_DISABLE); + programResult += commandNFree(dum); + setMaxLogLevel(LOG_INFO); + } + } + goto finish; + // NOTE: free variables allocated after this line before finish:, to avoid freeing initialized buffers + } + + // delete existing executable in buildPath + // to avoid running an old executable when the compilation fails + if (fileExists(buildExePath)) { + rmAll(buildExePath); + } + + // setup cflags key depending on the options: -c cflags, -t testCflags, -m memcheckCflags + const char *cflagsKey; + const char *cflagsAlwaysKey; + + if (sheepyParams.test) { + cflagsKey = "testCflags"; + cflagsAlwaysKey = "testCflagsAlways"; + } + else if (sheepyParams.memcheck) { + cflagsKey = "memcheckCflags"; + cflagsAlwaysKey = "memcheckCflagsAlways"; + } + else { + cflagsKey = "cflags"; + cflagsAlwaysKey = "cflagsAlways"; + } + + + // get compile options from user configuration + char *cflags = NULL;; + if (pkgD) { + cflags = getG(pkgD, rtChar, cflagsKey); + if (!cflags) { + cflags = getG(cfgD, rtChar, cflagsKey); + } + } + else { + cflags = getG(cfgD, rtChar, cflagsKey); + } + + if (!cflags) { + cflags = emptySF(); + } + else { + cflags = dupG(cflags); + } + + if (hasG(cfgD, cflagsAlwaysKey) && !isBlankG(getG(cfgD, rtChar, cflagsAlwaysKey))) { + if (!isBlankG(cflags)) { + prependG(&cflags, ' '); + } + prependG(&cflags, getG(cfgD, rtChar, cflagsAlwaysKey)); + } + //logVarG(cflags); + + if (sheepyParams.clean) { + // continue after this when clean is set + goto linkOrClean; + } + + if (hasG(toCompile, mainSrc)) { + // compile main c file + + FILE* fp; + char *cc; + if (!getG(cfgD, rtBool, "tcc")) { + asprintf(&cc, GCC " %s %s -I %s -I %s -o %s -c %s", cflags, m32bit, dir, libsheepyIncDir, mainOPath, mainCPath); + } + else { + cc = malloc(strlen(dir) + strlen(libsheepyIncDir) + strlen(mainOPath) + strlen(mainCPath) + 1 + 19); + sprintf(cc, "tcc -I %s -I %s -o %s -c %s", dir, libsheepyIncDir, mainOPath, mainCPath); + } + //char *cc = "cat" + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cc); + } + programResult += command(cc); + + // compile includes + } + char *subcc; + if (!getG(cfgD, rtBool, "tcc")) { + asprintf(&subcc, GCC " %s %s -I %s -I %s -c -o", cflags, m32bit, dir, libsheepyIncDir); + } + else { + subcc = malloc(strlen(dir) + strlen(libsheepyIncDir) + 1 + 17); + sprintf(subcc, "tcc -I %s -I %s -c -o", dir, libsheepyIncDir); + } + + free(cflags); + + if (listLengthS(sourcesToCompile) > 0) { + forEachCharP(sourcesToCompile, src) { + if (eqG(*src, mainSrc)) { + // main c file is compiled seperately to take care of the hashbang + continue; + } + + // set c file path and create object path + char *cpath; + char *oPath; + if (isC(*src)) { + cpath = catS(actualDir, "/", *src); + oPath = catS(buildPath, "/", *src); + } + else { + // cp file has been converted to c in buildPath + cpath = catS(buildPath, "/", *src); + setS(cpath, -1, 0); + oPath = strdup(cpath); + } + setS(oPath, -1, 'o'); + + // create compile command and run with system + createAllocateSmallArray(ccmdL); + + pushG(ccmdL, subcc); + + char *buildMirrorD; + // macOS: touch object to avoid error in macOS + buildMirrorD = catS("touch ", oPath); + char *D = shDirname(oPath); + mkdirParents(D); + free(D); + programResult += commandNFree(buildMirrorD); + buildMirrorD = shDirname(oPath); + if (!fileExists(buildMirrorD)) { + // create c file dir in homedir/build + mkdirParents(buildMirrorD); + } + free(buildMirrorD); + pushNFreeG(ccmdL, oPath); + + pushG(ccmdL, cpath); + char *ccmd = joinSG(ccmdL, " "); + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", ccmd); + } + + if (sheepyParams.parallel) { + // compile in parallel + // create argument list for child process that compile the source code + char **jobArgs = split(ccmd, " ");; + terminateG(ccmdL); + + // remove possible empty strings due to split before + iListCompactS(&jobArgs); + spawnProc(childProc, jobArgs); + listFreeS(jobArgs); + } + else { + programResult += command(ccmd); + } + free(ccmd); + } + } + + free(subcc); + + if (sheepyParams.parallel) { + // wait for the compilation to finish and start linking + waitForJobs(); + } + + // link and run + linkOrClean: + + listFreeS(sourcesToCompile); + + // list include objects and libraries in incObjFiles + char *incObjFiles; + // collect lflags from packages + char *packageLflags = NULL;; + createAllocateSmallArray(incList); + forEachSmallArray(inc, incL) { + castS(L, incL) + if (eqG(L, mainH)) { + // main c file is already in the compile list, dont add the main object file to avoid multiple definitions + // while linking + finishG(L); + continue; + } + char *s = strdup(ssGet(L)); + + if (hasG(L, PACKAGE_DIR)) { + // the packages are already compiled + // use the static library + if (isH(ssGet(L))) { + setS(s, -1, 'a'); + } + else { + // L is .ch extension + setS(s, -2, 'a'); + setS(s, -1, 0); + } + // the path in L can contain subdirectories in the package + // shpPackages/ini/src/ini.a + // the package is compiled at the package root + // remove the the subdirectories in L + smallStringt *sp = allocG(s); + smallArrayt *arr = splitG(sp, "/");; + terminateG(sp); + + int keepIndex; + // find package dir in L + enumerateSmallArray(arr, E, i) { + if (eqG(E, PACKAGE_DIR)) { + keepIndex = i; + finishG(E); + break; + } + finishG(E); + } + + // keep package name and delete subdirectories + delG(arr, keepIndex+2, -1); + //logVarG(arr); + + free(s); + s = joinSG(arr, "/"); + terminateG(arr); + if (!fileExists(s)) { + // link library only when it exists, there is no library in header only packages + free(s); + finishG(L); + continue; + } + + // collect lflags for this package + char *pkg = shDirnameG(s);; + iAppendManyS(&pkg, "/", PACKAGE); + //logVarG(pkg); + createAllocateSmallJson(pkgJ); + if (readFileG(pkgJ, pkg)) { + if (!isBlankG(getG(pkgJ, rtChar, "lflags"))) { + iAppendManyS(&packageLflags, " ", getG(pkgJ, rtChar, "lflags")); + } + } + free(pkg); + terminateG(pkgJ); + } + else { + // it is allowed to include an h without a corresponding c file + if (isH(ssGet(L))) { + setG(L, -1, 'c'); + } + else { + // L is .ch extension + setS(s, -1, 'p'); + } + dum = catS(actualDir, "/", ssGet(L)); + if (!fileExistsG(dum)) { + // no corresponding c file + // skip + freeManyS(L,s, dum); + continue; + } + free(dum); + + if (isC(ssGet(L))) { + setS(s, -1, 'o'); + } + else { + // L is .ch extension + setS(s, -2, 'o'); + setS(s, -1, 0); + } + iPrependS(&s, "/"); + iPrependS(&s, buildPath); + } + pushG(incList, s); + free(s); + finishG(L); + } + + // uniquify the object list to avoid multiple symbol definitions + uniqG(incList, unusedV); + + //logVarG(inc); + //logVarG(incList) + + if (sheepyParams.clean) { + // clean objects + // mainCPath is the generacted main in .sheepy + if (fileExistsG(mainCPath)) { + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("rm %s", mainCPath); + printf("\n"); + } + rmAll(mainCPath); + } + if (fileExistsG(mainOPath)) { + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("rm %s", mainOPath); + printf("\n"); + } + rmAll(mainOPath); + } + if (getG(cfgD, rtBool, "clean_exe")) { + // delete executable or library (.a and .so) + // executable in buildExePath is already deleted (above after if !lenG(toCompile)) + if (fileExists(exePath)) { + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("rm %s", exePath); + printf("\n"); + } + rmAll(exePath); + } + char *libname = appendS(rootMain, ".so");; + if (fileExists(libname)) { + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("rm %s", libname); + printf("\n"); + } + rmAll(libname); + } + free(libname); + libname = appendS(rootMain, ".a");; + if (fileExists(libname)) { + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("rm %s", libname); + printf("\n"); + } + rmAll(libname); + } + free(libname); + } + forEachSmallArray(incList, incL) { + castS(L, incL) + + // L is in the format: shpPackages/NAME/NAME.a + if (hasG(L, PACKAGE_DIR)) { + // the packages are already compiled + // keep .a files + finishG(L); + continue; + } + + if (fileExistsG(ssGet(L))) { + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("rm %s", ssGet(L)); + printf("\n"); + } + rmAll(ssGet(L)); + } + finishG(L); + } + + free(mainOPath); + terminateG(incList); + goto finish; + } + + incObjFiles = joinSG(incList, " "); + if (!incObjFiles) { + // when there are no other object files beside the main one, set incList to empty string + emptyS(incObjFiles); + } + + terminateG(incList); + //logVarG(incObjFiles) + + // setup lflags key depending on the options: -c lflags, -t testLflags, -m memcheckLflags + const char *lflagsKey; + + if (sheepyParams.test) { + lflagsKey = "testLflags"; + } + else if (sheepyParams.memcheck) { + lflagsKey = "memcheckLflags"; + } + else { + lflagsKey = "lflags"; + + // create link command gcc/tcc exe/lib/no linking + } + char *lflags; + if (pkgD) { + lflags = getG(pkgD, rtChar, lflagsKey); + if (!lflags) { + lflags = getG(cfgD, rtChar, lflagsKey); + } + } + else { + lflags = getG(cfgD, rtChar, lflagsKey); + } + if (!lflags) { + lflags = ""; + } + + lflags = dupG(lflags);; + + if (!isBlankG(packageLflags)) { + appendG(&lflags, packageLflags); + free(packageLflags); + } + //logVarG(lflags); + + // setup linkWithGold key depending on the options: -c compile, -t test, -m memcheck + const char *linkWithGoldKey; + + if (sheepyParams.test) { + linkWithGoldKey = "testLinkWithGold"; + } + else if (sheepyParams.memcheck) { + linkWithGoldKey = "memcheckLinkWithGold"; + } + else { + linkWithGoldKey = "linkWithGold"; + } + + char *ld; + if (!getG(cfgD, rtBool, "tcc")) { + char *linker; + if (getG(cfgD, rtBool, linkWithGoldKey)) { + linker = " -fuse-ld=gold -Xlinker --threads"; + } + else { + linker = ""; + } + + if (!sheepyParams.compileLib) { + if (!sheepyParams.dontCompileExe) { + asprintf(&ld, GCC " %s -o %s %s %s %s/%s "PTHREAD" %s%s %s", m32bit, buildExePath, mainOPath, incObjFiles, libsheepyDir, libsheepy, lflags, linker, run); + } + else { + ld = emptySF(); + } + } + else { + // link library in current folder + asprintf(&ld, "gcc %s -shared -o %s.so %s %s %s/%s "PTHREAD" %s%s", m32bit, rootMain, mainOPath, incObjFiles, libsheepyDir, libsheepy, lflags, linker); + } + } + else { + // TODO update command + ld = malloc(strlen(rootMain) + strlen(rootMain) + strlen(incObjFiles) + strlen(libsheepyDir) + strlen(libsheepy) + strlen(lflags) + strlen(run) + 1 + 24); + sprintf(ld, "tcc -o %s %s.o %s %s/%s -pthread %s %s", rootMain, rootMain, incObjFiles, libsheepyDir, libsheepy, lflags, run); + } + + free(lflags); + + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", ld); + } + + // hide eventual error from the compiled program + setMaxLogLevel(LOG_DISABLE); + programResult += commandNFree(ld); + setMaxLogLevel(LOG_INFO); + + // build static lib + if (sheepyParams.compileLib) { + // link library in current folder + // options: c create, q append objects, T thin archive for recursive library dependencies in packages + ld = malloc(strlen(ar32bit) + strlen(rootMain) + strlen(mainOPath) + strlen(incObjFiles) + 1 + 25); + sprintf(ld, "ar %s -cqT %s.a %s %s > /dev/null", ar32bit, rootMain, mainOPath, incObjFiles); + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", ld); + } + programResult += commandNFree(ld); + } + + // mainOPath is not used after link step + free(mainOPath); + free(incObjFiles); + + //puts("LIST SOURCES"); + //TODO use logE in pError0 and setModificationTime and disable logging with setMaxLogLevel + if (lenG(toCompile) > 0) { + // copy c file modified dates to newly created object files + iter(toCompile, info) { + cast(smallContainert *, infoC, info) + srcFilet *srcF = getG(infoC, rtVoid, 0); + //print srcF->fpath + + if (isH(srcF->bpath) || isCH(srcF->bpath)) { + char *dep = catS(srcF->bpath, ".dep"); + if (!fileExistsG(dep)) { + logW("'%s' not found.", dep); + } + else { + pError0(setModificationTime(dep, srcF->st.st_mtime)) { + // bug in cg_c + } + } + } + else { + if (!fileExistsG(srcF->bpath)) { + logW("'%s' not found.", srcF->bpath); + } + else { + pError0(setModificationTime(srcF->bpath, srcF->st.st_mtime)) { + // bug in cg_c + } + } + } + } + } + + // TODO free toCompile and containers + + + finish: + // copy exe + if (isEmptyS(run) && !sheepyParams.dontCompileExe) { + // copy it to main source folder + copy(buildExePath, exePath); + if (!sheepyParams.clean) { + printf("Built Executable: %s", exePath); + printf("\n"); + } + } + if (getG(cfgD, rtBool, "print_compile_commands") && !isEmptyS(run) && !sheepyParams.clean) { + printf("Built executable: %s", buildExePath); + printf("\n"); + } + + // free + free(mainCPath); + free(buildExePath); + free(buildPath); + free(mainH); + free(mainFilename); + free(exePath); + free(mainSrc); + terminateG(inc); + free(actualDir); + free(dir); + listFreeS(rootMain_l); + terminateG(paramL); + free(params); + free(run); + free(cfgD); + terminateG(cfgJ) + free(homedir); + finalizeLibsheepy(); + + exit(programResult); +} + +char *getInclude(smallStringt *L) { + char *r = NULL; + + if (strncmp(ssGet(L), "#include ", strlen("#include ")) == 0 && !hasG(L,"libsheepy.h") && !hasG(L, "libsheepyObject.h")) { + char **genericLib = extractS(ssGet(L), "<", ">"); + if (listLengthS(genericLib) == 0) { + char **incFileL = splitSG(L, "\""); + if (listLengthS(incFileL) > 2) { + r = strdup(incFileL[1]); + } + listFreeS(incFileL); + } + listFreeS(genericLib); + } + return(r); +} + +void addFileToCompile(char *actualDir, const char *cFileName, char *oPath, smallDictt *toCompile) { + + // add c file to compile list + if (!hasG(toCompile, cFileName)) { + srcFilet *srcI; + // allocate srcFile info, set later + srcI = malloc(sizeof(srcFilet)); + char *tmp = catS(actualDir, "/", cFileName);; + pError(stat(tmp, &(srcI->st))) + srcI->fpath = strdup(tmp); + srcI->bpath = strdup(oPath); + free(tmp); + smallContainert *srcFInfo = allocSmallContainer(srcI);; + setNFreeG(toCompile, cFileName, srcFInfo); +} + } + + +void copyHeaderToBuildPath(char *actualDir, const char *cFileName, char *oPath, smallDictt *toCompile, char *bPath, struct stat hst) { + + addFileToCompile(actualDir, cFileName, oPath, toCompile); + + // 'copy' header to build path, to check modification time next time + // the h.dep hold the modification time of the original header + char *tmp = catS("touch ", bPath, ".dep"); + char *D = shDirname(bPath); + mkdirParents(D); + free(D); + programResult += commandNFree(tmp); + + // copy modification time + char *b = catS(bPath, ".dep");; + pError0(setModificationTime(b, hst.st_mtime)) { + free(b); + // bug in cg_c - IF in MODIFICATION +} + } + + +void copyHeaderDates(char *actualDir, smallArrayt *hDeps, char *buildPath) { + + forEachSmallArray(hDeps, dep) { + char *depName = toStringG(dep); + + // get modification time for header depName + struct stat hst; + char *tmp = catS(actualDir, "/", depName); + pError(stat(tmp, &hst)) + free(tmp); + + char *bPath = catS(buildPath, "/", depName, ".dep"); + //puts(depName); + //puts(bPath); + + // 'copy' header to build path, to check modification time next time + tmp = catS("touch ", bPath); + char *D = shDirname(bPath); + mkdirParents(D); + free(D); + programResult += commandNFree(tmp); + + // copy modification time + pError0(setModificationTime(bPath, hst.st_mtime)) { + + finishG(dep); +} + } + } + +bool symlinkFile(char *path, char *buildPath) { + bool r = false;; + + if (!isCH(path) && !isCP(path) && fileExists(path)) { + if (!fileExists(buildPath)) { + // symlink (h) file + char *D = shDirname(buildPath); + mkdirParents(D); + free(D); + char *cmd = catS("ln -s ", path, " ", buildPath); + programResult += commandNFree(cmd); + } + r = true; + } + return(r); +} + +bool isC(const char *path) { + + if (getS(path, -1) == 'c') { + return(true); + } + else { + return(false); +} + } + +bool isH(const char *path) { + + if (getS(path, -2) == '.' && getS(path, -1) == 'h') { + return(true); + } + else { + return(false); +} + } + +bool isCP(const char *path) { + + if (getS(path, -2) == 'c' && getS(path, -1) == 'p') { + return(true); + } + else { + return(false); +} + } + +bool isCH(const char *path) { + + if (getS(path, -2) == 'c' && getS(path, -1) == 'h') { + return(true); + } + else { + return(false); +} + } + +void generateC(char *src, char *bpath) { + + createAllocateSmallArray(sheepySrc); + readFileG(sheepySrc, src); + + createAllocateSmallArray(cCode); + + generateCBuffers(sheepySrc, cCode); + + writeFileG(cCode, bpath); + + terminateG(sheepySrc); + terminateG(cCode); +} + + +void generateCBuffers(smallArrayt *sheepySrc, smallArrayt *cCode) { + + generatedC = cCode; + initiateAllocateSmallArray(&sheepyC); + initiateAllocateSmallArray(&stateStack); + initiateAllocateSmallArray(&textStack); + + smallStringt *srcO = joinG(sheepySrc, "\n"); + char *src = ssGet(srcO); + size_t len = strlen(src) +2; + *(src-1) = 0; + quex_Token* token_p = NULL; + size_t number_of_tokens = 0; + quex_EasyLexer qlex; + bool start = true; + + /* if len <= QUEX_SETTING_BUFFER_MIN_FALLBACK_N+2 */ + /* char *tmp = realloc(src-1, QUEX_SETTING_BUFFER_MIN_FALLBACK_N+3); */ + /* len = QUEX_SETTING_BUFFER_MIN_FALLBACK_N+3 */ + /* src = tmp+1 */ + + quex_EasyLexer_from_memory(&qlex, (QUEX_TYPE_LEXATOM*)(src-1), len, (QUEX_TYPE_LEXATOM*)(src+len-2)); + + //#ifdef PRINT_TOKEN + const size_t BufferSize = 1024; + char buffer[1024]; + //#endif + while ((start == true) || (token_p->_id != QUEX_TKN_TERMINATION)) { + start = false; + quex_EasyLexer_receive(&qlex, &token_p); + // process token with the state machine + char *text = (char*)QUEX_NAME_TOKEN(pretty_char_text)(token_p, buffer, BufferSize); + range(i, TRANSITIONS) { + if (stateTkn(i) == -1) { + // no more next state, stop + STATEDEFAULTF[stateM](stateM, text); + break; + } + if (token_p->_id == stateTkn(i)) { + callNxt(i); + break; + } + } + + //printf("nxt stateM %s, %s \n", STATESSTR[stateM], QUEX_NAME_TOKEN(get_string)(token_p, buffer, BufferSize)); + ++number_of_tokens; + } + + quex_EasyLexer_destruct(&qlex); + + terminateG(srcO); + + //printf("| [END] number of token = %i\n", (int)number_of_tokens); + + // TODO free stuff +} + +void splash(void) { + + putsG( + " __ _\n" + " .-.' `; `-._ __ _\n" + " (_, .-:' `; `-._\n" + " ,'o\"( (_, )\n" + " (__,-' ,'o\"( sheepy )>\n" + " ( (__,-' )\n" + " `-'._.--._( )\n" + " ||| |||`-'._.--._.-'\n" + " ||| |||\n" + "Project: " BLD WHT "https://spartatek.se/r/sheepy/file/README.md.html" RST "\n" + "Libsheepy documentation: " BLD WHT "https://spartatek.se/libsheepy/" RST "\n" + ); +} + +// vim: set expandtab ts=2 sw=2: diff --git a/src/sheepy.h b/src/sheepy.h @@ -0,0 +1,529 @@ +// MIT License +// +// Copyright (c) 2019 Remy Noulin +// +// 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. + +struct { + int compileLib; + int compileOnly; + int dontCompileExe; + int clean; + int test; + int memcheck; + int new; + int showExe; + int removeBuild; + int parallel; + int cclass; + int genTest; + int libsheepyMemcheck; +} sheepyParams; + +// MacOS definition +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + + +#define H_CLASS_TEMPLATE "#pragma once\n\ +\n\ +/* Libsheepy documentation: https://spartatek.se/libsheepy/ */\n\ +/* Add class methods and class data where there are the TODOs (TODO)*/\n\ +\n\ +/* TODO add generics: #define amethodG(obj) (obj)->f->amethod(obj) */\n\ +\n\ +/* Class classTemplate */\n\ +typ struct classTemplate classTemplatet;\n\ +\n\ +/* for object inheriting classTemplate, cast to classTemplate to be able to use this class functions and generics*/\n\ +#define cClassTemplate(self) ( (classTemplatet*) self )\n\ +\n\ +typ void (*freeClassTemplateFt) (classTemplatet *self);\n\ +typ void (*terminateClassTemplateFt) (classTemplatet **self);\n\ +typ char* (*toStringClassTemplateFt) (classTemplatet *self);\n\ +typ classTemplatet* (*duplicateClassTemplateFt) (classTemplatet *self);\n\ +typ void (*smashClassTemplateFt) (classTemplatet **self);\n\ +\n\ +/**\n\ + * free classTemplate\n\ + */\n\ +typ void (*finishClassTemplateFt) (classTemplatet **self);\n\ +\n\ +typ const char* (*helpClassTemplateFt) (classTemplatet *self);\n\ +/* TODO add function typ with pattern: functionNameClassTemplateFt */\n\ +\n\ +/**\n\ + * class functions\n\ + * allocated once for all objects\n\ + *\n\ + * freed with finalizeClassTemplate\n\ + */\n\ +\n\ +/**\n\ + * use this define in child classes and add the new function after this class functions\n\ + *\n\ + * in this define, add the methods after <finishClassTemplateFt finish;>\n\ + *\n\ + * Example:\n\ + * #define RINGFUNCTIONST \\n\ + * CLASSTEMPLATEFUNCTIONST; \\n\ + * setSizeRingFt setSize\n\ + */\n\ +#define CLASSTEMPLATEFUNCTIONST \\\n\ + helpClassTemplateFt help\n\ + /* TODO ADD METHODS AFTER <finishClassTemplateFt finish;> HERE */\n\ +\n\ +typ struct {\n\ + freeClassTemplateFt free;\n\ + terminateClassTemplateFt terminate;\n\ + toStringClassTemplateFt toString;\n\ + duplicateClassTemplateFt duplicate;\n\ + smashClassTemplateFt smash;\n\ + finishClassTemplateFt finish;\n\ + CLASSTEMPLATEFUNCTIONST;\n\ +} classTemplateFunctionst;\n\ +\n\ +/**\n\ + * class\n\ + */\n\ +struct classTemplate {\n\ + const char *type;\n\ + classTemplateFunctionst *f;\n\ + /* TODO add class data */\n\ +};\n\ +\n\ +/* classTemplate */\n\ +\n\ +/** return true when this object file was compiled with current libsheepy version */\n\ +#define isClassTemplateCompiledWithCurrentLisheepyVersion checkLibsheepyVersionClassTemplate(LIBSHEEPY_VERSION)\n\ +bool checkLibsheepyVersionClassTemplate(const char *currentLibsheepyVersion);\n\ +\n\ +#define createClassTemplate(obj) ;classTemplatet obj; initiateClassTemplate(&obj)\n\ +#define createAllocateClassTemplate(obj) ;classTemplatet *obj; initiateAllocateClassTemplate(&obj)\n\ +\n\ +void initiateClassTemplate(classTemplatet *self);\n\ +void initiateAllocateClassTemplate(classTemplatet **self);\n\ +void finalizeClassTemplate(void);\n\ +\n\ +/* initialize class methods, call registerMethodsClassTemplate from classes inheriting this class */\n\ +void registerMethodsClassTemplate(classTemplateFunctionst *f);\n\ +\n\ +classTemplatet* allocClassTemplate(void/*TODO INIT DATA */);\n\ +\n\ +/* end class classTemplate*/\n\ +// vim: set expandtab ts=2 sw=2:" + + + +#define C_CLASS_TEMPLATE "\n\ +\n\ +/* Libsheepy documentation: https://spartatek.se/libsheepy/ */\n\ +/* Add class methods and modify the base functions (free, duplicate, ...) where there are the TODOs (TODO)*/\n\ +\n\ +#include \"libsheepyObject.h\"\n\ +#include \"classTemplate.h\"\n\ +#include \"classTemplateInternal.h\"\n\ +\n\ +#include <stdlib.h>\n\ +#include <string.h>\n\ +#include <stdio.h>\n\ +\n\ +void initiateClassTemplate(classTemplatet *self);\n\ +void registerMethodsClassTemplate(classTemplateFunctionst *f);\n\ +void initiateAllocateClassTemplate(classTemplatet **self);\n\ +void finalizeClassTemplate(void);\n\ +classTemplatet* allocClassTemplate(void);\n\ +local void freeClassTemplate(classTemplatet *self);\n\ +local void terminateClassTemplate(classTemplatet **self);\n\ +local char* toStringClassTemplate(classTemplatet *self);\n\ +local classTemplatet* duplicateClassTemplate(classTemplatet *self);\n\ +local void smashClassTemplate(classTemplatet **self);\n\ +local void finishClassTemplate(classTemplatet **self);\n\ +local const char* helpClassTemplate(classTemplatet *self);\n\ +/* TODO add prototypes */\n\ +\n\ +/* enable/disable logging */\n\ +/* #undef pLog */\n\ +/* #define pLog(...) */\n\ +\n\ +bool checkLibsheepyVersionClassTemplate(const char *currentLibsheepyVersion) {\n\ + return eqG(currentLibsheepyVersion, LIBSHEEPY_VERSION);\n\ +}\n\ +\n\ +void initiateClassTemplate(classTemplatet *self) {\n\ +\n\ + self->type = \"classTemplate\";\n\ + if (!classTemplateF) {\n\ + classTemplateF = malloc(sizeof(classTemplateFunctionst));\n\ + registerMethodsClassTemplate(classTemplateF);\n\ + pErrorNot0(atexit(finalizeClassTemplate));\n\ + }\n\ + self->f = classTemplateF;\n\ + /* TODO Initialize object data */\n\ +}\n\ +\n\ +void registerMethodsClassTemplate(classTemplateFunctionst *f) {\n\ +\n\ + f->free = freeClassTemplate;\n\ + f->terminate = terminateClassTemplate;\n\ + f->toString = toStringClassTemplate;\n\ + f->duplicate = duplicateClassTemplate;\n\ + f->smash = smashClassTemplate;\n\ + f->finish = finishClassTemplate;\n\ + f->help = helpClassTemplate;\n\ + /* TODO add class functions */\n\ +}\n\ +\n\ +void initiateAllocateClassTemplate(classTemplatet **self) {\n\ +\n\ + if (self) {\n\ + (*self) = malloc(sizeof(classTemplatet));\n\ + if (*self) {\n\ + initiateClassTemplate(*self);\n\ + }\n\ + }\n\ +}\n\ +\n\ +void finalizeClassTemplate(void) {\n\ +\n\ + if (classTemplateF) {\n\ + free(classTemplateF);\n\ + classTemplateF = NULL;\n\ + }\n\ +}\n\ +\n\ +classTemplatet* allocClassTemplate(void/* TODO change parameter to get the initial data for the object */) {\n\ + classTemplatet *r = NULL;\n\ +\n\ + initiateAllocateClassTemplate(&r);\n\ + /* TODO copy data given in parameter to the object */\n\ + ret r;\n\ +}\n\ +\n\ +\n\ +local void freeClassTemplate(classTemplatet *self) {\n\ +\n\ + /* TODO free internal data (not the structure holding the function pointers) */\n\ +}\n\ +\n\ +local void terminateClassTemplate(classTemplatet **self) {\n\ +\n\ + freeClassTemplate(*self);\n\ + finishClassTemplate(self);\n\ +}\n\ +\n\ +\n\ +local char* toStringClassTemplate(classTemplatet *self) {\n\ +\n\ + /* TODO convert object data to string */\n\ + ret strdup(\"TODO - classTemplate\");\n\ +}\n\ +\n\ +local classTemplatet* duplicateClassTemplate(classTemplatet *self) {\n\ +\n\ + createAllocateClassTemplate(dup);\n\ + /* TODO COPY data */\n\ + ret dup;\n\ +}\n\ +\n\ +local void smashClassTemplate(classTemplatet **self) {\n\ +\n\ + finishClassTemplate(self);\n\ +}\n\ +\n\ +#if NFreeStackCheck\n\ +local void finishClassTemplate(classTemplatet **self) {\n\ +\n\ + register u64 rsp asm(\"rsp\");\n\ + if ((u64)*self > rsp) {\n\ + logW(\"Probably trying to free a smallArray on stack: \"BLD\"%p\"RST\" sp: \"BLD\"%p\"RST, *self, rsp);\n\ + logBtrace;\n\ + }\n\ + else {\n\ + free(*self);\n\ + *self = NULL;\n\ + }\n\ +}\n\ +#else\n\ +// #if NFreeStackCheck\n\ +local void finishClassTemplate(classTemplatet **self) {\n\ +\n\ + free(*self);\n\ + *self = NULL;\n\ +}\n\ +#endif\n\ +// #if NFreeStackCheck\n\ +\n\ +local const char* helpClassTemplate(classTemplatet UNUSED *self) {\n\ + ret \"TODO - classTemplate help\";\n\ +}\n\ +/* TODO add method implementations */\n\ +// vim: set expandtab ts=2 sw=2:" + + +#define INTERNAL_H_CLASS_TEMPLATE "#pragma once\n\ +\n\ +static classTemplateFunctionst *classTemplateF = NULL;\n\ +\n\ +/* TODO declare structs for private data and add a void pointer to the private data in the class declaration */\n\ +\n\ +// vim: set expandtab ts=2 sw=2:" + +#define C_TEST_TEMPLATE ""\ +"#! /usr/bin/env sheepy\n"\ +"/* or direct path to sheepy: #! /usr/local/bin/sheepy */\n"\ +"\n"\ +"/** \\file\n"\ +" * Each test must be independent and self contained\n"\ +" */\n"\ +"\n"\ +"#include <check.h>\n"\ +"\n"\ +"//START MEM TEST ANCHOR\n"\ +"\n"\ +"#include \"libsheepyObject.h\"\n"\ +"//TODO Add relevant includes\n"\ +"\n"\ +"int argc; char **argv;\n"\ +"\n"\ +"// TODO Declare an object of the class under test\n"\ +"\n"\ +"\n"\ +"START_TEST(basetT)\n"\ +"\n"\ +" // STEPS\n"\ +" // init\n"\ +" // init allocate\n"\ +" // terminate\n"\ +" // allocate\n"\ +" // string\n"\ +" // duplicate\n"\ +"\n"\ +" // init\n"\ +" //TODO initiate();\n"\ +" //TODO freeO();\n"\ +"\n"\ +" // init allocate\n"\ +" //TODO declare object pointer\n"\ +" //TODO initiateAllocate();\n"\ +"\n"\ +" // terminate\n"\ +" //TODO terminateO();\n"\ +"\n"\ +" // allocate\n"\ +" //TODO = alloc();\n"\ +"\n"\ +" // string\n"\ +" //TODO char *s = toStringO();\n"\ +"\n"\ +" //TODO ck_assert_str_eq(s, \"TODO - \");\n"\ +" //TODO free(s);\n"\ +"\n"\ +" // duplicate\n"\ +" //TODO class *oDup = duplicateO();\n"\ +" //TODO terminateO(oDup);\n"\ +" //TODO terminateO();\n"\ +"\n"\ +"END_TEST\n"\ +"\n"\ +"//TODO add more tests\n"\ +"\n"\ +"Suite * testTemplateSuite(void) {\n"\ +" Suite *s;\n"\ +" TCase *tc_core;\n"\ +"\n"\ +" s = suite_create(\"testTemplate\");\n"\ +"\n"\ +" /* Core test case */\n"\ +" tc_core = tcase_create(\"Core\");\n"\ +"\n"\ +"\n"\ +" tcase_add_test(tc_core, basetT);\n"\ +"\n"\ +" //TODO register tests\n"\ +"\n"\ +" suite_add_tcase(s, tc_core);\n"\ +"\n"\ +" ret s;\n"\ +"}\n"\ +"\n"\ +"int main(int ARGC, char** ARGV) {\n"\ +"\n"\ +" argc = ARGC; argv = ARGV;\n"\ +"\n"\ +" //dont initialize libsheepy, it conflicts with libcheck - initLibsheepy(ARGV[0]);\n"\ +" setLogMode(LOG_FUNC);\n"\ +"\n"\ +" int number_failed;\n"\ +" Suite *s;\n"\ +" SRunner *sr;\n"\ +"\n"\ +" s = testTemplateSuite();\n"\ +" sr = srunner_create(s);\n"\ +"\n"\ +" srunner_run_all(sr, CK_NORMAL);\n"\ +" number_failed = srunner_ntests_failed(sr);\n"\ +" srunner_free(sr);\n"\ +"\n"\ +" exit((number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"\ +"}\n"\ +"// vim: set expandtab ts=2 sw=2:" + +#define MEMTEST_C_TEMPLATE_NAME "memTest.c.template" +#define MEMTEST_C_TEMPLATE "\ +#include <stdlib.h>\n\ +#include <stdio.h>\n\ +#include <string.h>\n\ +\n\ +#define ck_assert_str_eq(a,b) a;b;\n\ +#define ck_assert_str_ne(a,b) a;b;\n\ +#define ck_assert_ptr_eq(a,b) a;b;\n\ +#define ck_assert_ptr_ne(a,b) a;b;\n\ +#define ck_assert_uint_eq(a,b) a;b;\n\ +#define ck_assert_uint_ne(a,b) a;b;\n\ +#define ck_assert_int_eq(a,b) a;b;\n\ +#define ck_assert_int_ne(a,b) a;b;\n\ +#define ck_assert(a) a;\n\ +\n\ +__tests\n\ +\n\ +int main(int n, char**v) {\n\ +\n\ +initLibsheepy(v[0]);\n\ +setLogMode(LOG_FUNC);\n\ +\n\ +__calls\n\ +}\ +" + +#define RUNMEMTEST_TEMPLATE_NAME "runMemtest.c" +#define RUNMEMTEST_TEMPLATE ""\ +"#! /usr/bin/env sheepy\n"\ +"/* or direct path to sheepy: #! /usr/local/bin/sheepy */\n"\ +"\n"\ +"//\n"\ +"// in unit test file, add line:\n"\ +"// //START MEM TEST ANCHOR\n"\ +"//\n"\ +"//\n"\ +"\n"\ +"#include \"libsheepyObject.h\"\n"\ +"\n"\ +"#include <stdlib.h>\n"\ +"#include <stdio.h>\n"\ +"\n"\ +"int argc; char **argv;\n"\ +"\n"\ +"enum {START, TEST, TESTEND, SEARCH};\n"\ +"\n"\ +"int main(int ARGC, char** ARGV) {\n"\ +" char **list = NULL;\n"\ +" char **tests = NULL;\n"\ +" char **functions = NULL;\n"\ +" char **result = NULL;\n"\ +"\n"\ +" argc = ARGC; argv = ARGV;;//\n"\ +"\n"\ +" initLibsheepy(argv[0]);\n"\ +"\n"\ +" if (argc < 3) {\n"\ +" printf(\"Give a parameter: unit test c file and template file\");\n"\ +" printf(\"\\n\");\n"\ +" XFAILURE;\n"\ +" }\n"\ +"\n"\ +" // get function list from argv[1]\n"\ +" list = readText(argv[1]);\n"\ +"\n"\ +" int status = START;;\n"\ +" forEachCharP(list, e) {\n"\ +" if (status != START) {\n"\ +" if (findS(*e, \"#include\")) {\n"\ +" listPushS(&tests, *e);\n"\ +" continue;\n"\ +" }\n"\ +" if (findS(*e, \"START_TEST(\")) {\n"\ +" char **l = split(*e, \"(\");\n"\ +" char **l2 = split(l[1], \")\");;\n"\ +" iAppendS(&l2[0], \"();\");\n"\ +" listPushS(&functions, l2[0]);\n"\ +" listFreeManyS(l,l2);\n"\ +" iReplaceManyS(e, \"START_TEST(\", \"void \", \")\", \"(void) {\");\n"\ +" status = TEST;\n"\ +" }\n"\ +" if (findS(*e, \"END_TEST\")) {\n"\ +" iReplaceS(e, \"END_TEST\", \"}\",0);\n"\ +" status = TESTEND;\n"\ +" }\n"\ +" if (status == SEARCH) {\n"\ +" char *s = sliceS(*e, 0, 5);;\n"\ +" if (strEq(s, \"Suite\")) {\n"\ +" break;\n"\ +" }\n"\ +" free(s);\n"\ +" listPushS(&tests, *e);\n"\ +" continue;\n"\ +" }\n"\ +" if ((status == TEST) || (status == TESTEND)) {\n"\ +" listPushS(&tests, *e);\n"\ +" if (status == TESTEND) {\n"\ +" status = SEARCH;\n"\ +" }\n"\ +" }\n"\ +" }\n"\ +" else if (findS(*e, \"START MEM TEST ANCHOR\")) {\n"\ +" status = SEARCH;\n"\ +" }\n"\ +" }\n"\ +"\n"\ +" listFreeS(list);\n"\ +"\n"\ +" //listPrintS(tests);\n"\ +" //listPrintS(functions);\n"\ +"\n"\ +" // read template\n"\ +" char **template = readText(argv[2]);\n"\ +"\n"\ +" // process template\n"\ +" forEachCharP(template, e) {\n"\ +" if (findS(*e, \"__tests\")) {\n"\ +" listAppendS(&result, tests);\n"\ +" }\n"\ +" else if (findS(*e, \"__calls\")) {\n"\ +" listAppendS(&result, functions);\n"\ +" }\n"\ +" else {\n"\ +" listPushS(&result, *e);\n"\ +" }\n"\ +" }\n"\ +"\n"\ +" // save result\n"\ +" putsG(\"memcheckBin\");\n"\ +" writeText(\"memcheckBin\", result);\n"\ +"\n"\ +" listFreeManyS(tests, functions, result, template);\n"\ +"\n"\ +" XSUCCESS;\n"\ +"}\n"\ +"// vim: set expandtab ts=2 sw=2:" + +#define MEMCHECK_SH_TEMPLATE "\ +./runMemtest.c testBin memTest.c.template\n\ +spm memcheck" diff --git a/src/spm.c b/src/spm.c @@ -0,0 +1,1945 @@ +#! /usr/bin/env sheepy +// MIT License +// +// Copyright (c) 2019 Remy Noulin +// +// 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. +// +// +// sheepy package manager +// the published packages have the package information and the source +// install downloads and compiles the packages as static and dynamic libraries +// +// dependencies: tar curl pigz sheepy +// +// commands: +// publish: upload pacakge to spmRegistry +// install pkg: install latest package in current folder +// install -g pkg: install latest package globally (system wide or specified folder in ~/.sheepy/config.yml) +// install pkg@1.0.0: install specific version +// +// To be able to publish, the registry key has to be set in ~/.sheepy/config.yml +// +// TODO +// add command to set registry key + +#include "libsheepyObject.h" +#include "spm.h" +#include "common.h" +#include "sha256/sha256.h" + +#define internal static + +#include <stdio.h> +#include <dirent.h> +#include <libgen.h> +#include <stdbool.h> +#include <string.h> +#include <sys/wait.h> +#include <stdlib.h> +#include <unistd.h> + +#ifndef unitTest +#endif +int MAIN(int ARGC, char** ARGV); +void publish(smallDictt *cfgD, bool pigz); +void installPackages(bool isGlobal, smallDictt *cfgD, smallArrayt *options, bool pigz); +void childInstall(void *Args); +void installAPackage(bool isGlobal, smallDictt *cfgD, smallStringt *o, bool pigz); +void compilePackage(char *name, bool isGlobal, smallDictt *cfgD, char *currentVersion); +smallDictt *loadYML(char *path); +bool installDependencies(bool isGlobal, smallDictt *cfgD, smallDictt *d, const char *name); +void testPackage(smallDictt *cfgD, smallDictt *packageyml); +void memcheckPackage(smallDictt *cfgD, smallDictt *packageyml); +void listAllPackages(smallDictt *cfgD, smallArrayt *options); +void showPackage(smallDictt *cfgD, smallStringt *o); +void showPackageInfo(smallStringt *path); +void updatePackages(bool isGlobal, smallDictt *cfgD, smallArrayt *options, bool pigz); +void uninstallPackages(bool isGlobal, smallDictt *cfgD, smallArrayt *options); +void uninstallDependencies(smallDictt *cfgD, smallDictt *d); +void spawnProcDeps(cbFt cb, void *arg); +void waitForJobsDeps(void); +void findPrint(smallDictt *d); +char **requestRegistry(smallDictt *cfgD, smallJsont *json); +void showPackageListFromRegistry(char **result, smallJsont *json); +void whoamiResult(char **result, smallJsont *json); +void profileResult(char **result, smallJsont *json); +void unpublishResult(char **result, smallJsont *json); +void apikeyResult(char **result, smallJsont *json); +void addUserResult(char **result, smallJsont *json); + +int argc; char **argv; + +#define LOCAL false +#define GLOBAL true +#define CURRENT_YML NULL + +jobst jobsDeps; + +char *localPackageDir; + +#ifndef unitTest +// Remove main when running the unit tests +#define MAIN main +#endif +int MAIN(int ARGC, char** ARGV) { + bool bum; + char *dum = NULL; + char *homedir = NULL; + bool pigz = false;; + + argc = ARGC; argv = ARGV;;// steps + // load config.yml + // check arguments + // set parameters + // check if pigz or gzip are installed + // publish package to registry + // get registry user key + // load package information + // get package information + // upload package + // install package + // choose install destination + // create package folder + // package name and version + // download package + // extract package in package folder + // compile package + // build with sheepy + // if global then link command to bin from package folder + // install dependencies + + // load config.yml + smallJsont *cfgJ = loadSheepyConfig(&homedir); + smallDictt *cfgD = getTopG(cfgJ, rtSmallDictt); + //putsG(cfgJ); + + // check arguments + // need at least 1 argument + if (argc < 2) { + puts("Nothing to do. "BLD GRN"spm help"RST" for help"); { + XFAILURE + } + } + + // find current local package dir + localPackageDir = findLocalPackageDir(cfgD); + + //logVarG(localPackageDir); + + if (eqG(argv[1], "help")) { + putsG(BLD GRN "Sheepy Package Manager Help" RST); + putsG(" " UDL YLW "Environment" RST); + putsG(" The configuration is located in " UDL HOME_DIR CONFIG_NAME RST "\n"); + char *dum = expandHome(HOME_DIR CONFIG_NAME);; + if (!fileExists(dum)) { + printf(" %s missing.", dum); + } + printf(" The build directory is located in " UDL "%sbuild/" RST "\n", HOME_DIR); + printf(" The local package repository is located in " UDL "%s" RST "\n", localPackageDir); + if (dum) { + var tmp = catS(getG(cfgD, rtChar, "system"), "/", PACKAGE_DIR); + bUniqSlash(tmp); + printf(" The global package repository is located in " UDL "%s" RST "\n", tmp); + free(tmp); + tmp = catS(getG(cfgD, rtChar, "system"), "/bin"); + bUniqSlash(tmp); + printf(" Commands from packages are added in " UDL "%s" RST "\n", tmp); + free(tmp); + } + if (hasG(cfgD, "parallelSpm") && !getG(cfgD, rtI32, "parallelSpm")) { + puts(BLD RED " Parallel package processing is disabled." RST); + } + if (hasG(cfgD, "parallelSheepy") && !getG(cfgD, rtI32, "parallelSheepy")) { + puts(BLD RED " Parallel compilation is disabled." RST); + } + free(dum); + put + putsG("For sheepy help, run: sheepy -h"); + put + putsG(" new (PKG1) (PKG2) - create a new empty package, without parameters print package.yml"); + putsG(" publish - upload package to spm registry"); + putsG(" install (PKG1) (PKG2) - install package from spm registry, without parameters install packages listed in package.yml"); + putsG(" -g install PKG1 (PKG2) - install package globally in the system"); + putsG(" uninstall PKG1 (PKG2) - uninstall package"); + putsG(" -g uninstall PKG1 (PKG2) - uninstall package globally"); + putsG(" test - compile testBin and run"); + putsG(" memcheck - compile memcheckBin and run with the memcheck command"); + putsG(" showmc - show the memcheck command, either in " HOME_DIR CONFIG_NAME " or in package.yml"); + putsG(" doc - generate the documentation by running the documentation command from package.yml"); + putsG(" show (PKG1 PKG2) - show package information in the system"); + putsG(" update|upgrade (PKG1 PKG2) - update package"); + putsG(" -g update|upgrade (PKG1 PKG2) - update packages globally"); + putsG(" find PKG1 (PKG2) - find package in the registry"); + putsG(" top - top packages in the registry"); + putsG(" hot - hot packages in the registry"); + putsG(" latest - latest packages in the registry"); + putsG(" whoami - user associated with the configured api key"); + putsG(" profile USERNAME - show user profile"); + putsG(" unpublish PKG1 (PKG2) - unpublish pacakges in the registry"); + putsG(" info PKG1 (PKG2) - show package information"); + putsG(" adduser - create an account in the registry"); + putsG(" apikey - get api key for a user, to use the key edit the key field in " HOME_DIR CONFIG_NAME); { + XSUCCESS + } + } + + // set parameters + // global is an option associated with install to install a package in the system + memset(&params, 0, sizeof(params)); + + createAllocateSmallArray(options); + + // bum is set to true when a command is found + bum = false; + rangeFrom(i, 1, argc) + if (eqG(argv[i], "publish")) { + params.publish += 1; + bum = true; + } + else if (eqG(argv[i], "new")) { + params.new += 1; + bum = true; + } + else if (eqG(argv[i], "install")) { + params.install += 1; + bum = true; + } + else if (eqG(argv[i], "uninstall")) { + params.uninstall += 1; + bum = true; + } + else if (eqG(argv[i], "test")) { + params.test += 1; + bum = true; + } + else if (eqG(argv[i], "memcheck")) { + params.memcheck += 1; + bum = true; + } + else if (eqG(argv[i], "showmc")) { + params.showmcheck += 1; + bum = true; + } + else if (eqG(argv[i], "doc")) { + params.doc += 1; + bum = true; + } + else if (eqG(argv[i], "-g")) { + params.global += 1; + } + else if (eqG(argv[i], "show")) { + params.show += 1; + bum = true; + } + else if (eqG(argv[i], "update") || eqG(argv[i], "upgrade")) { + params.update += 1; + bum = true; + } + else if (eqG(argv[i], "find")) { + params.find += 1; + bum = true; + } + else if (eqG(argv[i], "top")) { + params.top += 1; + bum = true; + } + else if (eqG(argv[i], "hot")) { + params.hot += 1; + bum = true; + } + else if (eqG(argv[i], "latest")) { + params.latest += 1; + bum = true; + } + else if (eqG(argv[i], "whoami")) { + params.whoami += 1; + bum = true; + } + else if (eqG(argv[i], "profile")) { + params.profile += 1; + bum = true; + } + else if (eqG(argv[i], "unpublish")) { + params.unpublish += 1; + bum = true; + } + else if (eqG(argv[i], "info")) { + params.info += 1; + bum = true; + } + else if (eqG(argv[i], "adduser")) { + params.adduser += 1; + bum = true; + } + else if (eqG(argv[i], "apikey")) { + params.apikey += 1; + bum = true; + } + else if (params.new || params.install || params.show || params.update || params.uninstall || params.find || params.profile || params.unpublish || params.info) { + pushG(options, argv[i]); + } + + if (!bum) { + putsG(BLD RED "Command not found." RST); + XFAILURE + } + + int paramsSum = params.install + params.publish + params.show + params.new + params.update + params.uninstall + params.find + params.top + params.hot + params.latest + params.whoami + params.profile + params.unpublish + params.info + params.adduser + params.apikey + params.test + params.memcheck + params.showmcheck + params.doc; + if (paramsSum > 1) { + putsG(BLD RED "Conflicting commands." RST); + XFAILURE + } + + if (params.adduser) { + + newUser: + printf("Username: "); + char *username = readS(); + + if (isBlankG(username)) { + free(username); + puts(BLD RED "Incorrect input. Enter new username." RST); + goto newUser; + } + + newName: + printf("Name: "); + char *name = readS(); + + if (isBlankG(name)) { + free(name); + puts(BLD RED "Incorrect input. Enter new name." RST); + goto newName; + } + + newPassword: + printf("Password: "); + char *password = readPasswordS();; + + printf("Confirm password: "); + char *cpassword = readPasswordS(); + + if (isBlankG(password) || !eqG(password, cpassword)) { + freeManyS(password, cpassword); + puts(BLD RED "Incorrect input, enter new password." RST); + goto newPassword; + } + if (lenG(password) < 8) { + freeManyS(password, cpassword); + puts(BLD RED "Too short, minimum 8 random characters, enter new password." RST); + goto newPassword; + } + // clear password from memory + zeroS(cpassword); + free(cpassword); + + newEmail: + printf("Public Email: "); + char *email = readS();; + + if (lenG(email) < 2 || countG(email, '@') != 1 || startsWithG(email, "@") || endsWithG(email, "@")) { + free(email); + puts(BLD RED "Incorrect input, enter another email address." RST); + goto newEmail; + } + + //logVarG(username); + //logVarG(name); + //logVarG(password); + //logVarG(email); + + char *hash = sha256S(password);; + // clear password from memory + zeroS(password); + free(password); + + createAllocateSmallJson(json); + setG(json, "method", "adduser"); + createSmallArray(a); + pushG(&a, username); + pushG(&a, hash); + pushG(&a, email); + pushG(&a, name); + setG(json, "params", &a); + + freeManyS(username, hash, email, name); + + //logVarG(json); + char **result = requestRegistry(cfgD, json); + // Success: result=["Ls28ZCj_i19JsLXxP5o9OcbSN0pj9KTEBNH,Y,IaiyI",""] + // Error: result=["","User USERNAME already exists!"] + + addUserResult(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.apikey) { + + printf("Username: "); + char *username = readS(); + + printf("Password: "); + char *password = readPasswordS(); + + //logVarG(username); + //logVarG(password); + + char *hash = sha256S(password);; + // clear password from memory + zeroS(password); + free(password); + + createAllocateSmallJson(json); + setG(json, "method", "apikey"); + createSmallArray(ar); + pushG(&ar, username); + pushG(&ar, hash); + setG(json, "params", &ar); + + freeManyS(username, hash); + + char **result = requestRegistry(cfgD, json); + apikeyResult(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.whoami) { + char *key = getG(cfgD, rtChar, "key"); + if (!key || eqG(key, "uninitialized")) { + puts(BLD RED "user key missing in " HOME_DIR CONFIG_NAME "!" RST); + // TODO free stuff? + XFAILURE + } + + createAllocateSmallJson(json); + setG(json, "method", "whoami"); + setG(json, "key", key); + + char **result = requestRegistry(cfgD, json); + // result=[{"username":"remy","name":"Remy Noulin","publicemail":"eqw@wdqd"}] + whoamiResult(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.profile) { + if (!lenG(options)) { + puts(BLD RED "Missing parameters!" RST); + XFAILURE + } + + createAllocateSmallJson(json); + setG(json, "method", "profile"); + setNFreeG(json, "params", dupG(options)); + + char **result = requestRegistry(cfgD, json); + //result=[{"username":"remy","name":"Remy Noulin","publicemail":"eqw@wdqd","packages":["aCmd","cfp","cpy","here","dmce","forest","inotify","mkparents","mve","normalize","easydoneitCTui","searchReplace","sheepyExamples","md4c","preprocessor","md","files","dog","pp","ini","liveserver"]}] + profileResult(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.unpublish) { + if (!lenG(options)) { + puts(BLD RED "Missing parameters!" RST); + XFAILURE + } + char *key = getG(cfgD, rtChar, "key"); + if (!key || eqG(key, "uninitialized")) { + puts(BLD RED "user key missing in " HOME_DIR CONFIG_NAME "!" RST); + // TODO free stuff? + XFAILURE + } + + createAllocateSmallJson(json); + setG(json, "method", "unpublish"); + setNFreeG(json, "params", dupG(options)); + setG(json, "key", key); + + char **result = requestRegistry(cfgD, json); + // result=["TT","simpleTemplates"] + unpublishResult(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.info) { + if (!lenG(options)) { + puts(BLD RED "Missing parameters!" RST); + XFAILURE + } + + createAllocateSmallJson(json); + setG(json, "method", "info"); + setNFreeG(json, "params", dupG(options)); + + char **result = requestRegistry(cfgD, json); + showPackageListFromRegistry(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.top) { + createAllocateSmallJson(json); + setG(json, "method", "top"); + + char **result = requestRegistry(cfgD, json); + showPackageListFromRegistry(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.hot) { + createAllocateSmallJson(json); + setG(json, "method", "hot"); + + char **result = requestRegistry(cfgD, json); + showPackageListFromRegistry(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.latest) { + createAllocateSmallJson(json); + setG(json, "method", "latest"); + + char **result = requestRegistry(cfgD, json); + showPackageListFromRegistry(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.find) { + if (!lenG(options)) { + puts(BLD RED "Find needs at least one parameter!" RST); + XFAILURE + } + createAllocateSmallJson(json); + setG(json, "method", "find"); + + // put options in a string in an array + createAllocateSmallArray(a); + pushNFreeG(a, joinG(options, ' ')); + setNFreeG(json, "params", a); + //logVarG(json); + + char **result = requestRegistry(cfgD, json); + showPackageListFromRegistry(result, json); + + terminateG(json); + XSUCCESS + } + + if (params.new) { + if (!lenG(options)) { + // show package.yml template + putsG(PKG_TEMPLATE); + XSUCCESS + } + + iter(options, O) { + castS(o, O); + mkdirParentsG(o); + chDirG(o); + sourceFromTemplate(ssGet(o)); + pkgFromTemplate(ssGet(o)); + chDirG(".."); + } + XSUCCESS + } + + if (params.show) { + if (argc < 3) { + // show dependencies when package.yml is in the current directory + if (fileExists(PACKAGE)) { + smallDictt *d = loadYML(PACKAGE); + smallDictt *deps = getG(d, rtSmallDictt, "dependencies"); + if (deps) { + char **depsL = keysG(deps); + if (fileExists(PACKAGE_DIR)) { + // list packages install PACKAGE_DIR dir and not listed in dependencies + var packagesInDir = readDirDir(PACKAGE_DIR); + forEachS(packagesInDir, dir) { + if ((!hasG(depsL, dir))) { + printf(BLD RED "%s"RST" installed and not in dependencies\n\n", dir); + } + } + freeG(packagesInDir); + } + fromArrayNFreeG(options, depsL, 0); + } + terminateG(d); + if (lenG(options)) { + params.generatedPackageList = 1; + } + } + if (!params.generatedPackageList && fileExists(PACKAGE_DIR)) { + // no dependencies in package.yml, check if there is shpPackages folder + char **shpp = readDirDir(PACKAGE_DIR); + fromArrayNFreeG(options, shpp, 0); + if (lenG(options)) { + params.generatedPackageList = 1; + } + } + } + + if ((!params.generatedPackageList && (argc < 3)) || ((argc == 3) && (params.global))) { + // no package is specified and package.yml not found, list all global packages + params.global = 1; + listAllPackages(cfgD, options); + } + + sortG(options); + // show packages in parameters or all packages + iter(options, O) { + castS(o, O); + showPackage(cfgD, o); + } + XSUCCESS + } + + // check if pigz or gzip are installed + createAllocateSmallArray(out); + createAllocateSmallArray(er); + execO("which pigz", out, er); + #if (__sun__) + if (not startsWithG(getG(out, rtChar, 0) , "no pigz")) { + pigz = true; + } + else { + emptyG(out); + execO("which gzip", out, er); + if (startsWithG(getG(out, rtChar, 0) , "no gzip")) { + puts(BLD RED "Neither pigz nor gunzip are not found." RST); + XFAILURE + } + } + #else // #if (__sun__) + if (lenG(out)) { + pigz = true; + } + else { + execO("which gzip", out, er); + if (!lenG(out)) { + puts(BLD RED "Neither pigz nor gunzip are not found." RST); + XFAILURE + } + } + #endif + // #if __sun__ + terminateManyO(out, er); + + if (params.update) { + if (argc < 3) { + // update/install dependencies when package.yml is in the current directory + if (fileExists(PACKAGE)) { + smallDictt *d = loadYML(PACKAGE); + smallDictt *deps = getG(d, rtSmallDictt, "dependencies"); + if (deps) { + char **depsL = keysG(deps); + if (fileExists(PACKAGE_DIR)) { + // list packages install PACKAGE_DIR dir and not listed in dependencies + var packagesInDir = readDirDir(PACKAGE_DIR); + forEachS(packagesInDir, dir) { + if ((!hasG(depsL, dir))) { + printf(BLD RED "%s"RST" installed and not in dependencies, to update this package run: "BLD"spm update %s"RST"\n\n", dir, dir); + } + } + freeG(packagesInDir); + } + fromArrayNFreeG(options, depsL, 0); + } + terminateG(d); + if (lenG(options)) { + params.generatedPackageList = 1; + } + } + if (!params.generatedPackageList && fileExists(PACKAGE_DIR)) { + // no dependencies in package.yml, check if there is shpPackages folder + char **shpp = readDirDir(PACKAGE_DIR); + fromArrayNFreeG(options, shpp, 0); + if (lenG(options)) { + params.generatedPackageList = 1; + } + } + } + + if ((!params.generatedPackageList && (argc < 3)) || ((argc == 3) && (params.global))) { + // no package is specified and package.yml not found, list all global packages + params.global = 1; + listAllPackages(cfgD, options); + if (lenG(options)) { + params.generatedPackageList = 1; + } + } + + sortG(options); + // update packages in parameters or all packages + updatePackages(params.global, cfgD, options, pigz); + XSUCCESS + } + + // TODO check that package name is valid: not -g, publish, install + // publish package to registry + if (params.publish) { + publish(cfgD, pigz); + } + + if (params.install) { + if (argc < 3) { + // install dependencies when package.yml is in the current directory + if (!fileExists(PACKAGE)) { + // command line is spm install and there is no package.yml + puts(BLD RED "Package name missing!" RST); + XFAILURE + } + smallDictt *d = loadYML(PACKAGE); + // install dependencies locally + installDependencies(LOCAL, cfgD, d, CURRENT_YML); + terminateG(d); + XSUCCESS + } + + installPackages(params.global, cfgD, options, pigz); + } + + if (params.uninstall) { + if (argc < 3) { + // install dependencies when package.yml is in the current directory + if (!fileExists(PACKAGE)) { + // command line is spm install and there is no package.yml + puts(BLD RED "Package name missing!" RST); + XFAILURE + } + smallDictt *d = loadYML(PACKAGE); + // install dependencies locally + uninstallDependencies(cfgD, d); + terminateG(d); + XSUCCESS + } + + uninstallPackages(params.global, cfgD, options); + } + + if (params.test) { + if (!fileExists(PACKAGE)) { + // command line is spm test and there is no package.yml + puts(BLD RED "Package name missing!" RST); + XFAILURE + } + smallDictt *d = loadYML(PACKAGE); + testPackage(cfgD, d); + terminateG(d); + } + + if (params.memcheck) { + if (!fileExists(PACKAGE)) { + // command line is spm memcheck and there is no package.yml + puts(BLD RED "Package name missing!" RST); + XFAILURE + } + smallDictt *d = loadYML(PACKAGE); + memcheckPackage(cfgD, d); + terminateG(d); + } + + if (params.showmcheck) { + smallDictt *packageyml = NULL; + if (fileExists(PACKAGE)) { + packageyml = loadYML(PACKAGE); + } + const char *mcheckCmd = NULL; + if (packageyml and hasG(packageyml, "memcheckCmd")) { + mcheckCmd = getG(packageyml, rtChar, "memcheckCmd"); + } + else if (hasG(cfgD, "memcheckCmd")) { + mcheckCmd = getG(cfgD, rtChar, "memcheckCmd"); + } + if (mcheckCmd) { + printf("Current memcheck: " BLD GRN "%s" RST "\n", mcheckCmd); + } + else { + puts(BLD RED "No memcheck command (memcheckCmd) found, searched " HOME_DIR CONFIG_NAME " and package.yml" RST); + } + terminateG(packageyml); + } + + if (params.doc) { + smallDictt *d = NULL; + if (fileExists(PACKAGE)) { + d = loadYML(PACKAGE); + } + if (d and hasG(d, "documentationCmd")) { + if (getG(cfgD, bum, "print_compile_commands")) { + printf("%s\n", getG(d, rtChar, "documentationCmd")); + } + system(getG(d, rtChar, "documentationCmd")); + } + else { + puts(BLD RED "No documentation command (documentationCmd) found in package.yml" RST); + } + terminateG(d); + } + + + terminateManyG(options, cfgJ); + finishG(cfgD); + free(homedir); + finalizeLibsheepy(); + XSUCCESS +} + +void publish(smallDictt *cfgD, bool pigz) { + char *cmd = NULL; + bool bum; + + // get registry user key + char *key = getG(cfgD, rtChar, "key"); + if (!key) { + puts(BLD RED "user key missing in " HOME_DIR CONFIG_NAME "!" RST); + // TODO free stuff? + XFAILURE + } + + // load package information + if (!fileExists(PACKAGE)) { + puts(BLD RED "'package.yml' missing!" RST); + // TODO free stuff? + XFAILURE + } + + smallDictt *d = loadYML(PACKAGE); + // TODO check yml validity + + // get package information + char *name = getG(d, rtChar, "name"); + if (!name) { + puts(BLD RED "Package name missing in package.yml!" RST); + // TODO free stuff? + XFAILURE + } + if (eqG(name, "sheepy") || eqG(name, "spm")) { + puts(BLD RED "Package name not allowed! (sheepy and spm)" RST); + // TODO free stuff? + XFAILURE + } + + char *version = getG(d, rtChar, "version"); + if (!version) { + puts(BLD RED "Version missing in package.yml!" RST); + // TODO free stuff? + XFAILURE + } + + // upload package + if (pigz) { + cmd = replaceManyS(UPLOAD_PKG_ZIP, "$NAME$", name, "$VERSION$", version, "$KEY$", key); + } + else { + cmd = replaceManyS(UPLOAD_PKG_ZIP, "pigz -9", "gzip -9", "$NAME$", name, "$VERSION$", version, "$KEY$", key); + } + if (getG(cfgD, bum, "print_compile_commands")) { + printf("%s\n", cmd); + } + systemNFreeG(cmd); + + terminateG(d); +} + +void installPackages(bool isGlobal, smallDictt *cfgD, smallArrayt *options, bool pigz) { + + // choose install destination + char *packageDir; + if (!isGlobal) { + // install package in current folder + packageDir = strdup(localPackageDir); + } + else { + // install package in system + packageDir = catS(getG(cfgD, rtChar, "system") , "/", PACKAGE_DIR); + } + + iExpandHome(&packageDir); + + // create package folder + if (!fileExists(packageDir)) { + mkdirParents(packageDir); + } + + char *cwd = getCwd(); + chDir(packageDir); + + //logVarG(options); + + // initialize child process list + staticArrayInit(jobs); + + char *cwdPackage = appendS(cwd, "/" PACKAGE); + if (!lenG(options) && isGlobal && fileExists(cwdPackage)) { + printf("installing current package %s\n", cwd); + char *pkgName = strdup(basename(cwd)); + if (isDir(pkgName)) { + rmAll(pkgName); + } + copy(cwd, packageDir); + compilePackage(pkgName, isGlobal, cfgD, "version"); + free(pkgName); + } + freeManyS(packageDir, cwdPackage); + + iter(options, O) { + castS(o, O); + installArgst args; + args.isGlobal = isGlobal; + args.cfgD = cfgD; + args.o = o; + args.pigz = pigz; + + // parallel has to be defined and 0 to disable parallel spm + if (hasG(cfgD, "parallelSpm") && !getG(cfgD, rtI32, "parallelSpm")) { + childInstall(&args); + } + else { + spawnProc(childInstall, &args); + } + } + + chDir(cwd); + free(cwd); + + // wait for the jobs to finish + waitForJobs(); +} + +void childInstall(void *Args) { + + cast(installArgst *, args, Args); + installAPackage(args->isGlobal, args->cfgD, args->o, args->pigz); + if (!hasG(args->cfgD, "parallelSpm") || getG(args->cfgD, rtI32, "parallelSpm")) { + XSUCCESS +} + } + +void installAPackage(bool isGlobal, smallDictt *cfgD, smallStringt *o, bool pigz) { + char *cmd = NULL; + + char *cwd = getCwd(); + if (!isWritable(cwd)) { + logC(BLD RED"%s is not writable. Stop."RST, cwd); + free(cwd); + XFAILURE + } + free(cwd); + + // package name and version + char *name; + char *version = NULL; + + smallArrayt *spl = splitG(o, "@");; + if (lenG(spl) == 1) { + name = ssGet(o); + cmd = replaceS_max(DOWNLOAD_PKG, "$$", name); + } + else { + name = getG(spl, rtChar, 0); + version = getG(spl, rtChar, 1); + cmd = replaceManyS(DOWNLOAD_PKG_VERSION, "$NAME$", name, "$VERSION$", version); + } + + // current version is checked against package version in compilePackage to eventually update the dependencies + char *currentVersion = NULL; + char *path = catS(name, "/", PACKAGE); + if (fileExists(path)) { + smallDictt *d = loadYML(path); + currentVersion = getNDupG(d, rtChar, "version"); + terminateG(d); + } + + free(path); + + // download package + // TODO save as pkg@version + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cmd); + } + systemNFree(cmd); + + // detect download errors + char *s = catS(name, ".tar.gz");; + if (!fileExists(s)) { + printf(BLD RED "Download error: %s not found" RST "\n", name); + free(s); + XFAILURE + } + char errorBuf[17]; + bLReadFileToS(s, errorBuf, sizeof(errorBuf)); + if (startsWithG(errorBuf, "No version found") or startsWithG(errorBuf, "Internal Error.") or startsWithG(errorBuf, "package does not")) { + printf(BLD RED "Download error: %s not found" RST "\n", name); + free(s); + XFAILURE + } + free(s); + + // extract package in package folder + if (pigz) { + cmd = replaceS_max(EXTRACT_PKG, "$$", name); + } + else { + cmd = replaceManyS(EXTRACT_PKG,"unpigz ", "gunzip ", "$$", name); + } + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cmd); + } + systemNFreeG(cmd); + + // compile package + compilePackage(name, isGlobal, cfgD, currentVersion); + terminateG(spl); + free(currentVersion); +} + +void compilePackage(char *name, bool isGlobal, smallDictt *cfgD, char *currentVersion) { + char *cmd = NULL; + char *version = NULL; + + cmd = catS(name, "/", PACKAGE); + smallDictt *d = loadYML(cmd); + free(cmd); + + version = getG(d, rtChar, "version"); + char *bin = getG(d, rtChar, "bin"); + bool isCompiled = false; + + if (eqG(currentVersion, version)) { + if (bin) { + // check if the package is already compiled + char *tbin = dupG(bin); + // remove extension + if (getS(tbin, -1) == 'c') { + // c extension + setG(tbin, -2, 0); + } + else if (getS(tbin, -2) == 'c' && getS(tbin, -1) == 'p') { + // cp extension + setG(tbin, -3, 0); + } + // is execautable or library: detect h file + char *h = catS(name, "/", tbin, ".h"); + bool isLib = fileExists(h); + free(h); + if (isLib) { + // check .a and .so + char *libname = catS(name, "/", tbin, ".a"); + bool a = fileExists(libname); + free(libname); + libname = catS(name, "/", tbin, ".so"); + bool so = fileExists(libname); + free(libname); + isCompiled = a && so; + } + else { + // check executable + char *exe = catS(name, "/", tbin); + isCompiled = fileExists(exe); + free(exe); + } + free(tbin); + if (isCompiled) { + goto checkDependencies; + } + } + else { + checkDependencies: + printf("%s@%s is already installed. Checking dependencies...", name, version); + printf("\n"); + } + } + + // install dependencies + // the goal with hasDependencies is to detect when dependencies are updated/compiled and recompile the package + // even when isCompiled is true + // TODO convert sheepy and spm to library and return the status (installed, updated, failed) to decide if this + // package needs to be recompiled + bool hasDependencies = false; + if (bin) { + // local, even when the package is installed globally + hasDependencies = installDependencies(LOCAL, cfgD, d, name); + } + else { + // metapackage + // install dependencies locally or globally + if (!isGlobal || !params.update || !params.generatedPackageList) { + // dont update dependencies in global metapackage + hasDependencies = installDependencies(isGlobal, cfgD, d, name); + } + } + + if (isCompiled && hasDependencies) { + cmd = replaceManyS(DELETE_PKG, "N", name, "B", bin); + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cmd); + } + if (systemNFreeG(cmd)) { + printf(BLD RED "Error deleting: %s" RST "\n", name); + } + } + + + if ((bin && !isCompiled) || (bin && isCompiled && hasDependencies)) { + // this package in a bin line, it is not a metapackage + + // build with sheepy + // compile lib when there is 'bin'.h in the package + // the executable is stored in the package folder + cmd = catS(name, "/", bin); + setS(cmd, -1, 'h'); + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cmd); + } + + char *build; + if (fileExists(cmd)) { + build = BUILD_PKG; + } + else { + build = BUILD_EXEONLY; + } + + free(cmd); + cmd = replaceManyS(build, "N", name, "B", bin); + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cmd); + } + if (systemNFreeG(cmd)) { + // compile error, show compile help text + printf(BLD RED "Error compiling: %s" RST "\n", name); + if (getG(d, rtChar, "compileHelp")) { + printf(BLD WHT "%s" RST "\n", getG(d, rtChar, "compileHelp")); + } + } + + if (isGlobal) { + // link command to bin from package folder + char *pkgBin = strdup(basename(bin)); + char **rootBin_l = split(pkgBin, "."); + char *rootBin = rootBin_l[0]; + // path to bin/cmd to check if it already exists + char *bin = catS("../bin/", rootBin); + cmd = replaceManyS(INSTALL_COMMAND, "$PACKAGE_DIR$", PACKAGE_DIR, "$name$", name, "$bin$", rootBin); + free(pkgBin); + listFreeS(rootBin_l); + + if (fileExists(bin)) { + if (!isLink(bin)) { + printf(BLD RED "%s is not a link, spm can't install this package completely, run: %s\n" RST, bin, cmd); + } + free(cmd); + goto skipLink; + } + + iUniqSlash(cmd); + + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cmd); + } + systemNFreeG(cmd); + skipLink: + free(bin); + } + } + + terminateG(d); +} + +smallDictt *loadYML(char *path) { + + createAllocateSmallJson(pkgInfo); + readFileG(pkgInfo, path); + //logVarG(pkgInfo); + + smallDictt *d = getTopG(pkgInfo, rtSmallDictt); + finishG(pkgInfo); + return(d); +} + +bool installDependencies(bool isGlobal, smallDictt *cfgD, smallDictt *d, const char *name) { + char **cmd = NULL; + bool r = false;; + + smallDictt *deps = getG(d, rtSmallDictt, "dependencies"); + if (deps) { + r = true; + // initialize child process list + staticArrayInit(jobsDeps); + + char **depsL = keysG(deps); + + char *cwd = getCwd(); + char *global; + if (isGlobal) { + global = "-g"; + } + else { + // install dependencies inside current package + chDir(name); + // create PACKAGE_DIR shpPackages to install locally + mkdirParents(PACKAGE_DIR); + global = ""; + } + + forEachCharP(depsL, dep) { + cmd = listCreateS(argv[0], "install", global, *dep); + iListCompactS(&cmd); + if (getG(cfgD, rtBool, "print_compile_commands")) { + logNFree(join(cmd, " ")); + } + + // parallel has to be defined and 0 to disable parallel spm + if (hasG(cfgD, "parallelSpm") && !getG(cfgD, rtI32, "parallelSpm")) { + systemNFreeG(join(cmd, " ")); + } + else { + spawnProcDeps(childProc, cmd); + } + listFreeS(cmd); + } + + chDir(cwd); + free(cwd); + listFreeS(depsL); + finishG(deps); + + // wait for the dependencies to install + waitForJobsDeps(); + } + return(r); +} + +void testPackage(smallDictt *cfgD, smallDictt *packageyml) { + + if (hasG(packageyml, "testBin")) { + char *bin = getNDupG(packageyml, rtChar, "testBin"); + + // delete intermediary files + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("sheepy -d %s\n", bin); + } + systemf("sheepy -d %s", bin); + // compile test + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("sheepy -t %s\n", bin); + } + if (commandf("sheepy -t %s", bin)) { + XFAILURE + } + + // remove extension from testBin + if ((getS(bin, -2) == '.') and (getS(bin, -1) == 'c')) { + setS(bin, -2, 0); + } + + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", bin); + } + system(bin); + + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("sheepy -d %s\n", getG(packageyml, rtChar, "testBin")); + } + systemf("sheepy -d %s", getG(packageyml, rtChar, "testBin")); +} + } + +void memcheckPackage(smallDictt *cfgD, smallDictt *packageyml) { + + if (!hasG(packageyml, "memcheckBin")) { + putsG(BLD RED "memcheckBin not set in " PACKAGE RST); + } + else { + const char *mcheckCmd; + if (hasG(packageyml, "memcheckCmd")) { + mcheckCmd = getG(packageyml, rtChar, "memcheckCmd"); + } + else if (hasG(cfgD, "memcheckCmd")) { + mcheckCmd = getG(cfgD, rtChar, "memcheckCmd"); + } + else { + // memcheck command not found + putsG(BLD RED "memcheck command not found. Searched " PACKAGE " and " HOME_DIR CONFIG_NAME RST); + return; + } + + char *bin = getNDupG(packageyml, rtChar, "memcheckBin"); + + if (!bin) { + putsG(BLD RED "memcheckBin is not set in " PACKAGE RST); + return; + } + + if (!fileExists(bin)) { + printf(BLD RED "memcheckBin %s not found" RST, bin); + return; + } + + // delete intermediary files + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("sheepy -d %s\n", bin); + } + systemf("sheepy -d %s", bin); + // compile test + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("sheepy -m %s\n", bin); + } + if (commandf("sheepy -m %s", bin)) { + XFAILURE + } + + // remove extension from memcheckBin + if ((getS(bin, -2) == '.') and (getS(bin, -1) == 'c')) { + setS(bin, -2, 0); + } + + // TODO due to a weird bug in debian stretch 180324, I run memcheckBin before running it again with valgrind + // TODO it should not be necessary: "%s %s", mcheckCmd, bin + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s ; %s %s\n", bin, mcheckCmd, bin); + } + systemf("%s ; %s %s\n", bin, mcheckCmd, bin); + + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("sheepy -d %s\n", getG(packageyml, rtChar, "memcheckBin")); + } + systemf("sheepy -d %s", getG(packageyml, rtChar, "memcheckBin")); +} + } + + +void listAllPackages(smallDictt *cfgD, smallArrayt *options) { + + if (isDirG(localPackageDir)) { + appendNSmashG(options, readDirDirG(rtSmallArrayt, localPackageDir)); + } + smallStringt *path = createS(getG(cfgD, rtChar, "system") , "/", PACKAGE_DIR); + normalizePathG(path); + expandHomeG(path); + if (isDirG(path)) { + appendNSmashG(options, readDirDirG(rtSmallArrayt, ssGet(path))); + } + terminateG(path); + uniqG(options, unusedV); +} + +void showPackage(smallDictt *cfgD, smallStringt *o) { + smallStringt *path = NULL; + + // local package + path = createS(localPackageDir, "/", ssGet(o), "/", PACKAGE); + + if (fileExistsG(path)) { + showPackageInfo(path); + } + + terminateG(path); + + // global package + path = createS(getG(cfgD, rtChar, "system") , "/", PACKAGE_DIR, "/", ssGet(o), "/", PACKAGE); + + normalizePathG(path); + expandHomeG(path); + if (fileExistsG(path)) { + puts(BLD WHT "GLOBAL" RST); + showPackageInfo(path); + } + + put + terminateG(path); +} + +void showPackageInfo(smallStringt *path) { + + smallDictt *d = loadYML(ssGet(path)); + + smallStringt *s = getNDupG(d, rtSmallStringt, "name"); + colorG(s, BLD YLW); + catSG(s, ": "); + + smallStringt *s2 = getG(d, rtSmallStringt, "version"); + catG(s, s2); + putsG(s); + + terminateO(s); + finishG(s2); + + colorG(path, BLD GRN); + putsG(path); + + s = getG(d, rtSmallStringt, "bin"); + if (s) { + printf(BLD GRN "bin:" RST " %s\n", ssGet(s)); + finishG(s); + } + + s = getG(d, rtSmallStringt, "description"); + putsG(s); + finishG(s); +} + +void updatePackages(bool isGlobal, smallDictt *cfgD, smallArrayt *options, bool pigz) { + smallStringt *path = NULL; + + createAllocateSmallArray(packagesToUpdate); + + // local package + if (!isGlobal) { + iter(options, O) { + castS(o, O); + path = createS(localPackageDir, "/", ssGet(o), "/", PACKAGE); + + // update all packages even those that are not yet installed + pushG(packagesToUpdate, o); + + terminateG(path); + } + } + else { + // global package + iter(options, O) { + castS(o, O); + path = createS(getG(cfgD, rtChar, "system") , "/", PACKAGE_DIR, "/", ssGet(o), "/", PACKAGE); + + normalizePathG(path); + expandHomeG(path); + // update all packages even those that are not yet installed + pushG(packagesToUpdate, o); + + terminateG(path); + } + } + + installPackages(isGlobal, cfgD, packagesToUpdate, pigz); + smashG(packagesToUpdate); +} + + +void uninstallPackages(bool isGlobal, smallDictt *cfgD, smallArrayt *options) { + char *cwd = NULL; + + // choose install destination + char *packageDir; + if (!isGlobal) { + // install package in current folder + packageDir = strdup(localPackageDir); + } + else { + // install package in system + packageDir = catS(getG(cfgD, rtChar, "system") , "/", PACKAGE_DIR); + } + + iExpandHome(&packageDir); + + // skip when package folder is not found + if (!fileExists(packageDir)) { + return; + } + + cwd = getCwd(); + chDir(packageDir); + + //logVarG(options); + + iter(options, O) { + castS(o, O); + + // package name + char *name; + + smallArrayt *spl = splitG(o, "@");; + if (lenG(spl) == 1) { + name = ssGet(o); + } + else { + name = getG(spl, rtChar, 0); + } + + if (!isDir(name)) { + goto end; + } + + char *path = catS(name, "/", PACKAGE); + smallDictt *d = loadYML(path); + char *bin = getG(d, rtChar, "bin"); + + // delete build files + if (bin) { + char *cmd = catS("sheepy -d ", bin); + if (getG(cfgD, rtBool, "print_compile_commands")) { + putsG(cmd); + } + chDir(name); + systemNFreeG(cmd); + chDir(".."); + + // uninstall dependencies + } + // metapackage + // uninstall dependencies globally + if (!bin && isGlobal) { + // install dependencies in global metapackage + uninstallDependencies(cfgD, d); + } + + if (bin && isGlobal) { + // unlink command in bin from package folder + char *pkgBin = strdup(basename(bin)); + char **rootBin_l = split(pkgBin, "."); + char *rootBin = rootBin_l[0]; + char *path = catS("../bin/", rootBin);; + rmAll(path); + free(path); + free(pkgBin); + listFreeS(rootBin_l); + } + + rmAll(name); + + terminateG(d); + free(path); + + end: + terminateG(spl); + } + chDir(cwd); + free(cwd); + smallArrayt *arr = readDirDirO(packageDir);; + if (!lenG(arr) && !isGlobal) { + // remove empty shpPackages + rmAll(packageDir); + } + terminateG(arr); + free(packageDir); +} + +void uninstallDependencies(smallDictt *cfgD, smallDictt *d) { + char **cmd = NULL; + + smallDictt *deps = getG(d, rtSmallDictt, "dependencies"); + if (deps) { + + char **depsL = keysG(deps); + + createAllocateSmallArray(depA); + fromArrayNFreeG(depA, depsL, 0); + + uninstallPackages(params.global, cfgD, depA); + terminateG(depA); + finishG(deps); +} + } + + + + +/** + * spawn a child process and add to the list + */ +void spawnProcDeps(cbFt cb, void *arg) { + pid_t pid; + int status; + + staticArrayPush(jobsDeps) + staticArrayLast(jobsDeps).pid = fork(); + switch (staticArrayLast(jobsDeps).pid) { + case -1: + perror("spawnProc error: "); + XFAILURE + case 0: + cb(arg); + perror("spawnProc error: "); + XFAILURE + default: + break; + } + + return; +} + +/** + * wait for all child processes to finish + */ +void waitForJobsDeps(void) { + + range(i, staticArrayCount(jobsDeps)) { + if (waitpid(staticArrayGet(jobsDeps,i).pid, &(staticArrayGet(jobsDeps,i).status), 0) == -1) { + printf("couldn't wait for child %d\n", jobsDeps.list[i].pid); { + XFAILURE + } + } + + #ifdef __HAIKU__ + if (WEXITSTATUS(staticArrayGet(jobsDeps,i).status) || WTERMSIG(staticArrayGet(jobsDeps,i).status)) { + puts("subprocess trouble, check output"); + XFAILURE + } + #else + if (WEXITSTATUS(staticArrayGet(jobsDeps,i).status) || WTERMSIG(staticArrayGet(jobsDeps,i).status) || WCOREDUMP(staticArrayGet(jobsDeps,i).status)) { + puts("subprocess trouble, check output"); + XFAILURE + } + #endif + } +} + +void findPrint(smallDictt *d) { + + smallStringt *s = getNDupG(d, rtSmallStringt, "name"); + colorG(s, BLD YLW); + catSG(s, ": "); + + smallStringt *s2 = getG(d, rtSmallStringt, "version"); + catG(s, s2); + putsG(s); + + terminateO(s); + finishG(s2); + + printf(BLD GRN "Author: " RST "%s\n", getG(d, rtChar, "user")); + printf(BLD GRN "Homepage: " RST "%s\n", getG(d, rtChar, "homepage")); + printf(BLD GRN "repo: " RST "%s\n", getG(d, rtChar, "repo")); + smallArrayt *a = getG(d, rtSmallArrayt, "keywords"); + s = joinG(a, ", "); + if (lenG(a) == 1) { + printf(BLD GRN "Keyword: " RST "%s\n", ssGet(s)); + } + else if (lenG(a) > 1) { + printf(BLD GRN "Keywords: " RST "%s\n", ssGet(s)); + } + finishG(s); + finishG(a); + + s = getG(d, rtSmallStringt, "description"); + put + putsG(s); + finishG(s); +} + + +char **requestRegistry(smallDictt *cfgD, smallJsont *json) { + + //TODO send the json without using the file system + char *s = toStringG(json); + char *reqFile = expandHomeG("~/.sheepy/api.json"); + + writeFileG(s, reqFile); + free(s); + + char *cmd = replaceG(API_REQUEST, "$JSONFILE$", reqFile, 1); + if (getG(cfgD, rtBool, "print_compile_commands")) { + printf("%s\n", cmd); + } + char **result = execOut(cmd);; + free(cmd); + rmAll(reqFile); + free(reqFile); + + return(result); +} + +void showPackageListFromRegistry(char **result, smallJsont *json) { + + //logVarG(result); + if (!result) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + char *r = result[0]; + + emptyG(json); + parseG(json, r); + listFreeS(result); + //logVarG(json); + //char *tmp = stringifyG(json, 4) + //logVarG(tmp); + //free tmp + + if (!eqG(getTopTypeG(json), "array")) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + // show package information + smallArrayt *a = getTopG(json, rtSmallArrayt); + + if (!lenG(a)) { + puts("Empty results."); + } + + iter(a, D) { + cast(smallDictt *, d, D); + if (!isOTypeG(d, "smallDict")) { + puts(BLD RED "Bad response from spm registry" RST); + break; + } + findPrint(d); + + // print -- between packages + if (iterIndexG(a) != (lenG(a)-1)) { + put + puts("-------------"); + } + } + + finishG(a); + + end: + return; +} + +void whoamiResult(char **result, smallJsont *json) { + + //logVarG(result); + + if (!result) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + char *r = result[0]; + emptyG(json); + parseG(json, r); + listFreeS(result); + + if (!eqG(getTopTypeG(json), "array")) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + smallArrayt *a = getTopG(json, rtSmallArrayt); + + if (!lenG(a)) { + puts("User not found."); + } + else { + smallDictt *d = getG(a, rtSmallDictt, 0);; + printf(BLD GRN "Username: " RST "%s\n", getG(d, rtChar, "username")); + printf(BLD GRN "Name: " RST "%s\n", getG(d, rtChar, "name")); + printf(BLD GRN "Public email: " RST "%s\n", getG(d, rtChar, "publicemail")); + finishG(d); + } + + finishG(a); + + end: + return; +} + +void profileResult(char **result, smallJsont *json) { + + //logVarG(result); + + if (!result) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + char *r = result[0]; + emptyG(json); + parseG(json, r); + listFreeS(result); + + if (!eqG(getTopTypeG(json), "array")) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + smallArrayt *a = getTopG(json, rtSmallArrayt); + + if (!lenG(a)) { + puts("No user found."); + } + else { + iter(a, D) { + cast(smallDictt*, d, D); + printf(BLD GRN "Username: " RST "%s\n", getG(d, rtChar, "username")); + printf(BLD GRN "Name: " RST "%s\n", getG(d, rtChar, "name")); + printf(BLD GRN "Public email: " RST "%s\n", getG(d, rtChar, "publicemail")); + + smallArrayt *pkgs = getG(d, rtSmallArrayt, "packages"); + + if (!pkgs) { + goto nullpkgs; + } + + if (!lenG(pkgs)) { + goto nopkgs; + } + + sortG(pkgs); + char *s = joinSG(pkgs, " ");; + + if (lenG(pkgs) == 1) { + printf(BLD GRN "Package: " RST "%s\n", s); + } + else { + printf(BLD GRN "Packages: " RST "%s\n", s); + } + + free(s); + + nopkgs: + finishG(pkgs); + + nullpkgs: + // print -- between packages + if (iterIndexG(a) != (lenG(a)-1)) { + put + puts("-------------"); + } + } + + finishG(a); + + end: + return; +} + } + +void unpublishResult(char **result, smallJsont *json) { + + //logVarG(result); + + if (!result) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + char *r = result[0]; + emptyG(json); + parseG(json, r); + listFreeS(result); + + if (!eqG(getTopTypeG(json), "array")) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + smallArrayt *a = getTopG(json, rtSmallArrayt); + + if (!lenG(a)) { + puts("Nothing unpublished."); + } + else { + char *unpub = joinSG(a, ", "); + printf("Unpublished: %s\n", unpub); + free(unpub); + } + + finishG(a); + + end: + return; +} + +void apikeyResult(char **result, smallJsont *json) { + + //logVarG(result); + + if (!result) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + char *r = result[0]; + emptyG(json); + parseG(json, r); + listFreeS(result); + + if (!eqG(getTopTypeG(json), "array")) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + smallArrayt *a = getTopG(json, rtSmallArrayt); + + if (!lenG(a)) { + puts("Error: API key not found."); + } + else { + printf("API Key: %s\n", getG(a, rtChar, 0)); + } + + finishG(a); + end: + return; +} + +void addUserResult(char **result, smallJsont *json) { + + //logVarG(result); + + if (!result) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + char *r = result[0]; + emptyG(json); + parseG(json, r); + listFreeS(result); + + if (!eqG(getTopTypeG(json), "array")) { + puts(BLD RED "Bad response from spm registry" RST); + goto end; + } + + smallArrayt *a = getTopG(json, rtSmallArrayt); + + if (!lenG(a)) { + puts(BLD RED "Bad response from spm registry" RST); + goto finisha; + } + + if (isBlankG(getG(a, rtChar, 0))) { + puts(BLD RED "Error: User not created." RST); + printf(BLD RED "%s" RST, getG(a, rtChar, 1)); + } + else { + puts(BLD GRN "New user created successfully." RST); + } + + finisha: + finishG(a); + + end: + return; +} + +// vim: set expandtab ts=2 sw=2: diff --git a/src/spm.h b/src/spm.h @@ -0,0 +1,58 @@ + +#define REGISTRY "https://sheepyregistry.com" +//#define REGISTRY "https://127.0.0.1:8888" + +#define UPLOAD_PKG_ZIP "cd .. ; tar -cf $NAME$.tar --exclude-vcs --exclude-vcs-ignores --exclude=shpPackages $NAME$; pigz -9 $NAME$.tar ; curl -k -F \"n=$NAME$\" -F \"v=$VERSION$\" -F \"k=$KEY$\" -F \"inf=@$NAME$/package.yml\" -F \"pkg=@$NAME$.tar.gz\" " REGISTRY "/op ; rm $NAME$.tar.gz" + +#define DOWNLOAD_PKG "curl -s -k -o $$.tar.gz \"" REGISTRY "/op?n=$$\"" +#define DOWNLOAD_PKG_VERSION "curl -s -k -o $NAME$.tar.gz \"" REGISTRY "/op?n=$NAME$&v=$VERSION$\"" + +#define EXTRACT_PKG "unpigz $$.tar.gz ; tar -xf $$.tar ; rm $$.tar" + +#define BUILD_PKG "cd N ; sheepy -l B ; sheepy -c B" +#define BUILD_EXEONLY "cd N ; sheepy -c B" + +#define DELETE_PKG "cd N ; sheepy -d B" + +#define INSTALL_COMMAND "cd ../bin ; ln -s ../$PACKAGE_DIR$/$name$/$bin$" + +#define API_REQUEST "curl -s -k -F json=@$JSONFILE$ " REGISTRY "/api" + + +// generatedPackageList is used to detect if the metapackages were listed on the command line +// when generatedPackageList=0, if a metapackage is to be installed then it was on the command line and the dependencies should be updated + +typedef struct { + int new; + int global; + int publish; + int install; + int uninstall; + int test; + int memcheck; + int showmcheck; + int doc; + int show; + int update; + int find; + int top; + int hot; + int latest; + int whoami; + int profile; + int unpublish; + int info; + int adduser; + int apikey; + int generatedPackageList; +} paramst; + +paramst params; + +typedef struct { + bool isGlobal; + smallDictt *cfgD; + smallStringt *o; + bool pigz; +} installArgst; +