insertion of GraphicHandle fixed
[scilab.git] / scilab / modules / ast / includes / ast / expHistory.hxx
1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2014 - Scilab Enterpprises - Cedric Delamarre
4  *
5  *  This file must be used under the terms of the CeCILL.
6  *  This source file is licensed as described in the file COPYING, which
7  *  you should have received as part of this distribution.  The terms
8  *  are also available at
9  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10  *
11  */
12
13 #ifndef __EXPHISTORY_HXX__
14 #define __EXPHISTORY_HXX__
15
16 #include <list>
17 #include <vector>
18 #include "types.hxx"
19 #include "ast.hxx"
20 #include "simplevar.hxx"
21
22 class ExpHistory
23 {
24 public :
25     ExpHistory();
26     ExpHistory(ExpHistory*, ast::SimpleVar*);
27     ExpHistory(ExpHistory*, types::typed_list*);
28     ExpHistory(ExpHistory*, ast::SimpleVar*, types::typed_list*, int, bool, types::InternalType*);
29
30     ~ExpHistory();
31
32     // expression "a"
33     void                    setExp(ast::SimpleVar*);
34     ast::SimpleVar*         getExp();
35     std::wstring            getExpAsString();
36
37     // arguments x of a(x)
38     void                    setArgs(types::typed_list*);
39     types::typed_list*      getArgs();
40     int                     getSizeFromArgs();
41     int                     getArgsDims();
42     int*                    getArgsDimsArray();
43     void                    computeArgs();
44     bool                    needResize();
45     void                    setArgsOwner(bool);
46     void                    setExpOwner(bool);
47
48     // current InternalType a
49     bool                    setCurrent(types::InternalType*);
50     types::InternalType*    getCurrent();
51     void                    setDeleteCurrent(bool bDelete); // false by default
52
53     // parent of me
54     ExpHistory*             getParent();
55
56     // use to know if we have to reinsert current in there parent and where
57     void                    setReinsertion(bool bForce = false);
58     void                    resetReinsertion();
59     bool                    reinsertMe();
60     int                     getWhereReinsert();
61     void                    setWhereReinsert(int);
62
63     // use to know where we are in expression
64     void                    setLevel(int);
65     int                     getLevel();
66
67     // management of expression a(x) or a{x}
68     void                    setCellExp();
69     bool                    isCellExp();
70
71 private :
72
73     void                    initHistory();
74
75     types::typed_list*      m_pArgs;
76     int*                    m_piArgsDimsArray;
77     ast::SimpleVar*         m_pExp;
78     ExpHistory*             m_pParent;
79     types::InternalType*    m_pITCurrent;
80     bool                    m_bReinsertMe;
81     bool                    m_bCellExp;
82     int                     m_iArgsDims;
83     int                     m_iWhere;
84     int                     m_iLevel;
85     bool                    m_pArgsOwner;
86     bool                    m_pExpOwner;
87     bool                    m_bDeleteCurrent;
88
89 };
90
91 #endif /* __EXPHISTORY_HXX__ */