Mercurial > octave
view libinterp/parse-tree/module.mk @ 23435:c452180ab672
begin refactoring parse tree evaluator
* libinterp/parse-tree/pt-tm-const.cc,
libinterp/parse-tree/pt-tm-const.h:
New files, extracted from pt-mat.h and pt-mat.cc.
* libinterp/parse-tree/module.mk: Update.
* interpreter.cc, ov-class.cc, ov-classdef.cc, ov-classdef.h,
ov-fcn-handle.cc, ov-fcn-handle.h, ov-usr-fcn.cc, oct-parse.in.yy,
pt-arg-list.cc, pt-arg-list.h, pt-array-list.h, pt-assign.cc,
pt-assign.h, pt-binop.cc, pt-binop.h, pt-cbinop.cc, pt-cbinop.h,
pt-cell.cc, pt-cell.h, pt-classdef.cc, pt-classdef.h, pt-cmd.cc,
pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc, pt-const.h,
pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc,
pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h,
pt-funcall.cc, pt-funcall.h, pt-id.cc, pt-id.h, pt-idx.cc, pt-idx.h,
pt-jit.cc, pt-jump.cc, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc,
pt-mat.h, pt-misc.cc, pt-misc.h, pt-select.cc, pt-select.h,
pt-stmt.cc, pt-stmt.h, pt-unop.cc, pt-unop.h:
Use tree_evaluator class to walk the parse tree instead of rvalue
methods in the parse tree classes. Maintain a stack in the evaluator
class to accumulate results.
Pass pointer to evaluator to function objects and other classes as
needed for evaluation.
This is a work in progress that is not yet complete. The ultimate
goal is to move all evaluation into the tree_evaluator class instead
of spreading that work among many different classes. The global
pointer to the current evaluator should also be eliminated.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 21 Apr 2017 18:07:40 -0400 |
parents | 872f42fb26dc |
children | 8308417aff1c |
line wrap: on
line source
PARSE_TREE_INC = \ libinterp/parse-tree/bp-table.h \ libinterp/parse-tree/jit-ir.h \ libinterp/parse-tree/jit-typeinfo.h \ libinterp/parse-tree/jit-util.h \ libinterp/parse-tree/lex.h \ libinterp/parse-tree/parse.h \ libinterp/parse-tree/pt-all.h \ libinterp/parse-tree/pt-arg-list.h \ libinterp/parse-tree/pt-array-list.h \ libinterp/parse-tree/pt-assign.h \ libinterp/parse-tree/pt-binop.h \ libinterp/parse-tree/pt-bp.h \ libinterp/parse-tree/pt-cbinop.h \ libinterp/parse-tree/pt-cell.h \ libinterp/parse-tree/pt-check.h \ libinterp/parse-tree/pt-classdef.h \ libinterp/parse-tree/pt-cmd.h \ libinterp/parse-tree/pt-colon.h \ libinterp/parse-tree/pt-const.h \ libinterp/parse-tree/pt-decl.h \ libinterp/parse-tree/pt-eval.h \ libinterp/parse-tree/pt-except.h \ libinterp/parse-tree/pt-exp.h \ libinterp/parse-tree/pt-fcn-handle.h \ libinterp/parse-tree/pt-funcall.h \ libinterp/parse-tree/pt-id.h \ libinterp/parse-tree/pt-idx.h \ libinterp/parse-tree/pt-jit.h \ libinterp/parse-tree/pt-jump.h \ libinterp/parse-tree/pt-loop.h \ libinterp/parse-tree/pt-mat.h \ libinterp/parse-tree/pt-misc.h \ libinterp/parse-tree/pt-pr-code.h \ libinterp/parse-tree/pt-select.h \ libinterp/parse-tree/pt-stmt.h \ libinterp/parse-tree/pt-tm-const.h \ libinterp/parse-tree/pt-unop.h \ libinterp/parse-tree/pt-walk.h \ libinterp/parse-tree/pt.h \ libinterp/parse-tree/token.h ## oct-gperf.h and oct-parse.h are in the SRC list so that they will ## be distributed but not installed. PARSE_TREE_SRC = \ libinterp/parse-tree/bp-table.cc \ libinterp/parse-tree/jit-ir.cc \ libinterp/parse-tree/jit-typeinfo.cc \ libinterp/parse-tree/jit-util.cc \ libinterp/parse-tree/lex.ll \ libinterp/parse-tree/oct-gperf.h \ libinterp/parse-tree/oct-parse.h \ libinterp/parse-tree/oct-parse.yy \ libinterp/parse-tree/pt-arg-list.cc \ libinterp/parse-tree/pt-array-list.cc \ libinterp/parse-tree/pt-assign.cc \ libinterp/parse-tree/pt-binop.cc \ libinterp/parse-tree/pt-bp.cc \ libinterp/parse-tree/pt-cbinop.cc \ libinterp/parse-tree/pt-cell.cc \ libinterp/parse-tree/pt-check.cc \ libinterp/parse-tree/pt-classdef.cc \ libinterp/parse-tree/pt-cmd.cc \ libinterp/parse-tree/pt-colon.cc \ libinterp/parse-tree/pt-const.cc \ libinterp/parse-tree/pt-decl.cc \ libinterp/parse-tree/pt-eval.cc \ libinterp/parse-tree/pt-except.cc \ libinterp/parse-tree/pt-exp.cc \ libinterp/parse-tree/pt-fcn-handle.cc \ libinterp/parse-tree/pt-funcall.cc \ libinterp/parse-tree/pt-id.cc \ libinterp/parse-tree/pt-idx.cc \ libinterp/parse-tree/pt-jit.cc \ libinterp/parse-tree/pt-jump.cc \ libinterp/parse-tree/pt-loop.cc \ libinterp/parse-tree/pt-mat.cc \ libinterp/parse-tree/pt-misc.cc \ libinterp/parse-tree/pt-pr-code.cc \ libinterp/parse-tree/pt-select.cc \ libinterp/parse-tree/pt-stmt.cc \ libinterp/parse-tree/pt-tm-const.cc \ libinterp/parse-tree/pt-unop.cc \ libinterp/parse-tree/pt-walk.cc \ libinterp/parse-tree/pt.cc \ libinterp/parse-tree/token.cc ## Special rules for sources which must be built before rest of compilation. ## Don't use a pipeline to process gperf output since if gperf ## is missing but sed is not, the exit status of the pipeline ## will still be success and we will end up creating an empty ## oct-gperf.h file. libinterp/parse-tree/oct-gperf.h: libinterp/parse-tree/octave.gperf $(AM_V_GEN)rm -f $@-t $@t1 $@ && \ $(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1 && \ $(SED) -e 's,lookup\[,gperf_lookup[,' -e 's,register ,,g' < $@-t1 > $@-t && \ mv $@-t $@ && \ rm -f $@-t1 libinterp/parse-tree/oct-parse.yy: libinterp/parse-tree/oct-parse.in.yy $(AM_V_GEN)$(call subst-bison-api-decls,octave_) noinst_LTLIBRARIES += \ libinterp/parse-tree/libparse-tree.la libinterp_parse_tree_libparse_tree_la_SOURCES = $(PARSE_TREE_SRC) libinterp_parse_tree_libparse_tree_la_CPPFLAGS = $(libinterp_liboctinterp_la_CPPFLAGS) libinterp_parse_tree_libparse_tree_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS) libinterp_parse_tree_libparse_tree_la_CXXFLAGS = $(AM_CXXFLAGS) $(WARN_CXXFLAGS) libinterp_EXTRA_DIST += \ libinterp/parse-tree/oct-parse.in.yy \ libinterp/parse-tree/octave.gperf