This file is indexed.

/usr/include/octave-4.0.0/octave/pt-classdef.h is in liboctave-dev 4.0.0-3ubuntu9.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
/*

Copyright (C) 2012-2015 John W. Eaton

This file is part of Octave.

Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.

Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with Octave; see the file COPYING.  If not, see
<http://www.gnu.org/licenses/>.

*/

#if !defined (octave_tree_classdef_h)
#define octave_tree_classdef_h 1

class octave_value;

class tree_walker;

#include "pt-cmd.h"
#include "pt-exp.h"
#include "pt-id.h"

#include "base-list.h"

#include <list>

class tree_classdef_attribute
{
public:

  tree_classdef_attribute (tree_identifier *i = 0, tree_expression *e = 0)
    : id (i), expr (e), neg (false) { }

  tree_classdef_attribute (tree_identifier *i, bool b)
    : id (i), expr (0), neg (b) { }

  ~tree_classdef_attribute (void)
  {
    delete id;
    delete expr;
  }

  tree_identifier *ident (void) { return id; }

  tree_expression *expression (void) { return expr; }

  bool negate (void) { return neg; }

  void accept (tree_walker&);

private:

  tree_identifier *id;
  tree_expression *expr;
  bool neg;

  // No copying!

  tree_classdef_attribute (const tree_classdef_attribute&);

  tree_classdef_attribute& operator = (const tree_classdef_attribute&);
};

class tree_classdef_attribute_list : public octave_base_list<tree_classdef_attribute *>
{
public:

  tree_classdef_attribute_list (void) { }

  tree_classdef_attribute_list (tree_classdef_attribute *a) { append (a); }

  tree_classdef_attribute_list (const octave_base_list<tree_classdef_attribute *>& a)
    : octave_base_list<tree_classdef_attribute *> (a) { }

  ~tree_classdef_attribute_list (void);

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_attribute_list (const tree_classdef_attribute_list&);

  tree_classdef_attribute_list& operator = (const tree_classdef_attribute_list&);
};

class tree_classdef_superclass
{
public:

  tree_classdef_superclass (const std::string& cname)
    : cls_name (cname) { }

  ~tree_classdef_superclass (void) { }

  std::string class_name (void) { return cls_name; }

  void accept (tree_walker&);

private:

  std::string cls_name;

  // No copying!

  tree_classdef_superclass (const tree_classdef_superclass&);

  tree_classdef_superclass& operator = (const tree_classdef_superclass&);
};

class tree_classdef_superclass_list : public octave_base_list<tree_classdef_superclass *>
{
public:

  tree_classdef_superclass_list (void) { }

  tree_classdef_superclass_list (tree_classdef_superclass *sc) { append (sc); }

  tree_classdef_superclass_list (const octave_base_list<tree_classdef_superclass *>& a)
    : octave_base_list<tree_classdef_superclass *> (a) { }

  ~tree_classdef_superclass_list (void);

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_superclass_list (const tree_classdef_superclass_list&);

  tree_classdef_superclass_list& operator = (const tree_classdef_superclass_list&);
};

template <typename T>
class tree_classdef_element : public tree
{
public:

  tree_classdef_element (tree_classdef_attribute_list *a,
                         octave_base_list<T> *elist,
                         octave_comment_list *lc, octave_comment_list *tc,
                         int l = -1, int c = -1)
    : tree (l, c), attr_list (a), elt_list (elist),
      lead_comm (lc), trail_comm (tc)
  { }

  ~tree_classdef_element (void)
  {
    delete attr_list;
    delete elt_list;
    delete lead_comm;
    delete trail_comm;
  }

  tree_classdef_attribute_list *attribute_list (void) { return attr_list; }

  octave_base_list<T> *element_list (void) { return elt_list; }

  octave_comment_list *leading_comment (void) { return lead_comm; }

  octave_comment_list *trailing_comment (void) { return trail_comm; }

  void accept (tree_walker&) { }

private:

  // List of attributes that apply to this class.
  tree_classdef_attribute_list *attr_list;

  // The list of objects contained in this block.
  octave_base_list<T> *elt_list;

  // Comment preceding the token marking the beginning of the block.
  octave_comment_list *lead_comm;

  // Comment preceding END token.
  octave_comment_list *trail_comm;

  // No copying!

  tree_classdef_element (const tree_classdef_element&);

  tree_classdef_element& operator = (const tree_classdef_element&);
};

class tree_classdef_property
{
public:

  tree_classdef_property (tree_identifier *i = 0, tree_expression *e = 0)
    : id (i), expr (e) { }

  ~tree_classdef_property (void)
  {
    delete id;
    delete expr;
  }

  tree_identifier *ident (void) { return id; }

  tree_expression *expression (void) { return expr; }

  void accept (tree_walker&);

private:

  tree_identifier *id;
  tree_expression *expr;

  // No copying!

  tree_classdef_property (const tree_classdef_property&);

  tree_classdef_property& operator = (const tree_classdef_property&);
};

class tree_classdef_property_list : public octave_base_list<tree_classdef_property *>
{
public:

  tree_classdef_property_list (void) { }

