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



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to