GNU Octave 11.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
pt-spmd.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2020-2026 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 "pt-cmd.h"
32#include "pt-walk.h"
33
35
36class comment_list;
38
39// Spmd.
40
41class OCTINTERP_API tree_spmd_command : public tree_command
42{
43public:
44
45 tree_spmd_command (const token& spmd_tok, tree_statement_list *body, const token& end_tok)
46 : m_spmd_tok (spmd_tok), m_body (body), m_end_tok (end_tok)
47 { }
48
49 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_spmd_command)
50
52
53 filepos beg_pos () const { return m_spmd_tok.beg_pos (); }
54 filepos end_pos () const { return m_end_tok.end_pos (); }
55
56 comment_list leading_comments () const { return m_spmd_tok.leading_comments (); }
57 comment_list trailing_comments () const { return m_end_tok.trailing_comments (); }
58
59 token spmd_token () { return m_spmd_tok; }
60
61 tree_statement_list * body () { return m_body; }
62
63 token end_token () { return m_end_tok; }
64
66 {
67 tw.visit_spmd_command (*this);
68 }
69
70private:
71
72 token m_spmd_tok;
73
74 // List of commands.
75 tree_statement_list *m_body;
76
77 token m_end_tok;
78};
79
80OCTAVE_END_NAMESPACE(octave)
81
82#endif
Definition token.h:42
tree_spmd_command(const token &spmd_tok, tree_statement_list *body, const token &end_tok)
Definition pt-spmd.h:45
comment_list trailing_comments() const
Definition pt-spmd.h:57
tree_statement_list * body()
Definition pt-spmd.h:61
token end_token()
Definition pt-spmd.h:63
filepos beg_pos() const
Definition pt-spmd.h:53
filepos end_pos() const
Definition pt-spmd.h:54
comment_list leading_comments() const
Definition pt-spmd.h:56
void accept(tree_walker &tw)
Definition pt-spmd.h:65
token spmd_token()
Definition pt-spmd.h:59
virtual void visit_spmd_command(tree_spmd_command &)
Definition pt-walk.cc:278
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn