This file is indexed.

/usr/include/scilab/exp.hxx is in scilab-include 6.0.1-1ubuntu1.

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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
/*
 *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 *  Copyright (C) 2007-2008 - DIGITEO - Bruno JOFRET
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 */

/**
** \file exp.hxx
** Define the Expression mother class.
*/

#ifndef AST_EXP_HXX
#define AST_EXP_HXX

#include <list>
#include <vector>
#include <algorithm>
#include "ast.hxx"

namespace ast
{

/** \brief Define a shorthand for list of Exp* manipulation. */
typedef std::vector<Exp *> exps_t;

/** \brief Abstract an Expression node. */
class Exp : public Ast
{
public:
    /** \name Ctor & dtor.
    ** \{ */

    /** \brief Construct an Expression node.
    ** \param location scanner position informations */
    Exp (const Location& location)
        : Ast (location),
          _verbose(false),
          _bBreak(false),
          _bBreakable(false),
          _bReturn(false),
          _bReturnable(false),
          _bContinue(false),
          _bContinuable(false),
          parent(NULL),
          original(NULL)
    {
        original = this;
    }
    /** \brief Destroys an Expression node. */
    virtual ~Exp ()
    {
        for (exps_t::const_iterator it = _exps.begin(); it != _exps.end(); ++it)
        {
            if (*it != NULL)
            {
                delete *it;
            }
        }

        if (original && original != this)
        {
            delete original;
        }
    }
    /** \} */

    virtual Exp* clone() = 0;

    virtual bool equal(const Exp & e) const
    {
        if (getType() == e.getType() && _exps.size() == e._exps.size())
        {
            for (exps_t::const_iterator i = _exps.begin(), j = e._exps.begin(), _e = _exps.end(); i != _e; ++i, ++j)
            {
                if (!(*i)->equal(**j))
                {
                    return false;
                }
            }
            return true;
        }
        return false;
    }

    inline bool operator==(const Exp & R) const
    {
        return equal(R);
    }

    inline bool operator!=(const Exp & R) const
    {
        return !equal(R);
    }

public:
    /** \brief Return if an expression should be displayed or not. */
    inline void mute(void)
    {
        _verbose = false;
    }

    /** \brief Return if an expression should be displayed or not. */
    inline void setVerbose(bool verbose)
    {
        _verbose = verbose;
    }

    /** \brief Return if an expression should be displayed or not. */
    inline virtual bool isVerbose(void) const
    {
        return _verbose;
    }

    //manage break instruction
    inline void setBreak(void)
    {
        _bBreak = true;
    }

    inline void resetBreak(void)
    {
        _bBreak = false;
    }

    inline virtual bool isBreak(void) const
    {
        return _bBreak;
    }

    virtual inline void setBreakable(void)
    {
        _bBreakable = true;
    }

    inline void resetBreakable(void)
    {
        _bBreakable = false;
    }

    inline virtual bool isBreakable(void) const
    {
        return _bBreakable;
    }

    //manage return instruction
    inline void setReturn(void)
    {
        _bReturn = true;
    }

    inline void resetReturn(void)
    {
        _bReturn = false;
    }

    inline virtual bool isReturn(void) const
    {
        return _bReturn;
    }

    virtual inline void setReturnable(void)
    {
        _bReturnable = true;
    }

    inline void resetReturnable(void)
    {
        _bReturnable = false;
    }

    inline virtual bool isReturnable(void) const
    {
        return _bReturnable;
    }

    //manage continue instruction
    inline void setContinue(void)
    {
        _bContinue = true;
    }

    inline void resetContinue(void)
    {
        _bContinue = false;
    }

    inline virtual bool isContinue(void) const
    {
        return _bContinue;
    }

    virtual inline void setContinuable(void)
    {
        _bContinuable = true;
    }

    inline void resetContinuable(void)
    {
        _bContinuable = false;
    }

    inline virtual bool isContinuable(void) const
    {
        return _bContinuable;
    }

