/src/tools/interpreter/debugger/liberty_interpreter_debugger_factory.e

http://github.com/tybor/Liberty · Specman e · 85 lines · 59 code · 12 blank · 14 comment · 0 complexity · 76da27740e293c47e427d3a0b3c9ea86 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_INTERPRETER_DEBUGGER_FACTORY
  16. inherit
  17. EIFFEL_NODE_FACTORY
  18. create {LIBERTY_INTERPRETER_DEBUGGER}
  19. make
  20. feature {EIFFEL_GRAMMAR}
  21. list (name: FIXED_STRING): EIFFEL_LIST_NODE is
  22. do
  23. check False end
  24. end
  25. non_terminal (name: FIXED_STRING; names: TRAVERSABLE[FIXED_STRING]): EIFFEL_NON_TERMINAL_NODE is
  26. local
  27. action: PROCEDURE[TUPLE[LIBERTY_INTERPRETER_DEBUGGER_VISITOR, LIBERTY_INTERPRETER_DEBUGGER_NON_TERMINAL_NODE]]
  28. do
  29. inspect
  30. name
  31. when "Entry" then
  32. action := action_entry
  33. when "Show" then
  34. action := action_show
  35. when "Step" then
  36. action := action_step
  37. when "Up" then
  38. action := action_up
  39. when "Down" then
  40. action := action_down
  41. end
  42. create {LIBERTY_INTERPRETER_DEBUGGER_NON_TERMINAL_NODE} Result.make(action, name, names)
  43. end
  44. terminal (name: FIXED_STRING; image: EIFFEL_IMAGE): EIFFEL_TERMINAL_NODE is
  45. do
  46. create {EIFFEL_TERMINAL_NODE_IMPL} Result.make(name, image)
  47. end
  48. feature {}
  49. action_entry: PROCEDURE[TUPLE[LIBERTY_INTERPRETER_DEBUGGER_VISITOR, LIBERTY_INTERPRETER_DEBUGGER_NON_TERMINAL_NODE]] is
  50. once
  51. Result := agent {LIBERTY_INTERPRETER_DEBUGGER_VISITOR}.visit_entry
  52. end
  53. action_show: PROCEDURE[TUPLE[LIBERTY_INTERPRETER_DEBUGGER_VISITOR, LIBERTY_INTERPRETER_DEBUGGER_NON_TERMINAL_NODE]] is
  54. once
  55. Result := agent {LIBERTY_INTERPRETER_DEBUGGER_VISITOR}.visit_show
  56. end
  57. action_step: PROCEDURE[TUPLE[LIBERTY_INTERPRETER_DEBUGGER_VISITOR, LIBERTY_INTERPRETER_DEBUGGER_NON_TERMINAL_NODE]] is
  58. once
  59. Result := agent {LIBERTY_INTERPRETER_DEBUGGER_VISITOR}.visit_step
  60. end
  61. action_up: PROCEDURE[TUPLE[LIBERTY_INTERPRETER_DEBUGGER_VISITOR, LIBERTY_INTERPRETER_DEBUGGER_NON_TERMINAL_NODE]] is
  62. once
  63. Result := agent {LIBERTY_INTERPRETER_DEBUGGER_VISITOR}.visit_up
  64. end
  65. action_down: PROCEDURE[TUPLE[LIBERTY_INTERPRETER_DEBUGGER_VISITOR, LIBERTY_INTERPRETER_DEBUGGER_NON_TERMINAL_NODE]] is
  66. once
  67. Result := agent {LIBERTY_INTERPRETER_DEBUGGER_VISITOR}.visit_down
  68. end
  69. feature {}
  70. make is
  71. do
  72. end
  73. end -- class LIBERTY_INTERPRETER_DEBUGGER_FACTORY