2 OCaml HTTP - do it yourself (fully OCaml) HTTP daemon
4 Copyright (C) <2002-2007> Stefano Zacchiroli <zack@cs.unibo.it>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation, version 2.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 [ `QSTRING of string (* quoted string, argument is the content (no quotes) *)
24 | `SEP (* cookie separator (i.e. ";") *)
25 | `TOKEN of string (* unitary token *)
26 | `ASSIGN (* equal sign *)
27 | `EOF (* end of file *)
32 | [' ' '\t' '\n' '\r'] { token lexbuf }
33 | '"' ([^ '"'] | "\\\"")* '"' as lexeme
35 let len = String.length lexeme in
36 let content = String.sub lexeme 1 (len - 2) in
41 | [^ ' ' '\t' '\n' '\r' '
\7f' '
\0'-'
\1f' '\'' '<' '=' '>' ',' ';' ':' '?' '/'
42 '(' ')' '[' ']' '{' '}' '@' '\\']+ as lexeme