Closed SouravKB closed 1 year ago
Indeed, only .hpp
, .cpp
and .cc
are recognized filename extensions at this time. This is decided in lib/pattern.cpp function gencode_dfa
.
Should we add .cxx
as well as upper case versions like .CPP, .CC and .CXX?
lib/pattern.cpp:2812 gencode_dfa
change to:
if ((len > 2 && filename.compare(len - 2, 2, ".h" ) == 0)
|| (len > 3 && filename.compare(len - 3, 3, ".hh" ) == 0)
|| (len > 4 && filename.compare(len - 4, 4, ".hpp") == 0)
|| (len > 4 && filename.compare(len - 4, 4, ".hxx") == 0)
|| (len > 3 && filename.compare(len - 3, 3, ".cc" ) == 0)
|| (len > 4 && filename.compare(len - 4, 4, ".cpp") == 0)
|| (len > 4 && filename.compare(len - 4, 4, ".cxx") == 0))
I don't want to use .cxx in particular. However, if this is the case, it should probably mentioned in the documentation explicitly. I had to spend time in-order to figure out why reflex suddenly stopped generating tables without giving any warnings or errors.
Note that, GCC recognizes .cc, .C, .cp, .cpp, .CPP, .cxx, .c++ file extensions as C++ source file & .h, .hh, .H, .hp, .hpp, .HPP, .hxx, .h++, .tcc file extensions as C++ header file.
My personal suggestion is that, if user is allowed to specify the filename, then let user use whatever extension he wants. Why constrain that. If you want, you may generate a warning instead.
Nope. There are cases where we want to generate a graphviz file with extension .gv, i.e. extensions affect the type of output produced.
RE-flex tool is not generating FSM transitions when outfile has cxx transitions. I'm not sure whether this is intended behavior. But in documentation, I didn't find this being mentioned.
Steps to reproduce:
%o outfile=lex.cxx
.