home
wiki
classes/clusters list
class information
+
Point of view
All features
ANY
XML_DTD_NODE
XML_DTD_VALIDATOR
RECYCLING_POOL
INTERNALS_HANDLER
All features
class XML_DTD_ELEMENT
Summary
top
Direct parents
inherit list:
BACKTRACKING_NODE
insert list:
RECYCLABLE
Class invariant
top
not
name
.is_empty
attributes
/= Void
Overview
top
creation features
make
(a_name:
STRING
)
features
name
:
STRING
out_in_tagged_out_memory
Append terse printable represention of current object in
tagged_out_memory
.
build
Prepare to build the element's structure
is_built
:
BOOLEAN
Data validation
is_valid_attributes
(xml_attributes:
DICTIONARY
[
STRING
,
STRING
]):
BOOLEAN
Tree validation
is_valid_child
(explorer:
XML_DTD_VALIDATOR
, node_name:
STRING
, children:
FAST_ARRAY
[
XML_DTD_NODE
]):
BOOLEAN
is_valid_data
(explorer:
XML_DTD_VALIDATOR
, data:
STRING
, children:
FAST_ARRAY
[
XML_DTD_NODE
]):
BOOLEAN
Tree structure validation
explore
(explorer:
XML_DTD_VALIDATOR
)
That feature must update the state of 'explorer'.
The element's structure
structure
:
BACKTRACKING_NODE
the element's structure
open_lists
:
FAST_ARRAY
[
BACKTRACKING_NODE_AND_LIST
]
used during construction a once array is enough since we build one element at a time
current_list_root_memory
:
REFERENCE
[
BACKTRACKING_NODE_AND_LIST
]
current_list_root
:
BACKTRACKING_NODE_AND_LIST
the last link of the current list
set_current_list_root
(a_current_list_root:
BACKTRACKING_NODE_AND_LIST
)
current_list_memory
:
REFERENCE
[
BACKTRACKING_NODE_AND_LIST
]
current_list
:
BACKTRACKING_NODE_AND_LIST
the last link of the current list
set_current_list
(a_current_list:
BACKTRACKING_NODE_AND_LIST
)
current_alt_memory
:
REFERENCE
[
BACKTRACKING_NODE_OR_LIST
]
current_alt
:
BACKTRACKING_NODE_OR_LIST
set_current_alt
(a_current_alt:
BACKTRACKING_NODE_OR_LIST
)
alt_is_last_of
(node:
BACKTRACKING_NODE
, alt:
BACKTRACKING_NODE_OR_LIST
):
BOOLEAN
node_in_current_list_or_alt
:
BACKTRACKING_NODE
set_node_in_current_list_or_alt
(new_node:
BACKTRACKING_NODE
)
Building element's structure
list_depth
:
INTEGER_32
open_list
close_list
child
(element: XML_DTD_ELEMENT)
alternative_child
(element: XML_DTD_ELEMENT)
one_or_more
zero_or_more
zero_or_one
exactly_one
pcdata
(alternative:
BOOLEAN
)
any
empty
commit
Multiplicity helpers
one_or_more_node
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
zero_or_more_node
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
zero_or_one_node
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
node_and_end
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
Special nodes
any_node
:
XML_DTD_ANY_NODE
empty_node
:
XML_DTD_EMPTY_NODE
end_node
:
XML_DTD_END_NODE
pcdata_node
:
XML_DTD_PCDATA_NODE
Adding attributes
attributes
:
HASHED_DICTIONARY
[
XML_DTD_ATTRIBUTE
,
STRING
]
current_attribute
:
XML_DTD_ATTRIBUTE
building_attlist
:
BOOLEAN
adding_attlist
(attribute_name:
STRING
):
BOOLEAN
has_attlist
(attribute_name:
STRING
):
BOOLEAN
add_attlist
(attribute_name:
STRING
)
commit_attlist
(attribute_name:
STRING
)
attlist_list_value
(value:
STRING
)
attlist_cdata
attlist_id
attlist_idref
attlist_idrefs
attlist_nmtoken
attlist_nmtokens
attlist_entity
attlist_entities
attlist_notation
attlist_required
attlist_implied
attlist_fixed
(value:
STRING
)
attlist_default_value
(value:
STRING
)
Constructor
make
(a_name:
STRING
)
recycle
Do whatever needs to be done to free resources or recycle other objects when recycling this one
Memory management
attributes_pool
:
RECYCLING_POOL
[
XML_DTD_ATTRIBUTE
]
recycle_attributes
name
:
STRING
writable attribute
top
out_in_tagged_out_memory
effective procedure
top
Append terse printable represention of current object in
tagged_out_memory
.
ensure
not_cleared:
tagged_out_memory.count >= old tagged_out_memory.count
append_only:
old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
build
effective procedure
top
Prepare to build the element's structure
is_built
:
BOOLEAN
writable attribute
top
is_valid_attributes
(xml_attributes:
DICTIONARY
[
STRING
,
STRING
]):
BOOLEAN
effective function
top
is_valid_child
(explorer:
XML_DTD_VALIDATOR
, node_name:
STRING
, children:
FAST_ARRAY
[
XML_DTD_NODE
]):
BOOLEAN
effective function
top
require
explorer /= Void
children /= Void
is_built
is_valid_data
(explorer:
XML_DTD_VALIDATOR
, data:
STRING
, children:
FAST_ARRAY
[
XML_DTD_NODE
]):
BOOLEAN
effective function
top
require
explorer /= Void
children /= Void
is_built
explore
(explorer:
XML_DTD_VALIDATOR
)
effective procedure
top
That feature must update the state of 'explorer'.
structure
:
BACKTRACKING_NODE
writable attribute
top
the element's structure
open_lists
:
FAST_ARRAY
[
BACKTRACKING_NODE_AND_LIST
]
once function
top
used during construction a once array is enough since we build one element at a time
current_list_root_memory
:
REFERENCE
[
BACKTRACKING_NODE_AND_LIST
]
once function
top
current_list_root
:
BACKTRACKING_NODE_AND_LIST
effective function
top
the last link of the current list
set_current_list_root
(a_current_list_root:
BACKTRACKING_NODE_AND_LIST
)
effective procedure
top
ensure
current_list_root
= a_current_list_root
current_list_memory
:
REFERENCE
[
BACKTRACKING_NODE_AND_LIST
]
once function
top
current_list
:
BACKTRACKING_NODE_AND_LIST
effective function
top
the last link of the current list
set_current_list
(a_current_list:
BACKTRACKING_NODE_AND_LIST
)
effective procedure
top
ensure
current_list
= a_current_list
current_alt_memory
:
REFERENCE
[
BACKTRACKING_NODE_OR_LIST
]
once function
top
current_alt
:
BACKTRACKING_NODE_OR_LIST
effective function
top
ensure
Result /= Void implies
current_list
/= Void and then
alt_is_last_of
(
current_list
.node, Result)
set_current_alt
(a_current_alt:
BACKTRACKING_NODE_OR_LIST
)
effective procedure
top
ensure
current_alt
= a_current_alt
alt_is_last_of
(node:
BACKTRACKING_NODE
, alt:
BACKTRACKING_NODE_OR_LIST
):
BOOLEAN
effective function
top
node_in_current_list_or_alt
:
BACKTRACKING_NODE
effective function
top
set_node_in_current_list_or_alt
(new_node:
BACKTRACKING_NODE
)
effective procedure
top
list_depth
:
INTEGER_32
effective function
top
open_list
effective procedure
top
ensure
list_depth
= old
list_depth
+ 1
current_list
= Void
close_list
effective procedure
top
require
list_depth
> 0
ensure
list_depth
= old
list_depth
- 1
old
current_list
/= Void implies
current_list
/= old
current_list
list_depth
= 0 implies
structure
/= Void
child
(element: XML_DTD_ELEMENT)
effective procedure
top
alternative_child
(element: XML_DTD_ELEMENT)
effective procedure
top
one_or_more
effective procedure
top
zero_or_more
effective procedure
top
zero_or_one
effective procedure
top
exactly_one
effective procedure
top
pcdata
(alternative:
BOOLEAN
)
effective procedure
top
any
effective procedure
top
empty
effective procedure
top
commit
effective procedure
top
require
not
is_built
ensure
is_built
one_or_more_node
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
effective function
top
zero_or_more_node
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
effective function
top
zero_or_one_node
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
effective function
top
node_and_end
(a_node:
BACKTRACKING_NODE
):
BACKTRACKING_NODE
effective function
top
any_node
:
XML_DTD_ANY_NODE
once function
top
empty_node
:
XML_DTD_EMPTY_NODE
once function
top
end_node
:
XML_DTD_END_NODE
once function
top
pcdata_node
:
XML_DTD_PCDATA_NODE
once function
top
attributes
:
HASHED_DICTIONARY
[
XML_DTD_ATTRIBUTE
,
STRING
]
writable attribute
top
current_attribute
:
XML_DTD_ATTRIBUTE
writable attribute
top
building_attlist
:
BOOLEAN
effective function
top
adding_attlist
(attribute_name:
STRING
):
BOOLEAN
effective function
top
ensure
Result implies
building_attlist
has_attlist
(attribute_name:
STRING
):
BOOLEAN
effective function
top
add_attlist
(attribute_name:
STRING
)
effective procedure
top
require
not
has_attlist
(attribute_name)
not
building_attlist
ensure
building_attlist
commit_attlist
(attribute_name:
STRING
)
effective procedure
top
require
adding_attlist
(attribute_name)
ensure
not
building_attlist
attlist_list_value
(value:
STRING
)
effective procedure
top
require
building_attlist
attlist_cdata
effective procedure
top
require
building_attlist
attlist_id
effective procedure
top
require
building_attlist
attlist_idref
effective procedure
top
require
building_attlist
attlist_idrefs
effective procedure
top
require
building_attlist
attlist_nmtoken
effective procedure
top
require
building_attlist
attlist_nmtokens
effective procedure
top
require
building_attlist
attlist_entity
effective procedure
top
require
building_attlist
attlist_entities
effective procedure
top
require
building_attlist
attlist_notation
effective procedure
top
require
building_attlist
attlist_required
effective procedure
top
require
building_attlist
attlist_implied
effective procedure
top
require
building_attlist
attlist_fixed
(value:
STRING
)
effective procedure
top
require
building_attlist
attlist_default_value
(value:
STRING
)
effective procedure
top
require
building_attlist
make
(a_name:
STRING
)
effective procedure
top
require
not a_name.is_empty
ensure
not
is_built
structure
= Void
name
= a_name
attributes
.is_empty
current_attribute
= Void
recycle
effective procedure
top
Do whatever needs to be done to free resources or recycle other objects when recycling this one
ensure
not
is_built
structure
= Void
current_attribute
= Void
attributes_pool
:
RECYCLING_POOL
[
XML_DTD_ATTRIBUTE
]
once function
top
recycle_attributes
effective procedure
top
ensure
attributes
.is_empty