Root Zanli
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
share
/
doc
/
re2c
/
manual
/
options
/
Filename :
options.rst_
back
Copy
``-? -h --help`` Show help message. ``-1 --single-pass`` Deprecated. Does nothing (single pass is the default now). ``-8 --utf-8`` Generate a lexer that reads input in UTF-8 encoding. re2c assumes that character range is 0 -- 0x10FFFF and character size is 1 byte. ``-b --bit-vectors`` Optimize conditional jumps using bit masks. Implies ``-s``. ``-c --conditions --start-conditions`` Enable support of Flex-like "conditions": multiple interrelated lexers within one block. Option ``--start-conditions`` is a legacy alias; use ``--conditions`` instead. ``--case-insensitive`` Treat single-quoted and double-quoted strings as case-insensitive. ``--case-inverted`` Invert the meaning of single-quoted and double-quoted strings: treat single-quoted strings as case-sensitive and double-quoted strings as case-insensitive. ``--case-ranges`` Collapse consecutive cases in a switch statements into a range of the form ``case low ... high:``. This syntax is an extension of the C/C++ language, supported by compilers like GCC, Clang and Tcc. The main advantage over using single cases is smaller generated C code and faster generation time, although for some compilers like Tcc it also results in smaller binary size. This option doesn't work for the Go backend. ``--depfile FILE`` Write dependency information to ``FILE`` in the form of a Makefile rule ``<output-file> : <input-file> [include-file ...]``. This allows to track build dependencies in the presence of ``/*!include:re2c*/`` directives, so that updating include files triggers regeneration of the output file. This option requires that ``-o --output`` option is specified. ``-e --ecb`` Generate a lexer that reads input in EBCDIC encoding. re2c assumes that character range is 0 -- 0xFF an character size is 1 byte. ``--empty-class <match-empty | match-none | error>`` Define the way re2c treats empty character classes. With ``match-empty`` (the default) empty class matches empty input (which is illogical, but backwards-compatible). With ``match-none`` empty class always fails to match. With ``error`` empty class raises a compilation error. ``--encoding-policy <fail | substitute | ignore>`` Define the way re2c treats Unicode surrogates. With ``fail`` re2c aborts with an error when a surrogate is encountered. With ``substitute`` re2c silently replaces surrogates with the error code point 0xFFFD. With ``ignore`` (the default) re2c treats surrogates as normal code points. The Unicode standard says that standalone surrogates are invalid, but real-world libraries and programs behave in different ways. ``-f --storable-state`` Generate a lexer which can store its inner state. This is useful in push-model lexers which are stopped by an outer program when there is not enough input, and then resumed when more input becomes available. In this mode users should additionally define ``YYGETSTATE()`` and ``YYSETSTATE(state)`` macros and variables ``yych``, ``yyaccept`` and ``state`` as part of the lexer state. ``-F --flex-syntax`` Partial support for Flex syntax: in this mode named definitions don't need the equal sign and the terminating semicolon, and when used they must be surrounded by curly braces. Names without curly braces are treated as double-quoted strings. ``-g --computed-gotos`` Optimize conditional jumps using non-standard "computed goto" extension (which must be supported by the compiler). re2c generates jump tables only in complex cases with a lot of conditional branches. Complexity threshold can be configured with ``cgoto:threshold`` configuration. This option implies ``-b``. This option doesn't work for the Go backend. ``-I PATH`` Add ``PATH`` to the list of locations which are used when searching for include files. This option is useful in combination with ``/*!include:re2c ... */`` directive. Re2c looks for ``FILE`` in the directory of including file and in the list of include paths specified by ``-I`` option. ``-i --no-debug-info`` Do not output ``#line`` information. This is useful when the generated code is tracked by some version control system or IDE. ``--input <default | custom>`` Specify the API used by the generated code to interface with used-defined code. Option ``default`` is the C API based on pointer arithmetic (it is the default for the C backend). Option ``custom`` is the generic API (it is the default for the Go backend). ``--input-encoding <ascii | utf8>`` Specify the way re2c parses regular expressions. With ``ascii`` (the default) re2c handles input as ASCII-encoded: any sequence of code units is a sequence of standalone 1-byte characters. With ``utf8`` re2c handles input as UTF8-encoded and recognizes multibyte characters. ``--lang <c | go>`` Specify the output language. Supported languages are C and Go (the default is C). ``--location-format <gnu | msvc>`` Specify location format in messages. With ``gnu`` locations are printed as 'filename:line:column: ...'. With ``msvc`` locations are printed as 'filename(line,column) ...'. Default is ``gnu``. ``--no-generation-date`` Suppress date output in the generated file. ``--no-version`` Suppress version output in the generated file. ``-o OUTPUT --output=OUTPUT`` Specify the ``OUTPUT`` file. ``-P --posix-captures`` Enable submatch extraction with POSIX-style capturing groups. ``-r --reusable`` Deprecated since re2c version 2.2 (reusable blocks are allowed by default now). ``-S --skeleton`` Ignore user-defined interface code and generate a self-contained "skeleton" program. Additionally, generate input files with strings derived from the regular grammar and compressed match results that are used to verify "skeleton" behavior on all inputs. This option is useful for finding bugs in optimizations and code generation. This option doesn't work for the Go backend. ``-s --nested-ifs`` Use nested ``if`` statements instead of ``switch`` statements in conditional jumps. This usually results in more efficient code with non-optimizing compilers. ``-T --tags`` Enable submatch extraction with tags. ``-t HEADER --type-header=HEADER`` Generate a ``HEADER`` file that contains enum with condition names. Requires ``-c`` option. ``-u --unicode`` Generate a lexer that reads UTF32-encoded input. Re2c assumes that character range is 0 -- 0x10FFFF and character size is 4 bytes. This option implies ``-s``. ``-V --vernum`` Show version information in ``MMmmpp`` format (major, minor, patch). ``--verbose`` Output a short message in case of success. ``-v --version`` Show version information. ``-w --wide-chars`` Generate a lexer that reads UCS2-encoded input. Re2c assumes that character range is 0 -- 0xFFFF and character size is 2 bytes. This option implies ``-s``. ``-x --utf-16`` Generate a lexer that reads UTF16-encoded input. Re2c assumes that character range is 0 -- 0x10FFFF and character size is 2 bytes. This option implies ``-s``.