/src/tools/semantics/code/features/liberty_feature_once.e

http://github.com/tybor/Liberty · Specman e · 82 lines · 55 code · 13 blank · 14 comment · 1 complexity · c7a3ac103ce582bb63f6e0999471cef9 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. --
  15. class LIBERTY_FEATURE_ONCE
  16. inherit
  17. LIBERTY_FEATURE_ROUTINE
  18. create {LIBERTY_BUILDER_TOOLS}
  19. make
  20. feature {ANY}
  21. accept (v: VISITOR) is
  22. local
  23. v0: LIBERTY_FEATURE_ONCE_VISITOR
  24. do
  25. v0 ::= v
  26. v0.visit_liberty_feature_once(Current)
  27. end
  28. feature {}
  29. do_join (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  30. do
  31. Result := a_feature.joined_once(a_type, Current, other_fd, current_fd)
  32. end
  33. feature {LIBERTY_FEATURE}
  34. joined_attribute (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_ATTRIBUTE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  35. do
  36. current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
  37. end
  38. joined_constant (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_CONSTANT; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  39. do
  40. current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
  41. end
  42. joined_deferred (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_DEFERRED; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  43. do
  44. Result := Current
  45. end
  46. joined_do (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_DO; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  47. do
  48. current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
  49. end
  50. joined_external (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_EXTERNAL; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  51. do
  52. current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
  53. end
  54. joined_once (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_ONCE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  55. do
  56. current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
  57. end
  58. joined_redefined (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_REDEFINED; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  59. do
  60. if a_feature.definition_type = definition_type then
  61. current_fd.fatal_join_error_concrete_redefined(a_type, other_fd)
  62. end
  63. Result := Current
  64. end
  65. joined_unique (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_UNIQUE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
  66. do
  67. current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
  68. end
  69. end