Closed SouravKB closed 1 year ago
The constants - REFLEX_OPTION_tables_file
, REFLEX_OPTION_regexp_file
, REFLEX_OPTION_graphs_file
- in generated outfile always has the value of FILE
, whereas the corresponding constants in generated header-file has the value of actual generated file names (FILE[.cpp]
, FILE[.txt]
, FILE[.gv]
).
My personal suggestion would be to always use FILE
as generated file name. Though it may not be possible to change that now as it may break existing projects.
Documented:
−−tables-file[=FILE] This option generates a C++ file
FILE.cpp
with the finite state machine in source code form ...Actual: This option generates a C++ file
FILE
ifFILE
ends with.cpp
, otherwise generatesFILE.cpp
.
When the extension is the default like .cpp, then here is no need to add an extension, which would produce files like FILE.cpp.cpp
. So this is correct. Same for graphs-file
and regexp-file
. This is logical and doesn't need further explanation.
The header-file
should add a .h
if not provided, but that appears not to be the case so I'll check the logic to correct this.
BTW. The fact that header-file
doesn't add the extension is because Flex doesn't and RE/flex is largely backward compatible to Flex. The same applies to option outfile
that behaves the same as Flex, i.e. no extension. The other options are new and do not require an extension, but if one is given it must be of the right type corresponding to the type of output.
In that convention, outfile
should also add .cpp
extension if not present in FILE
.
You can add .hpp
extension to header-file
and .cpp
extension to outfile
only when %o flex
is not specified. Much like how other backward comapatibilty featues work.
The constants - REFLEX_OPTION_tables_file, REFLEX_OPTION_regexp_file, REFLEX_OPTION_graphs_file - in generated outfile always has the value of FILE, whereas the corresponding constants in generated header-file has the value of actual generated file names (FILE[.cpp], FILE[.txt], FILE[.gv]).
You haven't said anything about this!
Documented:
Actual: This option generates a C++ header file
FILE
rather thanFILE.h
.Documented:
Actual: This option generates a C++ file
FILE
ifFILE
ends with.cpp
, otherwise generatesFILE.cpp
.Documented:
Actual: This option generates a text file
FILE
ifFILE
ends with.txt
, otherwise generatesFILE.txt
.Documented:
Actual: This option generates a Graphviz file
FILE
ifFILE
ends with.gv
, otherwise generatesFILE.gv
.