GNU Octave
10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Loading...
Searching...
No Matches
anon-fcn-validator.h
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 2019-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_anon_fcn_validator_h)
27
#define octave_anon_fcn_validator_h 1
28
29
#include "octave-config.h"
30
31
#include <string>
32
33
#include "
filepos.h
"
34
#include "
pt-walk.h
"
35
36
OCTAVE_BEGIN_NAMESPACE
(octave)
37
38
class
tree_expression
;
39
class
tree_parameter_list
;
40
41
// How to check the semantics of the code that the parse trees represent.
42
43
class
anon_fcn_validator
:
public
tree_walker
44
{
45
public
:
46
47
anon_fcn_validator
(
tree_parameter_list
*,
tree_expression
*expr);
48
49
OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (
anon_fcn_validator
)
50
51
~anon_fcn_validator
() =
default
;
52
53
void
visit_postfix_expression
(
tree_postfix_expression
&);
54
55
void
visit_prefix_expression
(
tree_prefix_expression
&);
56
57
void
visit_multi_assignment
(
tree_multi_assignment
&);
58
59
void
visit_simple_assignment
(
tree_simple_assignment
&);
60
61
bool
ok
()
const
{
return
m_ok; }
62
63
filepos
beg_pos
()
const
{
return
m_beg_pos; }
64
filepos
end_pos
()
const
{
return
m_end_pos; }
65
66
std::string
message
()
const
{
return
m_message; }
67
68
private
:
69
70
bool
m_ok {
true
};
71
filepos
m_beg_pos;
72
filepos
m_end_pos;
73
std::string m_message;
74
75
void
error (
tree_expression
& expr);
76
};
77
78
OCTAVE_END_NAMESPACE(octave)
79
80
#endif
anon_fcn_validator
Definition
anon-fcn-validator.h:44
anon_fcn_validator::end_pos
filepos end_pos() const
Definition
anon-fcn-validator.h:64
anon_fcn_validator::ok
bool ok() const
Definition
anon-fcn-validator.h:61
anon_fcn_validator::visit_prefix_expression
void visit_prefix_expression(tree_prefix_expression &)
Definition
anon-fcn-validator.cc:55
anon_fcn_validator::message
std::string message() const
Definition
anon-fcn-validator.h:66
anon_fcn_validator::~anon_fcn_validator
~anon_fcn_validator()=default
anon_fcn_validator::visit_multi_assignment
void visit_multi_assignment(tree_multi_assignment &)
Definition
anon-fcn-validator.cc:66
anon_fcn_validator::visit_simple_assignment
void visit_simple_assignment(tree_simple_assignment &)
Definition
anon-fcn-validator.cc:72
anon_fcn_validator::beg_pos
filepos beg_pos() const
Definition
anon-fcn-validator.h:63
anon_fcn_validator::visit_postfix_expression
void visit_postfix_expression(tree_postfix_expression &)
Definition
anon-fcn-validator.cc:44
filepos
Definition
filepos.h:34
tree_expression
Definition
pt-exp.h:49
tree_multi_assignment
Definition
pt-assign.h:119
tree_parameter_list
Definition
pt-misc.h:47
tree_postfix_expression
Definition
pt-unop.h:123
tree_prefix_expression
Definition
pt-unop.h:87
tree_simple_assignment
Definition
pt-assign.h:53
tree_walker
Definition
pt-walk.h:111
OCTAVE_BEGIN_NAMESPACE
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
filepos.h
pt-walk.h
libinterp
parse-tree
anon-fcn-validator.h
Generated on Sat Aug 2 2025 06:52:12 for GNU Octave by
1.9.8