GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
libinterp
parse-tree
pt-unop.h
Go to the documentation of this file.
1
/*
2
3
Copyright (C) 1996-2015 John W. Eaton
4
5
This file is part of Octave.
6
7
Octave is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by the
9
Free Software Foundation; either version 3 of the License, or (at your
10
option) any later version.
11
12
Octave is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with Octave; see the file COPYING. If not, see
19
<http://www.gnu.org/licenses/>.
20
21
*/
22
23
#if !defined (octave_pt_unop_h)
24
#define octave_pt_unop_h 1
25
26
#include <string>
27
28
class
tree_walker
;
29
30
class
octave_value
;
31
class
octave_value_list
;
32
class
octave_lvalue
;
33
34
#include "
pt-exp.h
"
35
#include "
symtab.h
"
36
37
// Unary expressions.
38
39
class
40
tree_unary_expression
:
public
tree_expression
41
{
42
public
:
43
44
tree_unary_expression
(
int
l = -1,
int
c = -1,
45
octave_value::unary_op
t
46
=
octave_value::unknown_unary_op
)
47
:
tree_expression
(l, c), op (0), etype (t) { }
48
49
tree_unary_expression
(
tree_expression
*e,
int
l = -1,
int
c = -1,
50
octave_value::unary_op
t
51
=
octave_value::unknown_unary_op
)
52
:
tree_expression
(l, c), op (e), etype (t) { }
53
54
~tree_unary_expression
(
void
) {
delete
op; }
55
56
bool
is_unary_expression
(
void
)
const
{
return
true
; }
57
58
bool
has_magic_end
(
void
)
const
{
return
(op && op->has_magic_end ()); }
59
60
tree_expression
*
operand
(
void
) {
return
op; }
61
62
std::string oper (
void
)
const
;
63
64
octave_value::unary_op
op_type
(
void
)
const
{
return
etype; }
65
66
protected
:
67
68
// The operand for the expression.
69
tree_expression
*
op
;
70
71
// The type of the expression.
72
octave_value::unary_op
etype
;
73
74
private
:
75
76
// No copying!
77
78
tree_unary_expression
(
const
tree_unary_expression
&);
79
80
tree_unary_expression
&
operator =
(
const
tree_unary_expression
&);
81
};
82
83
// Prefix expressions.
84
85
class
86
tree_prefix_expression
:
public
tree_unary_expression
87
{
88
public
:
89
90
tree_prefix_expression
(
int
l = -1,
int
c = -1)
91
:
tree_unary_expression
(l, c,
octave_value
::unknown_unary_op) { }
92
93
tree_prefix_expression
(
tree_expression
*e,
int
l = -1,
int
c = -1,
94
octave_value::unary_op
t
95
=
octave_value::unknown_unary_op
)
96
:
tree_unary_expression
(e, l, c, t) { }
97
98
~tree_prefix_expression
(
void
) { }
99
100
bool
rvalue_ok
(
void
)
const
{
return
true
; }
101
102
octave_value
rvalue1 (
int
nargout = 1);
103
104
octave_value_list
rvalue (
int
nargout);
105
106
tree_expression
*dup (
symbol_table::scope_id
scope,
107
symbol_table::context_id
context
)
const
;
108
109
void
accept (
tree_walker
& tw);
110
111
std::string
profiler_name
(
void
)
const
{
return
"prefix "
+ oper (); }
112
113
114
private
:
115
116
// No copying!
117
118
tree_prefix_expression
(
const
tree_prefix_expression
&);
119
120
tree_prefix_expression
&
operator =
(
const
tree_prefix_expression
&);
121
};
122
123
// Postfix expressions.
124
125
class
126
tree_postfix_expression
:
public
tree_unary_expression
127
{
128
public
:
129
130
tree_postfix_expression
(
int
l = -1,
int
c = -1)
131
:
tree_unary_expression
(l, c,
octave_value
::unknown_unary_op) { }
132
133
tree_postfix_expression
(
tree_expression
*e,
int
l = -1,
int
c = -1,
134
octave_value::unary_op
t
135
=
octave_value::unknown_unary_op
)
136
:
tree_unary_expression
(e, l, c, t) { }
137
138
~tree_postfix_expression
(
void
) { }
139
140
bool
rvalue_ok
(
void
)
const
{
return
true
; }
141
142
octave_value
rvalue1 (
int
nargout = 1);
143
144
octave_value_list
rvalue (
int
nargout);
145
146
tree_expression
*dup (
symbol_table::scope_id
scope,
147
symbol_table::context_id
context
)
const
;
148
149
void
accept (
tree_walker
& tw);
150
151
std::string
profiler_name
(
void
)
const
{
return
"postfix "
+ oper (); }
152
153
private
:
154
155
// No copying!
156
157
tree_postfix_expression
(
const
tree_postfix_expression
&);
158
159
tree_postfix_expression
&
operator =
(
const
tree_postfix_expression
&);
160
};
161
162
#endif
tree_unary_expression::operand
tree_expression * operand(void)
Definition:
pt-unop.h:60
octave_value
Definition:
ov.h:68
tree_unary_expression::op_type
octave_value::unary_op op_type(void) const
Definition:
pt-unop.h:64
tree_prefix_expression::rvalue_ok
bool rvalue_ok(void) const
Definition:
pt-unop.h:100
tree_expression
Definition:
pt-exp.h:37
tree_postfix_expression::~tree_postfix_expression
~tree_postfix_expression(void)
Definition:
pt-unop.h:138
tree_unary_expression::tree_unary_expression
tree_unary_expression(int l=-1, int c=-1, octave_value::unary_op t=octave_value::unknown_unary_op)
Definition:
pt-unop.h:44
tree_prefix_expression
Definition:
pt-unop.h:85
tree_postfix_expression::tree_postfix_expression
tree_postfix_expression(int l=-1, int c=-1)
Definition:
pt-unop.h:130
tree_unary_expression::has_magic_end
bool has_magic_end(void) const
Definition:
pt-unop.h:58
octave_value_list
Definition:
oct-obj.h:36
symtab.h
tree_prefix_expression::profiler_name
std::string profiler_name(void) const
Definition:
pt-unop.h:111
tree_prefix_expression::tree_prefix_expression
tree_prefix_expression(int l=-1, int c=-1)
Definition:
pt-unop.h:90
tree_unary_expression::etype
octave_value::unary_op etype
Definition:
pt-unop.h:72
tree_unary_expression::op
tree_expression * op
Definition:
pt-unop.h:69
tree_unary_expression::is_unary_expression
bool is_unary_expression(void) const
Definition:
pt-unop.h:56
context
static llvm::LLVMContext & context
Definition:
jit-typeinfo.cc:76
tree_postfix_expression::tree_postfix_expression
tree_postfix_expression(tree_expression *e, int l=-1, int c=-1, octave_value::unary_op t=octave_value::unknown_unary_op)
Definition:
pt-unop.h:133
tree_prefix_expression::~tree_prefix_expression
~tree_prefix_expression(void)
Definition:
pt-unop.h:98
tree_walker
Definition:
pt-walk.h:87
tree_unary_expression::tree_unary_expression
tree_unary_expression(tree_expression *e, int l=-1, int c=-1, octave_value::unary_op t=octave_value::unknown_unary_op)
Definition:
pt-unop.h:49
tree_postfix_expression::profiler_name
std::string profiler_name(void) const
Definition:
pt-unop.h:151
tree_prefix_expression::tree_prefix_expression
tree_prefix_expression(tree_expression *e, int l=-1, int c=-1, octave_value::unary_op t=octave_value::unknown_unary_op)
Definition:
pt-unop.h:93
tree_postfix_expression
Definition:
pt-unop.h:125
symbol_table::context_id
size_t context_id
Definition:
symtab.h:51
tree_unary_expression
Definition:
pt-unop.h:39
pt-exp.h
octave_value::unary_op
unary_op
Definition:
ov.h:74
int
tree_postfix_expression::rvalue_ok
bool rvalue_ok(void) const
Definition:
pt-unop.h:140
octave_value::unknown_unary_op
Definition:
ov.h:84
tree_unary_expression::~tree_unary_expression
~tree_unary_expression(void)
Definition:
pt-unop.h:54
octave_lvalue
Definition:
oct-lvalue.h:35
octave_lvalue::operator=
octave_lvalue & operator=(const octave_lvalue &vr)
Definition:
oct-lvalue.h:49
Generated on Thu Jun 4 2015 23:30:20 for GNU Octave by
1.8.8