annotate libinterp/parse-tree/pt-classdef.h @ 31605:e88a07dec498 stable

maint: Use macros to begin/end C++ namespaces. * oct-conf-post-public.in.h: Define two macros (OCTAVE_BEGIN_NAMESPACE, OCTAVE_END_NAMESPACE) that can be used to start/end a namespace. * mk-opts.pl, build-env.h, build-env.in.cc, __betainc__.cc, __contourc__.cc, __dsearchn__.cc, __eigs__.cc, __expint__.cc, __ftp__.cc, __gammainc__.cc, __ichol__.cc, __ilu__.cc, __isprimelarge__.cc, __lin_interpn__.cc, __magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, auto-shlib.cc, auto-shlib.h, balance.cc, base-text-renderer.cc, base-text-renderer.h, besselj.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h, call-stack.cc, call-stack.h, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc, colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, data.h, debug.cc, defaults.cc, defaults.h, defun-int.h, defun.cc, det.cc, dirfns.cc, display.cc, display.h, dlmread.cc, dmperm.cc, dot.cc, dynamic-ld.cc, dynamic-ld.h, eig.cc, ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.h, event-manager.cc, event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc, find.cc, ft-text-renderer.cc, ft-text-renderer.h, gcd.cc, getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, gl-render.cc, gl-render.h, gl2ps-print.cc, gl2ps-print.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc, graphics.in.h, gsvd.cc, gtk-manager.cc, gtk-manager.h, hash.cc, help.cc, help.h, hess.cc, hex2num.cc, hook-fcn.cc, hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h, inv.cc, jsondecode.cc, jsonencode.cc, kron.cc, latex-text-renderer.cc, latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h, lookup.cc, ls-ascii-helper.cc, ls-ascii-helper.h, ls-oct-text.cc, ls-utils.cc, ls-utils.h, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex-private.h, mex.cc, mgorth.cc, nproc.cc, oct-fstrm.cc, oct-fstrm.h, oct-hdf5-types.cc, oct-hdf5-types.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc, oct-iostrm.h, oct-opengl.h, oct-prcstrm.cc, oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-process.cc, oct-process.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h, oct-tex-lexer.in.ll, oct-tex-parser.yy, ordqz.cc, ordschur.cc, pager.cc, pager.h, pinv.cc, pow2.cc, pr-flt-fmt.cc, pr-output.cc, procstream.cc, procstream.h, psi.cc, qr.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, settings.cc, settings.h, sighandlers.cc, sighandlers.h, sparse-xdiv.cc, sparse-xdiv.h, sparse-xpow.cc, sparse-xpow.h, sparse.cc, spparms.cc, sqrtm.cc, stack-frame.cc, stack-frame.h, stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc, symbfact.cc, syminfo.cc, syminfo.h, symrcm.cc, symrec.cc, symrec.h, symscope.cc, symscope.h, symtab.cc, symtab.h, syscalls.cc, sysdep.cc, sysdep.h, text-engine.cc, text-engine.h, text-renderer.cc, text-renderer.h, time.cc, toplev.cc, tril.cc, tsearch.cc, typecast.cc, url-handle-manager.cc, url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc, variables.h, xdiv.cc, xdiv.h, xnorm.cc, xnorm.h, xpow.cc, xpow.h, __delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc, audioread.cc, convhulln.cc, fftw.cc, gzip.cc, mk-build-env-features.sh, mk-builtins.pl, cdef-class.cc, cdef-class.h, cdef-fwd.h, cdef-manager.cc, cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h, cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h, cdef-utils.cc, cdef-utils.h, ov-base.cc, ov-base.h, ov-bool-mat.cc, ov-builtin.h, ov-cell.cc, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h, ov-complex.cc, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h, ov-java.cc, ov-java.h, ov-mex-fcn.h, ov-null-mat.cc, ov-oncleanup.cc, ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, octave.cc, octave.h, mk-ops.sh, op-b-b.cc, op-b-bm.cc, op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc, op-chm.cc, op-class.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc, op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc, op-cs-scm.cc, op-cs-sm.cc, op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc, op-dm-template.cc, op-dms-template.cc, op-fcdm-fcdm.cc, op-fcm-fcm.cc, op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcn.cc, op-fcs-fcm.cc, op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fdm.cc, op-fm-fcm.cc, op-fm-fcs.cc, op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-int-concat.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc, op-mi.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc, op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc, op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, ops.h, anon-fcn-validator.cc, anon-fcn-validator.h, bp-table.cc, bp-table.h, comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll, oct-lvalue.cc, oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h, pt-anon-scopes.cc, pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h, pt-args-block.cc, pt-args-block.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h, pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h, pt-classdef.cc, pt-classdef.h, 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-id.cc, pt-id.h, pt-idx.cc, pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-spmd.cc, pt-spmd.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-vm-eval.cc, pt-walk.cc, pt-walk.h, pt.cc, pt.h, token.cc, token.h, Range.cc, Range.h, idx-vector.cc, idx-vector.h, range-fwd.h, CollocWt.cc, CollocWt.h, aepbalance.cc, aepbalance.h, chol.cc, chol.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h, lo-mappers.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h, oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc, randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h, lo-sysinfo.cc, lo-sysinfo.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h, oct-password.cc, oct-password.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h, action-container.cc, action-container.h, base-list.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, f77-fcn.h, file-info.cc, file-info.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-hash.cc, lo-hash.h, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-utils.cc, lo-utils.h, oct-base64.cc, oct-base64.h, oct-glob.cc, oct-glob.h, oct-inttypes.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h, oct-sparse.cc, oct-sparse.h, oct-string.h, octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc, quit.h, unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h : Use new macros to begin/end C++ namespaces.
author Rik <rik@octave.org>
date Thu, 01 Dec 2022 14:23:45 -0800
parents 796f54d4ddbf
children aac27ad79be6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30259
diff changeset
3 // Copyright (C) 2012-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
26 #if ! defined (octave_tree_classdef_h)
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #define octave_tree_classdef_h 1
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21017
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21017
diff changeset
30
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 class octave_value;
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
23750
ea879bc55272 move comment_list and comment_elt classes to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23696
diff changeset
33 #include "comment-list.h"
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 #include "pt-cmd.h"
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 #include "pt-exp.h"
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
36 #include "pt-walk.h"
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 #include "pt-id.h"
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 #include "base-list.h"
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 #include <list>
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
43 OCTAVE_BEGIN_NAMESPACE(octave)
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
44
23533
8edbc923a7dc begin refactoring use of interpreter/evaluator in classdef objects
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
45 class interpreter;
8edbc923a7dc begin refactoring use of interpreter/evaluator in classdef objects
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
46
29729
d0ce7260978d also accept validation syntax for classdef properties
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
47 class tree_arg_validation;
d0ce7260978d also accept validation syntax for classdef properties
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
48
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
49 class tree_superclass_ref : public tree_expression
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
50 {
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
51 public:
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
52
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
53 tree_superclass_ref (void) = delete;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
54
26718
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
55 tree_superclass_ref (const std::string& meth, const std::string& cls,
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
56 int l = -1, int c = -1)
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
57 : tree_expression (l, c), m_method_name (meth), m_class_name (cls)
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
58 { }
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
59
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
60 // No copying!
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
61
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
62 tree_superclass_ref (const tree_superclass_ref&) = delete;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
63
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
64 tree_superclass_ref& operator = (const tree_superclass_ref&) = delete;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
65
26718
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
66 std::string method_name (void) const
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
67 {
26718
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
68 return m_method_name;
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
69 }
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
70
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
71 std::string class_name (void) const { return m_class_name; }
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
72
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
73 tree_superclass_ref * dup (symbol_scope& scope) const;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
74
27371
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
75 octave_value evaluate (tree_evaluator& tw, int nargout = 1)
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
76 {
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
77 octave_value_list retval = evaluate_n (tw, nargout);
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
78
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
79 return retval.length () > 0 ? retval(0) : octave_value ();
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
80 }
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
81
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
82 octave_value_list evaluate_n (tree_evaluator& tw, int nargout = 1);
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
83
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
84 void accept (tree_walker& tw)
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
85 {
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
86 tw.visit_superclass_ref (*this);
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
87 }
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
88
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
89 private:
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
90
26718
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
91 // The name of the method to call. This is the text before the
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
92 // "@" and may be of the form "object.method".
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
93 std::string m_method_name;
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
94
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
95 // The name of the superclass. This is the text after the "@"
9b0335f4bc74 revise naming of the parts of a superclass reference
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
96 // and may be of the form "object.method".
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
97 std::string m_class_name;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
98 };
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
99
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
100 class tree_metaclass_query : public tree_expression
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
101 {
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
102 public:
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
103
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
104 tree_metaclass_query (void) = delete;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
105
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
106 tree_metaclass_query (const std::string& cls, int l = -1, int c = -1)
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
107 : tree_expression (l, c), m_class_name (cls)
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
108 { }
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
109
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
110 // No copying!
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
111
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
112 tree_metaclass_query (const tree_metaclass_query&) = delete;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
113
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
114 tree_metaclass_query& operator = (const tree_metaclass_query&) = delete;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
115
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
116 std::string class_name (void) const { return m_class_name; }
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
117
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
118 tree_metaclass_query * dup (symbol_scope& scope) const;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
119
27371
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
120 octave_value evaluate (tree_evaluator&, int nargout = 1);
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
121
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
122 octave_value_list evaluate_n (tree_evaluator& tw, int nargout = 1)
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
123 {
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
124 return ovl (evaluate (tw, nargout));
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
125 }
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27189
diff changeset
126
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
127 void accept (tree_walker& tw)
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
128 {
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
129 tw.visit_metaclass_query (*this);
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
130 }
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
131
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
132 private:
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
133
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
134 std::string m_class_name;
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
135 };
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
136
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
137 class tree_classdef_attribute
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
139 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140
23457
21baad6b35c4 maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents: 23449
diff changeset
141 tree_classdef_attribute (tree_identifier *i = nullptr,
21baad6b35c4 maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents: 23449
diff changeset
142 tree_expression *e = nullptr)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
143 : m_id (i), m_expr (e), m_neg (false)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
144 { }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
145
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
146 tree_classdef_attribute (tree_identifier *i, bool b)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
147 : m_id (i), m_expr (nullptr), m_neg (b)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
148 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
150 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
151
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
152 tree_classdef_attribute (const tree_classdef_attribute&) = delete;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
153
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
154 tree_classdef_attribute& operator = (const tree_classdef_attribute&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
156 ~tree_classdef_attribute (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
157 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
158 delete m_id;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
159 delete m_expr;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
160 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
162 tree_identifier * ident (void) { return m_id; }
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 18520
diff changeset
163
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
164 tree_expression * expression (void) { return m_expr; }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
165
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
166 bool negate (void) { return m_neg; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
168 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
169 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
170 tw.visit_classdef_attribute (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
171 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
173 private:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
175 tree_identifier *m_id;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
176 tree_expression *m_expr;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
177 bool m_neg;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
178 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
179
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
180 class tree_classdef_attribute_list : public base_list<tree_classdef_attribute *>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
181 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
182 public:
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
183
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
184 tree_classdef_attribute_list (void) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
186 tree_classdef_attribute_list (tree_classdef_attribute *a) { append (a); }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
188 tree_classdef_attribute_list (const base_list<tree_classdef_attribute *>& a)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
189 : base_list<tree_classdef_attribute *> (a)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
190 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
192 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
194 tree_classdef_attribute_list (const tree_classdef_attribute_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
195
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
196 tree_classdef_attribute_list&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
197 operator = (const tree_classdef_attribute_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
198
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
199 ~tree_classdef_attribute_list (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
201 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
202 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
203 tw.visit_classdef_attribute_list (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
204 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
205 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
207 class tree_classdef_superclass
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
208 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
209 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
210
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
211 tree_classdef_superclass (const std::string& cname)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
212 : m_cls_name (cname)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
213 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
214
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
215 // No copying!
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
216
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
217 tree_classdef_superclass (const tree_classdef_superclass&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
218
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
219 tree_classdef_superclass&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
220 operator = (const tree_classdef_superclass&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
221
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
222 ~tree_classdef_superclass (void) = default;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
223
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
224 std::string class_name (void) { return m_cls_name; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
225
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
226 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
227 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
228 tw.visit_classdef_superclass (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
229 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
231 private:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
232
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
233 std::string m_cls_name;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
234 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
235
27932
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
236 class tree_classdef_superclass_list
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
237 : public base_list<tree_classdef_superclass *>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
238 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
239 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
240
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
241 tree_classdef_superclass_list (void) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
242
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
243 tree_classdef_superclass_list (tree_classdef_superclass *sc)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
244 {
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
245 append (sc);
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
246 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
247
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
248 tree_classdef_superclass_list (const base_list<tree_classdef_superclass *>& a)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
249 : base_list<tree_classdef_superclass *> (a)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
250 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
251
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
252 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
253
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
254 tree_classdef_superclass_list (const tree_classdef_superclass_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
255
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
256 tree_classdef_superclass_list&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
257 operator = (const tree_classdef_superclass_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
258
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
259 ~tree_classdef_superclass_list (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
260
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
261 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
262 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
263 tw.visit_classdef_superclass_list (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
264 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
265 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
266
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
267 template <typename T>
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
268 class tree_classdef_element : public tree
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
269 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
270 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
271
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
272 tree_classdef_element (tree_classdef_attribute_list *a, T *elt_list,
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
273 comment_list *lc, comment_list *tc,
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
274 int l = -1, int c = -1)
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
275 : tree (l, c), m_attr_list (a), m_elt_list (elt_list),
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
276 m_lead_comm (lc), m_trail_comm (tc)
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
277 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
278
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
279 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
280
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
281 tree_classdef_element (const tree_classdef_element&) = delete;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
282
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
283 tree_classdef_element& operator = (const tree_classdef_element&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
284
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
285 ~tree_classdef_element (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
286 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
287 delete m_attr_list;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
288 delete m_elt_list;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
289 delete m_lead_comm;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
290 delete m_trail_comm;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
291 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
292
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
293 tree_classdef_attribute_list * attribute_list (void) { return m_attr_list; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
294
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
295 T * element_list (void) { return m_elt_list; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
296
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
297 comment_list * leading_comment (void) { return m_lead_comm; }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
298
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
299 comment_list * trailing_comment (void) { return m_trail_comm; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
300
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
301 void accept (tree_walker&) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
302
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
303 private:
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
304
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
305 // List of attributes that apply to this class.
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
306 tree_classdef_attribute_list *m_attr_list;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
307
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
308 // The list of objects contained in this block.
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
309 T *m_elt_list;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
310
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
311 // Comments preceding the token marking the beginning of the block.
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
312 comment_list *m_lead_comm;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
313
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
314 // Comments preceding the END token marking the end of the block.
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
315 comment_list *m_trail_comm;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
316 };
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 18520
diff changeset
317
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
318 class tree_classdef_property
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
319 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
320 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
321
29729
d0ce7260978d also accept validation syntax for classdef properties
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
322 tree_classdef_property (tree_arg_validation *av,
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
323 comment_list *comments = nullptr);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
324
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
325 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
326
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
327 tree_classdef_property (const tree_classdef_property&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
328
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
329 tree_classdef_property& operator = (const tree_classdef_property&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
330
29729
d0ce7260978d also accept validation syntax for classdef properties
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
331 ~tree_classdef_property (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
332
29729
d0ce7260978d also accept validation syntax for classdef properties
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
333 tree_identifier * ident (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
334
29729
d0ce7260978d also accept validation syntax for classdef properties
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
335 tree_expression * expression (void);
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
336
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
337 comment_list * comments (void) const { return m_comments; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
338
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
339 void doc_string (const std::string& txt) { m_doc_string = txt; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
340
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
341 std::string doc_string (void) const { return m_doc_string; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
342
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
343 bool have_doc_string (void) const { return ! m_doc_string.empty (); }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
344
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
345 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
346 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
347 tw.visit_classdef_property (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
348 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
349
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
350 private:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
351
29729
d0ce7260978d also accept validation syntax for classdef properties
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
352 tree_arg_validation *m_av;
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
353 comment_list *m_comments;
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
354 std::string m_doc_string;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
355 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
356
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
357 class tree_classdef_property_list : public base_list<tree_classdef_property *>
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
358 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
359 public:
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
360
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
361 tree_classdef_property_list (void) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
362
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23446
diff changeset
363 tree_classdef_property_list (tree_classdef_property *p) { append (p); }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
364
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
365 tree_classdef_property_list (const base_list<tree_classdef_property *>& a)
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
366 : base_list<tree_classdef_property *> (a) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
367
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
368 // No copying!
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
369
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
370 tree_classdef_property_list (const tree_classdef_property_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
371
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
372 tree_classdef_property_list&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
373 operator = (const tree_classdef_property_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
374
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
375 ~tree_classdef_property_list (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
376
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
377 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
378 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
379 tw.visit_classdef_property_list (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
380 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
381 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
382
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
383 class tree_classdef_properties_block
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
384 : public tree_classdef_element<tree_classdef_property_list>
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
385 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
386 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
387
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
388 tree_classdef_properties_block (tree_classdef_attribute_list *a,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
389 tree_classdef_property_list *plist,
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
390 comment_list *lc, comment_list *tc,
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
391 int l = -1, int c = -1)
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
392 : tree_classdef_element<tree_classdef_property_list> (a, plist, lc, tc, l, c)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
393 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
394
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
395 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
396
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
397 tree_classdef_properties_block (const tree_classdef_properties_block&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
398
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
399 tree_classdef_properties_block&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
400 operator = (const tree_classdef_properties_block&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
401
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
402 ~tree_classdef_properties_block (void) = default;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
403
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
404 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
405 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
406 tw.visit_classdef_properties_block (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
407 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
408 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
409
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
410 class tree_classdef_methods_list : public base_list<octave_value>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
411 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
412 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
413
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
414 tree_classdef_methods_list (void) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
415
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
416 tree_classdef_methods_list (const octave_value& f) { append (f); }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
417
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
418 tree_classdef_methods_list (const base_list<octave_value>& a)
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
419 : base_list<octave_value> (a) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
420
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
421 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
422
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
423 tree_classdef_methods_list (const tree_classdef_methods_list&) = delete;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
424
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
425 tree_classdef_methods_list&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
426 operator = (const tree_classdef_methods_list&) = delete;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
427
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
428 ~tree_classdef_methods_list (void) = default;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
429
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
430 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
431 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
432 tw.visit_classdef_methods_list (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
433 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
434 };
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
435
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
436 class tree_classdef_methods_block
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
437 : public tree_classdef_element<tree_classdef_methods_list>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
438 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
439 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
440
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
441 tree_classdef_methods_block (tree_classdef_attribute_list *a,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
442 tree_classdef_methods_list *mlist,
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
443 comment_list *lc, comment_list *tc,
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
444 int l = -1, int c = -1)
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
445 : tree_classdef_element<tree_classdef_methods_list> (a, mlist, lc, tc, l, c)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
446 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
447
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
448 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
449
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
450 tree_classdef_methods_block (const tree_classdef_methods_block&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
451
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
452 tree_classdef_methods_block&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
453 operator = (const tree_classdef_methods_block&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
454
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
455 ~tree_classdef_methods_block (void) = default;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
456
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
457 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
458 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
459 tw.visit_classdef_methods_block (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
460 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
461 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
462
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
463 class tree_classdef_event
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
464 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
465 public:
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
466
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
467 tree_classdef_event (tree_identifier *i = nullptr,
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
468 comment_list *comments = nullptr);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
469
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
470 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
471
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
472 tree_classdef_event (const tree_classdef_event&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
473
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
474 tree_classdef_event& operator = (const tree_classdef_event&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
475
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
476 ~tree_classdef_event (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
477 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
478 delete m_id;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
479 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
480
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
481 tree_identifier * ident (void) { return m_id; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
482
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
483 comment_list * comments (void) const { return m_comments; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
484
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
485 void doc_string (const std::string& txt) { m_doc_string = txt; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
486
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
487 std::string doc_string (void) const { return m_doc_string; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
488
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
489 bool have_doc_string (void) const { return ! m_doc_string.empty (); }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
490
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
491 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
492 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
493 tw.visit_classdef_event (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
494 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
495
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
496 private:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
497
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
498 tree_identifier *m_id;
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
499 comment_list *m_comments;
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
500 std::string m_doc_string;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
501 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
502
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
503 class tree_classdef_events_list : public base_list<tree_classdef_event *>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
504 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
505 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
506
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
507 tree_classdef_events_list (void) { }
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
508
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
509 tree_classdef_events_list (tree_classdef_event *e) { append (e); }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
510
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
511 tree_classdef_events_list (const base_list<tree_classdef_event *>& a)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
512 : base_list<tree_classdef_event *> (a)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
513 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
514
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
515 // No copying!
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
516
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
517 tree_classdef_events_list (const tree_classdef_events_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
518
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
519 tree_classdef_events_list&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
520 operator = (const tree_classdef_events_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
521
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
522 ~tree_classdef_events_list (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
523
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
524 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
525 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
526 tw.visit_classdef_events_list (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
527 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
528 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
529
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
530 class tree_classdef_events_block
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
531 : public tree_classdef_element<tree_classdef_events_list>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
532 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
533 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
534
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
535 tree_classdef_events_block (tree_classdef_attribute_list *a,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
536 tree_classdef_events_list *elist,
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
537 comment_list *lc, comment_list *tc,
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
538 int l = -1, int c = -1)
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
539 : tree_classdef_element<tree_classdef_events_list> (a, elist, lc, tc, l, c)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
540 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
541
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
542 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
543
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
544 tree_classdef_events_block (const tree_classdef_events_block&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
545
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
546 tree_classdef_events_block&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
547 operator = (const tree_classdef_events_block&) = delete;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
548
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
549 ~tree_classdef_events_block (void) = default;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
550
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
551 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
552 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
553 tw.visit_classdef_events_block (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
554 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
555 };
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
556
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
557 class tree_classdef_enum
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
558 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
559 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
560
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
561 tree_classdef_enum (tree_identifier *i, tree_expression *e,
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
562 comment_list *comments);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
563
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
564 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
565
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
566 tree_classdef_enum (const tree_classdef_enum&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
567
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
568 tree_classdef_enum& operator = (const tree_classdef_enum&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
569
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
570 ~tree_classdef_enum (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
571 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
572 delete m_id;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
573 delete m_expr;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
574 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
575
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
576 tree_identifier * ident (void) { return m_id; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
577
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
578 tree_expression * expression (void) { return m_expr; }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
579
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
580 comment_list * comments (void) const { return m_comments; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
581
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
582 void doc_string (const std::string& txt) { m_doc_string = txt; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
583
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
584 std::string doc_string (void) const { return m_doc_string; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
585
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
586 bool have_doc_string (void) const { return ! m_doc_string.empty (); }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
587
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
588 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
589 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
590 tw.visit_classdef_enum (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
591 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
592
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
593 private:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
594
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
595 tree_identifier *m_id;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
596 tree_expression *m_expr;
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
597 comment_list *m_comments;
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
598 std::string m_doc_string;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
599 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
600
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
601 class tree_classdef_enum_list : public base_list<tree_classdef_enum *>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
602 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
603 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
604
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
605 tree_classdef_enum_list (void) { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
606
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
607 tree_classdef_enum_list (tree_classdef_enum *e) { append (e); }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
608
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23601
diff changeset
609 tree_classdef_enum_list (const base_list<tree_classdef_enum *>& a)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
610 : base_list<tree_classdef_enum *> (a)
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
611 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
612
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
613 // No copying!
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
614
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
615 tree_classdef_enum_list (const tree_classdef_enum_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
616
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
617 tree_classdef_enum_list& operator = (const tree_classdef_enum_list&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
618
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
619 ~tree_classdef_enum_list (void);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
620
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
621 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
622 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
623 tw.visit_classdef_enum_list (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
624 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
625 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
626
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
627 class tree_classdef_enum_block
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
628 : public tree_classdef_element<tree_classdef_enum_list>
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
629 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
630 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
631
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
632 tree_classdef_enum_block (tree_classdef_attribute_list *a,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
633 tree_classdef_enum_list *elist,
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
634 comment_list *lc, comment_list *tc,
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
635 int l = -1, int c = -1)
29862
255fa40977c0 use different template parameter for tree_classdef_element class
John W. Eaton <jwe@octave.org>
parents: 29729
diff changeset
636 : tree_classdef_element<tree_classdef_enum_list> (a, elist, lc, tc, l, c)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
637 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
638
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
639 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
640
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
641 tree_classdef_enum_block (const tree_classdef_enum_block&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
642
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
643 tree_classdef_enum_block&
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
644 operator = (const tree_classdef_enum_block&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
645
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
646 ~tree_classdef_enum_block (void) = default;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
647
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
648 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
649 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
650 tw.visit_classdef_enum_block (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
651 }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
652 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
653
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
654 class tree_classdef_body
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
655 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
656 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
657
27932
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
658 typedef std::list<tree_classdef_properties_block *>::iterator
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
659 properties_list_iterator;
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
660 typedef std::list<tree_classdef_properties_block *>::const_iterator
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
661 properties_list_const_iterator;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
662
27932
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
663 typedef std::list<tree_classdef_methods_block *>::iterator
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
664 methods_list_iterator;
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
665 typedef std::list<tree_classdef_methods_block *>::const_iterator
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
666 methods_list_const_iterator;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
667
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
668 typedef std::list<tree_classdef_events_block *>::iterator events_list_iterator;
27932
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
669 typedef std::list<tree_classdef_events_block *>::const_iterator
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
670 events_list_const_iterator;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
671
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
672 typedef std::list<tree_classdef_enum_block *>::iterator enum_list_iterator;
27932
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
673 typedef std::list<tree_classdef_enum_block *>::const_iterator
b018f553fd85 maint: Use Octave coding conventions in libinterp/
Rik <rik@octave.org>
parents: 27923
diff changeset
674 enum_list_const_iterator;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
675
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
676 tree_classdef_body (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
677
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
678 tree_classdef_body (tree_classdef_properties_block *pb);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
679
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
680 tree_classdef_body (tree_classdef_methods_block *mb);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
681
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
682 tree_classdef_body (tree_classdef_events_block *evb);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
683
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
684 tree_classdef_body (tree_classdef_enum_block *enb);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
685
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
686 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
687
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
688 tree_classdef_body (const tree_classdef_body&) = delete;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
689
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
690 tree_classdef_body& operator = (const tree_classdef_body&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
691
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
692 ~tree_classdef_body (void);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
693
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
694 void append (tree_classdef_properties_block *pb)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
695 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
696 m_properties_lst.push_back (pb);
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
697 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
698
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
699 void append (tree_classdef_methods_block *mb)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
700 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
701 m_methods_lst.push_back (mb);
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
702 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
703
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
704 void append (tree_classdef_events_block *evb)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
705 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
706 m_events_lst.push_back (evb);
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
707 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
708
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
709 void append (tree_classdef_enum_block *enb)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
710 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
711 m_enum_lst.push_back (enb);
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
712 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
713
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
714 std::list<tree_classdef_properties_block *> properties_list (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
715 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
716 return m_properties_lst;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
717 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
718
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
719 std::list<tree_classdef_methods_block *> methods_list (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
720 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
721 return m_methods_lst;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
722 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
723
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
724 std::list<tree_classdef_events_block *> events_list (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
725 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
726 return m_events_lst;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
727 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
728
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
729 std::list<tree_classdef_enum_block *> enum_list (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
730 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
731 return m_enum_lst;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
732 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
733
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
734 void doc_string (const std::string& txt) { m_doc_string = txt; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
735
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
736 std::string doc_string (void) const { return m_doc_string; }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
737
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
738 bool have_doc_string (void) const { return ! m_doc_string.empty (); }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
739
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
740 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
741 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
742 tw.visit_classdef_body (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
743 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
744
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
745 private:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
746
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
747 std::string get_doc_string (comment_list *comment) const;
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
748
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
749 std::list<tree_classdef_properties_block *> m_properties_lst;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
750
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
751 std::list<tree_classdef_methods_block *> m_methods_lst;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
752
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
753 std::list<tree_classdef_events_block *> m_events_lst;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
754
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
755 std::list<tree_classdef_enum_block *> m_enum_lst;
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
756
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
757 std::string m_doc_string;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
758 };
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
759
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
760 // Classdef definition.
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
761
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
762 class tree_classdef : public tree_command
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
763 {
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
764 public:
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
765
28857
43ad651cf5a0 eliminate unnecessary uses of octave:: namespace qualifier
John W. Eaton <jwe@octave.org>
parents: 28806
diff changeset
766 tree_classdef (const symbol_scope& scope,
27189
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
767 tree_classdef_attribute_list *a, tree_identifier *i,
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
768 tree_classdef_superclass_list *sc,
23750
ea879bc55272 move comment_list and comment_elt classes to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23696
diff changeset
769 tree_classdef_body *b, comment_list *lc,
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
770 comment_list *tc, const std::string& pn = "",
30259
03ff3f1020cf store file name in classdef class object
John W. Eaton <jwe@octave.org>
parents: 29862
diff changeset
771 const std::string& fn = "", int l = -1, int c = -1)
27189
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
772 : tree_command (l, c), m_scope (scope), m_attr_list (a), m_id (i),
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
773 m_supclass_list (sc), m_element_list (b), m_lead_comm (lc),
30259
03ff3f1020cf store file name in classdef class object
John W. Eaton <jwe@octave.org>
parents: 29862
diff changeset
774 m_trail_comm (tc), m_pack_name (pn), m_file_name (fn)
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
775 { }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
776
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
777 // No copying!
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
778
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
779 tree_classdef (const tree_classdef&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
780
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
781 tree_classdef& operator = (const tree_classdef&) = delete;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
782
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
783 ~tree_classdef (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
784 {
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
785 delete m_attr_list;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
786 delete m_id;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
787 delete m_supclass_list;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
788 delete m_element_list;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
789 delete m_lead_comm;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
790 delete m_trail_comm;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
791 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
792
28857
43ad651cf5a0 eliminate unnecessary uses of octave:: namespace qualifier
John W. Eaton <jwe@octave.org>
parents: 28806
diff changeset
793 symbol_scope scope (void) { return m_scope; }
27189
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
794
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
795 tree_classdef_attribute_list *
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
796 attribute_list (void) { return m_attr_list; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
797
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
798 tree_identifier * ident (void) { return m_id; }
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
799
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
800 tree_classdef_superclass_list *
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
801 superclass_list (void) { return m_supclass_list; }
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
802
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
803 tree_classdef_body * body (void) { return m_element_list; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
804
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
805 comment_list * leading_comment (void) { return m_lead_comm; }
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
806 comment_list * trailing_comment (void) { return m_trail_comm; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
807
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
808 std::string package_name (void) const { return m_pack_name; }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
809
30259
03ff3f1020cf store file name in classdef class object
John W. Eaton <jwe@octave.org>
parents: 29862
diff changeset
810 std::string file_name (void) const { return m_file_name; }
03ff3f1020cf store file name in classdef class object
John W. Eaton <jwe@octave.org>
parents: 29862
diff changeset
811
27505
c409d16b7190 eliminate some uses of bare pointers to octave_function objects
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
812 octave_value make_meta_class (interpreter& interp,
c409d16b7190 eliminate some uses of bare pointers to octave_function objects
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
813 bool is_at_folder = false);
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
814
28511
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
815 std::string doc_string (void) const
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
816 {
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
817 return m_element_list ? m_element_list->doc_string () : "";
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
818 }
59dfd9ed72a3 capture comments for classdef classes, properties, events, and enumerations
John W. Eaton <jwe@octave.org>
parents: 27932
diff changeset
819
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
820 void accept (tree_walker& tw)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
821 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
822 tw.visit_classdef (*this);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
823 }
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
824
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
825 private:
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
826
27189
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
827 // The scope that was used when parsing the classdef object and that
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
828 // corresponds to any identifiers that were found in attribute lists
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
829 // (for example). Used again when computing the meta class object.
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
830
28857
43ad651cf5a0 eliminate unnecessary uses of octave:: namespace qualifier
John W. Eaton <jwe@octave.org>
parents: 28806
diff changeset
831 symbol_scope m_scope;
27189
946c6f117091 use dummy stack frame when creating meta class (bug #55766 and #55768)
John W. Eaton <jwe@octave.org>
parents: 26718
diff changeset
832
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
833 tree_classdef_attribute_list *m_attr_list;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
834
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
835 tree_identifier *m_id;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
836
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
837 tree_classdef_superclass_list *m_supclass_list;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
838
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
839 tree_classdef_body *m_element_list;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
840
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
841 comment_list *m_lead_comm;
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
842 comment_list *m_trail_comm;
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
843
24846
7620f1f5290d use m_ prefix for member variables in parse tree classes
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
844 std::string m_pack_name;
30259
03ff3f1020cf store file name in classdef class object
John W. Eaton <jwe@octave.org>
parents: 29862
diff changeset
845 std::string m_file_name;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
846 };
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
847
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
848 OCTAVE_END_NAMESPACE(octave)
15037
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
849
56b8eb7c9c04 improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
diff changeset
850 #endif