* Bug 15599 fixed: now degree of zero polynomial is -Inf
[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 *
14 */
15
16 #ifndef AST_VISITOR_COMMON_HXX
17 #define AST_VISITOR_COMMON_HXX
18
19
20 #define ENABLE_EXTERNAL_TYPER
21
22 #include "internal.hxx"
23 #include "struct.hxx"
24 #include "list.hxx"
25 #include "exp.hxx"
26 #include "symbol.hxx"
27 #include <list>
28 #include "expHistory.hxx"
29 #include "dynlib_ast.h"
30 #define bsiz    4096
31
32 //void ExpandList(int ** _piList, int *_piListSize, int _iListSizeSize, int *_piResultList);
33
34 types::InternalType* AddElementToVariable(
35     types::InternalType* _poDest,
36     types::InternalType* _poSource,
37     int _iRows, int _iCols);
38
39 types::InternalType* AddElementToVariableFromCol(
40     types::InternalType* _poDest,
41     types::InternalType* _poSource,
42     int _iRows, int _iCols, int *_piCols);
43
44 types::InternalType* AddElementToVariableFromRow(
45     types::InternalType* _poDest,
46     types::InternalType* _poSource,
47     int _iRows, int _iCols, int *_piRows);
48
49 const std::wstring* getStructNameFromExp(const ast::Exp* _pExp);
50
51 bool getFieldsFromExp(ast::Exp* _pExp, std::list<ExpHistory*>& fields);
52
53 types::InternalType* evaluateFields(const ast::Exp* _pExp, std::list<ExpHistory*>& fields, types::InternalType* pIT);
54
55 types::InternalType* callOverload(const ast::Exp& e,
56                                   const std::wstring& _strType,
57                                   types::typed_list* _pArgs,
58                                   types::InternalType* _source,
59                                   types::InternalType* _dest);
60
61 types::InternalType* callOverload(const std::wstring& strType, types::InternalType* _paramL, types::InternalType* _paramR);
62
63 types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs, types::InternalType* _pVar, types::InternalType* _pInsert);
64
65 EXTERN_AST void callOnPrompt(void);
66 EXTERN_AST ast::Exp* callTyper(ast::Exp* _tree, std::wstring _msg = std::wstring(L""));
67
68 void printLine(const std::string& _stPrompt, const std::string& _stLine, bool _bLF);
69 std::string printExp(std::ifstream& _File, ast::Exp* _pExp, const std::string& _stPrompt, int* _piLine /* in/out */, int* _piCol /* in/out */, std::string& _stPreviousBuffer);
70
71
72 #endif //!AST_VISITOR_COMMON_HXX