Mercurial > octave
annotate libinterp/parse-tree/pt-walk.cc @ 23424:872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
* pt-walk.cc: New file.
* module.mk: Update
* pt-walk.h, pt-walk.cc (tree_walker::visit_boolean_expression,
tree_walker::visit_compound_binary_expression): New methods.
* pt-binop.h, pt-binop.cc (tree_boolean_expression::accept):
New function.
* pt-cbinop.h, pt-cbinop.cc (tree_compound_binary_expression::accept):
Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Apr 2017 12:52:32 -0400 |
parents | |
children | 194eb4bd202b |
rev | line source |
---|---|
23424
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 Copyright (C) 2017 John W. Eaton |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 the Free Software Foundation; either version 3 of the License, or |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 (at your option) any later version. |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 GNU General Public License for more details. |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 #if defined (HAVE_CONFIG_H) |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 # include "config.h" |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 #endif |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 #include "pt-binop.h" |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #include "pt-cbinop.h" |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include "pt-walk.h" |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 namespace octave |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 { |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 void |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 tree_walker::visit_boolean_expression (tree_boolean_expression& expr) |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 { |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 visit_binary_expression (expr); |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 } |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 void |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 tree_walker::visit_compound_binary_expression (tree_compound_binary_expression& expr) |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 { |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 visit_binary_expression (expr); |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 } |
872f42fb26dc
let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 } |