1 //////////////////////////////////////////////////////////////////////// 2 // 3 // Copyright (C) 1996-2021 The Octave Project Developers 4 // 5 // See the file COPYRIGHT.md in the top-level directory of this 6 // distribution or <https://octave.org/copyright/>. 7 // 8 // This file is part of Octave. 9 // 10 // Octave is free software: you can redistribute it and/or modify it 11 // under the terms of the GNU General Public License as published by 12 // the Free Software Foundation, either version 3 of the License, or 13 // (at your option) any later version. 14 // 15 // Octave is distributed in the hope that it will be useful, but 16 // WITHOUT ANY WARRANTY; without even the implied warranty of 17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 // GNU General Public License for more details. 19 // 20 // You should have received a copy of the GNU General Public License 21 // along with Octave; see the file COPYING. If not, see 22 // <https://www.gnu.org/licenses/>. 23 // 24 //////////////////////////////////////////////////////////////////////// 25 26 #if ! defined (octave_pt_jump_h) 27 #define octave_pt_jump_h 1 28 29 #include "octave-config.h" 30 31 #include "pt-cmd.h" 32 #include "pt-walk.h" 33 34 namespace octave 35 { 36 // Break. 37 38 class tree_break_command : public tree_command 39 { 40 public: 41 42 tree_break_command (int l = -1, int c = -1) tree_command(l,c)43 : tree_command (l, c) { } 44 45 // No copying! 46 47 tree_break_command (const tree_break_command&) = delete; 48 49 tree_break_command& operator = (const tree_break_command&) = delete; 50 51 ~tree_break_command (void) = default; 52 accept(tree_walker & tw)53 void accept (tree_walker& tw) 54 { 55 tw.visit_break_command (*this); 56 } 57 }; 58 59 // Continue. 60 61 class tree_continue_command : public tree_command 62 { 63 public: 64 65 tree_continue_command (int l = -1, int c = -1) tree_command(l,c)66 : tree_command (l, c) { } 67 68 // No copying! 69 70 tree_continue_command (const tree_continue_command&) = delete; 71 72 tree_continue_command& operator = (const tree_continue_command&) = delete; 73 74 ~tree_continue_command (void) = default; 75 accept(tree_walker & tw)76 void accept (tree_walker& tw) 77 { 78 tw.visit_continue_command (*this); 79 } 80 }; 81 82 // Return. 83 84 class tree_return_command : public tree_command 85 { 86 public: 87 88 tree_return_command (int l = -1, int c = -1) tree_command(l,c)89 : tree_command (l, c) { } 90 91 // No copying! 92 93 tree_return_command (const tree_return_command&) = delete; 94 95 tree_return_command& operator = (const tree_return_command&) = delete; 96 97 ~tree_return_command (void) = default; 98 accept(tree_walker & tw)99 void accept (tree_walker& tw) 100 { 101 tw.visit_return_command (*this); 102 } 103 }; 104 } 105 106 #endif 107