3a5100b035fab9eb549bb0e056e9aa6fd16a945c
1 # This file is part of NIT ( http://www.nitlanguage.org ).
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 # `memberdef` element reading.
16 module doxml
::memberdef
20 # Processes the content of a `<memberdef>` element.
21 class MemberDefListener
22 super EntityDefListener
25 var member
: Member is writable, noinit
26 private var type_listener
: TypeListener is noinit
30 type_listener
= new TypeListener(reader
, self)
33 redef fun entity
do return member
35 redef fun start_dox_element
(local_name
: String, atts
: Attributes) do
36 if "name" == local_name
then
37 text
.listen_until
(dox_uri
, local_name
)
38 else if "reimplements" == local_name
then
39 member
.reimplement
(get_required
(atts
, "refid"))
40 else if "type" == local_name
then
41 type_listener
.listen_until
(dox_uri
, local_name
)
47 redef fun end_dox_element
(local_name
: String) do
48 if "memberdef" == local_name
then
50 else if "name" == local_name
then
51 member
.name
= text
.to_s
52 else if "type" == local_name
then
53 source_language
.apply_member_type
(member
, type_listener
.linked_text
)