views:

63

answers:

1

Hi there i have a flex rule inside my lexer definition :

operators  "[]"|"[]="|"[]<"|".."|"."|".="|"+"|"+="|"-"|"-="|"/"|"/="|"*"|"*="|"%"|"%="|"++"|"--"|"^"|"^="|"~"|"&"|"&="|"|"|"|="|"<<"|"<<="|">>"|"!"|"<"|">"|">="|"<="|"=="|"!="|"&&"|"||"|"~="

Is there any way to split this ruole on more lines to keep it clearer? I tried with \ just like macros but it does not seem to be accepted by flex :(

PS: I don't want to split the rule in more sub-rules, but only split its regex in more lines to keep the code clearer.

+2  A: 

No, that's not possible with flex (I've already looked up flex sources once to find this out).

Strictly speaking, the question is a bit misleading, since you're talking about a name definition, not rule.

Michael Krelin - hacker