diff options
author | Chris Lattner <sabre@nondot.org> | 2001-07-15 00:17:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-07-15 00:17:01 +0000 |
commit | 3d52b2fdcc07ce26c61adf99822adfa8251696cc (patch) | |
tree | 320de2cd2d6927e91cddfc37685bdfc3259f6c8d /lib/AsmParser/Lexer.l | |
parent | 2e35bedc825ab1e125d1173a69faca784e2b5a2f (diff) | |
download | external_llvm-3d52b2fdcc07ce26c61adf99822adfa8251696cc.zip external_llvm-3d52b2fdcc07ce26c61adf99822adfa8251696cc.tar.gz external_llvm-3d52b2fdcc07ce26c61adf99822adfa8251696cc.tar.bz2 |
Add support to the parser to recognize floating point constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/Lexer.l')
-rw-r--r-- | lib/AsmParser/Lexer.l | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AsmParser/Lexer.l b/lib/AsmParser/Lexer.l index 91fc1b6..e966de1 100644 --- a/lib/AsmParser/Lexer.l +++ b/lib/AsmParser/Lexer.l @@ -80,6 +80,10 @@ ENInteger %-[0-9]+ PInteger [0-9]+ NInteger -[0-9]+ +/* FPConstant - A Floating point constant. + TODO: Expand lexer to support 10e50 FP constant notation */ +FPConstant [0-9]+[.][0-9]* + %% {Comment} { /* Ignore comments for now */ } @@ -181,6 +185,7 @@ getelementptr { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } return SINTVAL; } +{FPConstant} { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } [ \t\n] { /* Ignore whitespace */ } . { /*printf("'%s'", yytext);*/ return yytext[0]; } |