[PATCH 1/2] flex: Avoid REJECT name conflict.

Martin Mares mj at ucw.cz
Thu Apr 29 23:21:48 CEST 2010


Hello!

> Haven't you heard a word ? ECHO, REJECT and BEGIN are pre defined
> actions in flex that you can use in your C code. Go read flex again.

I know that. But what does that really means from the point of view
of C syntax (as used in the C snippets contained in the C source)?
Go read the C standard ;-)

Does that mean that every occurrence of REJECT as a substring in the
C code is interpreted by flex?

Or does that mean an occurrence of REJECT as an identifier?

Or as a C statement?

Do you see any place in the flex doc which makes this clear?

Historically, all dialects of lex I have ever seen define these constructs
as C macros, so that they do not trigger in strings or in non-expanding
macro parameters and it is possible to un-/redefine them. If flex suddenly
started to scan the source for calls of these actions in a way which does
not really respect C syntax, it is at least a breach of long tradition.
Whether it is a breach of the specs, nobody can tell as the specs are
utterly vague.

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj at ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth



More information about the Bird-users mailing list