GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
XML_DTD_PARSER
+
Point of view
All features
ANY
XML_PARSER
All features
class XML_DTD_PARSER
Summary
top
Parses a validation instruction in an XML file:
<!DOCTYPE . . .>
Direct parents
Insert list:
SINGLETON
,
URL_VALIDITY
,
XML_DTD_MEMORY
,
XML_PARSER_TOOLS
Class invariant
top
urls
/= Void implies
buffers
/= Void and then
urls
.count =
buffers
.count
readable_url:
buffer /= Void and then buffer.is_connected implies buffer.url.read
current_is_not_an_expanded_type
is_real_singleton
Overview
top
Creation features
{
XML_PARSER
}
make
Features
Error reporting
{
XML_PARSER
}
has_error
:
BOOLEAN
error_message
:
STRING
{
XML_PARSER
}
parse
(a_buffer:
UNICODE_PARSER_BUFFER
):
XML_DTD_VALIDATOR
{}
urls
:
FAST_ARRAY
[
URL
]
buffers
:
FAST_ARRAY
[
UNICODE_PARSER_BUFFER
]
set_buffer
(a_buffer:
UNICODE_PARSER_BUFFER
)
set_url
(a_url:
URL
)
url
:
URL
buffer
:
UNICODE_PARSER_BUFFER
relative_url
(a_url:
STRING
):
URL
parse_system_dtd
(validator:
XML_DTD_VALIDATOR
):
URL
parse_public_dtd
(validator:
XML_DTD_VALIDATOR
):
URL
parse_external_dtd
(validator:
XML_DTD_VALIDATOR
, a_url:
URL
)
parse_inline_dtd
(validator:
XML_DTD_VALIDATOR
)
parse_dtd
(validator:
XML_DTD_VALIDATOR
, standalone:
BOOLEAN
)
parse_xml_header
parse_attribute
:
BOOLEAN
an attribute in the XML header
skip_comment
parse_element
(validator:
XML_DTD_VALIDATOR
)
parse_element_children
(validator:
XML_DTD_VALIDATOR
)
parse_element_child_list
(validator:
XML_DTD_VALIDATOR
)
parse_element_child_alt
(validator:
XML_DTD_VALIDATOR
)
parse_element_child
(validator:
XML_DTD_VALIDATOR
)
parse_attlist
(validator:
XML_DTD_VALIDATOR
)
parse_attlist_option
(validator:
XML_DTD_VALIDATOR
)
parse_entity
(validator:
XML_DTD_VALIDATOR
)
{}
entity_system_file
(path:
STRING
):
UNICODE_STRING
entity_public_url
(pubid:
UNICODE_STRING
, a_url:
STRING
):
UNICODE_STRING
entity_public_file
(pubid:
UNICODE_STRING
, a_url:
STRING
):
UNICODE_STRING
read_stream_in
(a_buffer:
UNICODE_STRING
, u:
URL
)
{}
in_comment
:
BOOLEAN
next
current_character
:
INTEGER_32
end_of_input
:
BOOLEAN
pe_entity_names
:
FAST_ARRAY
[
UNICODE_STRING
]
pe_entity_strings
:
FAST_ARRAY
[
UNICODE_STRING
]
pe_entity_old_indexes
:
FAST_ARRAY
[
INTEGER_32
]
pe_entities
:
HASHED_DICTIONARY
[
UNICODE_STRING
,
UNICODE_STRING
]
pe_index
:
INTEGER_32
has_pe_entity
(pe_entity_name:
UNICODE_STRING
):
BOOLEAN
add_pe_entity
(pe_entity_name:
UNICODE_STRING
, string:
UNICODE_STRING
)
{}
make
Error_end_of_file
:
STRING
error
:
STRING
set_error
(a_error:
STRING
)
{
ANY
}
line
:
INTEGER_32
column
:
INTEGER_32
{}
skip_blanks
previous
skip
(character:
CHARACTER
):
BOOLEAN
skip2
(char1:
CHARACTER
, char2:
CHARACTER
):
BOOLEAN
skip_word
(word:
STRING
):
BOOLEAN
is_identifier_start
(unicode:
INTEGER_32
):
BOOLEAN
is_identifier_part
(unicode:
INTEGER_32
):
BOOLEAN
read_identifier
:
UNICODE_STRING
read_string
:
UNICODE_STRING
read_identifier_as_string
:
STRING
read_string_as_string
:
STRING
{
ANY
}
is_separator
(unicode:
INTEGER_32
):
BOOLEAN
is_base_char
(unicode:
INTEGER_32
):
BOOLEAN
is_ideographic
(unicode:
INTEGER_32
):
BOOLEAN
is_combining_char
(unicode:
INTEGER_32
):
BOOLEAN
is_extender
(unicode:
INTEGER_32
):
BOOLEAN
is_letter
(unicode:
INTEGER_32
):
BOOLEAN
is_digit
(unicode:
INTEGER_32
):
BOOLEAN
Memory management
{}
dtd_validators_pool
:
RECYCLING_POOL
[
XML_DTD_VALIDATOR
]
new_dtd_validator
(root_node_name:
UNICODE_STRING
):
XML_DTD_VALIDATOR
recycle_dtd_validator
(a_validator:
XML_DTD_VALIDATOR
)
string_pool
:
RECYCLING_POOL
[
UNICODE_STRING
]
new_empty_string
:
UNICODE_STRING
new_string
(s:
UNICODE_STRING
):
UNICODE_STRING
free_string
(a_string:
UNICODE_STRING
)
url_pool
:
RECYCLING_POOL
[
URL
]
buffer_pool
:
RECYCLING_POOL
[
UNICODE_PARSER_BUFFER
]
{
ANY
}
is_equal
(other: XML_DTD_PARSER):
BOOLEAN
Is
other
attached to an object considered equal to current object?
{}
is_real_singleton
:
BOOLEAN
singleton_memory_pool
:
HASHED_DICTIONARY
[
POINTER
,
STRING
]
This pool is unique in the whole system.
current_is_not_an_expanded_type
:
BOOLEAN
Check that the dynamic type of the
SINGLETON
is not an expanded type.
{
ANY
}
valid_url
(a_url:
ABSTRACT_STRING
):
BOOLEAN
True if the
STRING
represents a real
URL
(i.e. with a known protocol and a valid URI for that protocol)
has_error
:
BOOLEAN
effective function
{
XML_PARSER
}
top
error_message
:
STRING
effective function
{
XML_PARSER
}
top
require
has_error
parse
(a_buffer:
UNICODE_PARSER_BUFFER
):
XML_DTD_VALIDATOR
effective function
{
XML_PARSER
}
top
require
a_buffer /= Void
urls
:
FAST_ARRAY
[
URL
]
writable attribute
{}
top
buffers
:
FAST_ARRAY
[
UNICODE_PARSER_BUFFER
]
writable attribute
{}
top
set_buffer
(a_buffer:
UNICODE_PARSER_BUFFER
)
effective procedure
{}
top
set_url
(a_url:
URL
)
effective procedure
{}
top
url
:
URL
effective function
{}
top
buffer
:
UNICODE_PARSER_BUFFER
effective function
{}
top
relative_url
(a_url:
STRING
):
URL
effective function
{}
top
require
not a_url.is_empty
parse_system_dtd
(validator:
XML_DTD_VALIDATOR
):
URL
effective function
{}
top
ensure
not
has_error
implies Result.is_connected
has_error
implies Result = Void
parse_public_dtd
(validator:
XML_DTD_VALIDATOR
):
URL
effective function
{}
top
ensure
not
has_error
implies Result.is_connected
has_error
implies Result = Void
parse_external_dtd
(validator:
XML_DTD_VALIDATOR
, a_url:
URL
)
effective procedure
{}
top
require
a_url.is_connected
not
has_error
ensure
url
= old
url
buffer
= old
buffer
buffer
.line = old
buffer
.line
buffer
.column = old
buffer
.column
buffer
.index = old
buffer
.index
parse_inline_dtd
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_dtd
(validator:
XML_DTD_VALIDATOR
, standalone:
BOOLEAN
)
effective procedure
{}
top
parse_xml_header
effective procedure
{}
top
parse_attribute
:
BOOLEAN
effective function
{}
top
an attribute in the XML header
skip_comment
effective procedure
{}
top
parse_element
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_element_children
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_element_child_list
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_element_child_alt
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_element_child
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_attlist
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_attlist_option
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
parse_entity
(validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
entity_system_file
(path:
STRING
):
UNICODE_STRING
effective function
{}
top
entity_public_url
(pubid:
UNICODE_STRING
, a_url:
STRING
):
UNICODE_STRING
effective function
{}
top
entity_public_file
(pubid:
UNICODE_STRING
, a_url:
STRING
):
UNICODE_STRING
effective function
{}
top
read_stream_in
(a_buffer:
UNICODE_STRING
, u:
URL
)
effective procedure
{}
top
require
u.is_connected
ensure
not u.is_connected
in_comment
:
BOOLEAN
writable attribute
{}
top
next
effective procedure
{}
top
require
buffer.is_connected
not end_of_input
current_character
:
INTEGER_32
effective function
{}
top
require
buffer.is_connected
not end_of_input
end_of_input
:
BOOLEAN
effective function
{}
top
require
buffer.is_connected
pe_entity_names
:
FAST_ARRAY
[
UNICODE_STRING
]
writable attribute
{}
top
pe_entity_strings
:
FAST_ARRAY
[
UNICODE_STRING
]
writable attribute
{}
top
pe_entity_old_indexes
:
FAST_ARRAY
[
INTEGER_32
]
writable attribute
{}
top
pe_entities
:
HASHED_DICTIONARY
[
UNICODE_STRING
,
UNICODE_STRING
]
writable attribute
{}
top
pe_index
:
INTEGER_32
writable attribute
{}
top
has_pe_entity
(pe_entity_name:
UNICODE_STRING
):
BOOLEAN
effective function
{}
top
add_pe_entity
(pe_entity_name:
UNICODE_STRING
, string:
UNICODE_STRING
)
effective procedure
{}
top
require
not
has_pe_entity
(pe_entity_name)
make
effective procedure
{}
top
Error_end_of_file
:
STRING
is "Unexpected end of file"
constant attribute
{}
top
error
:
STRING
writable attribute
{}
top
set_error
(a_error:
STRING
)
effective procedure
{}
top
line
:
INTEGER_32
effective function
{
ANY
}
top
column
:
INTEGER_32
effective function
{
ANY
}
top
skip_blanks
effective procedure
{}
top
require
buffer
.is_connected
previous
effective procedure
{}
top
require
buffer
.is_connected
buffer
.index > 0
skip
(character:
CHARACTER
):
BOOLEAN
effective function
{}
top
require
buffer
.is_connected
skip2
(char1:
CHARACTER
, char2:
CHARACTER
):
BOOLEAN
effective function
{}
top
require
buffer
.is_connected
skip_word
(word:
STRING
):
BOOLEAN
effective function
{}
top
require
buffer
.is_connected
not word.is_empty
is_identifier_start
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{}
top
require
buffer
.is_connected
is_identifier_part
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{}
top
require
buffer
.is_connected
read_identifier
:
UNICODE_STRING
effective function
{}
top
require
buffer
.is_connected
read_string
:
UNICODE_STRING
effective function
{}
top
require
buffer
.is_connected
current_character
= '%''.code or else
current_character
= '"'.code
read_identifier_as_string
:
STRING
effective function
{}
top
require
buffer
.is_connected
read_string_as_string
:
STRING
effective function
{}
top
require
buffer
.is_connected
is_separator
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{
ANY
}
top
is_base_char
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{
ANY
}
top
is_ideographic
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{
ANY
}
top
is_combining_char
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{
ANY
}
top
is_extender
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{
ANY
}
top
is_letter
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{
ANY
}
top
is_digit
(unicode:
INTEGER_32
):
BOOLEAN
effective function
{
ANY
}
top
dtd_validators_pool
:
RECYCLING_POOL
[
XML_DTD_VALIDATOR
]
effective function
{}
top
new_dtd_validator
(root_node_name:
UNICODE_STRING
):
XML_DTD_VALIDATOR
effective function
{}
top
ensure
Result /= Void
Result.root_name = root_node_name
recycle_dtd_validator
(a_validator:
XML_DTD_VALIDATOR
)
effective procedure
{}
top
string_pool
:
RECYCLING_POOL
[
UNICODE_STRING
]
once function
{}
top
new_empty_string
:
UNICODE_STRING
effective function
{}
top
ensure
Result /= Void
new_string
(s:
UNICODE_STRING
):
UNICODE_STRING
effective function
{}
top
require
s /= Void
ensure
Result.is_equal(s)
free_string
(a_string:
UNICODE_STRING
)
effective procedure
{}
top
require
a_string /= Void
url_pool
:
RECYCLING_POOL
[
URL
]
once function
{}
top
buffer_pool
:
RECYCLING_POOL
[
UNICODE_PARSER_BUFFER
]
once function
{}
top
is_equal
(other: XML_DTD_PARSER):
BOOLEAN
effective function
{
ANY
}
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
is_real_singleton
:
BOOLEAN
effective function
{}
top
ensure
assertion_check_only:
Result
singleton_memory_pool
:
HASHED_DICTIONARY
[
POINTER
,
STRING
]
once function
{}
top
This pool is unique in the whole system.
A memory is kept for each singleton type (type, not class) in the system.
current_is_not_an_expanded_type
:
BOOLEAN
effective function
{}
top
Check that the dynamic type of the
SINGLETON
is not an expanded type.
valid_url
(a_url:
ABSTRACT_STRING
):
BOOLEAN
effective function
{
ANY
}
top
True if the
STRING
represents a real
URL
(i.e. with a known protocol and a valid URI for that protocol)
require
a_url /= Void