[CMake] 1 tricky question, 1 bug report

Brad King brad.king at kitware.com
Mon Mar 16 10:06:28 EDT 2009


Maik Beckmann wrote:
> Brad King schrieb am Montag 16 März 2009 um 14:24:
>> Maik Beckmann wrote:
>>> The _third_ option is to make the lexer format agnostic and handle
>>> formats at the parser code.  This should work well, since we just have to
>>> make sure that the valid MODULE und USE statements are catched.  Remeber,
>>> so far the free format code processes fixed format code proper most of
>>> time.
>> What happens if a 'C' appears at the beginning of a non-comment line in
>> free format?  If it appears on a module line then the build might break
>> because ordering among source files may be broken.
> 
> 
> If lines like Something like
> {{{
> call Foo()
> c = 1.0
> }}}
> are ignored, it doesn't hurt.  This is only a problem if a line starts with 
> "c" and contains a relevant MODULE or USE statement.  Is this possible?

CALL FOO() ; MODULE mymod ! crazy, but possible

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.

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.

-Brad



More information about the CMake mailing list