import saxophonit
import model
+import language_specific
# Common abstractions for SAX listeners reading XML documents generated by Doxygen.
abstract class DoxmlListener
# The project graph.
fun graph: ProjectGraph is abstract
+ # The language-specific strategies to use.
+ fun source_language: SourceLanguage is abstract
+
redef fun document_locator=(locator: SAXLocator) do
self.locator = locator
end
+ # The Doxygen’s namespace IRI.
protected fun dox_uri: String do return ""
redef fun start_element(uri: String, local_name: String, qname: String,
# See `ContentHandler.start_element` for the description of the parameters.
protected fun end_dox_element(local_name: String) do end
+ # Get the boolean value of the specified attribute.
+ #
+ # `false` by default.
protected fun get_bool(atts: Attributes, local_name: String): Bool do
return get_optional(atts, local_name, "no") == "yes"
end
# The project graph.
private var p_graph: ProjectGraph is noinit
+ # The language-specific strategies to use.
+ private var p_source: SourceLanguage is noinit
+
init do
super
p_graph = parent.graph
+ p_source = parent.source_language
end
redef fun graph do return p_graph
+ redef fun source_language do return p_source
# Temporary redirect events to itself until the end of the specified element.
fun listen_until(uri: String, local_name: String) do
class TextListener
super StackableListener
+ # The read text.
protected var buffer: Buffer = new FlatBuffer
+
+ # Is the last read chunk was ignorable white space?
private var sp: Bool = false
redef fun listen_until(uri: String, local_name: String) do