File: parse_condition.ml

package info (click to toggle)
bibtex2html 1.85-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 464 kB
  • ctags: 441
  • sloc: ml: 3,213; makefile: 250; sh: 155; perl: 50
file content (39 lines) | stat: -rw-r--r-- 1,192 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(*
 * bibtex2html - A BibTeX to HTML translator
 * Copyright (C) 1997-2000 Jean-Christophe Fillitre and Claude March
 * 
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation.
 * 
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * 
 * See the GNU General Public License version 2 for more details
 * (enclosed in the file GPL).
 *)

(*i $Id: parse_condition.ml,v 1.4 2001/02/21 09:51:54 filliatr Exp $ i*)

open Condition

(*
let condition s =
  try
    let n = String.index s ':' in 
    let field = String.uppercase (String.sub s 0 n)
    and filter = String.sub s (succ n) (String.length s - n - 1)
    in
      Printf.printf "champ = %s\n" field;
      Printf.printf "filter = %s\n" filter;
      Match (Field field,Str.regexp_case_fold filter)
  with 
      Not_found ->
	raise Syntax_error
;;
*)

let condition s =
  let b = Lexing.from_string s in
  Condition_parser.condition_start Condition_lexer.token b