Project

General

Profile

Revision 53206908 src/lexerLustreSpec.mll

View differences:

src/lexerLustreSpec.mll
44 44
  "wcet", WCET;
45 45
  "int", TINT;
46 46
  "bool", TBOOL;
47
  "float", TFLOAT;
47
  (* "float", TFLOAT; *)
48 48
  "real", TREAL;
49 49
  "clock", TCLOCK;
50 50
  "not", NOT;
......
86 86
	token lexbuf }
87 87
  | blank +
88 88
      {token lexbuf}
89
  | '-'? ['0'-'9'] ['0'-'9']* '.' ['0'-'9']*
90
      {FLOAT (float_of_string (Lexing.lexeme lexbuf))}
89
  | (('-'? ['0'-'9'] ['0'-'9']* as l) '.' (['0'-'9']* as r)) as s
90
      {REAL (Num.num_of_string (l^r), String.length r, s)}
91 91
  | '-'? ['0'-'9']+ 
92 92
      {INT (int_of_string (Lexing.lexeme lexbuf)) }
93
  | '-'? ['0'-'9']+ '.' ['0'-'9']+ ('E'|'e') ('+'|'-') ['0'-'9'] ['0'-'9'] as s {REAL s}
93
  | (('-'? ['0'-'9']+ as l)  '.' (['0'-'9']+ as r) ('E'|'e') (('+'|'-') ['0'-'9'] ['0'-'9']* as exp)) as s
94
      {REAL (Num.num_of_string (l^r), String.length r + -1 * int_of_string exp, s)}
95

  
94 96
 (* | '/' (['_' 'A'-'Z' 'a'-'z'] ['A'-'Z' 'a'-'z' '_' '0'-'9']* '/')+ as s
95 97
      {IDENT s}
96 98
 *)

Also available in: Unified diff