/src/tools/semantics/code/expressions/liberty_prefix_operator.e

http://github.com/tybor/Liberty · Specman e · 66 lines · 43 code · 9 blank · 14 comment · 0 complexity · 656152963900ccce19829aa766698791 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_PREFIX_OPERATOR
  16. inherit
  17. LIBERTY_PREFIX_CALL
  18. rename
  19. make as prefix_make
  20. end
  21. create {LIBERTY_BUILDER_TOOLS}
  22. make
  23. create {LIBERTY_PREFIX_OPERATOR}
  24. new
  25. feature {}
  26. make (a_target: like target; a_entity: like entity; a_position: like position) is
  27. require
  28. a_target /= Void
  29. a_entity.feature_name.is_prefix
  30. a_position /= Void
  31. do
  32. target := a_target
  33. entity := a_entity
  34. position := a_position
  35. ensure
  36. position = a_position
  37. end
  38. the_prefix_name: FIXED_STRING is
  39. do
  40. check False end
  41. end
  42. make_new (a_target: like target; a_entity: like entity; a_actuals: like actuals_list; a_position: like position): like Current is
  43. do
  44. create Result.new(a_target, a_entity, a_actuals, a_position)
  45. end
  46. feature {ANY}
  47. accept (v: VISITOR) is
  48. local
  49. v0: LIBERTY_PREFIX_OPERATOR_VISITOR
  50. do
  51. v0 ::= v
  52. v0.visit_liberty_prefix_operator(Current)
  53. end
  54. invariant
  55. actuals.is_empty
  56. not is_implicit_current
  57. end