Source

hello / sql / lexer.mll

Full commit

{

open Parser
let debugprint = ref false;;
let print str =  if !debugprint then print_endline str;;

}

let digit = ['0'-'9']*
let literal = ['a'-'z']['A'-'Z' 'a'-'z' '_' '0'-'9']*

rule token = parse
  | "select" { SELECT }
  | "SELECT" { SELECT }
  | "from" { FROM }
  | "FROM" { FROM }
  | ","    { COMMA }
  | literal as s { LITERAL(s) }
  | eof		{ print "eof."; EOF }
  | _   { token lexbuf }