Negative FP constants... whodathunkit.
[oota-llvm.git] / lib / AsmParser / Lexer.l
index 84062e7837ba74fe0f11f8d459f8139d5a583224..b4910ec5172e6dd551f7f6a184c9782c61b25017 100644 (file)
@@ -111,7 +111,7 @@ NInteger  -[0-9]+
 
 /* FPConstant - A Floating point constant.
    TODO: Expand lexer to support 10e50 FP constant notation */
-FPConstant [0-9]+[.][0-9]*
+FPConstant -?[0-9]+[.][0-9]*
 
 %%
 
@@ -124,10 +124,14 @@ false           { return FALSE; }
 declare         { return DECLARE; }
 global          { return GLOBAL; }
 constant        { return CONSTANT; }
+const           { return CONST; }
 uninitialized   { return UNINIT; }
 implementation  { return IMPLEMENTATION; }
 \.\.\.          { return DOTDOTDOT; }
 string          { return STRING; }
+null            { return NULL_TOK; }
+to              { return TO; }
+except          { return EXCEPT; }
 
 void            { llvmAsmlval.PrimType = Type::VoidTy  ; return VOID;   }
 bool            { llvmAsmlval.PrimType = Type::BoolTy  ; return BOOL;   }
@@ -158,6 +162,9 @@ sub             { RET_TOK(BinaryOpVal, Sub, SUB); }
 mul             { RET_TOK(BinaryOpVal, Mul, MUL); }
 div             { RET_TOK(BinaryOpVal, Div, DIV); }
 rem             { RET_TOK(BinaryOpVal, Rem, REM); }
+and             { RET_TOK(BinaryOpVal, And, AND); }
+or              { RET_TOK(BinaryOpVal, Or , OR ); }
+xor             { RET_TOK(BinaryOpVal, Xor, XOR); }
 setne           { RET_TOK(BinaryOpVal, SetNE, SETNE); }
 seteq           { RET_TOK(BinaryOpVal, SetEQ, SETEQ); }
 setlt           { RET_TOK(BinaryOpVal, SetLT, SETLT); }
@@ -165,7 +172,6 @@ setgt           { RET_TOK(BinaryOpVal, SetGT, SETGT); }
 setle           { RET_TOK(BinaryOpVal, SetLE, SETLE); }
 setge           { RET_TOK(BinaryOpVal, SetGE, SETGE); }
 
-to              { return TO; }
 phi             { RET_TOK(OtherOpVal, PHINode, PHI); }
 call            { RET_TOK(OtherOpVal, Call, CALL); }
 cast            { RET_TOK(OtherOpVal, Cast, CAST); }
@@ -175,6 +181,7 @@ shr             { RET_TOK(OtherOpVal, Shr, SHR); }
 ret             { RET_TOK(TermOpVal, Ret, RET); }
 br              { RET_TOK(TermOpVal, Br, BR); }
 switch          { RET_TOK(TermOpVal, Switch, SWITCH); }
+invoke          { RET_TOK(TermOpVal, Invoke, INVOKE); }
 
 
 malloc          { RET_TOK(MemOpVal, Malloc, MALLOC); }