1
(* $Id: pxp_core_parser.mli 707 2004-09-04 17:25:35Z gerd $
2
* ----------------------------------------------------------------------
3
* PXP: The polymorphic XML parser for Objective Caml.
4
* Copyright by Gerd Stolpmann. See LICENSE for details.
7
(* INTERNAL PXP INTERFACE!
9
* This module should not be used from outside. Use Pxp_tree_parser or
10
* Pxp_ev_parser. The signature of this module may be heavily changed
11
* without keeping backwards compatibility.
17
open Pxp_entity_manager
22
{ mutable current : unit -> token; (* get the current token *)
23
mutable get_next : unit -> token; (* go on to the next token; return it *)
24
mutable current_token : token; (* This is the current token *)
25
mutable manager : entity_manager; (* The entity manager *)
28
type continuation_state =
29
{ cont_context : context;
30
cont_extend_dtd : bool;
31
cont_process_xmldecl : bool;
34
exception End_of_parsing
35
(* One way to signal that parsing is done *)
37
exception Interrupt_parsing of continuation_state
38
(* Interrupt the parsing loop to process pull-style events *)
40
val make_context : ?first_token:token -> entity_manager -> context
44
| `Entry_continuation of continuation_state
50
val stack_create : 't -> 't array_stack
52
val stack_push : 't -> 't array_stack -> unit
54
val stack_top : 't array_stack -> 't
56
val stack_pop : 't array_stack -> 't
59
class virtual core_parser : dtd -> config -> int ->
62
val lfactory : lexer_factory
64
val mutable n_tags_open : int
65
val mutable n_entities_open : int
66
val pull_counter_limit : int
67
val mutable pull_counter : int
68
val mutable p_internal_subset : bool
69
val mutable ns_scope : Pxp_dtd.namespace_scope option
71
method parse : context -> extended_entry -> unit
73
method private only_whitespace : string -> unit
75
method private init_ns_processing : Pxp_dtd.namespace_manager -> unit
77
method private push_src_norm_mapping :
78
namespace_manager -> string -> (string * string) list ->
79
(string * string * string *
80
(string * string * string * string) list)
82
method private pop_src_norm_mapping : unit -> unit
84
method private virtual init_for_xml_body : unit -> unit
86
method private virtual event_document_xmldecl :
87
Pxp_lexer_types.prolog_token list -> unit
89
method private virtual event_start_tag :
90
(string*int*int) option ->
92
(string * string) list ->
97
method private virtual event_end_tag :
102
method private virtual event_char_data : string -> unit
104
method private virtual event_pinstr :
105
(string*int*int) option ->
111
method private virtual event_comment :
112
(string*int*int) option ->
117
method private virtual sub_parser : unit -> core_parser
118
(* used for the external subset *)