# 16 "tools/cvt_emit.mll" let first_item = ref false let lexeme_beginning = ref 0 let add_semicolon () = if !first_item then first_item := false else print_string "; " let print_unescaped_string s = let l = String.length s in let i = ref 0 in while !i < l do if s.[!i] = '\\' && !i+1 < l && (let c = s.[!i+1] in c = '{' || c = '`') (* ` *) then i := !i+1; print_char s.[!i]; i := !i + 1 done # 24 "tools/cvt_emit.ml" let __ocaml_lex_tables = { Lexing.lex_base = "\000\000\250\255\251\255\252\255\253\255\001\000\255\255\254\255\ \002\000\003\000\008\000\003\000\254\255\255\255\253\255\000\000\ \013\000\023\000\001\000\253\255\010\000\004\000\255\255\254\255\ "; Lexing.lex_backtrk = "\255\255\255\255\255\255\255\255\255\255\005\000\255\255\255\255\ \255\255\255\255\003\000\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\001\000\255\255\255\255\255\255\ "; Lexing.lex_default = "\001\000\000\000\000\000\000\000\000\000\255\255\000\000\000\000\ \010\000\255\255\010\000\011\000\000\000\000\000\000\000\255\255\ \255\255\255\255\020\000\000\000\020\000\023\000\000\000\000\000\ "; Lexing.lex_trans = "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\004\000\010\000\000\000\000\000\010\000\000\000\000\000\ \015\000\000\000\000\000\000\000\000\000\000\000\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\022\000\000\000\010\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\016\000\016\000\016\000\016\000\016\000\ \016\000\016\000\016\000\016\000\016\000\017\000\017\000\017\000\ \017\000\017\000\017\000\017\000\017\000\017\000\017\000\010\000\ \010\000\010\000\010\000\010\000\010\000\010\000\010\000\010\000\ \010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\005\000\021\000\009\000\010\000\ \006\000\007\000\013\000\010\000\009\000\010\000\255\255\000\000\ \255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\010\000\000\000\000\000\000\000\010\000\000\000\010\000\ \000\000\000\000\000\000\000\000\000\000\011\000\010\000\000\000\ \014\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\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \002\000\019\000\012\000\255\255\255\255\000\000\000\000\000\000\ \255\255\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\ "; Lexing.lex_check = "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\000\000\015\000\255\255\255\255\009\000\255\255\255\255\ \009\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\000\000\018\000\255\255\009\000\255\255\255\255\ \255\255\255\255\255\255\255\255\020\000\255\255\255\255\255\255\ \255\255\255\255\255\255\009\000\009\000\009\000\009\000\009\000\ \009\000\009\000\009\000\009\000\009\000\016\000\016\000\016\000\ \016\000\016\000\016\000\016\000\016\000\016\000\016\000\017\000\ \017\000\017\000\017\000\017\000\017\000\017\000\017\000\017\000\ \017\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\000\000\018\000\008\000\009\000\ \000\000\005\000\008\000\009\000\010\000\009\000\020\000\255\255\ \010\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\009\000\255\255\255\255\255\255\009\000\255\255\009\000\ \255\255\255\255\255\255\255\255\255\255\008\000\009\000\255\255\ \011\000\255\255\255\255\010\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\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\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\000\018\000\008\000\011\000\021\000\255\255\255\255\255\255\ \010\000\255\255\020\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\ "; 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 lex lexbuf = __ocaml_lex_lex_rec lexbuf 0 and __ocaml_lex_lex_rec lexbuf __ocaml_lex_state = match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with | 0 -> # 39 "tools/cvt_emit.mll" ( lexeme_beginning := Lexing.lexeme_start lexbuf; first_item := true; print_char '('; command lexbuf; print_char ')'; lex lexbuf ) # 141 "tools/cvt_emit.ml" | 1 -> # 46 "tools/cvt_emit.mll" ( print_string "`"; lex lexbuf ) # 146 "tools/cvt_emit.ml" | 2 -> # 47 "tools/cvt_emit.mll" ( prerr_string "Invalid tab at character "; prerr_int (Lexing.lexeme_start lexbuf); prerr_newline(); exit 2 ) # 154 "tools/cvt_emit.ml" | 3 -> # 51 "tools/cvt_emit.mll" ( lexeme_beginning := Lexing.lexeme_start lexbuf; print_char '"'; string lexbuf ) # 161 "tools/cvt_emit.ml" | 4 -> # 54 "tools/cvt_emit.mll" ( () ) # 166 "tools/cvt_emit.ml" | 5 -> # 55 "tools/cvt_emit.mll" ( print_char(Lexing.lexeme_char lexbuf 0); lex lexbuf ) # 171 "tools/cvt_emit.ml" | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_lex_rec lexbuf __ocaml_lex_state and command lexbuf = __ocaml_lex_command_rec lexbuf 8 and __ocaml_lex_command_rec lexbuf __ocaml_lex_state = match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with | 0 -> # 58 "tools/cvt_emit.mll" ( () ) # 183 "tools/cvt_emit.ml" | 1 -> # 59 "tools/cvt_emit.mll" ( prerr_string "Unterminated `...` at character "; prerr_int !lexeme_beginning; prerr_newline(); exit 2 ) # 191 "tools/cvt_emit.ml" | 2 -> # 64 "tools/cvt_emit.mll" ( let s = Lexing.lexeme lexbuf in add_semicolon(); print_string (String.sub s 1 (String.length s - 2)); command lexbuf ) # 199 "tools/cvt_emit.ml" | 3 -> # 72 "tools/cvt_emit.mll" ( let s = Lexing.lexeme lexbuf in add_semicolon(); (* Optimise one-character strings *) if String.length s = 1 && s.[0] <> '\\' && s.[0] <> '\'' || String.length s = 2 && s.[0] = '\\' && s.[1] <> '`' && s.[1]<>'{' (* ` *) then begin print_string "emit_char '"; print_unescaped_string s; print_string "'" end else begin print_string "emit_string \""; print_unescaped_string s; print_string "\"" end; command lexbuf ) # 219 "tools/cvt_emit.ml" | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_command_rec lexbuf __ocaml_lex_state and string lexbuf = __ocaml_lex_string_rec lexbuf 18 and __ocaml_lex_string_rec lexbuf __ocaml_lex_state = match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with | 0 -> # 90 "tools/cvt_emit.mll" ( print_char '"'; lex lexbuf ) # 232 "tools/cvt_emit.ml" | 1 -> # 93 "tools/cvt_emit.mll" ( print_string (Lexing.lexeme lexbuf); string lexbuf ) # 238 "tools/cvt_emit.ml" | 2 -> # 95 "tools/cvt_emit.mll" ( prerr_string "Unterminated \"...\" at character "; prerr_int !lexeme_beginning; prerr_newline(); exit 2 ) # 246 "tools/cvt_emit.ml" | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; __ocaml_lex_string_rec lexbuf __ocaml_lex_state ;; # 100 "tools/cvt_emit.mll" let main () = lex (Lexing.from_channel stdin); exit 0 let _ = main () # 261 "tools/cvt_emit.ml"