    //manage derived exp
    enum ExpType
    {
        SIMPLEVAR,
        DOLLARVAR,
        COLONVAR,
        ARRAYLISTVAR,
        DOUBLEEXP,
        BOOLEXP,
        STRINGEXP,
        COMMENTEXP,
        CONSTEXP,
        NILEXP,
        CALLEXP,
        CELLCALLEXP,
        OPEXP,
        LOGICALOPEXP,
        ASSIGNEXP,
        IFEXP,
        WHILEEXP,
        FOREXP,
        BREAKEXP,
        CONTINUEEXP,
        TRYCATCHEXP,
        SELECTEXP,
        CASEEXP,
        RETURNEXP,
        FIELDEXP,
        NOTEXP,
        TRANSPOSEEXP,
        MATRIXEXP,
        MATRIXLINEEXP,
        CELLEXP,
        SEQEXP,
        ARRAYLISTEXP,
        ASSIGNLISTEXP,
        VARDEC,
        FUNCTIONDEC,
        LISTEXP,
        OPTIMIZEDEXP,
        MEMFILLEXP,
        DAXPYEXP,
        STRINGSELECTEXP,
        TABLEINTSELECTEXP,
        MAPINTSELECTEXP,
        SMALLINTSELECTEXP,
    };

    const std::wstring getTypeString() const
    {
        switch (getType())
        {
            case SIMPLEVAR:
                return L"SimpleVar";
            case DOLLARVAR:
                return L"DollarVar";
            case COLONVAR:
                return L"ColonVar";
            case ARRAYLISTVAR:
                return L"ArrayListVar";
            case DOUBLEEXP:
                return L"DoubleExp";
            case BOOLEXP:
                return L"BoolExp";
            case STRINGEXP:
                return L"StringExp";
            case COMMENTEXP:
                return L"CommentExp";
            case CONSTEXP:
                return L"ConstExp";
            case NILEXP:
                return L"NilExp";
            case CALLEXP:
                return L"CallExp";
            case CELLCALLEXP:
                return L"CellCallExp";
            case OPEXP:
                return L"OpExp";
            case LOGICALOPEXP:
                return L"LogicalOpExp";
            case ASSIGNEXP:
                return L"AssignExp";
            case IFEXP:
                return L"IfExp";
            case WHILEEXP:
                return L"WhileExp";
            case FOREXP:
                return L"ForExp";
            case BREAKEXP:
                return L"BreakExp";
            case CONTINUEEXP:
                return L"ContinueExp";
            case TRYCATCHEXP:
                return L"TryCatchExp";
            case SELECTEXP:
                return L"SelectExp";
            case CASEEXP:
                return L"CaseExp";
            case RETURNEXP:
                return L"ReturnExp";
            case FIELDEXP:
                return L"FieldExp";
            case NOTEXP:
                return L"NotExp";
            case TRANSPOSEEXP:
                return L"TransposeExp";
            case MATRIXEXP:
                return L"MatrixExp";
            case MATRIXLINEEXP:
                return L"MatrixLineExp";
            case CELLEXP:
                return L"CellExp";
            case SEQEXP:
                return L"SeqExp";
            case ARRAYLISTEXP:
                return L"ArrayListExp";
            case ASSIGNLISTEXP:
                return L"AssignListExp";
            case VARDEC:
                return L"VarDec";
            case FUNCTIONDEC:
                return L"FunctionDec";
            case LISTEXP:
                return L"ListExp";
            case OPTIMIZEDEXP:
                return L"OptimizedExp";
            case MEMFILLEXP:
                return L"MemfillExp";
            case DAXPYEXP:
                return L"DAXPYExp";
            case STRINGSELECTEXP:
                return L"StringSelectExp";
            case TABLEINTSELECTEXP:
                return L"TableIntSelectExp";
            case MAPINTSELECTEXP:
                return L"MapIntSelectExp";
            case SMALLINTSELECTEXP:
                return L"SmallIntSelectExp";
            default:
                return L"????Exp";
        }
    }

    virtual ExpType getType() const = 0;

    template <class T>
    inline T* getAs(void)
    {
        return static_cast<T*>(this);
    }

    template <class T>
    inline const T* getAs(void) const
    {
        return static_cast<const T*>(this);
    }

    inline virtual bool isSimpleVar() const
    {
        return false;
    }

    inline virtual bool isDollarVar() const
    {
        return false;
    }

    inline virtual bool isColonVar() const
    {
        return false;
    }

    inline virtual bool isArrayListVar() const
    {
        return false;
    }

    inline virtual bool isDoubleExp() const
    {
        return false;
    }

