/src/lib/parse/eiffel/eiffel_image.e

http://github.com/tybor/Liberty · Specman e · 74 lines · 36 code · 11 blank · 27 comment · 0 complexity · 2fef00c76d4e81f195eb0fdcaceb5030 MD5 · raw file

  1. -- This file is part of a Liberty Eiffel library.
  2. -- See the full copyright at the end.
  3. --
  4. deferred class EIFFEL_IMAGE
  5. inherit
  6. PARSER_IMAGE
  7. redefine
  8. out_in_tagged_out_memory, is_equal
  9. end
  10. feature {ANY}
  11. is_equal (other: like Current): BOOLEAN is
  12. -- Redefined because SmartEiffel's default is_equal generates bad code in some strange situations
  13. do
  14. Result := position = other.position
  15. and then image.is_equal(other.image)
  16. end
  17. feature {ANY}
  18. image: STRING
  19. -- the real image of the token
  20. blanks: STRING
  21. -- the leading blanks and comments (before the `image' itself)
  22. line: INTEGER is
  23. do
  24. Result := position.line
  25. end
  26. column: INTEGER is
  27. do
  28. Result := position.column
  29. end
  30. index: INTEGER is
  31. do
  32. Result := position.index
  33. end
  34. out_in_tagged_out_memory is
  35. do
  36. tagged_out_memory.append(image)
  37. end
  38. feature {EIFFEL_IMAGE}
  39. position: EIFFEL_POSITION
  40. -- the position of the `image' (discarding the leading `blanks')
  41. invariant
  42. image /= Void
  43. end -- class EIFFEL_IMAGE
  44. --
  45. -- Copyright (c) 2009 by all the people cited in the AUTHORS file.
  46. --
  47. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  48. -- of this software and associated documentation files (the "Software"), to deal
  49. -- in the Software without restriction, including without limitation the rights
  50. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  51. -- copies of the Software, and to permit persons to whom the Software is
  52. -- furnished to do so, subject to the following conditions:
  53. --
  54. -- The above copyright notice and this permission notice shall be included in
  55. -- all copies or substantial portions of the Software.
  56. --
  57. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  58. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  59. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  60. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  61. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  62. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  63. -- THE SOFTWARE.