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

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