From: Felipe P. <fel...@gm...> - 2011-08-06 13:55:56
|
Hi, 2011/8/6 Rui Maciel <rui...@gm...>: > Let's consider the following regex pattern: > > natural = "0"|[1-9][0-9]*; > [-+]?natural "." [0-9]+ ([Ee] [+-]?[0-9]+)? { return > TT_FLOAT_NUMBER; } > [^] { return TT_UNKNOWN; } > > Now, consider the following string: > > 2e+09 > > > The code generated by re2c interprets this string as being > TT_FLOAT_NUMBER (the string "2") followed by TT_UNKNOWN (the string > "e+09"). > > Is there a way to use re2c in order to generate code that performs a > greedy pattern match, which returns a TT_FLOAT_NUMBER with the string > ""2e+09"? > > Note your regex pattern for TT_FLOAT_NUMBER uses "." (dot), and the supplied input doesn't have it. -- Regards, Felipe Pena |