    inline virtual bool isBoolExp() const
    {
        return false;
    }

    inline virtual bool isStringExp() const
    {
        return false;
    }

    inline virtual bool isCommentExp() const
    {
        return false;
    }

    inline virtual bool isConstExp() const
    {
        return false;
    }

    inline virtual bool isNilExp() const
    {
        return false;
    }

    inline virtual bool isCallExp() const
    {
        return false;
    }

    inline virtual bool isCellCallExp() const
    {
        return false;
    }

    inline virtual bool isOpExp() const
    {
        return false;
    }

    inline virtual bool isLogicalOpExp() const
    {
        return false;
    }

    inline virtual bool isAssignExp() const
    {
        return false;
    }

    inline virtual bool isControlExp() const
    {
        return false;
    }

    inline virtual bool isIfExp() const
    {
        return false;
    }

    inline virtual bool isWhileExp() const
    {
        return false;
    }

    inline virtual bool isForExp() const
    {
        return false;
    }

    inline virtual bool isBreakExp() const
    {
        return false;
    }

    inline virtual bool isContinueExp() const
    {
        return false;
    }

    inline virtual bool isTryCatchExp() const
    {
        return false;
    }

    inline virtual bool isSelectExp() const
    {
        return false;
    }

    inline virtual bool isCaseExp() const
    {
        return false;
    }

    inline virtual bool isReturnExp() const
    {
        return false;
    }

    inline virtual bool isFieldExp() const
    {
        return false;
    }

    inline virtual bool isNotExp() const
    {
        return false;
    }

    inline virtual bool isTransposeExp() const
    {
        return false;
    }

    inline virtual bool isMatrixExp() const
    {
        return false;
    }

    inline virtual bool isMatrixLineExp() const
    {
        return false;
    }

    inline virtual bool isCellExp() const
    {
        return false;
    }

    inline virtual bool isSeqExp() const
    {
        return false;
    }

    inline virtual bool isArrayListExp() const
    {
        return false;
    }

    inline virtual bool isAssignListExp() const
    {
        return false;
    }

    inline virtual bool isVarDec() const
    {
        return false;
    }

    inline virtual bool isFunctionDec() const
    {
        return false;
    }

    inline virtual bool isListExp() const
    {
        return false;
    }

    inline virtual bool isOptimizedExp() const
    {
        return false;
    }

    inline virtual bool isMemfillExp() const
    {
        return false;
    }

    inline virtual bool isFastSelectExp() const
    {
        return false;
    }

    inline virtual bool isStringSelectExp() const
    {
        return false;
    }

    inline virtual bool isIntSelectExp() const
    {
        return false;
    }

    inline virtual bool isTableIntSelectExp() const
    {
        return false;
    }

    inline virtual bool isMapIntSelectExp() const
    {
        return false;
    }

    inline virtual bool isSmallIntSelectExp() const
    {
        return false;
    }

    inline Exp* getParent() const
    {
        return parent;
    }

    inline Exp* getParent()
    {
        return parent;
    }

    inline void setParent(Exp* _ast)
    {
        parent = _ast;
    }

    inline Exp* getOriginal() const
    {
        return original;
    }

    inline Exp* getOriginal()
    {
        return original;
    }

    inline void setOriginal(Exp* _ast)
    {
        original = _ast;
    }

    inline void replace(Exp* _new)
    {
        if (parent && _new)
        {
            parent->replace(this, _new);
        }
    }

    inline void replace(Exp* _old, Exp* _new)
    {
        if (_old && _new)
        {
            for (exps_t::iterator it = _exps.begin(), itEnd = _exps.end(); it != itEnd; ++it)
            {
                if (*it == _old)
                {
                    _new->setOriginal(_old);
                    *it = _new;
                    _new->setParent(this);
                    return;
                }
            }
        }
    }

    inline const exps_t & getExps() const
    {
        return _exps;
    }

    inline exps_t & getExps()
    {
        return _exps;
    }


private:
    bool _verbose;
    bool _bBreak;
    bool _bBreakable;
    bool _bReturn;
    bool _bReturnable;
    bool _bContinue;
    bool _bContinuable;
protected:
    exps_t _exps;
    Exp* parent;
    Exp* original;
};
} // namespace ast

#endif // !AST_EXP_HXX