  tree_classdef_property_list (tree_classdef_property* p) { append (p); }

  tree_classdef_property_list (const octave_base_list<tree_classdef_property *>& a)
    : octave_base_list<tree_classdef_property *> (a) { }

  ~tree_classdef_property_list (void);

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_property_list (const tree_classdef_property_list&);

  tree_classdef_property_list& operator = (const tree_classdef_property_list&);
};

class tree_classdef_properties_block
  : public tree_classdef_element<tree_classdef_property *>
{
public:

  tree_classdef_properties_block (tree_classdef_attribute_list *a,
                                  tree_classdef_property_list *plist,
                                  octave_comment_list *lc,
                                  octave_comment_list *tc,
                                  int l = -1, int c = -1)
    : tree_classdef_element<tree_classdef_property *> (a, plist, lc, tc, l, c) { }

  ~tree_classdef_properties_block (void) { }

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_properties_block (const tree_classdef_properties_block&);

  tree_classdef_properties_block& operator = (const tree_classdef_properties_block&);
};

class tree_classdef_methods_list : public octave_base_list<octave_value>
{
public:

  tree_classdef_methods_list (void) { }

  tree_classdef_methods_list (const octave_value& f) { append (f); }

  tree_classdef_methods_list (const octave_base_list<octave_value>& a)
    : octave_base_list<octave_value> (a) { }

  ~tree_classdef_methods_list (void) { }

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_methods_list (const tree_classdef_methods_list&);

  tree_classdef_methods_list& operator = (const tree_classdef_methods_list&);
};

class tree_classdef_methods_block : public tree_classdef_element<octave_value>
{
public:

  tree_classdef_methods_block (tree_classdef_attribute_list *a,
                               tree_classdef_methods_list *mlist,
                               octave_comment_list *lc,
                               octave_comment_list *tc, int l = -1, int c = -1)
    : tree_classdef_element<octave_value> (a, mlist, lc, tc, l, c) { }

  ~tree_classdef_methods_block (void) { }

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_methods_block (const tree_classdef_methods_block&);

  tree_classdef_methods_block& operator = (const tree_classdef_methods_block&);
};

class tree_classdef_event
{
public:

  tree_classdef_event (tree_identifier *i = 0) : id (i) { }

  ~tree_classdef_event (void)
  {
    delete id;
  }

  tree_identifier *ident (void) { return id; }

  void accept (tree_walker&);

private:

  tree_identifier *id;

  // No copying!

  tree_classdef_event (const tree_classdef_event&);

  tree_classdef_event& operator = (const tree_classdef_event&);
};

class tree_classdef_events_list : public octave_base_list<tree_classdef_event *>
{
public:

  tree_classdef_events_list (void) { }

  tree_classdef_events_list (tree_classdef_event *e) { append (e); }

  tree_classdef_events_list (const octave_base_list<tree_classdef_event *>& a)
    : octave_base_list<tree_classdef_event *> (a) { }

  ~tree_classdef_events_list (void);

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_events_list (const tree_classdef_events_list&);

  tree_classdef_events_list& operator = (const tree_classdef_events_list&);
};

class tree_classdef_events_block
  : public tree_classdef_element<tree_classdef_event *>
{
public:

  tree_classdef_events_block (tree_classdef_attribute_list *a,
                              tree_classdef_events_list *elist,
                              octave_comment_list *lc,
                              octave_comment_list *tc, int l = -1, int c = -1)
    : tree_classdef_element<tree_classdef_event *> (a, elist, lc, tc, l, c) { }

  ~tree_classdef_events_block (void) { }

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_events_block (const tree_classdef_events_block&);

  tree_classdef_events_block& operator = (const tree_classdef_events_block&);
};

class tree_classdef_enum
{
public:

  tree_classdef_enum (void) : id (0), expr (0) { }

  tree_classdef_enum (tree_identifier *i, tree_expression *e)
    : id (i), expr (e) { }

  ~tree_classdef_enum (void)
  {
    delete id;
    delete expr;
  }

  tree_identifier *ident (void) { return id; }

  tree_expression *expression (void) { return expr; }

  void accept (tree_walker&);

private:

  tree_identifier *id;
  tree_expression *expr;

  // No copying!

  tree_classdef_enum (const tree_classdef_enum&);

  tree_classdef_enum& operator = (const tree_classdef_enum&);
};

class tree_classdef_enum_list : public octave_base_list<tree_classdef_enum *>
{
public:

  tree_classdef_enum_list (void) { }

  tree_classdef_enum_list (tree_classdef_enum *e) { append (e); }

  tree_classdef_enum_list (const octave_base_list<tree_classdef_enum *>& a)
    : octave_base_list<tree_classdef_enum *> (a) { }

  ~tree_classdef_enum_list (void);

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_enum_list (const tree_classdef_enum_list&);

  tree_classdef_enum_list& operator = (const tree_classdef_enum_list&);
};

