[CMake] 1 tricky question, 1 bug report
Maik Beckmann
beckmann.maik at googlemail.com
Mon Mar 16 10:39:17 EDT 2009
Brad King schrieb am Montag 16 März 2009 um 15:06:
>
> CALL FOO() ; MODULE mymod ! crazy, but possible
Damn, you are right.
> Perhaps it is simplest to use the file extension as a heuristic for now.
> At least some compilers require special flags to build ".f" as free format.
> If this becomes a real problem we can do something better later.
agreed
> The question remains how to handle both formats in the lexer. The original
> makedepf90 code on which it is based handles things with the fixed_fmt
> state plus support for strings of either format in the common quote states.
> It might just work if we invoke BEGIN(fixed_fmt) before parsing.
This is option number one.
{{{
..
%%
// will be processed before yylex
%{
// manage states before yylex is called
if(...)
BEGIN(fixed_fmt)
else:
BEGIN(free_fmt)
%}
...
%%
..
}}}
Since you showed me an example where my lazy approach doesn't work, this is my
new favorite. All we got to make sure is that the str_* start states don't
mess with the *_fmt ones.
I still didn't test whether fixed format file can include a free format file,
or vise versa. In this case having distinct lexers(and parsers?) is the only
reliable approach.
-- Maik
More information about the CMake
mailing list