# 25 "odot_lexer.mll"
 
(* $Id: odot_lexer.mll 133 2005-12-16 10:03:56Z zoggy $ *)
open Odot_parser


let print_DEBUG s = () (*prerr_endline*)

let line = ref 0

let buf = Buffer.create 256
let init_buf () = Buffer.reset buf

let keywords = [
  "digraph"DIGRAPH ;
  "graph"GRAPH ;
  "strict"STRICT ;
  "node"NODE ;
  "edge"EDGE ;
  "subgraph"SUBGRAPH ;
]

let open_angles = ref 0


# 27 "odot_lexer.ml"
let __ocaml_lex_tables = {
  Lexing.lex_base = 
   "\000\000\233\255\234\2557\000\236\255\237\255\020\000\030\000\209\000\240\255\242\255\243\255\244\255\245\255\246\255\247\255\248\255\249\255\250\2554\0009\0005\0000\000\241\255O\000\255\255Y\000\254\255\253\255\144\000\251\255\252\255\154\000\168\000\235\255l\001d\000\202\000\240\000e\000f\000\003\001g\000i\000E\000";
  Lexing.lex_backtrk = 
   "\255\255\255\255\255\255\020\000\255\255\255\255\017\000\022\000\016\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\022\000\022\000\020\000\022\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\017\000\017\000\255\255\255\255\001\000\005\000\255\255\005\000\002\000\255\255\004\000\001\000\004\000";
  Lexing.lex_default = 
   "\008\000\000\000\000\000\255\255\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\000\000\024\000\000\000\026\000\000\000\000\000\255\255\000\000\000\000\255\255\255\255\000\000\018\000\255\255\255\255\018\000\255\255\255\255\030\000\255\255\255\255\255\255";
  Lexing.lex_trans = 
   "\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\004\000\021\000\001\000\004\000\003\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\004\000\001\000\t\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\n\000\016\000\019\000\007\000\022\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\017\000\018\000\005\000\015\000\001\000\001\000\001\000\"\000!\000\028\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000\026\000\025\000\023\000\012\000\020\000\011\000\001\000\024\000\001\000\031\000\029\000\027\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\027\000\031\000\028\000\028\000\030\000\027\000\025\000\000\000\000\000\000\000\000\000\000\000\000\000\014\000\001\000\013\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000\028\000\000\000\000\000\001\000!\000!\000!\000!\000!\000!\000!\000!\000!\000!\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\028\000\000\000\000\000(\000\000\000\000\000\002\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\000\000\000\000\027\000\000\000\000\000+\000\000\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\027\000,\000\025\000\000\000\008\000\000\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000'\000\000\000\000\000\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\000\000\000\000\000\000\000\000\000\000*\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\027\000\000\000\000\000$\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\000\000\000\000\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\000\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000%\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\030\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\030\000";
  Lexing.lex_check = 
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\006\000\020\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\007\000\021\000\024\000\022\000\000\000\000\000\000\000\000\000\022\000\000\000\019\000\019\000\026\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000$\000'\000(\000*\000\019\000+\000,\000\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000 \000 \000 \000 \000 \000 \000 \000 \000 \000 \000%\000\255\255\255\255\000\000!\000!\000!\000!\000!\000!\000!\000!\000!\000!\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255%\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\255\255\255\255&\000\255\255\255\255&\000\255\255\255\255\000\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\255\255\255\255)\000\255\255\255\255)\000\255\255\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000&\000)\000&\000\255\255\008\000\255\255\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000&\000\255\255\255\255\024\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\026\000\255\255\255\255\255\255\255\255\255\255)\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255#\000\255\255\255\255#\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255#\000\255\255\255\255\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\255\255\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000#\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\008\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255&\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255)\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255#\000";
  Lexing.lex_base_code = 
   "";
  Lexing.lex_backtrk_code = 
   "";
  Lexing.lex_default_code = 
   "";
  Lexing.lex_trans_code = 
   "";
  Lexing.lex_check_code = 
   "";
  Lexing.lex_code = 
   "";
}

let rec main lexbuf =
    __ocaml_lex_main_rec lexbuf 0
and __ocaml_lex_main_rec lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 65 "odot_lexer.mll"
                   ( incr line; main lexbuf )
# 229 "odot_lexer.ml"

  | 1 ->
# 66 "odot_lexer.mll"
         ( incr line; incr line; main lexbuf )
# 234 "odot_lexer.ml"

  | 2 ->
# 67 "odot_lexer.mll"
                  ( incr line; main lexbuf )
# 239 "odot_lexer.ml"

  | 3 ->
# 68 "odot_lexer.mll"
       ( EDGEOP )
# 244 "odot_lexer.ml"

  | 4 ->
# 69 "odot_lexer.mll"
       ( EDGEOP )
# 249 "odot_lexer.ml"

  | 5 ->
# 70 "odot_lexer.mll"
      ( SEMICOLON )
# 254 "odot_lexer.ml"

  | 6 ->
# 71 "odot_lexer.mll"
      ( COLON )
# 259 "odot_lexer.ml"

  | 7 ->
# 72 "odot_lexer.mll"
      ( COMMA )
# 264 "odot_lexer.ml"

  | 8 ->
# 73 "odot_lexer.mll"
      ( EQUALS )
# 269 "odot_lexer.ml"

  | 9 ->
# 74 "odot_lexer.mll"
      ( LBRA )
# 274 "odot_lexer.ml"

  | 10 ->
# 75 "odot_lexer.mll"
      ( RBRA )
# 279 "odot_lexer.ml"

  | 11 ->
# 76 "odot_lexer.mll"
      ( LSBRA )
