[CMake] 1 tricky question, 1 bug report

Maik Beckmann beckmann.maik at googlemail.com
Fri Mar 13 19:02:23 EDT 2009


Brad King schrieb am Freitag 13 März 2009 um 16:51:
> The full fix is of course to discard 'C'-prefixed comments completely,
> but that can only be done in fixed-form sources.  Currently our lexer
> has code to support fixed-form files but it is never enabled.  CMake
> does not know whether a source file is fixed-form or free-form.  We
> may have to create a source file property to specify it, much like
> some compilers require a flag.  Other suggestions?

What we want is to set the lexer state to either 
  fixed_fmt 
or 
  free_fmt
depending the file extension.  

However, a look at cmFortranLexer.cxx shows that BEGIN is defined as
  #define BEGIN yyg->yy_start = 1 + 2 *
which IMHO means that the lexer can only have one state at a time.  If str_dq 
or str_sq is set, the desired *_fmt state is lost.  

Given that this is the case, lexer states are the wrong tool for the problem.

I'll investigate whether this can be solved within lexer of it has to be 
handled by the parser.

-- Maik





More information about the CMake mailing list