Add support to the parser to recognize floating point constants
llvm-svn: 188
diff --git a/llvm/lib/AsmParser/Lexer.l b/llvm/lib/AsmParser/Lexer.l
index 91fc1b6..e966de1 100644
--- a/llvm/lib/AsmParser/Lexer.l
+++ b/llvm/lib/AsmParser/Lexer.l
@@ -80,6 +80,10 @@
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 @@
return SINTVAL;
}
+{FPConstant} { llvmAsmlval.FPVal = atof(yytext); return FPVAL; }
[ \t\n] { /* Ignore whitespace */ }
. { /*printf("'%s'", yytext);*/ return yytext[0]; }