PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/configuration/etc/liberty_etc_factory.e

http://github.com/tybor/Liberty
Specman e | 244 lines | 196 code | 34 blank | 14 comment | 0 complexity | e1ac32fe298135f329c72622e1b592e0 MD5 | raw file
  1-- This file is part of Liberty Eiffel.
  2--
  3-- Liberty Eiffel is free software: you can redistribute it and/or modify
  4-- it under the terms of the GNU General Public License as published by
  5-- the Free Software Foundation, version 3 of the License.
  6--
  7-- Liberty Eiffel is distributed in the hope that it will be useful,
  8-- but WITHOUT ANY WARRANTY; without even the implied warranty of
  9-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 10-- GNU General Public License for more details.
 11--
 12-- You should have received a copy of the GNU General Public License
 13-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
 14--
 15class LIBERTY_ETC_FACTORY
 16
 17inherit
 18   EIFFEL_NODE_FACTORY
 19
 20create {LIBERTY_ETC}
 21   make
 22
 23feature {EIFFEL_GRAMMAR}
 24   list (name: FIXED_STRING): EIFFEL_LIST_NODE is
 25      local
 26         visitor: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]]
 27      do
 28         inspect
 29            name
 30         when "Environment_Variable*" then
 31            visitor := agent_environment_variable_list
 32         when "Cluster*" then
 33            visitor := agent_cluster_list
 34         when "Cluster_Configuration*" then
 35            visitor := agent_cluster_configuration_list
 36         when "Debug_Configuration*" then
 37            visitor := agent_debug_configuration_list
 38         when "Debug_Key+" then
 39            visitor := agent_debug_key_list
 40         when "Location+" then
 41            visitor := agent_location_list
 42         end
 43         create {LIBERTY_ETC_LIST} Result.make(name, visitor)
 44      end
 45
 46   non_terminal (name: FIXED_STRING; names: TRAVERSABLE[FIXED_STRING]): EIFFEL_NON_TERMINAL_NODE is
 47      local
 48         visitor: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]]
 49      do
 50         inspect
 51            name
 52         when "Master" then
 53            visitor := agent_master
 54         when "Cluster_Definition" then
 55            visitor := agent_cluster_definition
 56         when "Configure" then
 57            visitor := agent_configure
 58         when "Environment" then
 59            visitor := agent_environment
 60         when "Environment_Variable" then
 61            visitor := agent_environment_variable
 62         when "Clusters" then
 63            visitor := agent_clusters
 64         when "Cluster" then
 65            visitor := agent_cluster
 66         when "Version" then
 67            visitor := agent_version
 68         when "Needs" then
 69            visitor := agent_needs
 70         when "Cluster_Configuration" then
 71            visitor := agent_cluster_configuration
 72         when "Cluster_Constraints" then
 73            visitor := agent_cluster_constraints
 74         when "Cluster_Version_Constraint" then
 75            visitor := agent_cluster_version_constraint
 76         when "Version_Operator" then
 77            visitor := agent_version_operator
 78         when "Assertion" then
 79            visitor := agent_assertion
 80         when "Assertion_Level" then
 81            visitor := agent_assertion_level
 82         when "Debug" then
 83            visitor := agent_debug
 84         when "Debug_Configuration" then
 85            visitor := agent_debug_configuration
 86         when "Debug_Key" then
 87            visitor := agent_debug_key
 88         when "Concurrency" then
 89            visitor := agent_concurrency
 90         when "Locations" then
 91            visitor := agent_locations
 92         when "Location" then
 93            visitor := agent_location
 94         end
 95         create {LIBERTY_ETC_NON_TERMINAL} Result.make(name, names, visitor)
 96      end
 97
 98   terminal (name: FIXED_STRING; image: EIFFEL_IMAGE): EIFFEL_TERMINAL_NODE is
 99      do
