~ubuntu-branches/ubuntu/hardy/pxp/hardy

« back to all changes in this revision

Viewing changes to src/pxp-engine/pxp_core_parser.mli

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2005-03-29 11:06:39 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050329110639-5p39hz1d4aq3r2ec
Tags: 1.1.95-6
* Rebuilt against ocaml 3.08.3
* No longer built with wlex support (since wlex is no longer supported
  upstream and corresponding package has been removed from the debian
  archive)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
5
 *)
 
6
 
 
7
(* INTERNAL PXP INTERFACE!
 
8
 *
 
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.
 
12
 *)
 
13
 
 
14
open Pxp_types
 
15
open Pxp_lexers
 
16
open Pxp_lexer_types
 
17
open Pxp_entity_manager
 
18
open Pxp_dtd
 
19
 
 
20
 
 
21
type context =
 
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 *)
 
26
    }
 
27
 
 
28
type continuation_state =
 
29
  { cont_context : context;
 
30
    cont_extend_dtd : bool;
 
31
    cont_process_xmldecl : bool;
 
32
  }
 
33
 
 
34
exception End_of_parsing
 
35
  (* One way to signal that parsing is done *)
 
36
 
 
37
exception Interrupt_parsing of continuation_state
 
38
  (* Interrupt the parsing loop to process pull-style events *)
 
39
 
 
40
val make_context : ?first_token:token -> entity_manager -> context
 
41
 
 
42
type extended_entry =
 
43
  [ entry
 
44
  | `Entry_continuation of continuation_state
 
45
  ]
 
46
 
 
47
 
 
48
type 't array_stack
 
49
 
 
50
val stack_create : 't -> 't array_stack
 
51
 
 
52
val stack_push : 't -> 't array_stack -> unit
 
53
 
 
54
val stack_top : 't array_stack -> 't
 
55
 
 
56
val stack_pop : 't array_stack -> 't
 
57
 
 
58
 
 
59
class virtual core_parser : dtd -> config -> int ->
 
60
object 
 
61
  val mutable dtd : dtd
 
62
  val lfactory : lexer_factory
 
63
  val config : config
 
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
 
70
 
 
71
  method parse : context -> extended_entry -> unit
 
72
 
 
73
  method private only_whitespace : string -> unit
 
74
 
 
75
  method private init_ns_processing : Pxp_dtd.namespace_manager -> unit
 
76
 
 
77
  method private push_src_norm_mapping : 
 
78
                   namespace_manager -> string -> (string * string) list ->
 
79
                     (string * string * string * 
 
80
                      (string * string * string * string) list)
 
81
 
 
82
  method private pop_src_norm_mapping : unit -> unit
 
83
 
 
84
  method private virtual init_for_xml_body : unit -> unit
 
85
 
 
86
  method private virtual event_document_xmldecl : 
 
87
                             Pxp_lexer_types.prolog_token list -> unit
 
88
 
 
89
  method private virtual event_start_tag : 
 
90
                             (string*int*int) option ->
 
91
                             string ->
 
92
                             (string * string) list ->
 
93
                             bool ->
 
94
                             entity_id ->
 
95
                               unit
 
96
 
 
97
  method private virtual event_end_tag :
 
98
                             string ->
 
99
                             entity_id ->
 
100
                               unit
 
101
 
 
102
  method private virtual event_char_data : string -> unit
 
103
 
 
104
  method private virtual event_pinstr : 
 
105
                             (string*int*int) option ->
 
106
                             string ->
 
107
                             string ->
 
108
                             entity_id ->
 
109
                               unit
 
110
 
 
111
  method private virtual event_comment : 
 
112
                             (string*int*int) option ->
 
113
                             string list ->
 
114
                               unit
 
115
 
 
116
 
 
117
  method private virtual sub_parser : unit -> core_parser
 
118
    (* used for the external subset *)
 
119
 
 
120
end
 
121