adding tokens

This commit is contained in:
Simon Petit 2024-12-10 18:00:26 +01:00
parent 87959fae33
commit 4d62ebe2a3

View File

@ -9,6 +9,9 @@ let alphanumeric = (alpha|digit)
rule read_token = parse
| "SELECT" { SELECT }
| "AS" { AS }
| "DATE" { DATE }
| "TIME" { TIME }
| "AVG" { AVG }
| "MAX" { MAX }
| "MIN" { MIN }
@ -38,13 +41,14 @@ rule read_token = parse
| "=" { EQUALS_OPERATOR }
| "(" { LEFT_PAREN }
| ")" { RIGHT_PAREN }
| "," { COMMA }
| ',' { COMMA }
| "|" { PIPE }
| "'" { QUOTE }
| "+" { PLUS_SIGN }
| "-" { MINUS_SIGN }
| ':' { COLON }
| whitespace { read_token lexbuf }
| digit+ { INTEGER }
| digit+ as integer { INTEGER (int_of_string integer) }
| digit+"."digit+ { FLOAT }
| '.'digit+ { FLOAT }
| alpha alphanumeric* as ident { IDENT ident }