diff options
author | kugwa <kugwa2000@gmail.com> | 2015-10-23 02:35:10 +0800 |
---|---|---|
committer | kugwa <kugwa2000@gmail.com> | 2015-10-23 02:35:10 +0800 |
commit | 47cf523c3abc5af218560f9412f3cf203996817d (patch) | |
tree | 96b7a7fd840623fcd8b1588741d52896f0a86d43 | |
parent | 6eb80220249bbbb73a3a9449fa3c65c854f38997 (diff) | |
download | compiler2015-47cf523c3abc5af218560f9412f3cf203996817d.tar compiler2015-47cf523c3abc5af218560f9412f3cf203996817d.tar.gz compiler2015-47cf523c3abc5af218560f9412f3cf203996817d.tar.bz2 compiler2015-47cf523c3abc5af218560f9412f3cf203996817d.tar.lz compiler2015-47cf523c3abc5af218560f9412f3cf203996817d.tar.xz compiler2015-47cf523c3abc5af218560f9412f3cf203996817d.tar.zst compiler2015-47cf523c3abc5af218560f9412f3cf203996817d.zip |
More complex format of int and float can be match
-rw-r--r-- | lexer.l | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -48,9 +48,9 @@ ID {letter}({letter}|{digit}|"_")* WS [ \t]+ /* You need to define the following RE's */ -CONST_INT {digit}+ -CONST_FLOAT {digit}+\.{digit}+ -/* -?([0-9]+|[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?) */ +CONST_INT [+-]?{digit}+ +CONST_FLOAT [+-]?([0-9]+|[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?) + /* {digit}+\.{digit}+ */ CONST_STRING \"([^\"\n]|(\\.))*\" COMMENT \/\*([^*]|\n|(\*+([^*/]|\n)))*\*+\/ |