X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=inline;f=helm%2Focaml%2Fmathql%2FmQueryTLexer.mll;h=a0884e79dd21a7a6ec2f23da7380875a6639d4d6;hb=9a73e22935eb65da9e23ece23ad152d79629c661;hp=ca24965b1ff7e08dac5d0fee89b9146df7fc600c;hpb=57a47d11437c168d5ee1c6024ae7a48df8a302ba;p=helm.git diff --git a/helm/ocaml/mathql/mQueryTLexer.mll b/helm/ocaml/mathql/mQueryTLexer.mll index ca24965b1..a0884e79d 100644 --- a/helm/ocaml/mathql/mQueryTLexer.mll +++ b/helm/ocaml/mathql/mQueryTLexer.mll @@ -41,32 +41,43 @@ let SPC = [' ' '\t' '\n']+ let ALPHA = ['A'-'Z' 'a'-'z'] let NUM = ['0'-'9'] let IDEN = ALPHA (NUM | ALPHA)* -let QSTR = [^ '"\']* +let QSTR = [^ '"' '\\']+ - -rule string_token = parse +rule comm_token = parse + | "*)" { query_token lexbuf } + | [^ '*']* { comm_token lexbuf } +and string_token = parse | '"' { DQ } - | '\' . { STR (Lexing.lexeme lexbuf) } - | QSTR { STR (String.sub 1 1 (Lexing.lexeme lexbuf)) } + | '\\' _ { STR (String.sub (Lexing.lexeme lexbuf) 1 1) } + | QSTR { STR (Lexing.lexeme lexbuf) } | eof { EOF } -and main_token = parse - | SPC { main_token lexbuf } +and query_token = parse + | "(*" { comm_token lexbuf } + | SPC { query_token lexbuf } + | '"' { STR (qstr string_token lexbuf) } | '(' { LP } | ')' { RP } + | '{' { LC } + | '}' { RC } | '@' { AT } | '%' { PC } | '$' { DL } | '.' { FS } - | '"' { STR (qstr string_token lexbuf } + | ',' { CM } + | '/' { SL } | "and" { AND } | "attr" { ATTR } | "attribute" { ATTRIB } + | "be" { BE } | "diff" { DIFF } | "eq" { EQ } + | "ex" { EX } | "false" { FALSE } | "fun" { FUN } | "in" { IN } | "intersect" { INTER } + | "let" { LET } + | "meet" { MEET } | "not" { NOT } | "or" { OR } | "pattern" { PAT } @@ -81,4 +92,13 @@ and main_token = parse | "where" { WHERE } | IDEN { ID (Lexing.lexeme lexbuf) } | eof { EOF } - +and result_token = parse + | SPC { result_token lexbuf } + | '"' { STR (qstr string_token lexbuf) } + | '{' { LC } + | '}' { RC } + | ',' { CM } + | ';' { SC } + | '=' { IS } + | "attr" { ATTR } + | eof { EOF }