class tree_classdef_enum_block
  : public tree_classdef_element<tree_classdef_enum *>
{
public:

  tree_classdef_enum_block (tree_classdef_attribute_list *a,
                            tree_classdef_enum_list *elist,
                            octave_comment_list *lc,
                            octave_comment_list *tc, int l = -1, int c = -1)
    : tree_classdef_element<tree_classdef_enum *> (a, elist, lc, tc, l, c) { }

  ~tree_classdef_enum_block (void) { }

  void accept (tree_walker&);

private:

  // No copying!

  tree_classdef_enum_block (const tree_classdef_enum_block&);

  tree_classdef_enum_block& operator = (const tree_classdef_enum_block&);
};

class tree_classdef_body
{
public:

  typedef std::list<tree_classdef_properties_block *>::iterator properties_list_iterator;
  typedef std::list<tree_classdef_properties_block *>::const_iterator properties_list_const_iterator;

  typedef std::list<tree_classdef_methods_block *>::iterator methods_list_iterator;
  typedef std::list<tree_classdef_methods_block *>::const_iterator methods_list_const_iterator;

  typedef std::list<tree_classdef_events_block *>::iterator events_list_iterator;
  typedef std::list<tree_classdef_events_block *>::const_iterator events_list_const_iterator;

  typedef std::list<tree_classdef_enum_block *>::iterator enum_list_iterator;
  typedef std::list<tree_classdef_enum_block *>::const_iterator enum_list_const_iterator;

  tree_classdef_body (void)
    : properties_lst (), methods_lst (), events_lst (), enum_lst () { }

  tree_classdef_body (tree_classdef_properties_block *pb)
    : properties_lst (), methods_lst (), events_lst (), enum_lst ()
  {
    append (pb);
  }

  tree_classdef_body (tree_classdef_methods_block *mb)
    : properties_lst (), methods_lst (), events_lst (), enum_lst ()
  {
    append (mb);
  }

  tree_classdef_body (tree_classdef_events_block *evb)
    : properties_lst (), methods_lst (), events_lst (), enum_lst ()
  {
    append (evb);
  }

  tree_classdef_body (tree_classdef_enum_block *enb)
    : properties_lst (), methods_lst (), events_lst (), enum_lst ()
  {
    append (enb);
  }

  ~tree_classdef_body (void);

  void append (tree_classdef_properties_block *pb)
  {
    properties_lst.push_back (pb);
  }

  void append (tree_classdef_methods_block *mb)
  {
    methods_lst.push_back (mb);
  }

  void append (tree_classdef_events_block *evb)
  {
    events_lst.push_back (evb);
  }

  void append (tree_classdef_enum_block *enb)
  {
    enum_lst.push_back (enb);
  }

  std::list<tree_classdef_properties_block *> properties_list (void)
  {
    return properties_lst;
  }

  std::list<tree_classdef_methods_block *> methods_list (void)
  {
    return methods_lst;
  }

  std::list<tree_classdef_events_block *> events_list (void)
  {
    return events_lst;
  }

  std::list<tree_classdef_enum_block *> enum_list (void)
  {
    return enum_lst;
  }

  void accept (tree_walker&);

private:

  std::list<tree_classdef_properties_block *> properties_lst;

  std::list<tree_classdef_methods_block *> methods_lst;

  std::list<tree_classdef_events_block *> events_lst;

  std::list<tree_classdef_enum_block *> enum_lst;

  // No copying!

  tree_classdef_body (const tree_classdef_body&);

  tree_classdef_body& operator = (const tree_classdef_body&);
};

// Classdef definition.

class tree_classdef : public tree_command
{
public:

  tree_classdef (tree_classdef_attribute_list *a, tree_identifier *i,
                 tree_classdef_superclass_list *sc,
                 tree_classdef_body *b, octave_comment_list *lc,
                 octave_comment_list *tc,
                 const std::string& pn = std::string (), int l = -1,
                 int c = -1)
    : tree_command (l, c), attr_list (a), id (i),
      supclass_list (sc), element_list (b), lead_comm (lc), trail_comm (tc),
      pack_name (pn) { }

  ~tree_classdef (void)
  {
    delete attr_list;
    delete id;
    delete supclass_list;
    delete element_list;
    delete lead_comm;
    delete trail_comm;
  }

  tree_classdef_attribute_list *attribute_list (void) { return attr_list; }

  tree_identifier *ident (void) { return id; }

  tree_classdef_superclass_list *superclass_list (void) { return supclass_list; }

  tree_classdef_body *body (void) { return element_list; }

  octave_comment_list *leading_comment (void) { return lead_comm; }
  octave_comment_list *trailing_comment (void) { return trail_comm; }

  const std::string& package_name (void) const { return pack_name; }

  octave_function* make_meta_class (bool is_at_folder = false);

  tree_classdef *dup (symbol_table::scope_id scope,
                      symbol_table::context_id context) const;

  void accept (tree_walker& tw);

private:

  tree_classdef_attribute_list *attr_list;

  tree_identifier *id;

  tree_classdef_superclass_list *supclass_list;

  tree_classdef_body *element_list;

  octave_comment_list *lead_comm;
  octave_comment_list *trail_comm;

  std::string pack_name;

  // No copying!

  tree_classdef (const tree_classdef&);

  tree_classdef& operator = (const tree_classdef&);
};

#endif