100         create {EIFFEL_TERMINAL_NODE_IMPL} Result.make(name, image)
101      end
102
103feature {}
104   make is
105      do
106      end
107
108feature {} -- visitor agents
109   agent_environment_variable_list: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]] is
110      once
111         Result := agent {LIBERTY_ETC_VISITOR}.visit_environment_variable_list
112      end
113
114   agent_cluster_list: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]] is
115      once
116         Result := agent {LIBERTY_ETC_VISITOR}.visit_cluster_list
117      end
118
119   agent_cluster_configuration_list: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]] is
120      once
121         Result := agent {LIBERTY_ETC_VISITOR}.visit_cluster_configuration_list
122      end
123
124   agent_debug_configuration_list: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]] is
125      once
126         Result := agent {LIBERTY_ETC_VISITOR}.visit_debug_configuration_list
127      end
128
129   agent_debug_key_list: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]] is
130      once
131         Result := agent {LIBERTY_ETC_VISITOR}.visit_debug_key_list
132      end
133
134   agent_location_list: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]] is
135      once
136         Result := agent {LIBERTY_ETC_VISITOR}.visit_location_list
137      end
138
139   agent_master: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
140      once
141         Result := agent {LIBERTY_ETC_VISITOR}.visit_master
142      end
143
144   agent_cluster_definition: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
145      once
146         Result := agent {LIBERTY_ETC_VISITOR}.visit_cluster_definition
147      end
148
149   agent_configure: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
150      once
151         Result := agent {LIBERTY_ETC_VISITOR}.visit_configure
152      end
153
154   agent_environment: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
155      once
156         Result := agent {LIBERTY_ETC_VISITOR}.visit_environment
157      end
158
159   agent_environment_variable: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
160      once
161         Result := agent {LIBERTY_ETC_VISITOR}.visit_environment_variable
162      end
163
164   agent_clusters: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
165      once
166         Result := agent {LIBERTY_ETC_VISITOR}.visit_clusters
167      end
168
169   agent_cluster: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
170      once
171         Result := agent {LIBERTY_ETC_VISITOR}.visit_cluster
172      end
173
174   agent_locations: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
175      once
176         Result := agent {LIBERTY_ETC_VISITOR}.visit_locations
177      end
178
179   agent_location: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
180      once
181         Result := agent {LIBERTY_ETC_VISITOR}.visit_location
182      end
183
184   agent_version: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
185      once
186         Result := agent {LIBERTY_ETC_VISITOR}.visit_version
187      end
188
189   agent_needs: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
190      once
191         Result := agent {LIBERTY_ETC_VISITOR}.visit_needs
192      end
193
194   agent_cluster_configuration: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
195      once
196         Result := agent {LIBERTY_ETC_VISITOR}.visit_cluster_configuration
197      end
198
199   agent_cluster_constraints: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
200      once
201         Result := agent {LIBERTY_ETC_VISITOR}.visit_cluster_constraints
202      end
203
204   agent_cluster_version_constraint: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
205      once
206         Result := agent {LIBERTY_ETC_VISITOR}.visit_cluster_version_constraint
207      end
208
209   agent_version_operator: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
210      once
211         Result := agent {LIBERTY_ETC_VISITOR}.visit_version_operator
212      end
213
214   agent_assertion: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
215      once
216         Result := agent {LIBERTY_ETC_VISITOR}.visit_assertion
217      end
218
219   agent_assertion_level: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
220      once
221         Result := agent {LIBERTY_ETC_VISITOR}.visit_assertion_level
222      end
223
224   agent_debug: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
225      once
226         Result := agent {LIBERTY_ETC_VISITOR}.visit_debug
227      end
228
229   agent_debug_configuration: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
230      once
231         Result := agent {LIBERTY_ETC_VISITOR}.visit_debug_configuration
232      end
233
234   agent_debug_key: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
235      once
236         Result := agent {LIBERTY_ETC_VISITOR}.visit_debug_key
237      end
238
239   agent_concurrency: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_NON_TERMINAL]] is
240      once
241         Result := agent {LIBERTY_ETC_VISITOR}.visit_concurrency
242      end
243
244end -- class LIBERTY_ETC_FACTORY