1
Vote

Dot rule violates lex syntax and own documentation

description

Quote from documentation for dot regex: "It means any character except ā€˜\nā€™" (in lex it was except "\n" and "\r"). Anyway, try to add 2 rules -- with dot and "\n". Gplex will display info, that dot rule always overrides "\n".

comments

k_john_gough wrote Oct 29, 2012 at 12:28 AM

Hi macias
Cannot reproduce the violation. Can you give an example please. I have a lex file with just two rules
%%
\n Blah1;
. Blah2;
%%
this gives no diagnostic and produces correct scanning tables.

Lex lookalikes vary in their treatment of '.'
I chose the minimal and oldest tradition. However, no traditional meaning is adequate for Unicode scanners. I encourage the use of the set
DotChar [^\r\n\u0085\u2828\u2029]
Even for ascii scanners I usually define
DotChr [^\r\n]

macias wrote Oct 29, 2012 at 1:15 PM

I am terribly sorry, I mixed the lines numbers, and I was not looking at the correct one the gplex reported. Sorry for taking your time on this!

macias wrote Oct 29, 2012 at 1:17 PM

I am terribly sorry, I mixed the lines number, and I was not looking at the correct line gplex reported. There is only conflict between \r and dot, so it is according to documentation, but not with other tools (but here I don't know what counts as good tradition and what as bad one).

Once again, please forgive me for taking your time.

wrote Feb 14, 2013 at 2:43 AM