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