neo_doxygen: List members.
[nit.git] / contrib / neo_doxygen / src / doxml / memberdef.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # `memberdef` element reading.
16 module doxml::memberdef
17
18 import entitydef
19
20 # Processes the content of a `<memberdef>` element.
21 class MemberDefListener
22 super EntityDefListener
23
24 # The current member.
25 var member: Member is writable, noinit
26
27 init do
28 super
29 end
30
31 redef fun entity do return member
32
33 redef fun start_dox_element(local_name: String, atts: Attributes) do
34 if "name" == local_name then
35 text.listen_until(dox_uri, local_name)
36 else if "reimplements" == local_name then
37 member.reimplement(get_required(atts, "refid"))
38 else if "type" == local_name then
39 text.listen_until(dox_uri, local_name)
40 # TODO links
41 else
42 super
43 end
44 end
45
46 redef fun end_dox_element(local_name: String) do
47 if "memberdef" == local_name then
48 member.put_in_graph
49 else if "name" == local_name then
50 member.name = text.to_s
51 else if "type" == local_name then
52 # TODO
53 else
54 super
55 end
56 end
57 end