GNU Octave 11.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
pt-classdef.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2012-2026 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_tree_classdef_h)
27#define octave_tree_classdef_h 1
28
29#include "octave-config.h"
30
31class octave_value;
32
33#include "pt-cmd.h"
34#include "pt-delimiter-list.h"
35#include "pt-exp.h"
36#include "pt-walk.h"
37#include "pt-id.h"
38#include "token.h"
39
40#include <list>
41
43
44class coment_list;
45class interpreter;
47
48class OCTINTERP_API tree_superclass_ref : public tree_expression
49{
50public:
51
52 tree_superclass_ref (const std::string& meth, const std::string& cls, const token& tok)
53 : m_method_name (meth), m_class_name (cls), m_token (tok)
54 { }
55
56 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_superclass_ref)
57
59
60 filepos beg_pos () const { return m_token.beg_pos (); }
61 filepos end_pos () const { return m_token.end_pos (); }
62
63 comment_list leading_comments () const { return m_token.leading_comments (); }
64 comment_list trailing_comments () const { return m_token.trailing_comments (); }
65
66 std::string method_name () const
67 {
68 return m_method_name;
69 }
70
71 std::string class_name () const { return m_class_name; }
72
73 token op_token () const { return m_token; }
74
75 tree_superclass_ref * dup (symbol_scope& scope) const;
76
77 octave_value evaluate (tree_evaluator& tw, int nargout = 1)
78 {
79 octave_value_list retval = evaluate_n (tw, nargout);
80
81 return retval.length () > 0 ? retval(0) : octave_value ();
82 }
83
84 octave_value_list evaluate_n (tree_evaluator& tw, int nargout = 1);
85
87 {
88 tw.visit_superclass_ref (*this);
89 }
90
91private:
92
93 // The name of the method to call. This is the text before the
94 // "@" and may be of the form "object.method".
95 std::string m_method_name;
96
97 // The name of the superclass. This is the text after the "@"
98 // and may be of the form "object.method".
99 std::string m_class_name;
100
101 token m_token;
102};
103
104class OCTINTERP_API tree_metaclass_query : public tree_expression
105{
106public:
107
108 tree_metaclass_query (const std::string& cls, const token& tok)
109 : m_class_name (cls), m_token (tok)
110 { }
111
112 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_metaclass_query)
113
115
116 filepos beg_pos () const { return m_token.beg_pos (); }
117 filepos end_pos () const { return m_token.end_pos (); }
118
119 comment_list leading_comments () const { return m_token.leading_comments (); }
120 comment_list trailing_comments () const { return m_token.trailing_comments (); }
121
122 std::string class_name () const { return m_class_name; }
123
124 token op_token () const { return m_token; }
125
126 tree_metaclass_query * dup (symbol_scope& scope) const;
127
128 octave_value evaluate (tree_evaluator&, int nargout = 1);
129
131 {
132 return ovl (evaluate (tw, nargout));
133 }
134
136 {
137 tw.visit_metaclass_query (*this);
138 }
139
140private:
141
142 std::string m_class_name;
143
144 token m_token;
145};
146
147class OCTINTERP_API tree_classdef_attribute
148{
149public:
150
152 : m_id (i)
153 { }
154
156 : m_id (i), m_eq_tok (eq_tok), m_expr (e)
157 { }
158
159 tree_classdef_attribute (const token& not_tok, tree_identifier *i, bool b)
160 : m_not_tok (not_tok), m_id (i), m_neg (b)
161 { }
162
163 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_attribute)
164
166 {
167 delete m_id;
168 delete m_expr;
169 }
170
171 filepos beg_pos () const { return m_not_tok ? m_not_tok.beg_pos () : m_id->beg_pos (); }
172 filepos end_pos () const { return m_expr ? m_expr->end_pos () : m_id->end_pos (); }
173
174 comment_list leading_comments () const { return m_not_tok ? m_not_tok.leading_comments () : m_id->leading_comments (); }
175 comment_list trailing_comments () const { return m_expr ? m_expr->trailing_comments () : m_id->trailing_comments (); }
176
177 token not_token () { return m_not_tok; }
178
179 tree_identifier * ident () { return m_id; }
180
181 token eq_token () { return m_eq_tok; }
182
183 tree_expression * expression () { return m_expr; }
184
185 bool negate () { return m_neg; }
186
188 {
189 tw.visit_classdef_attribute (*this);
190 }
191
192private:
193
194 token m_not_tok;
195
196 tree_identifier *m_id;
197
198 token m_eq_tok;
199
200 tree_expression *m_expr {nullptr};
201
202 bool m_neg {false};
203};
204
205class OCTINTERP_API tree_classdef_attribute_list : public std::list<tree_classdef_attribute *>
206{
207public:
208
210
212
213 tree_classdef_attribute_list (const std::list<tree_classdef_attribute *>& a)
214 : std::list<tree_classdef_attribute *> (a)
215 { }
216
217 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_attribute_list)
218
220
221 tree_classdef_attribute_list * mark_in_delims (const token& open_delim, token& close_delim)
222 {
223 m_delims.push (open_delim, close_delim);
224 return this;
225 }
226
228
230 {
232 }
233
234private:
235
237};
238
239class OCTINTERP_API tree_classdef_superclass
240{
241public:
242
244 : m_fqident (fqident)
245 { }
246
247 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_superclass)
248
250
251 void set_separator (const token& sep_tok) { m_sep_tok = sep_tok; }
252
253 std::string class_name () { return m_fqident.text (); }
254
255 token separator_token () const { return m_sep_tok; }
256
257 token fqident_token () const { return m_fqident; }
258
260 {
261 tw.visit_classdef_superclass (*this);
262 }
263
264private:
265
266 // The '<' or '&&' token introducing an element of a superclass list
267 // element. Is there a better name for it?
268
269 token m_sep_tok;
270
271 // The fully-qualified identifier token for this superclass element.
272 token m_fqident;
273};
274
276 : public std::list<tree_classdef_superclass *>
277{
278public:
279
281
283 {
284 push_back (sc);
285 }
286
287 tree_classdef_superclass_list (const std::list<tree_classdef_superclass *>& a)
288 : std::list<tree_classdef_superclass *> (a)
289 { }
290
291 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_superclass_list)
292
294
296 {
298 }
299};
300
301class OCTINTERP_API tree_base_classdef_block : public tree
302{
303public:
304
306 : m_block_tok (block_tok), m_attr_list (a), m_end_tok (end_tok)
307 { }
308
309 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_base_classdef_block)
310
312 {
313 delete m_attr_list;
314 }
315
316 comment_list leading_comments () const { return m_block_tok.leading_comments (); }
317
318 token block_token () const { return m_block_tok; }
319
320 tree_classdef_attribute_list * attribute_list () { return m_attr_list; }
321
322 token end_token () const { return m_end_tok; }
323
324 void accept (tree_walker&) { }
325
326protected:
327
329
330 // List of attributes that apply to this class.
332
334};
335
336template <typename T>
338{
339public:
340
341 tree_classdef_block (const token& block_tok, tree_classdef_attribute_list *a, T *elt_list, const token& end_tok)
342 : tree_base_classdef_block (block_tok, a, end_tok), m_elt_list (elt_list)
343 { }
344
345 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_block)
346
348 {
349 delete m_elt_list;
350 }
351
352 filepos beg_pos () const { return m_block_tok.beg_pos (); }
353 filepos end_pos () const { return m_end_tok.end_pos (); }
354
357
358 T * element_list () { return m_elt_list; }
359
360private:
361
362 T *m_elt_list;
363};
364
365// FIXME: should this class be derived from tree?
366
367class OCTINTERP_API tree_classdef_property
368{
369public:
370
372
373 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_property)
374
376
378
380
381 void doc_string (const std::string& s) { m_doc_string = s; }
382
383 std::string doc_string () const { return m_doc_string; }
384
385 bool have_doc_string () const { return ! m_doc_string.empty (); }
386
387 tree_identifier * ident ();
388
389 tree_expression * expression ();
390
392 {
393 tw.visit_classdef_property (*this);
394 }
395
396private:
397
399
400 std::string m_doc_string;
401};
402
403class OCTINTERP_API tree_classdef_property_list : public std::list<tree_classdef_property *>
404{
405public:
406
408
410
411 tree_classdef_property_list (const std::list<tree_classdef_property *>& a)
412 : std::list<tree_classdef_property *> (a) { }
413
414 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_property_list)
415
417
419 {
421 }
422};
423
424class OCTINTERP_API tree_classdef_properties_block : public tree_classdef_block<tree_classdef_property_list>
425{
426public:
427
429 : tree_classdef_block<tree_classdef_property_list> (block_tok, a, plist, end_tok)
430 { }
431
432 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_properties_block)
433
435
436 tree_classdef_property_list * property_list () { return element_list (); }
437
439 {
441 }
442};
443
444class OCTINTERP_API tree_classdef_method_list : public std::list<octave_value>
445{
446public:
447
449
450 tree_classdef_method_list (const octave_value& f) { push_back (f); }
451
452 tree_classdef_method_list (const std::list<octave_value>& a)
453 : std::list<octave_value> (a) { }
454
455 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_method_list)
456
458
460 {
462 }
463};
464
465class OCTINTERP_API tree_classdef_methods_block : public tree_classdef_block<tree_classdef_method_list>
466{
467public:
468
470 : tree_classdef_block<tree_classdef_method_list> (block_tok, a, mlist, end_tok)
471 { }
472
473 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_methods_block)
474
476
477 tree_classdef_method_list * method_list () { return element_list (); }
478
480 {
482 }
483};
484
485class OCTINTERP_API tree_classdef_event
486{
487public:
488
490
491 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_event)
492
494 {
495 delete m_id;
496 }
497
498 tree_identifier * ident () { return m_id; }
499
501 {
502 tw.visit_classdef_event (*this);
503 }
504
505private:
506
507 tree_identifier *m_id;
508};
509
510class OCTINTERP_API tree_classdef_event_list : public std::list<tree_classdef_event *>
511{
512public:
513
515
517
518 tree_classdef_event_list (const std::list<tree_classdef_event *>& a)
519 : std::list<tree_classdef_event *> (a)
520 { }
521
522 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_event_list)
523
525
527 {
528 tw.visit_classdef_event_list (*this);
529 }
530};
531
532class OCTINTERP_API tree_classdef_events_block : public tree_classdef_block<tree_classdef_event_list>
533{
534public:
535
537 : tree_classdef_block<tree_classdef_event_list> (block_tok, a, elist, end_tok)
538 { }
539
540 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_events_block)
541
543
544 tree_classdef_event_list * event_list () { return element_list (); }
545
547 {
549 }
550};
551
552class OCTINTERP_API tree_classdef_enum
553{
554public:
555
556 tree_classdef_enum (tree_identifier *i, const token& open_paren, tree_expression *e, const token& close_paren);
557
558 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_enum)
559
561 {
562 delete m_id;
563 delete m_expr;
564 }
565
566 tree_identifier * ident () { return m_id; }
567
568 token open_paren () const { return m_open_paren; }
569
570 tree_expression * expression () { return m_expr; }
571
572 token close_paren () const { return m_close_paren; }
573
575 {
576 tw.visit_classdef_enum (*this);
577 }
578
579private:
580
581 tree_identifier *m_id;
582
583 token m_open_paren;
584
585 tree_expression *m_expr;
586
587 token m_close_paren;
588};
589
590class OCTINTERP_API tree_classdef_enum_list : public std::list<tree_classdef_enum *>
591{
592public:
593
595
597
598 tree_classdef_enum_list (const std::list<tree_classdef_enum *>& a)
599 : std::list<tree_classdef_enum *> (a)
600 { }
601
602 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_enum_list)
603
605
607 {
608 tw.visit_classdef_enum_list (*this);
609 }
610};
611
612class OCTINTERP_API tree_classdef_enum_block : public tree_classdef_block<tree_classdef_enum_list>
613{
614public:
615
617 : tree_classdef_block<tree_classdef_enum_list> (block_tok, a, elist, end_tok)
618 { }
619
620 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef_enum_block)
621
623
624 tree_classdef_enum_list * enum_list () { return element_list (); }
625
627 {
628 tw.visit_classdef_enum_block (*this);
629 }
630};
631
632// FIXME: should this class be derived from tree?
633
634class OCTINTERP_API tree_classdef_body
635{
636public:
637
638 typedef std::list<tree_classdef_properties_block *>::iterator property_list_iterator;
639 typedef std::list<tree_classdef_properties_block *>::const_iterator property_list_const_iterator;
640
641 typedef std::list<tree_classdef_methods_block *>::iterator method_list_iterator;
642 typedef std::list<tree_classdef_methods_block *>::const_iterator method_list_const_iterator;
643
644 typedef std::list<tree_classdef_events_block *>::iterator event_list_iterator;
645 typedef std::list<tree_classdef_events_block *>::const_iterator event_list_const_iterator;
646
647 typedef std::list<tree_classdef_enum_block *>::iterator enum_list_iterator;
648 typedef std::list<tree_classdef_enum_block *>::const_iterator enum_list_const_iterator;
649
651
653
655
657
659
660 OCTAVE_DISABLE_COPY_MOVE (tree_classdef_body)
661
663
665
667 {
668 m_property_lst.push_back (pb);
669 m_all_elements.push_back (pb);
670 return this;
671 }
672
674 {
675 m_method_lst.push_back (mb);
676 m_all_elements.push_back (mb);
677 return this;
678 }
679
681 {
682 m_event_lst.push_back (evb);
683 m_all_elements.push_back (evb);
684 return this;
685 }
686
688 {
689 m_enum_lst.push_back (enb);
690 m_all_elements.push_back (enb);
691 return this;
692 }
693
694 std::list<tree_classdef_properties_block *> property_list ()
695 {
696 return m_property_lst;
697 }
698
699 std::list<tree_classdef_methods_block *> method_list ()
700 {
701 return m_method_lst;
702 }
703
704 std::list<tree_classdef_events_block *> event_list ()
705 {
706 return m_event_lst;
707 }
708
709 std::list<tree_classdef_enum_block *> enum_list ()
710 {
711 return m_enum_lst;
712 }
713
715 {
716 tw.visit_classdef_body (*this);
717 }
718
719private:
720
721 std::list<tree_classdef_properties_block *> m_property_lst;
722
723 std::list<tree_classdef_methods_block *> m_method_lst;
724
725 std::list<tree_classdef_events_block *> m_event_lst;
726
727 std::list<tree_classdef_enum_block *> m_enum_lst;
728
729 std::list<tree_base_classdef_block *> m_all_elements;
730};
731
732// Classdef definition.
733
734class OCTINTERP_API tree_classdef : public tree_command
735{
736public:
737
738 tree_classdef (const symbol_scope& scope, const token& cdef_tok, tree_classdef_attribute_list *a, tree_identifier *i, tree_classdef_superclass_list *sc, tree_classdef_body *b, const token& end_tok, const std::string& pn = "", const std::string& fn = "")
739 : m_scope (scope), m_cdef_tok (cdef_tok), m_attr_list (a), m_id (i), m_supclass_list (sc), m_body (b), m_end_tok (end_tok), m_pack_name (pn), m_file_name (fn)
740 {
741 cache_doc_string ();
742 }
743
744 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (tree_classdef)
745
747 {
748 delete m_attr_list;
749 delete m_id;
750 delete m_supclass_list;
751 delete m_body;
752 }
753
754 filepos beg_pos () const { return m_cdef_tok.beg_pos (); }
755 filepos end_pos () const { return m_end_tok.end_pos (); }
756
757 comment_list leading_comments () const { return m_cdef_tok.leading_comments (); }
758 comment_list trailing_comments () const { return m_end_tok.trailing_comments (); }
759
760 symbol_scope scope () { return m_scope; }
761
762 token classdef_token () const { return m_cdef_tok; }
763
765 attribute_list () { return m_attr_list; }
766
767 tree_identifier * ident () { return m_id; }
768
770 superclass_list () { return m_supclass_list; }
771
772 tree_classdef_body * body () { return m_body; }
773
774 token end_token () const { return m_end_tok; }
775
776 std::string package_name () const { return m_pack_name; }
777
778 std::string file_name () const { return m_file_name; }
779
780 octave_value make_meta_class (interpreter& interp,
781 bool is_at_folder = false);
782
783 std::string doc_string () const { return m_doc_string; }
784
786 {
787 tw.visit_classdef (*this);
788 }
789
790private:
791
792 void cache_doc_string ()
793 {
794 // First non-copyright comments found above and below classdef
795 // keyword are candidates for the documentation string. Use the
796 // first one that is not empty.
797
798 comment_list comments = m_cdef_tok.leading_comments ();
799
800 m_doc_string = comments.find_doc_string ();
801
802 if (m_doc_string.empty ())
803 {
804 comments = m_body->leading_comments ();
805
806 m_doc_string = comments.find_doc_string ();
807 }
808 }
809
810 // The scope that was used when parsing the classdef object and that
811 // corresponds to any identifiers that were found in attribute lists
812 // (for example). Used again when computing the meta class object.
813
814 symbol_scope m_scope;
815
816 token m_cdef_tok;
817
818 tree_classdef_attribute_list *m_attr_list;
819
820 tree_identifier *m_id;
821
822 tree_classdef_superclass_list *m_supclass_list;
823
824 tree_classdef_body *m_body;
825
826 token m_end_tok;
827
828 std::string m_pack_name;
829 std::string m_file_name;
830
831 std::string m_doc_string;
832};
833
834OCTAVE_END_NAMESPACE(octave)
835
836#endif
std::string find_doc_string() const
octave_idx_type length() const
Definition ovl.h:111
Definition token.h:42
filepos end_pos() const
Definition token.h:127
comment_list leading_comments() const
Definition token.h:132
comment_list trailing_comments() const
Definition token.h:133
filepos beg_pos() const
Definition token.h:126
tree_classdef_attribute_list * m_attr_list
tree_base_classdef_block(const token &block_tok, tree_classdef_attribute_list *a, const token &end_tok)
void accept(tree_walker &)
comment_list leading_comments() const
token block_token() const
tree_classdef_attribute_list * attribute_list()
tree_classdef_attribute_list(const std::list< tree_classdef_attribute * > &a)
tree_classdef_attribute_list(tree_classdef_attribute *a)
tree_delimiter_list delims() const
tree_classdef_attribute_list * mark_in_delims(const token &open_delim, token &close_delim)
void accept(tree_walker &tw)
tree_classdef_attribute(tree_identifier *i, const token eq_tok, tree_expression *e)
tree_identifier * ident()
void accept(tree_walker &tw)
comment_list trailing_comments() const
filepos end_pos() const
tree_expression * expression()
tree_classdef_attribute(const token &not_tok, tree_identifier *i, bool b)
filepos beg_pos() const
comment_list leading_comments() const
tree_classdef_attribute(tree_identifier *i)
filepos beg_pos() const
comment_list trailing_comments() const
comment_list leading_comments() const
filepos end_pos() const
tree_classdef_block(const token &block_tok, tree_classdef_attribute_list *a, T *elt_list, const token &end_tok)
std::list< tree_classdef_methods_block * >::const_iterator method_list_const_iterator
std::list< tree_classdef_events_block * >::const_iterator event_list_const_iterator
std::list< tree_classdef_events_block * >::iterator event_list_iterator
tree_classdef_body * append(tree_classdef_properties_block *pb)
std::list< tree_classdef_properties_block * >::const_iterator property_list_const_iterator
tree_classdef_body * append(tree_classdef_events_block *evb)
tree_classdef_body * append(tree_classdef_enum_block *enb)
std::list< tree_classdef_properties_block * >::iterator property_list_iterator
void accept(tree_walker &tw)
std::list< tree_classdef_enum_block * >::iterator enum_list_iterator
std::list< tree_classdef_properties_block * > property_list()
std::list< tree_classdef_methods_block * > method_list()
tree_classdef_body * append(tree_classdef_methods_block *mb)
std::list< tree_classdef_enum_block * > enum_list()
std::list< tree_classdef_events_block * > event_list()
std::list< tree_classdef_enum_block * >::const_iterator enum_list_const_iterator
std::list< tree_classdef_methods_block * >::iterator method_list_iterator
tree_classdef_enum_list * enum_list()
tree_classdef_enum_block(const token &block_tok, tree_classdef_attribute_list *a, tree_classdef_enum_list *elist, const token &end_tok)
void accept(tree_walker &tw)
~tree_classdef_enum_block()=default
void accept(tree_walker &tw)
tree_classdef_enum_list(const std::list< tree_classdef_enum * > &a)
tree_classdef_enum_list(tree_classdef_enum *e)
tree_identifier * ident()
tree_expression * expression()
token close_paren() const
token open_paren() const
void accept(tree_walker &tw)
void accept(tree_walker &tw)
tree_classdef_event_list(const std::list< tree_classdef_event * > &a)
tree_classdef_event_list(tree_classdef_event *e)
void accept(tree_walker &tw)
tree_identifier * ident()
void accept(tree_walker &tw)
~tree_classdef_events_block()=default
tree_classdef_event_list * event_list()
tree_classdef_events_block(const token &block_tok, tree_classdef_attribute_list *a, tree_classdef_event_list *elist, const token &end_tok)
tree_classdef_method_list(const octave_value &f)
void accept(tree_walker &tw)
tree_classdef_method_list(const std::list< octave_value > &a)
~tree_classdef_method_list()=default
tree_classdef_method_list * method_list()
void accept(tree_walker &tw)
tree_classdef_methods_block(const token &block_tok, tree_classdef_attribute_list *a, tree_classdef_method_list *mlist, const token &end_tok)
~tree_classdef_methods_block()=default
tree_classdef_properties_block(const token &block_tok, tree_classdef_attribute_list *a, tree_classdef_property_list *plist, const token &end_tok)
tree_classdef_property_list * property_list()
void accept(tree_walker &tw)
tree_classdef_property_list(const std::list< tree_classdef_property * > &a)
void accept(tree_walker &tw)
tree_classdef_property_list(tree_classdef_property *p)
tree_arg_validation * arg_validation()
void doc_string(const std::string &s)
std::string doc_string() const
void accept(tree_walker &tw)
bool have_doc_string() const
tree_classdef_superclass_list(const std::list< tree_classdef_superclass * > &a)
void accept(tree_walker &tw)
tree_classdef_superclass_list(tree_classdef_superclass *sc)
tree_classdef_superclass(const token &fqident)
token fqident_token() const
token separator_token() const
void accept(tree_walker &tw)
~tree_classdef_superclass()=default
void set_separator(const token &sep_tok)
token classdef_token() const
comment_list leading_comments() const
std::string package_name() const
comment_list trailing_comments() const
tree_classdef_body * body()
tree_identifier * ident()
filepos end_pos() const
void accept(tree_walker &tw)
tree_classdef_superclass_list * superclass_list()
tree_classdef_attribute_list * attribute_list()
symbol_scope scope()
std::string doc_string() const
tree_classdef(const symbol_scope &scope, const token &cdef_tok, tree_classdef_attribute_list *a, tree_identifier *i, tree_classdef_superclass_list *sc, tree_classdef_body *b, const token &end_tok, const std::string &pn="", const std::string &fn="")
filepos beg_pos() const
std::string file_name() const
token end_token() const
virtual octave_value evaluate(tree_evaluator &tw, int nargout=1)=0
tree_delimiter_list m_delims
Definition pt-exp.h:169
virtual tree_expression * dup(symbol_scope &scope) const =0
virtual octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)=0
token op_token() const
comment_list leading_comments() const
filepos end_pos() const
std::string class_name() const
tree_metaclass_query(const std::string &cls, const token &tok)
void accept(tree_walker &tw)
comment_list trailing_comments() const
octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)
filepos beg_pos() const
~tree_metaclass_query()=default
filepos end_pos() const
Definition pt-classdef.h:61
void accept(tree_walker &tw)
Definition pt-classdef.h:86
std::string method_name() const
Definition pt-classdef.h:66
token op_token() const
Definition pt-classdef.h:73
filepos beg_pos() const
Definition pt-classdef.h:60
tree_superclass_ref(const std::string &meth, const std::string &cls, const token &tok)
Definition pt-classdef.h:52
comment_list trailing_comments() const
Definition pt-classdef.h:64
octave_value evaluate(tree_evaluator &tw, int nargout=1)
Definition pt-classdef.h:77
comment_list leading_comments() const
Definition pt-classdef.h:63
~tree_superclass_ref()=default
std::string class_name() const
Definition pt-classdef.h:71
virtual void visit_classdef_attribute(tree_classdef_attribute &)
Definition pt-walk.cc:666
virtual void visit_classdef_methods_block(tree_classdef_methods_block &)
Definition pt-walk.cc:744
virtual void visit_classdef_enum_block(tree_classdef_enum_block &)
Definition pt-walk.cc:794
virtual void visit_classdef(tree_classdef &)
Definition pt-walk.cc:832
virtual void visit_classdef_superclass(tree_classdef_superclass &)
Definition pt-walk.cc:690
virtual void visit_classdef_property(tree_classdef_property &)
Definition pt-walk.cc:706
virtual void visit_classdef_event_list(tree_classdef_event_list &)
Definition pt-walk.cc:759
virtual void visit_classdef_events_block(tree_classdef_events_block &)
Definition pt-walk.cc:769
virtual void visit_classdef_property_list(tree_classdef_property_list &)
Definition pt-walk.cc:713
virtual void visit_classdef_body(tree_classdef_body &)
Definition pt-walk.cc:803
virtual void visit_classdef_enum(tree_classdef_enum &)
Definition pt-walk.cc:778
virtual void visit_classdef_enum_list(tree_classdef_enum_list &)
Definition pt-walk.cc:784
virtual void visit_classdef_properties_block(tree_classdef_properties_block &)
Definition pt-walk.cc:723
virtual void visit_classdef_superclass_list(tree_classdef_superclass_list &)
Definition pt-walk.cc:696
virtual void visit_classdef_attribute_list(tree_classdef_attribute_list &)
Definition pt-walk.cc:680
virtual void visit_classdef_method_list(tree_classdef_method_list &)
Definition pt-walk.cc:732
virtual void visit_classdef_event(tree_classdef_event &)
Definition pt-walk.cc:753
virtual void visit_superclass_ref(tree_superclass_ref &)
Definition pt-walk.cc:654
virtual void visit_metaclass_query(tree_metaclass_query &)
Definition pt-walk.cc:660
Definition pt.h:47
virtual comment_list leading_comments() const =0
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
Definition ovl.h:217
F77_RET_T const F77_DBLE const F77_DBLE * f