From a7a422abfc0af37c9c2d2f915dc717b4f9fdba1c Mon Sep 17 00:00:00 2001 From: Simon Petit Date: Fri, 13 Dec 2024 08:29:52 +0100 Subject: [PATCH] adding tokens --- lexer/lexer.mll | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lexer/lexer.mll b/lexer/lexer.mll index f735e09..17b84b8 100644 --- a/lexer/lexer.mll +++ b/lexer/lexer.mll @@ -18,6 +18,7 @@ rule read_token = parse | "SUM" { SUM } | "COUNT" { COUNT } | "DISTINCT" { DISTINCT } + | "SUBSTRING" { SUBSTRING } | "FROM" { FROM } | "INNER" { INNER } | "LEFT" { LEFT } @@ -31,13 +32,13 @@ rule read_token = parse | "AND" { AND } | "WHERE" { WHERE } | "HAVING" { HAVING } + | "NOT" { NOT } | "BETWEEN" { BETWEEN } | "IN" { IN } | "LIKE" { LIKE } | "GROUP" { GROUP } | "BY" { BY } | "*" { ASTERISK } - | "." { DOT } | "=" { EQUALS_OPERATOR } | "(" { LEFT_PAREN } | ")" { RIGHT_PAREN } @@ -49,7 +50,7 @@ rule read_token = parse | ':' { COLON } | whitespace { read_token lexbuf } | digit+ as integer { INTEGER (int_of_string integer) } - | digit+"."digit+ { FLOAT } - | '.'digit+ { FLOAT } + | digit+"."digit+ as number { FLOAT (float_of_string number) } + | '.'digit+ as number { FLOAT (float_of_string number) } | alpha alphanumeric* as ident { IDENT ident } | eof { EOF }