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

http://github.com/tybor/Liberty · Specman e · 74 lines · 50 code · 10 blank · 14 comment · 1 complexity · 5962af0eab6ca20d3ce15974cabb270e 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_OLD
  16. inherit
  17. LIBERTY_EXPRESSION
  18. create {LIBERTY_BUILDER_TOOLS, LIBERTY_OLD}
  19. make
  20. feature {ANY}
  21. expression: LIBERTY_EXPRESSION
  22. result_type: LIBERTY_TYPE is
  23. do
  24. Result := expression.result_type
  25. end
  26. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  27. local
  28. e: like expression
  29. do
  30. e := expression.specialized_in(a_type)
  31. if e = expression then
  32. Result := Current
  33. else
  34. create Result.make(e, position)
  35. end
  36. end
  37. feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
  38. mark_reachable_code (mark: INTEGER) is
  39. do
  40. expression.mark_reachable_code(mark)
  41. end
  42. feature {}
  43. make (a_expression: like expression; a_position: like position) is
  44. require
  45. a_expression /= Void
  46. a_position /= Void
  47. do
  48. expression := a_expression
  49. position := a_position
  50. ensure
  51. expression = a_expression
  52. position = a_position
  53. end
  54. feature {ANY}
  55. accept (v: VISITOR) is
  56. local
  57. v0: LIBERTY_OLD_VISITOR
  58. do
  59. v0 ::= v
  60. v0.visit_liberty_old(Current)
  61. end
  62. invariant
  63. expression /= Void
  64. end