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

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23