/src/lib/parse/parse_error.e

http://github.com/tybor/Liberty · Specman e · 76 lines · 47 code · 6 blank · 23 comment · 3 complexity · f72feef2aaa33cc35fe9dce4219420fb MD5 · raw file

  1. -- This file is part of a Liberty Eiffel library.
  2. -- See the full copyright at the end.
  3. --
  4. class PARSE_ERROR
  5. create {ANY}
  6. make
  7. feature {ANY}
  8. index: INTEGER
  9. message: STRING
  10. next: PARSE_ERROR
  11. feature {PARSE_ERROR}
  12. set_next (a_next: like next)
  13. require
  14. a_next /= Void
  15. a_next /= Current
  16. do
  17. if next = Void then
  18. next := a_next
  19. else
  20. next.set_next(a_next)
  21. end
  22. ensure
  23. last = a_next
  24. end
  25. last: PARSE_ERROR
  26. do
  27. if next = Void then
  28. Result := Current
  29. else
  30. Result := next.last
  31. end
  32. ensure
  33. Result /= Void
  34. end
  35. feature {}
  36. make (a_index: like index; a_message: like message; a_previous: PARSE_ERROR)
  37. require
  38. a_message /= Void
  39. do
  40. index := a_index
  41. message := a_message
  42. if a_previous /= Void then
  43. a_previous.set_next(Current)
  44. end
  45. ensure
  46. index = a_index
  47. message = a_message
  48. a_previous /= Void implies a_previous.last = Current
  49. end
  50. end -- class PARSE_ERROR
  51. --
  52. -- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
  53. --
  54. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  55. -- of this software and associated documentation files (the "Software"), to deal
  56. -- in the Software without restriction, including without limitation the rights
  57. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  58. -- copies of the Software, and to permit persons to whom the Software is
  59. -- furnished to do so, subject to the following conditions:
  60. --
  61. -- The above copyright notice and this permission notice shall be included in
  62. -- all copies or substantial portions of the Software.
  63. --
  64. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  65. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  66. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  67. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  68. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  69. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  70. -- THE SOFTWARE.