# 284 "odot_lexer.ml"

  | 12 ->
# 77 "odot_lexer.mll"
      ( RSBRA )
# 289 "odot_lexer.ml"

  | 13 ->
# 78 "odot_lexer.mll"
      ( PLUS )
# 294 "odot_lexer.ml"

  | 14 ->
# 79 "odot_lexer.mll"
       ( comment lexbuf )
# 299 "odot_lexer.ml"

  | 15 ->
# 80 "odot_lexer.mll"
      ( print_DEBUG "entering double quoted string";
        init_buf () ;
        double_quoted lexbuf
      )
# 307 "odot_lexer.ml"

  | 16 ->
# 85 "odot_lexer.mll"
    (
      let id = Lexing.lexeme lexbuf in
      try
        List.assoc (String.lowercase id) keywords
      with
        Not_found ->
          print_DEBUG ("ID "^id);
          Id id
    )
# 320 "odot_lexer.ml"

  | 17 ->
# 95 "odot_lexer.mll"
    (
      let id = Lexing.lexeme lexbuf in
      print_DEBUG ("ID "^id);
      Id id
    )
# 329 "odot_lexer.ml"

  | 18 ->
# 102 "odot_lexer.mll"
    (
      init_buf () ;
      open_angles := 1 ;
      html_id lexbuf
    )
# 338 "odot_lexer.ml"

  | 19 ->
# 107 "odot_lexer.mll"
        ( main lexbuf )
# 343 "odot_lexer.ml"

  | 20 ->
# 108 "odot_lexer.mll"
          ( incr line ; main lexbuf)
# 348 "odot_lexer.ml"

  | 21 ->
# 109 "odot_lexer.mll"
      ( print_DEBUG "EOF"EOF )
# 353 "odot_lexer.ml"

  | 22 ->
# 111 "odot_lexer.mll"
    (print_DEBUG (Lexing.lexeme lexbuf);
      main lexbuf
    )
# 360 "odot_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_main_rec lexbuf __ocaml_lex_state

and double_quoted lexbuf =
    __ocaml_lex_double_quoted_rec lexbuf 35
and __ocaml_lex_double_quoted_rec lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 116 "odot_lexer.mll"
         ( Buffer.add_string buf "\""; double_quoted lexbuf
         )
# 372 "odot_lexer.ml"

  | 1 ->
# 118 "odot_lexer.mll"
          ( incr line ;
            Buffer.add_string buf (Lexing.lexeme lexbuf);
            double_quoted lexbuf
          )
# 380 "odot_lexer.ml"

  | 2 ->
# 122 "odot_lexer.mll"
                  ( incr line; double_quoted lexbuf )
# 385 "odot_lexer.ml"

  | 3 ->
# 123 "odot_lexer.mll"
      ( print_DEBUG "getting out of double quoted string";
        Id_double_quoted (Buffer.contents buf)
      )
# 392 "odot_lexer.ml"

  | 4 ->
# 126 "odot_lexer.mll"
      ( failwith ("End of file in double quoted string, line "^(string_of_int !line)) )
# 397 "odot_lexer.ml"

  | 5 ->
# 127 "odot_lexer.mll"
    ( Buffer.add_string buf (Lexing.lexeme lexbuf);
      double_quoted lexbuf
    )
# 404 "odot_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_double_quoted_rec lexbuf __ocaml_lex_state

and html_id lexbuf =
    __ocaml_lex_html_id_rec lexbuf 38
and __ocaml_lex_html_id_rec lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 132 "odot_lexer.mll"
      ( decr open_angles;
        if !open_angles <= 0 then
           Id_html (Buffer.contents buf)
        else
          (
           Buffer.add_string buf ">";
           html_id lexbuf
          )
         )
# 423 "odot_lexer.ml"

  | 1 ->
# 141 "odot_lexer.mll"
      ( incr open_angles ;
        Buffer.add_char buf '<';
        html_id lexbuf
      )
# 431 "odot_lexer.ml"

  | 2 ->
# 146 "odot_lexer.mll"
          ( incr line ;
            Buffer.add_string buf (Lexing.lexeme lexbuf);
            html_id lexbuf
          )
# 439 "odot_lexer.ml"

  | 3 ->
# 150 "odot_lexer.mll"
                  ( incr line; html_id lexbuf )
# 444 "odot_lexer.ml"

  | 4 ->
# 151 "odot_lexer.mll"
      ( failwith ("End of file in html id, line "^(string_of_int !line)) )
# 449 "odot_lexer.ml"

  | 5 ->
# 152 "odot_lexer.mll"
    ( Buffer.add_string buf (Lexing.lexeme lexbuf);
      html_id lexbuf
    )
# 456 "odot_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_html_id_rec lexbuf __ocaml_lex_state

and comment lexbuf =
    __ocaml_lex_comment_rec lexbuf 41
and __ocaml_lex_comment_rec lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 157 "odot_lexer.mll"
       ( main lexbuf )
# 467 "odot_lexer.ml"

  | 1 ->
# 158 "odot_lexer.mll"
          ( incr line ; comment lexbuf)
# 472 "odot_lexer.ml"

  | 2 ->
# 159 "odot_lexer.mll"
                  ( incr line; comment lexbuf )
# 477 "odot_lexer.ml"

  | 3 ->
# 160 "odot_lexer.mll"
      ( failwith "Comment not terminated" )
# 482 "odot_lexer.ml"

  | 4 ->
# 161 "odot_lexer.mll"
    ( comment lexbuf )
# 487 "odot_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_comment_rec lexbuf __ocaml_lex_state

;;