"Robert B. Easter" <reaster@comptechnews.com> writes:
> In scan.l, there is:
> decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*))
> real
> ((({digit}*\.{digit}+)|({digit}+\.{digit}*)|({digit}+))([Ee][-+]?{digit}+))
> Could this be simplified as:
> decimal (({integer}?\.{integer})|({integer}\.{integer}?))
> real ((({decimal})|({integer}))([Ee][-+]?{integer}))
I think it's better style as it stands. The latter might be fewer
characters but it's not easier to understand (IMHO anyway), because
you have to refer back to more nonterminals to decipher it, and said
nonterminals have meanings much more complicated than digit.
Also, as you noted, it'd link the definitions of integer/decimal/real
in ways that might cause trouble later.
regards, tom lane