GPL + CeCILL Header change
[scilab.git] / scilab / modules / ast / includes / ast / visitor_common.hxx
1 /*
2 *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 *  Copyright (C) 2010-2010 - DIGITEO - Antoine ELIAS
4 *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13  * === LICENSE_END ===
14 *
15 */
16
17 #ifndef AST_VISITOR_COMMON_HXX
18 #define AST_VISITOR_COMMON_HXX
19
20
21 #define ENABLE_EXTERNAL_TYPER
22
23 #include "internal.hxx"
24 #include "struct.hxx"
25 #include "list.hxx"
26 #include "exp.hxx"
27 #include "symbol.hxx"
28 #include <list>
29 #include "expHistory.hxx"
30 #include "dynlib_ast.h"
31 #define bsiz    4096
32
33 //void ExpandList(int ** _piList, int *_piListSize, int _iListSizeSize, int *_piResultList);
34
35 types::InternalType* AddElementToVariable(
36     types::InternalType* _poDest,
37     types::InternalType* _poSource,
38     int _iRows, int _iCols);
39
40 types::InternalType* AddElementToVariableFromCol(
41     types::InternalType* _poDest,
42     types::InternalType* _poSource,
43     int _iRows, int _iCols, int *_piCols);
44
45 types::InternalType* AddElementToVariableFromRow(
46     types::InternalType* _poDest,
47     types::InternalType* _poSource,
48     int _iRows, int _iCols, int *_piRows);
49
50 const std::wstring* getStructNameFromExp(const ast::Exp* _pExp);
51
52 bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields);
53
54 types::InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fields, types::InternalType* pIT);
55
56 types::InternalType* callOverload(const ast::Exp& e,
57                                   const std::wstring& _strType,
58                                   types::typed_list* _pArgs,
59                                   types::InternalType* _source,
60                                   types::InternalType* _dest);
61
62 types::InternalType* callOverload(const std::wstring& strType, types::InternalType* _paramL, types::InternalType* _paramR);
63
64 types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs, types::InternalType* _pVar, types::InternalType* _pInsert);
65
66 EXTERN_AST void callOnPrompt(void);
67 EXTERN_AST ast::Exp* callTyper(ast::Exp* _tree, std::wstring _msg = std::wstring(L""));
68
69 void printLine(const std::string& _stPrompt, const std::string& _stLine, bool _bLF);
70 std::string printExp(std::ifstream& _File, ast::Exp* _pExp, const std::string& _stPrompt, int* _piLine /* in/out */, int* _piCol /* in/out */, std::string& _stPreviousBuffer);
71
72
73 #endif //!AST_VISITOR_COMMON_HXX