Root Zanli
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
share
/
doc
/
re2c
/
manual
/
headers
/
Filename :
headers.rst_
back
Copy
Re2c allows one to generate header file from the input ``.re`` file using option ``-t``, ``--type-header`` or configuration ``re2c:flags:type-header`` and directives ``/*!header:re2c:on*/`` and ``/*!header:re2c:off*/``. The first directive marks the beginning of header file, and the second directive marks the end of it. Everything between these directives is processed by re2c, and the generated code is written to the file specified by the ``-t --type-header`` option (or ``stdout`` if this option was not used). Autogenerated header file may be needed in cases when re2c is used to generate definitions of constants, variables and structs that must be visible from other translation units. Here is an example of generating a header file that contains definition of the lexer state with tag variables (the number variables depends on the regular grammar and is unknown to the programmer).