/[eiffelstudio]/vendor/gobosoft.com/gobo/4.0d/library/tools/src/eiffel/compilation/et_class_type_status_checker3.e
ViewVC logotype

Contents of /vendor/gobosoft.com/gobo/4.0d/library/tools/src/eiffel/compilation/et_class_type_status_checker3.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 98698 - (show annotations)
Mon May 9 13:53:54 2016 UTC (3 years, 5 months ago) by manus
File size: 3739 byte(s)
Update 4.0d version with changes in Gobo from 2016/05/09

1 note
2
3 description:
4
5 "[
6 Eiffel class type validity third pass status checkers.
7 Check whether all classes that appear in a type have
8 their features already successfully flattened.
9 ]"
10
11 library: "Gobo Eiffel Tools Library"
12 copyright: "Copyright (c) 2007-2016, Eric Bezault and others"
13 license: "MIT License"
14 date: "$Date$"
15 revision: "$Revision$"
16
17 class ET_CLASS_TYPE_STATUS_CHECKER3
18
19 inherit
20
21 ET_AST_NULL_PROCESSOR
22 redefine
23 process_class,
24 process_class_type,
25 process_qualified_like_braced_type,
26 process_qualified_like_type,
27 process_tuple_type
28 end
29
30 create
31
32 make
33
34 feature -- Status report
35
36 has_fatal_error: BOOLEAN
37 -- Has a fatal error occurred?
38
39 feature -- Validity checking
40
41 check_type_validity (a_type: ET_TYPE)
42 -- Check whether all classes that appear in `a_type'
43 -- have their features already successfully flattened.
44 -- Set `has_fatal_error' to True otherwise.
45 require
46 a_type_not_void: a_type /= Void
47 do
48 has_fatal_error := False
49 a_type.process (Current)
50 end
51
52 feature {NONE} -- Type validity
53
54 check_class_type_validity (a_type: ET_CLASS_TYPE)
55 -- Check whether all classes that appear in `a_type'
56 -- have their features already successfully flattened.
57 -- Set `has_fatal_error' to True otherwise.
58 require
59 a_type_not_void: a_type /= Void
60 local
61 l_class: ET_NAMED_CLASS
62 i, nb: INTEGER
63 do
64 l_class := a_type.named_base_class
65 if not l_class.features_flattened or else l_class.has_flattening_error then
66 set_fatal_error
67 elseif attached a_type.actual_parameters as l_actuals then
68 nb := l_actuals.count
69 from i := 1 until i > nb loop
70 l_actuals.type (i).process (Current)
71 if has_fatal_error then
72 i := nb + 1 -- Jump out of the loop.
73 end
74 i := i + 1
75 end
76 end
77 end
78
79 check_qualified_like_identifier_validity (a_type: ET_QUALIFIED_LIKE_IDENTIFIER)
80 -- Check whether all classes that appear in `a_type'
81 -- have their features already successfully flattened.
82 -- Set `has_fatal_error' to True otherwise.
83 require
84 a_type_not_void: a_type /= Void
85 do
86 a_type.target_type.process (Current)
87 end
88
89 check_tuple_type_validity (a_type: ET_TUPLE_TYPE)
90 -- Check whether all classes that appear in `a_type'
91 -- have their features already successfully flattened.
92 -- Set `has_fatal_error' to True otherwise.
93 require
94 a_type_not_void: a_type /= Void
95 local
96 l_class: ET_NAMED_CLASS
97 i, nb: INTEGER
98 do
99 l_class := a_type.named_base_class
100 if not l_class.features_flattened or else l_class.has_flattening_error then
101 set_fatal_error
102 elseif attached a_type.actual_parameters as l_parameters then
103 nb := l_parameters.count
104 from i := 1 until i > nb loop
105 l_parameters.type (i).process (Current)
106 if has_fatal_error then
107 i := nb + 1 -- Jump out of the loop.
108 end
109 i := i + 1
110 end
111 end
112 end
113
114 feature {ET_AST_NODE} -- Type dispatcher
115
116 process_class (a_class: ET_CLASS)
117 -- Process `a_class'.
118 do
119 process_class_type (a_class)
120 end
121
122 process_class_type (a_type: ET_CLASS_TYPE)
123 -- Process `a_type'.
124 do
125 check_class_type_validity (a_type)
126 end
127
128 process_qualified_like_braced_type (a_type: ET_QUALIFIED_LIKE_BRACED_TYPE)
129 -- Process `a_type'.
130 do
131 check_qualified_like_identifier_validity (a_type)
132 end
133
134 process_qualified_like_type (a_type: ET_QUALIFIED_LIKE_TYPE)
135 -- Process `a_type'.
136 do
137 check_qualified_like_identifier_validity (a_type)
138 end
139
140 process_tuple_type (a_type: ET_TUPLE_TYPE)
141 -- Process `a_type'.
142 do
143 check_tuple_type_validity (a_type)
144 end
145
146 feature {NONE} -- Error handling
147
148 set_fatal_error
149 -- Report a fatal error.
150 do
151 has_fatal_error := True
152 ensure
153 has_fatal_error: has_fatal_error
154 end
155
156 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23