tests: error_syntax errors on `? now
[nit.git] / contrib / neo_doxygen / src / doxml / listener.nit
index ccdd8f5..40d021f 100644 (file)
@@ -17,6 +17,7 @@ module doxml::listener
 
 import saxophonit
 import model
+import language_specific
 
 # Common abstractions for SAX listeners reading XML documents generated by Doxygen.
 abstract class DoxmlListener
@@ -28,10 +29,14 @@ 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,
@@ -57,6 +62,9 @@ abstract class DoxmlListener
        # 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
@@ -130,13 +138,18 @@ abstract class StackableListener
        # 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
@@ -188,7 +201,10 @@ end
 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