GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-classdef.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2012-2023 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 
31 class octave_value;
32 
33 #include "comment-list.h"
34 #include "pt-cmd.h"
35 #include "pt-exp.h"
36 #include "pt-walk.h"
37 #include "pt-id.h"
38 
39 #include "base-list.h"
40 
41 #include <list>
42 
44 
45 class interpreter;
46 
48 
50 {
51 public:
52 
53  tree_superclass_ref (void) = delete;
54 
55  tree_superclass_ref (const std::string& meth, const std::string& cls,
56  int l = -1, int c = -1)
57  : tree_expression (l, c), m_method_name (meth), m_class_name (cls)
58  { }
59 
60  // No copying!
61 
63 
65 
66  std::string method_name (void) const
67  {
68  return m_method_name;
69  }
70 
71  std::string class_name (void) const { return m_class_name; }
72 
73  tree_superclass_ref * dup (symbol_scope& scope) const;
74 
75  octave_value evaluate (tree_evaluator& tw, int nargout = 1)
76  {
77  octave_value_list retval = evaluate_n (tw, nargout);
78 
79  return retval.length () > 0 ? retval(0) : octave_value ();
80  }
81 
82  octave_value_list evaluate_n (tree_evaluator& tw, int nargout = 1);
83 
84  void accept (tree_walker& tw)
85  {
86  tw.visit_superclass_ref (*this);
87  }
88 
89 private:
90 
91  // The name of the method to call. This is the text before the
92  // "@" and may be of the form "object.method".
93  std::string m_method_name;
94 
95  // The name of the superclass. This is the text after the "@"
96  // and may be of the form "object.method".
97  std::string m_class_name;
98 };
99 
101 {
102 public:
103 
104  tree_metaclass_query (void) = delete;
105 
106  tree_metaclass_query (const std::string& cls, int l = -1, int c = -1)
107  : tree_expression (l, c), m_class_name (cls)
108  { }
109 
110  // No copying!
111 
113 
115 
116  std::string class_name (void) const { return m_class_name; }
117 
118  tree_metaclass_query * dup (symbol_scope& scope) const;
119 
120  octave_value evaluate (tree_evaluator&, int nargout = 1);
121 
123  {
124  return ovl (evaluate (tw, nargout));
125  }
126 
127  void accept (tree_walker& tw)
128  {
129  tw.visit_metaclass_query (*this);
130  }
131 
132 private:
133 
134  std::string m_class_name;
135 };
136 
138 {
139 public:
140 
142  tree_expression *e = nullptr)
143  : m_id (i), m_expr (e), m_neg (false)
144  { }
145 
147  : m_id (i), m_expr (nullptr), m_neg (b)
148  { }
149 
150  // No copying!
151 
153 
155 
157  {
158  delete m_id;
159  delete m_expr;
160  }
161 
162  tree_identifier * ident (void) { return m_id; }
163 
164  tree_expression * expression (void) { return m_expr; }
165 
166  bool negate (void) { return m_neg; }
167 
168  void accept (tree_walker& tw)
169  {
170  tw.visit_classdef_attribute (*this);
171  }
172 
173 private:
174 
177  bool m_neg;
178 };
179 
180 class tree_classdef_attribute_list : public base_list<tree_classdef_attribute *>
181 {
182 public:
183 
185 
187 
190  { }
191 
192  // No copying!
193 
195 
198 
200 
201  void accept (tree_walker& tw)
202  {
204  }
205 };
206 
208 {
209 public:
210 
211  tree_classdef_superclass (const std::string& cname)
212  : m_cls_name (cname)
213  { }
214 
215  // No copying!
216 
218 
221 
222  ~tree_classdef_superclass (void) = default;
223 
224  std::string class_name (void) { return m_cls_name; }
225 
226  void accept (tree_walker& tw)
227  {
228  tw.visit_classdef_superclass (*this);
229  }
230 
231 private:
232 
233  std::string m_cls_name;
234 };
235 
237  : public base_list<tree_classdef_superclass *>
238 {
239 public:
240 
242 
244  {
245  append (sc);
246  }
247 
250  { }
251 
252  // No copying!
253 
255 
258 
260 
261  void accept (tree_walker& tw)
262  {
264  }
265 };
266 
267 template <typename T>
269 {
270 public:
271 
273  comment_list *lc, comment_list *tc,
274  int l = -1, int c = -1)
275  : tree (l, c), m_attr_list (a), m_elt_list (elt_list),
276  m_lead_comm (lc), m_trail_comm (tc)
277  { }
278 
279  // No copying!
280 
282 
284 
286  {
287  delete m_attr_list;
288  delete m_elt_list;
289  delete m_lead_comm;
290  delete m_trail_comm;
291  }
292 
294 
295  T * element_list (void) { return m_elt_list; }
296 
298 
300 
301  void accept (tree_walker&) { }
302 
303 private:
304 
305  // List of attributes that apply to this class.
307 
308  // The list of objects contained in this block.
310 
311  // Comments preceding the token marking the beginning of the block.
313 
314  // Comments preceding the END token marking the end of the block.
316 };
317 
319 {
320 public:
321 
323  comment_list *comments = nullptr);
324 
325  // No copying!
326 
328 
330 
332 
333  tree_identifier * ident (void);
334 
335  tree_expression * expression (void);
336 
337  comment_list * comments (void) const { return m_comments; }
338 
339  void doc_string (const std::string& txt) { m_doc_string = txt; }
340 
341  std::string doc_string (void) const { return m_doc_string; }
342 
343  bool have_doc_string (void) const { return ! m_doc_string.empty (); }
344 
345  void accept (tree_walker& tw)
346  {
347  tw.visit_classdef_property (*this);
348  }
349 
350 private:
351 
354  std::string m_doc_string;
355 };
356 
357 class tree_classdef_property_list : public base_list<tree_classdef_property *>
358 {
359 public:
360 
362 
364 
366  : base_list<tree_classdef_property *> (a) { }
367 
368  // No copying!
369 
371 
374 
376 
377  void accept (tree_walker& tw)
378  {
379  tw.visit_classdef_property_list (*this);
380  }
381 };
382 
384  : public tree_classdef_element<tree_classdef_property_list>
385 {
386 public:
387 
390  comment_list *lc, comment_list *tc,
391  int l = -1, int c = -1)
392  : tree_classdef_element<tree_classdef_property_list> (a, plist, lc, tc, l, c)
393  { }
394 
395  // No copying!
396 
398 
401 
403 
404  void accept (tree_walker& tw)
405  {
407  }
408 };
409 
410 class tree_classdef_methods_list : public base_list<octave_value>
411 {
412 public:
413 
415 
417 
419  : base_list<octave_value> (a) { }
420 
421  // No copying!
422 
424 
427 
428  ~tree_classdef_methods_list (void) = default;
429 
430  void accept (tree_walker& tw)
431  {
432  tw.visit_classdef_methods_list (*this);
433  }
434 };
435 
437  : public tree_classdef_element<tree_classdef_methods_list>
438 {
439 public:
440 
443  comment_list *lc, comment_list *tc,
444  int l = -1, int c = -1)
445  : tree_classdef_element<tree_classdef_methods_list> (a, mlist, lc, tc, l, c)
446  { }
447 
448  // No copying!
449 
451 
454 
456 
457  void accept (tree_walker& tw)
458  {
459  tw.visit_classdef_methods_block (*this);
460  }
461 };
462 
464 {
465 public:
466 
467  tree_classdef_event (tree_identifier *i = nullptr,
468  comment_list *comments = nullptr);
469 
470  // No copying!
471 
473 
475 
477  {
478  delete m_id;
479  }
480 
481  tree_identifier * ident (void) { return m_id; }
482 
483  comment_list * comments (void) const { return m_comments; }
484 
485  void doc_string (const std::string& txt) { m_doc_string = txt; }
486 
487  std::string doc_string (void) const { return m_doc_string; }
488 
489  bool have_doc_string (void) const { return ! m_doc_string.empty (); }
490 
491  void accept (tree_walker& tw)
492  {
493  tw.visit_classdef_event (*this);
494  }
495 
496 private:
497 
500  std::string m_doc_string;
501 };
502 
503 class tree_classdef_events_list : public base_list<tree_classdef_event *>
504 {
505 public:
506 
508 
510 
513  { }
514 
515  // No copying!
516 
518 
521 
523 
524  void accept (tree_walker& tw)
525  {
526  tw.visit_classdef_events_list (*this);
527  }
528 };
529 
531  : public tree_classdef_element<tree_classdef_events_list>
532 {
533 public:
534 
537  comment_list *lc, comment_list *tc,
538  int l = -1, int c = -1)
539  : tree_classdef_element<tree_classdef_events_list> (a, elist, lc, tc, l, c)
540  { }
541 
542  // No copying!
543 
545 
548 
549  ~tree_classdef_events_block (void) = default;
550 
551  void accept (tree_walker& tw)
552  {
553  tw.visit_classdef_events_block (*this);
554  }
555 };
556 
558 {
559 public:
560 
563 
564  // No copying!
565 
567 
569 
571  {
572  delete m_id;
573  delete m_expr;
574  }
575 
576  tree_identifier * ident (void) { return m_id; }
577 
578  tree_expression * expression (void) { return m_expr; }
579 
580  comment_list * comments (void) const { return m_comments; }
581 
582  void doc_string (const std::string& txt) { m_doc_string = txt; }
583 
584  std::string doc_string (void) const { return m_doc_string; }
585 
586  bool have_doc_string (void) const { return ! m_doc_string.empty (); }
587 
588  void accept (tree_walker& tw)
589  {
590  tw.visit_classdef_enum (*this);
591  }
592 
593 private:
594 
598  std::string m_doc_string;
599 };
600 
601 class tree_classdef_enum_list : public base_list<tree_classdef_enum *>
602 {
603 public:
604 
606 
608 
611  { }
612 
613  // No copying!
614 
616 
618 
620 
621  void accept (tree_walker& tw)
622  {
623  tw.visit_classdef_enum_list (*this);
624  }
625 };
626 
628  : public tree_classdef_element<tree_classdef_enum_list>
629 {
630 public:
631 
634  comment_list *lc, comment_list *tc,
635  int l = -1, int c = -1)
636  : tree_classdef_element<tree_classdef_enum_list> (a, elist, lc, tc, l, c)
637  { }
638 
639  // No copying!
640 
642 
645 
646  ~tree_classdef_enum_block (void) = default;
647 
648  void accept (tree_walker& tw)
649  {
650  tw.visit_classdef_enum_block (*this);
651  }
652 };
653 
655 {
656 public:
657 
658  typedef std::list<tree_classdef_properties_block *>::iterator
660  typedef std::list<tree_classdef_properties_block *>::const_iterator
662 
663  typedef std::list<tree_classdef_methods_block *>::iterator
665  typedef std::list<tree_classdef_methods_block *>::const_iterator
667 
668  typedef std::list<tree_classdef_events_block *>::iterator events_list_iterator;
669  typedef std::list<tree_classdef_events_block *>::const_iterator
671 
672  typedef std::list<tree_classdef_enum_block *>::iterator enum_list_iterator;
673  typedef std::list<tree_classdef_enum_block *>::const_iterator
675 
676  tree_classdef_body (void);
677 
679 
681 
683 
685 
686  // No copying!
687 
689 
691 
692  ~tree_classdef_body (void);
693 
695  {
696  m_properties_lst.push_back (pb);
697  }
698 
700  {
701  m_methods_lst.push_back (mb);
702  }
703 
705  {
706  m_events_lst.push_back (evb);
707  }
708 
710  {
711  m_enum_lst.push_back (enb);
712  }
713 
714  std::list<tree_classdef_properties_block *> properties_list (void)
715  {
716  return m_properties_lst;
717  }
718 
719  std::list<tree_classdef_methods_block *> methods_list (void)
720  {
721  return m_methods_lst;
722  }
723 
724  std::list<tree_classdef_events_block *> events_list (void)
725  {
726  return m_events_lst;
727  }
728 
729  std::list<tree_classdef_enum_block *> enum_list (void)
730  {
731  return m_enum_lst;
732  }
733 
734  void doc_string (const std::string& txt) { m_doc_string = txt; }
735 
736  std::string doc_string (void) const { return m_doc_string; }
737 
738  bool have_doc_string (void) const { return ! m_doc_string.empty (); }
739 
740  void accept (tree_walker& tw)
741  {
742  tw.visit_classdef_body (*this);
743  }
744 
745 private:
746 
747  std::string get_doc_string (comment_list *comment) const;
748 
749  std::list<tree_classdef_properties_block *> m_properties_lst;
750 
751  std::list<tree_classdef_methods_block *> m_methods_lst;
752 
753  std::list<tree_classdef_events_block *> m_events_lst;
754 
755  std::list<tree_classdef_enum_block *> m_enum_lst;
756 
757  std::string m_doc_string;
758 };
759 
760 // Classdef definition.
761 
763 {
764 public:
765 
770  comment_list *tc, const std::string& pn = "",
771  const std::string& fn = "", int l = -1, int c = -1)
772  : tree_command (l, c), m_scope (scope), m_attr_list (a), m_id (i),
774  m_trail_comm (tc), m_pack_name (pn), m_file_name (fn)
775  { }
776 
777  // No copying!
778 
779  tree_classdef (const tree_classdef&) = delete;
780 
782 
784  {
785  delete m_attr_list;
786  delete m_id;
787  delete m_supclass_list;
788  delete m_element_list;
789  delete m_lead_comm;
790  delete m_trail_comm;
791  }
792 
793  symbol_scope scope (void) { return m_scope; }
794 
796  attribute_list (void) { return m_attr_list; }
797 
798  tree_identifier * ident (void) { return m_id; }
799 
801  superclass_list (void) { return m_supclass_list; }
802 
804 
807 
808  std::string package_name (void) const { return m_pack_name; }
809 
810  std::string file_name (void) const { return m_file_name; }
811 
813  bool is_at_folder = false);
814 
815  std::string doc_string (void) const
816  {
817  return m_element_list ? m_element_list->doc_string () : "";
818  }
819 
820  void accept (tree_walker& tw)
821  {
822  tw.visit_classdef (*this);
823  }
824 
825 private:
826 
827  // The scope that was used when parsing the classdef object and that
828  // corresponds to any identifiers that were found in attribute lists
829  // (for example). Used again when computing the meta class object.
830 
832 
834 
836 
838 
840 
843 
844  std::string m_pack_name;
845  std::string m_file_name;
846 };
847 
849 
850 #endif
OCTAVE_END_NAMESPACE(octave)
void append(const tree_classdef_attribute * &s)
Definition: base-list.h:92
octave_idx_type length(void) const
Definition: ovl.h:113
tree_classdef_attribute_list(const tree_classdef_attribute_list &)=delete
tree_classdef_attribute_list & operator=(const tree_classdef_attribute_list &)=delete
tree_classdef_attribute_list(tree_classdef_attribute *a)
Definition: pt-classdef.h:186
tree_classdef_attribute_list(const base_list< tree_classdef_attribute * > &a)
Definition: pt-classdef.h:188
void accept(tree_walker &tw)
Definition: pt-classdef.h:201
tree_classdef_attribute(const tree_classdef_attribute &)=delete
tree_classdef_attribute & operator=(const tree_classdef_attribute &)=delete
tree_identifier * ident(void)
Definition: pt-classdef.h:162
void accept(tree_walker &tw)
Definition: pt-classdef.h:168
tree_classdef_attribute(tree_identifier *i, bool b)
Definition: pt-classdef.h:146
tree_expression * m_expr
Definition: pt-classdef.h:176
tree_expression * expression(void)
Definition: pt-classdef.h:164
tree_classdef_attribute(tree_identifier *i=nullptr, tree_expression *e=nullptr)
Definition: pt-classdef.h:141
tree_identifier * m_id
Definition: pt-classdef.h:175
std::list< tree_classdef_enum_block * > enum_list(void)
Definition: pt-classdef.h:729
std::list< tree_classdef_properties_block * > properties_list(void)
Definition: pt-classdef.h:714
std::list< tree_classdef_properties_block * >::iterator properties_list_iterator
Definition: pt-classdef.h:659
tree_classdef_body(const tree_classdef_body &)=delete
std::list< tree_classdef_events_block * >::const_iterator events_list_const_iterator
Definition: pt-classdef.h:670
tree_classdef_body & operator=(const tree_classdef_body &)=delete
void append(tree_classdef_enum_block *enb)
Definition: pt-classdef.h:709
std::list< tree_classdef_events_block * >::iterator events_list_iterator
Definition: pt-classdef.h:668
std::list< tree_classdef_properties_block * >::const_iterator properties_list_const_iterator
Definition: pt-classdef.h:661
void append(tree_classdef_methods_block *mb)
Definition: pt-classdef.h:699
std::list< tree_classdef_enum_block * >::iterator enum_list_iterator
Definition: pt-classdef.h:672
std::list< tree_classdef_events_block * > m_events_lst
Definition: pt-classdef.h:753
void accept(tree_walker &tw)
Definition: pt-classdef.h:740
std::list< tree_classdef_enum_block * >::const_iterator enum_list_const_iterator
Definition: pt-classdef.h:674
std::string doc_string(void) const
Definition: pt-classdef.h:736
std::list< tree_classdef_methods_block * > m_methods_lst
Definition: pt-classdef.h:751
std::list< tree_classdef_methods_block * > methods_list(void)
Definition: pt-classdef.h:719
std::list< tree_classdef_methods_block * >::iterator methods_list_iterator
Definition: pt-classdef.h:664
void doc_string(const std::string &txt)
Definition: pt-classdef.h:734
void append(tree_classdef_events_block *evb)
Definition: pt-classdef.h:704
std::list< tree_classdef_enum_block * > m_enum_lst
Definition: pt-classdef.h:755
std::string m_doc_string
Definition: pt-classdef.h:757
std::list< tree_classdef_properties_block * > m_properties_lst
Definition: pt-classdef.h:749
std::list< tree_classdef_events_block * > events_list(void)
Definition: pt-classdef.h:724
bool have_doc_string(void) const
Definition: pt-classdef.h:738
void append(tree_classdef_properties_block *pb)
Definition: pt-classdef.h:694
std::list< tree_classdef_methods_block * >::const_iterator methods_list_const_iterator
Definition: pt-classdef.h:666
std::string get_doc_string(comment_list *comment) const
Definition: pt-classdef.cc:292
tree_classdef_element(tree_classdef_attribute_list *a, T *elt_list, comment_list *lc, comment_list *tc, int l=-1, int c=-1)
Definition: pt-classdef.h:272
comment_list * leading_comment(void)
Definition: pt-classdef.h:297
void accept(tree_walker &)
Definition: pt-classdef.h:301
comment_list * m_lead_comm
Definition: pt-classdef.h:312
tree_classdef_attribute_list * m_attr_list
Definition: pt-classdef.h:306
tree_classdef_element & operator=(const tree_classdef_element &)=delete
comment_list * m_trail_comm
Definition: pt-classdef.h:315
tree_classdef_element(const tree_classdef_element &)=delete
comment_list * trailing_comment(void)
Definition: pt-classdef.h:299
tree_classdef_attribute_list * attribute_list(void)
Definition: pt-classdef.h:293
~tree_classdef_enum_block(void)=default
void accept(tree_walker &tw)
Definition: pt-classdef.h:648
tree_classdef_enum_block & operator=(const tree_classdef_enum_block &)=delete
tree_classdef_enum_block(tree_classdef_attribute_list *a, tree_classdef_enum_list *elist, comment_list *lc, comment_list *tc, int l=-1, int c=-1)
Definition: pt-classdef.h:632
tree_classdef_enum_block(const tree_classdef_enum_block &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:621
tree_classdef_enum_list & operator=(const tree_classdef_enum_list &)=delete
tree_classdef_enum_list(const base_list< tree_classdef_enum * > &a)
Definition: pt-classdef.h:609
tree_classdef_enum_list(const tree_classdef_enum_list &)=delete
tree_classdef_enum_list(tree_classdef_enum *e)
Definition: pt-classdef.h:607
comment_list * comments(void) const
Definition: pt-classdef.h:580
bool have_doc_string(void) const
Definition: pt-classdef.h:586
void doc_string(const std::string &txt)
Definition: pt-classdef.h:582
tree_classdef_enum(tree_identifier *i, tree_expression *e, comment_list *comments)
Definition: pt-classdef.cc:205
std::string doc_string(void) const
Definition: pt-classdef.h:584
comment_list * m_comments
Definition: pt-classdef.h:597
tree_expression * m_expr
Definition: pt-classdef.h:596
tree_classdef_enum(const tree_classdef_enum &)=delete
std::string m_doc_string
Definition: pt-classdef.h:598
tree_identifier * m_id
Definition: pt-classdef.h:595
tree_identifier * ident(void)
Definition: pt-classdef.h:576
tree_classdef_enum & operator=(const tree_classdef_enum &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:588
tree_expression * expression(void)
Definition: pt-classdef.h:578
comment_list * comments(void) const
Definition: pt-classdef.h:483
bool have_doc_string(void) const
Definition: pt-classdef.h:489
std::string m_doc_string
Definition: pt-classdef.h:500
tree_identifier * ident(void)
Definition: pt-classdef.h:481
comment_list * m_comments
Definition: pt-classdef.h:499
void accept(tree_walker &tw)
Definition: pt-classdef.h:491
tree_identifier * m_id
Definition: pt-classdef.h:498
tree_classdef_event(const tree_classdef_event &)=delete
void doc_string(const std::string &txt)
Definition: pt-classdef.h:485
std::string doc_string(void) const
Definition: pt-classdef.h:487
tree_classdef_event(tree_identifier *i=nullptr, comment_list *comments=nullptr)
Definition: pt-classdef.cc:183
tree_classdef_event & operator=(const tree_classdef_event &)=delete
tree_classdef_events_block(tree_classdef_attribute_list *a, tree_classdef_events_list *elist, comment_list *lc, comment_list *tc, int l=-1, int c=-1)
Definition: pt-classdef.h:535
void accept(tree_walker &tw)
Definition: pt-classdef.h:551
tree_classdef_events_block & operator=(const tree_classdef_events_block &)=delete
tree_classdef_events_block(const tree_classdef_events_block &)=delete
~tree_classdef_events_block(void)=default
tree_classdef_events_list(const base_list< tree_classdef_event * > &a)
Definition: pt-classdef.h:511
tree_classdef_events_list & operator=(const tree_classdef_events_list &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:524
tree_classdef_events_list(const tree_classdef_events_list &)=delete
tree_classdef_events_list(tree_classdef_event *e)
Definition: pt-classdef.h:509
tree_classdef_methods_block & operator=(const tree_classdef_methods_block &)=delete
tree_classdef_methods_block(const tree_classdef_methods_block &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:457
tree_classdef_methods_block(tree_classdef_attribute_list *a, tree_classdef_methods_list *mlist, comment_list *lc, comment_list *tc, int l=-1, int c=-1)
Definition: pt-classdef.h:441
~tree_classdef_methods_block(void)=default
~tree_classdef_methods_list(void)=default
tree_classdef_methods_list(const octave_value &f)
Definition: pt-classdef.h:416
tree_classdef_methods_list(const tree_classdef_methods_list &)=delete
tree_classdef_methods_list(const base_list< octave_value > &a)
Definition: pt-classdef.h:418
tree_classdef_methods_list & operator=(const tree_classdef_methods_list &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:430
~tree_classdef_properties_block(void)=default
tree_classdef_properties_block(const tree_classdef_properties_block &)=delete
tree_classdef_properties_block(tree_classdef_attribute_list *a, tree_classdef_property_list *plist, comment_list *lc, comment_list *tc, int l=-1, int c=-1)
Definition: pt-classdef.h:388
void accept(tree_walker &tw)
Definition: pt-classdef.h:404
tree_classdef_properties_block & operator=(const tree_classdef_properties_block &)=delete
tree_classdef_property_list(const base_list< tree_classdef_property * > &a)
Definition: pt-classdef.h:365
tree_classdef_property_list(const tree_classdef_property_list &)=delete
tree_classdef_property_list & operator=(const tree_classdef_property_list &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:377
tree_classdef_property_list(tree_classdef_property *p)
Definition: pt-classdef.h:363
tree_identifier * ident(void)
Definition: pt-classdef.cc:151
tree_classdef_property(const tree_classdef_property &)=delete
std::string doc_string(void) const
Definition: pt-classdef.h:341
tree_arg_validation * m_av
Definition: pt-classdef.h:352
std::string m_doc_string
Definition: pt-classdef.h:354
void accept(tree_walker &tw)
Definition: pt-classdef.h:345
tree_classdef_property(tree_arg_validation *av, comment_list *comments=nullptr)
Definition: pt-classdef.cc:140
bool have_doc_string(void) const
Definition: pt-classdef.h:343
comment_list * comments(void) const
Definition: pt-classdef.h:337
tree_classdef_property & operator=(const tree_classdef_property &)=delete
void doc_string(const std::string &txt)
Definition: pt-classdef.h:339
comment_list * m_comments
Definition: pt-classdef.h:353
tree_expression * expression(void)
Definition: pt-classdef.cc:158
tree_classdef_superclass_list & operator=(const tree_classdef_superclass_list &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:261
tree_classdef_superclass_list(tree_classdef_superclass *sc)
Definition: pt-classdef.h:243
tree_classdef_superclass_list(const base_list< tree_classdef_superclass * > &a)
Definition: pt-classdef.h:248
tree_classdef_superclass_list(const tree_classdef_superclass_list &)=delete
tree_classdef_superclass(const tree_classdef_superclass &)=delete
void accept(tree_walker &tw)
Definition: pt-classdef.h:226
~tree_classdef_superclass(void)=default
tree_classdef_superclass(const std::string &cname)
Definition: pt-classdef.h:211
tree_classdef_superclass & operator=(const tree_classdef_superclass &)=delete
std::string class_name(void)
Definition: pt-classdef.h:224
tree_classdef & operator=(const tree_classdef &)=delete
tree_classdef_superclass_list * m_supclass_list
Definition: pt-classdef.h:837
tree_identifier * m_id
Definition: pt-classdef.h:835
tree_classdef_attribute_list * m_attr_list
Definition: pt-classdef.h:833
symbol_scope m_scope
Definition: pt-classdef.h:831
octave_value make_meta_class(interpreter &interp, bool is_at_folder=false)
Definition: pt-classdef.cc:310
tree_classdef_body * body(void)
Definition: pt-classdef.h:803
tree_classdef_superclass_list * superclass_list(void)
Definition: pt-classdef.h:801
tree_classdef_body * m_element_list
Definition: pt-classdef.h:839
symbol_scope scope(void)
Definition: pt-classdef.h:793
tree_classdef_attribute_list * attribute_list(void)
Definition: pt-classdef.h:796
std::string m_pack_name
Definition: pt-classdef.h:844
comment_list * leading_comment(void)
Definition: pt-classdef.h:805
std::string file_name(void) const
Definition: pt-classdef.h:810
std::string doc_string(void) const
Definition: pt-classdef.h:815
comment_list * m_trail_comm
Definition: pt-classdef.h:842
tree_classdef(const tree_classdef &)=delete
tree_identifier * ident(void)
Definition: pt-classdef.h:798
void accept(tree_walker &tw)
Definition: pt-classdef.h:820
comment_list * m_lead_comm
Definition: pt-classdef.h:841
tree_classdef(const symbol_scope &scope, tree_classdef_attribute_list *a, tree_identifier *i, tree_classdef_superclass_list *sc, tree_classdef_body *b, comment_list *lc, comment_list *tc, const std::string &pn="", const std::string &fn="", int l=-1, int c=-1)
Definition: pt-classdef.h:766
std::string m_file_name
Definition: pt-classdef.h:845
~tree_classdef(void)
Definition: pt-classdef.h:783
comment_list * trailing_comment(void)
Definition: pt-classdef.h:806
std::string package_name(void) const
Definition: pt-classdef.h:808
tree_metaclass_query * dup(symbol_scope &scope) const
Definition: pt-classdef.cc:78
tree_metaclass_query & operator=(const tree_metaclass_query &)=delete
tree_metaclass_query(const tree_metaclass_query &)=delete
std::string class_name(void) const
Definition: pt-classdef.h:116
tree_metaclass_query(const std::string &cls, int l=-1, int c=-1)
Definition: pt-classdef.h:106
std::string m_class_name
Definition: pt-classdef.h:134
void accept(tree_walker &tw)
Definition: pt-classdef.h:127
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition: pt-classdef.cc:89
tree_metaclass_query(void)=delete
octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)
Definition: pt-classdef.h:122
tree_superclass_ref(const std::string &meth, const std::string &cls, int l=-1, int c=-1)
Definition: pt-classdef.h:55
void accept(tree_walker &tw)
Definition: pt-classdef.h:84
std::string method_name(void) const
Definition: pt-classdef.h:66
tree_superclass_ref(const tree_superclass_ref &)=delete
tree_superclass_ref(void)=delete
std::string m_class_name
Definition: pt-classdef.h:97
std::string m_method_name
Definition: pt-classdef.h:93
octave_value evaluate(tree_evaluator &tw, int nargout=1)
Definition: pt-classdef.h:75
tree_superclass_ref & operator=(const tree_superclass_ref &)=delete
octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)
Definition: pt-classdef.cc:53
tree_superclass_ref * dup(symbol_scope &scope) const
Definition: pt-classdef.cc:41
std::string class_name(void) const
Definition: pt-classdef.h:71
virtual void visit_classdef_attribute(tree_classdef_attribute &)
Definition: pt-walk.cc:616
virtual void visit_classdef_methods_list(tree_classdef_methods_list &)
Definition: pt-walk.cc:675
virtual void visit_classdef_methods_block(tree_classdef_methods_block &)
Definition: pt-walk.cc:686
virtual void visit_classdef_enum_block(tree_classdef_enum_block &)
Definition: pt-walk.cc:730
virtual void visit_classdef(tree_classdef &)
Definition: pt-walk.cc:766
virtual void visit_classdef_superclass(tree_classdef_superclass &)
Definition: pt-walk.cc:638
virtual void visit_classdef_property(tree_classdef_property &)
Definition: pt-walk.cc:652
virtual void visit_classdef_events_block(tree_classdef_events_block &)
Definition: pt-walk.cc:708
virtual void visit_classdef_property_list(tree_classdef_property_list &)
Definition: pt-walk.cc:658
virtual void visit_classdef_body(tree_classdef_body &)
Definition: pt-walk.cc:738
virtual void visit_classdef_enum(tree_classdef_enum &)
Definition: pt-walk.cc:716
virtual void visit_classdef_enum_list(tree_classdef_enum_list &)
Definition: pt-walk.cc:721
virtual void visit_classdef_properties_block(tree_classdef_properties_block &)
Definition: pt-walk.cc:667
virtual void visit_classdef_superclass_list(tree_classdef_superclass_list &)
Definition: pt-walk.cc:643
virtual void visit_classdef_attribute_list(tree_classdef_attribute_list &)
Definition: pt-walk.cc:629
virtual void visit_classdef_event(tree_classdef_event &)
Definition: pt-walk.cc:694
virtual void visit_classdef_events_list(tree_classdef_events_list &)
Definition: pt-walk.cc:699
virtual void visit_superclass_ref(tree_superclass_ref &)
Definition: pt-walk.cc:606
virtual void visit_metaclass_query(tree_metaclass_query &)
Definition: pt-walk.cc:611
Definition: pt.h:45
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE const F77_DBLE * f
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
Definition: ovl.h:211