/src/lib/parse/parse_action.e

http://github.com/tybor/Liberty · Specman e · 61 lines · 29 code · 8 blank · 24 comment · 0 complexity · f22acc7d81667b876fe6f13b3f9cab48 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_ACTION
  5. creation {PARSE_TERMINAL, PARSE_NT_NODE}
  6. make
  7. feature {ANY}
  8. name: STRING
  9. -- useful for debug
  10. call is
  11. do
  12. action.call([])
  13. end
  14. feature {PARSE_TERMINAL, PARSE_NT_NODE}
  15. set_name (a_name: like name) is
  16. do
  17. name := a_name
  18. ensure
  19. name = a_name
  20. end
  21. feature {}
  22. make (a_action: like action) is
  23. require
  24. a_action /= Void
  25. do
  26. action := a_action
  27. ensure
  28. action = a_action
  29. end
  30. action: PROCEDURE[TUPLE]
  31. invariant
  32. action /= Void
  33. end -- PARSE_ACTION
  34. --
  35. -- Copyright (c) 2009 by all the people cited in the AUTHORS file.
  36. --
  37. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  38. -- of this software and associated documentation files (the "Software"), to deal
  39. -- in the Software without restriction, including without limitation the rights
  40. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  41. -- copies of the Software, and to permit persons to whom the Software is
  42. -- furnished to do so, subject to the following conditions:
  43. --
  44. -- The above copyright notice and this permission notice shall be included in
  45. -- all copies or substantial portions of the Software.
  46. --
  47. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  48. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  49. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  50. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  51. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  52. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  53. -- THE SOFTWARE.