Mercurial > octave
annotate libinterp/parse-tree/module.mk @ 26686:581d01526b34
eliminate unnecessary tree_funcall class
The tree_funcall class was only used to handled generated calls to
internal functions used by classdef superclass reference and metaclass
query operations. This change replaces those function calls by
something more direct.
* pt-classdef.h, pt-classdef.cc (tree_superclass_ref,
tree_metaclass_query): New classes.
* pt-walk.h (tree_walker::visit_tree_funcall): Delete. Update all
derived classes.
(tree_walker::visit_superclass_ref,
tree_walker::visit_metaclass_query): New virtual functions.
* pt-pr-code.h, pt-pr-code.cc (tree_print_code::visit
(tree_print_code::visit_superclass_ref,
tree_print_code::visit_metaclass_query):
Correctly print these parse tree elements.
* oct-parse.yy (superclass_identifier, meta_identifier): Use new
tree_superclass_ref tree_metaclass_query classes instead of
tree_funcall to represent these language elements.
* lex.ll (base_lexer::handle_superclass_identifier): Attempt to make
intent of code clearer. Save line and column info in token.
* pt-eval.h, pt-eval.cc (tree_evaluator::visit_funcall): Delete.
(tree_evaluator::visit_superclass_ref,
tree_evaluator::visit_metaclass_query): New functions. Handle
superclass reference and metaclass query operations more directly.
* ov-classdef.h, ov-classdef.cc (F__superclass_reference__,
F__meta_class_query__): Delete.
(class octave_classdef_superclass_ref): Work directly with
method or object and class names as strings instead of octave_value
objects.
(octave_classdef::superclass_ref, octave_classdef::metaclass_query):
New static functions.
* token.h, token.cc: Attempt to use clearer names for superclass
reference tokens.
* pt-funcall.h, pt-funcall.cc: Delete.
* libinterp/parse-tree/module.mk: Update.
* pt-all.h: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 07 Feb 2019 00:03:55 +0000 |
parents | 91e1ca0e3a9d |
children | 5e92bff668d6 |
rev | line source |
---|---|
21023
ec532a439c6f
rework method of disabling warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
20366
diff
changeset
|
1 PARSE_TREE_INC = \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
2 %reldir%/bp-table.h \ |
23749
6921d8458203
move comment-list.h and comment-list.cc to libinterp/parse-tree directory
John W. Eaton <jwe@octave.org>
parents:
23601
diff
changeset
|
3 %reldir%/comment-list.h \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
4 %reldir%/jit-ir.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
5 %reldir%/jit-typeinfo.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
6 %reldir%/jit-util.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
7 %reldir%/lex.h \ |
24350
b991accccd4c
move oct-lvalue files from corefcn to parse-tree directory
John W. Eaton <jwe@octave.org>
parents:
24234
diff
changeset
|
8 %reldir%/oct-lvalue.h \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
9 %reldir%/parse.h \ |
23751
0ebc4f1a5714
move profiler.h and profiler.cc to libinterp/parse-tree directory
John W. Eaton <jwe@octave.org>
parents:
23749
diff
changeset
|
10 %reldir%/profiler.h \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
11 %reldir%/pt-all.h \ |
25824
91e1ca0e3a9d
Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
25637
diff
changeset
|
12 %reldir%/pt-anon-scopes.h \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
13 %reldir%/pt-arg-list.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
14 %reldir%/pt-array-list.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
15 %reldir%/pt-assign.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
16 %reldir%/pt-binop.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
17 %reldir%/pt-bp.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
18 %reldir%/pt-cbinop.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
19 %reldir%/pt-cell.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
20 %reldir%/pt-check.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
21 %reldir%/pt-classdef.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
22 %reldir%/pt-cmd.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
23 %reldir%/pt-colon.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
24 %reldir%/pt-const.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
25 %reldir%/pt-decl.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
26 %reldir%/pt-eval.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
27 %reldir%/pt-except.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
28 %reldir%/pt-exp.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
29 %reldir%/pt-fcn-handle.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
30 %reldir%/pt-id.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
31 %reldir%/pt-idx.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
32 %reldir%/pt-jit.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
33 %reldir%/pt-jump.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
34 %reldir%/pt-loop.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
35 %reldir%/pt-mat.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
36 %reldir%/pt-misc.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
37 %reldir%/pt-pr-code.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
38 %reldir%/pt-select.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
39 %reldir%/pt-stmt.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
40 %reldir%/pt-tm-const.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
41 %reldir%/pt-unop.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
42 %reldir%/pt-walk.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
43 %reldir%/pt.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
44 %reldir%/token.h |
15057
46b19589b593
maint: Partition src/ directory with more code in subdirs.
Rik <rik@octave.org>
parents:
diff
changeset
|
45 |
23126
2eb7d330eb7f
move JIT compiler files from corefcn to parse-tree directory
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
46 |
21242
ae03a16f3343
don't install oct-gperf.h, oct-parse.h, or oct-tex-parser.h
John W. Eaton <jwe@octave.org>
parents:
21023
diff
changeset
|
47 ## oct-gperf.h and oct-parse.h are in the SRC list so that they will |
ae03a16f3343
don't install oct-gperf.h, oct-parse.h, or oct-tex-parser.h
John W. Eaton <jwe@octave.org>
parents:
21023
diff
changeset
|
48 ## be distributed but not installed. |
ae03a16f3343
don't install oct-gperf.h, oct-parse.h, or oct-tex-parser.h
John W. Eaton <jwe@octave.org>
parents:
21023
diff
changeset
|
49 |
15057
46b19589b593
maint: Partition src/ directory with more code in subdirs.
Rik <rik@octave.org>
parents:
diff
changeset
|
50 PARSE_TREE_SRC = \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
51 %reldir%/bp-table.cc \ |
23749
6921d8458203
move comment-list.h and comment-list.cc to libinterp/parse-tree directory
John W. Eaton <jwe@octave.org>
parents:
23601
diff
changeset
|
52 %reldir%/comment-list.cc \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
53 %reldir%/jit-ir.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
54 %reldir%/jit-typeinfo.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
55 %reldir%/jit-util.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
56 %reldir%/lex.ll \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
57 %reldir%/oct-gperf.h \ |
24350
b991accccd4c
move oct-lvalue files from corefcn to parse-tree directory
John W. Eaton <jwe@octave.org>
parents:
24234
diff
changeset
|
58 %reldir%/oct-lvalue.cc \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
59 %reldir%/oct-parse.h \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
60 %reldir%/oct-parse.yy \ |
23751
0ebc4f1a5714
move profiler.h and profiler.cc to libinterp/parse-tree directory
John W. Eaton <jwe@octave.org>
parents:
23749
diff
changeset
|
61 %reldir%/profiler.cc \ |
25824
91e1ca0e3a9d
Save all scopes of nested anonymous functions (bug #45969).
Olaf Till <i7tiol@t-online.de>
parents:
25637
diff
changeset
|
62 %reldir%/pt-anon-scopes.cc \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
63 %reldir%/pt-arg-list.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
64 %reldir%/pt-array-list.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
65 %reldir%/pt-assign.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
66 %reldir%/pt-binop.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
67 %reldir%/pt-bp.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
68 %reldir%/pt-cbinop.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
69 %reldir%/pt-cell.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
70 %reldir%/pt-check.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
71 %reldir%/pt-classdef.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
72 %reldir%/pt-colon.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
73 %reldir%/pt-const.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
74 %reldir%/pt-decl.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
75 %reldir%/pt-eval.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
76 %reldir%/pt-except.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
77 %reldir%/pt-exp.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
78 %reldir%/pt-fcn-handle.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
79 %reldir%/pt-id.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
80 %reldir%/pt-idx.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
81 %reldir%/pt-jit.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
82 %reldir%/pt-loop.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
83 %reldir%/pt-mat.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
84 %reldir%/pt-misc.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
85 %reldir%/pt-pr-code.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
86 %reldir%/pt-select.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
87 %reldir%/pt-stmt.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
88 %reldir%/pt-tm-const.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
89 %reldir%/pt-unop.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
90 %reldir%/pt-walk.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
91 %reldir%/pt.cc \ |
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
92 %reldir%/token.cc |
15057
46b19589b593
maint: Partition src/ directory with more code in subdirs.
Rik <rik@octave.org>
parents:
diff
changeset
|
93 |
15096
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
94 ## Special rules for sources which must be built before rest of compilation. |
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
95 |
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
96 ## Don't use a pipeline to process gperf output since if gperf |
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
97 ## is missing but sed is not, the exit status of the pipeline |
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
98 ## will still be success and we will end up creating an empty |
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
99 ## oct-gperf.h file. |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
100 %reldir%/oct-gperf.h: %reldir%/octave.gperf |
19792
4f6ae6b94abe
make --enable-silent-rules configure option more useful
John W. Eaton <jwe@octave.org>
parents:
19775
diff
changeset
|
101 $(AM_V_GEN)rm -f $@-t $@t1 $@ && \ |
4f6ae6b94abe
make --enable-silent-rules configure option more useful
John W. Eaton <jwe@octave.org>
parents:
19775
diff
changeset
|
102 $(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1 && \ |
21332
db574711df78
eliminate deprecated register storage class specifier
John W. Eaton <jwe@octave.org>
parents:
21242
diff
changeset
|
103 $(SED) -e 's,lookup\[,gperf_lookup[,' -e 's,register ,,g' < $@-t1 > $@-t && \ |
19792
4f6ae6b94abe
make --enable-silent-rules configure option more useful
John W. Eaton <jwe@octave.org>
parents:
19775
diff
changeset
|
104 mv $@-t $@ && \ |
15096
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
105 rm -f $@-t1 |
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
15087
diff
changeset
|
106 |
16298
faaf60aa457c
use separate automake convenience library for bison and flex generated files
John W. Eaton <jwe@octave.org>
parents:
16237
diff
changeset
|
107 noinst_LTLIBRARIES += \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
108 %reldir%/libparse-tree.la |
20327
0ce7d8303152
eliminate recursive make invocations in liboctave and libinterp directories
John W. Eaton <jwe@octave.org>
parents:
19879
diff
changeset
|
109 |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
110 %canon_reldir%_libparse_tree_la_SOURCES = $(PARSE_TREE_SRC) |
20327
0ce7d8303152
eliminate recursive make invocations in liboctave and libinterp directories
John W. Eaton <jwe@octave.org>
parents:
19879
diff
changeset
|
111 |
24234
4e93c39b4b97
libinterp/parse-tree/module.mk: Add LLVM flags to libparse_tree_la
Julien Bect <jbect@users.sourceforge.net>
parents:
23751
diff
changeset
|
112 %canon_reldir%_libparse_tree_la_CPPFLAGS = \ |
4e93c39b4b97
libinterp/parse-tree/module.mk: Add LLVM flags to libparse_tree_la
Julien Bect <jbect@users.sourceforge.net>
parents:
23751
diff
changeset
|
113 $(libinterp_liboctinterp_la_CPPFLAGS) \ |
4e93c39b4b97
libinterp/parse-tree/module.mk: Add LLVM flags to libparse_tree_la
Julien Bect <jbect@users.sourceforge.net>
parents:
23751
diff
changeset
|
114 $(LLVM_CPPFLAGS) |
15107
03381a36f70d
generate convenience libraries for new parse-tree and interpfcn subdirectories
John W. Eaton <jwe@octave.org>
parents:
15096
diff
changeset
|
115 |
20366
9b44691a3520
provide per-directory clean targets
John W. Eaton <jwe@octave.org>
parents:
20327
diff
changeset
|
116 libinterp_EXTRA_DIST += \ |
23495
8308417aff1c
use automake %reldir% feature
John W. Eaton <jwe@octave.org>
parents:
23435
diff
changeset
|
117 %reldir%/octave.gperf |