GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-spmd.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2020-2024 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_spmd_command_h)
27 #define octave_pt_spmd_command_h 1
28 
29 #include "octave-config.h"
30 
31 #include "base-list.h"
32 #include "pt-cmd.h"
33 #include "pt-walk.h"
34 
36 
37 class tree_comment_list;
39 
40 // Spmd.
41 
43 {
44 public:
45 
47  comment_list *tc, int l = -1, int c = -1)
48  : tree_command (l, c), m_body (body), m_lead_comm (lc), m_trail_comm (tc)
49  { }
50 
51  OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_spmd_command)
52 
54 
55  tree_statement_list * body () { return m_body; }
56 
57  comment_list * leading_comment () { return m_lead_comm; }
58 
59  comment_list * trailing_comment () { return m_trail_comm; }
60 
61  void accept (tree_walker& tw)
62  {
63  tw.visit_spmd_command (*this);
64  }
65 
66 private:
67 
68  // List of commands.
69  tree_statement_list *m_body;
70 
71  // Comment preceding SPMD token.
72  comment_list *m_lead_comm;
73 
74  // Comment preceding ENDSPMD token.
75  comment_list *m_trail_comm;
76 };
77 
78 OCTAVE_END_NAMESPACE(octave)
79 
80 #endif
tree_spmd_command(tree_statement_list *body, comment_list *lc, comment_list *tc, int l=-1, int c=-1)
Definition: pt-spmd.h:46
comment_list * trailing_comment()
Definition: pt-spmd.h:59
comment_list * leading_comment()
Definition: pt-spmd.h:57
tree_statement_list * body()
Definition: pt-spmd.h:55
void accept(tree_walker &tw)
Definition: pt-spmd.h:61
virtual void visit_spmd_command(tree_spmd_command &)
Definition: pt-walk.cc:278
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn