GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
pt-jump.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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
35
36// Base class for jump commands
37
39{
40public:
41
42 tree_jump_command (const token& tok) : m_token (tok) { }
43
44 OCTAVE_DISABLE_COPY_MOVE (tree_jump_command)
45
46 ~tree_jump_command () = default;
47
48 filepos beg_pos () const { return m_token.beg_pos (); }
49 filepos end_pos () const { return m_token.end_pos (); }
50
51protected:
52
54};
55
56// Break.
57
59{
60public:
61
63
64 OCTAVE_DISABLE_COPY_MOVE (tree_break_command)
65
66 ~tree_break_command () = default;
67
69 {
70 tw.visit_break_command (*this);
71 }
72};
73
74// Continue.
75
77{
78public:
79
81
82 OCTAVE_DISABLE_COPY_MOVE (tree_continue_command)
83
85
87 {
88 tw.visit_continue_command (*this);
89 }
90};
91
92// Return.
93
95{
96public:
97
99
100 OCTAVE_DISABLE_COPY_MOVE (tree_return_command)
101
103
105 {
106 tw.visit_return_command (*this);
107 }
108};
109
110OCTAVE_END_NAMESPACE(octave)
111
112#endif
Definition token.h:42
~tree_break_command()=default
void accept(tree_walker &tw)
Definition pt-jump.h:68
tree_break_command(const token &tok)
Definition pt-jump.h:62
tree_continue_command(const token &tok)
Definition pt-jump.h:80
~tree_continue_command()=default
void accept(tree_walker &tw)
Definition pt-jump.h:86
~tree_jump_command()=default
filepos beg_pos() const
Definition pt-jump.h:48
tree_jump_command(const token &tok)
Definition pt-jump.h:42
filepos end_pos() const
Definition pt-jump.h:49
~tree_return_command()=default
void accept(tree_walker &tw)
Definition pt-jump.h:104
tree_return_command(const token &tok)
Definition pt-jump.h:98
virtual void visit_return_command(tree_return_command &)
Definition pt-walk.cc:547
virtual void visit_continue_command(tree_continue_command &)
Definition pt-walk.cc:193
virtual void visit_break_command(tree_break_command &)
Definition pt-walk.cc:168
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn