}
}
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), _iComplex ? "allocComplexMatrixOfDouble" : "allocMatrixOfDouble", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), _iComplex ? "allocComplexMatrixOfDouble" : "allocMatrixOfDouble", ie.GetErrorMessage().c_str());
return sciErr;
}
return sciErr;
}
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createNamedList", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createNamedList", ie.GetErrorMessage().c_str());
return sciErr;
}
return sciErr;
}
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createList", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createList", ie.GetErrorMessage().c_str());
return sciErr;
}
return sciErr;
}
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, ie.GetErrorMessage().c_str());
return sciErr;
}
{
pDbl = new Double(_iRows, _iCols, _iComplex == 1);
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), _iComplex ? "allocComplexMatrixOfDoubleInList" : "allocMatrixOfDoubleInList", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), _iComplex ? "allocComplexMatrixOfDoubleInList" : "allocMatrixOfDoubleInList", ie.GetErrorMessage().c_str());
return sciErr;
}
{
pS = new String(_iRows, _iCols);
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, ie.GetErrorMessage().c_str());
return sciErr;
}
{
pBool = new Bool(_iRows, _iCols);
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "allocMatrixOfBooleanInList", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "allocMatrixOfBooleanInList", ie.GetErrorMessage().c_str());
return sciErr;
}
break;
}
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "allocMatrixOfIntegerInList", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "allocMatrixOfIntegerInList", ie.GetErrorMessage().c_str());
return sciErr;
}
{
pSparse = new Sparse(_iRows, _iCols, _iComplex == 1);
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, ie.GetErrorMessage().c_str());
return sciErr;
}
{
pSparse = new SparseBool(_iRows, _iCols);
}
- catch (const ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), funcName, ie.GetErrorMessage().c_str());
return sciErr;
}
return sciErr;
}
}
- catch (ast::ScilabError se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createPointerInList", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createPointerInList", ie.GetErrorMessage().c_str());
return sciErr;
}
#include "gatewaystruct.hxx"
#include "pointer.hxx"
#include "context.hxx"
-#include "scilabexception.hxx"
extern "C"
{
return sciErr;
}
}
- catch (ast::ScilabError se)
+ catch (const ast::InternalError& ie)
{
- addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createPointer", se.GetErrorMessage().c_str());
+ addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: %ls"), "createPointer", ie.GetErrorMessage().c_str());
return sciErr;
}
FREE(strErr);
std::wstring wstError(pwstError);
FREE(pwstError);
- throw ScilabError(wstError, 999, e.getLocation());
+ throw InternalError(wstError, 999, e.getLocation());
//Err, SimpleVar doesn't exist in Scilab scopes.
}
}
//restore previous prompt mode
ConfigVariable::setSilentError(oldVal);
}
- catch (ScilabMessage sm)
+ catch (const InternalError& /* ie */)
{
//restore previous prompt mode
ConfigVariable::setSilentError(oldVal);
e.getInit().accept(*this);
getResult()->IncreaseRef();
}
- catch (ScilabError error)
+ catch (const InternalError& error)
{
throw error;
}
#include <stdexcept>
#include "location.hxx"
#include "localization.hxx"
+//#include "configvariable.hxx"
extern "C"
{
namespace ast
{
+
+enum ExceptionType
+{
+ TYPE_ERROR,
+ TYPE_EXCEPTION
+};
+
class ScilabException : public std::exception
{
public :
- ScilabException()
- {
- createScilabException(L"", 0, Location());
- }
+ ScilabException() {}
- ScilabException(std::wstring _wstErrorMesssage)
+ ScilabException(const std::wstring& _wstErrorMesssage)
{
- setLastError(999, _wstErrorMesssage.c_str(), 0, NULL);
- createScilabException(_wstErrorMesssage, 0, Location());
+ m_type = TYPE_EXCEPTION;
+ createScilabException(_wstErrorMesssage, 999, Location());
}
- ScilabException(std::string _stErrorMesssage)
+ ScilabException(const std::string& _stErrorMesssage)
{
+ m_type = TYPE_EXCEPTION;
wchar_t* pwst = to_wide_string(_stErrorMesssage.c_str());
- setLastError(999, pwst, 0, NULL);
- createScilabException(pwst, 0, Location());
+ createScilabException(pwst, 999, Location());
FREE(pwst);
}
- ScilabException(const Location& _ErrorLocation)
- {
- createScilabException(L"", 0, _ErrorLocation);
- }
- ScilabException(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation)
+ ScilabException(const std::wstring& _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation)
{
- setLastError(_iErrorNumber, _wstErrorMesssage.c_str(), _ErrorLocation.first_line, NULL);
+ m_type = TYPE_EXCEPTION;
createScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation);
}
virtual ~ScilabException() throw() {};
- void SetErrorMessage(std::wstring _wstErrorMesssage)
+ void SetErrorMessage(const std::wstring& _wstErrorMesssage)
{
m_wstErrorMessage = _wstErrorMesssage;
}
{
return m_ErrorLocation;
}
+
+ void SetErrorType(ExceptionType _type)
+ {
+ m_type = _type;
+ }
+
+ ExceptionType GetErrorType(void)
+ {
+ return m_type;
+ }
+
protected :
std::wstring m_wstErrorMessage;
-
int m_iErrorNumber;
Location m_ErrorLocation;
+ ExceptionType m_type;
protected :
- void createScilabException(std::wstring _wstErrorMessage, int _iErrorNumber, const Location& _ErrorLocation)
+ void createScilabException(const std::wstring& _wstErrorMessage, int _iErrorNumber, const Location& _ErrorLocation)
{
m_wstErrorMessage = _wstErrorMessage;
m_iErrorNumber = _iErrorNumber;
}
};
-class ScilabError : public ScilabException
-{
-public :
- ScilabError() : ScilabException() {}
- ScilabError(std::wstring _wstErrorMesssage) : ScilabException(_wstErrorMesssage) {}
- ScilabError(std::string _stErrorMesssage) : ScilabException(_stErrorMesssage) {}
- ScilabError(const Location& _ErrorLocation) : ScilabException(_ErrorLocation) {}
- ScilabError(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation) : ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation) {}
-};
-
-class InternalAbort : public ScilabException
+class InternalError : public ScilabException
{
public :
- InternalAbort() {}
-};
-
-class ScilabMessage : public ScilabException
-{
-public :
- ScilabMessage() : ScilabException() {}
- ScilabMessage(std::wstring _wstErrorMesssage)
+ InternalError(std::wstring _wstErrorMesssage) : ScilabException(_wstErrorMesssage)
{
- createScilabException(_wstErrorMesssage, 0, Location());
+ m_type = TYPE_ERROR;
+ // check on error number because error message can be empty.
+ if (getLastErrorNumber() == 0)
+ {
+ setLastError(999, _wstErrorMesssage.c_str(), 0, NULL);
+ }
}
- ScilabMessage(std::string _stErrorMesssage)
+ InternalError(std::string _stErrorMesssage) : ScilabException(_stErrorMesssage)
{
-
- wchar_t* pwst = to_wide_string(_stErrorMesssage.c_str());
- createScilabException(pwst, 0, Location());
- FREE(pwst);
+ m_type = TYPE_ERROR;
+ // check on error number because error message can be empty.
+ if (getLastErrorNumber() == 0)
+ {
+ setLastError(999, m_wstErrorMessage.c_str(), 0, NULL);
+ }
}
- ScilabMessage(const Location& _ErrorLocation) : ScilabException(_ErrorLocation) {}
- ScilabMessage(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation)
+ InternalError(std::wstring _wstErrorMesssage, int _iErrorNumber, const Location& _ErrorLocation) : ScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation)
{
- createScilabException(_wstErrorMesssage, _iErrorNumber, _ErrorLocation);
+ m_type = TYPE_ERROR;
+ // check on error number because error message can be empty.
+ if (getLastErrorNumber() == 0)
+ {
+ setLastError(_iErrorNumber, _wstErrorMesssage.c_str(), _ErrorLocation.first_line, NULL);
+ }
}
};
+
+class InternalAbort : public ScilabException
+{
+public :
+ InternalAbort() {}
+};
}
#endif // !AST_SCILABEXCEPTION_HXX
types::InternalType* callOverload(std::wstring strType, types::InternalType* _paramL, types::InternalType* _paramR);
-
-types::List* getPropertyTree(ast::Exp* e, types::List* pList);
-
types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs, types::InternalType* _pVar, types::InternalType* _pInsert);
EXTERN_AST void callOnPrompt(void);
/** \brief Construct a Location. */
Location (void)
{
- first_line = last_line = 1;
- first_column = last_column = 1;
+ first_line = last_line = 0;
+ first_column = last_column = 0;
}
/** \} */
{
char message[bsiz];
os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double) ((double) m_iSize * (double) m_piDims[i] * sizeof(T)) / 1.e6);
- throw (ast::ScilabError(message));
+ throw ast::InternalError(message);
}
m_iSize = iTmpSize;
m_pImgData = NULL;
char message[bsiz];
os_sprintf(message, _("Can not allocate negative size (%d).\n"), m_iSize);
- ast::ScilabError se(message);
- se.SetErrorNumber(999);
- throw (se);
+ throw ast::InternalError(message);
}
}
{
char message[bsiz];
os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double)(m_iSize * sizeof(T)) / 1.e6);
- ast::ScilabError se(message);
- se.SetErrorNumber(999);
- throw (se);
+ throw ast::InternalError(message);
}
m_iSizeMax = m_iSize;
{
std::wostringstream os;
os << _W("Invalid index.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
out.push_back(_out);
}
#pragma warning (disable : 4251)
#endif
-#include <vector>
+#include <list>
#include <string>
-
-#include "internal.hxx"
+#include "dynlib_ast.h"
namespace types
{
+class InternalType;
+
#ifndef NDEBUG
class EXTERN_AST Inspector
{
#include "visitor.hxx" // for invoke
#include "callexp.hxx"
#include "localization.hxx"
-#include "scilabexception.hxx"
-
+#ifndef NDEBUG
+#include "inspector.hxx"
+#endif
#define bsiz 4096
{
std::wostringstream os;
os << _W("Invalid index.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
out.push_back(_out);
}
{
std::wostringstream os;
os << _W("Invalid index.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
out.push_back(_out);
}
// _iRetCount : is the number of output arguments (ie : [a,b] = myUserType(...), _iRetCount = 2)
// out : after "invoke" execution, will contain results
// execFunc : is used in case of macro call : Overload::call(L"A_Macro", in, _iRetCount, out, execFunc);
- // e : Generally used to return the Location when thowing an error. ie : throw ast::ScilabError(L"error message", 999, e.getLocation());
+ // e : Generally used to return the Location when thowing an error. ie : throw ast::InternalError(L"error message", 999, e.getLocation());
// Outputs :
// if false, Scilab will call the macro %UserType_e,where UserType is the string return by the method getShortTypeStr()
// if true, Scilab will set each elements of out in Scilab variables
std::wostringstream os;
os << _W("Can not assign multiple value in a single variable") << std::endl;
//os << ((Location)e.getRightExp().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
pIT = getResult();
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, e.getLeftExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLeftExp().getLocation());
}
}
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, e.getLeftExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLeftExp().getLocation());
}
}
// if the right hand is NULL.
std::wostringstream os;
os << _W("Unable to extract right part expression.\n");
- throw ast::ScilabError(os.str(), 999, e.getLeftExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLeftExp().getLocation());
}
std::list<ExpHistory*> fields;
}
std::wostringstream os;
os << _W("Get fields from expression failed.");
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
try
{
pOut = evaluateFields(pCell, fields, pITR);
}
- catch (ast::ScilabError error)
+ catch (const InternalError& error)
{
// catch error when call overload
for (std::list<ExpHistory*>::const_iterator i = fields.begin(), end = fields.end(); i != end; i++)
{
std::wostringstream os;
os << _W("Fields evaluation failed.");
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
if (pOut != NULL)
//manage error
std::wostringstream os;
os << _W("Invalid Index.\n");
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
return;
// if the right hand is NULL.
std::wostringstream os;
os << _W("Unable to extract right part expression.\n");
- throw ast::ScilabError(os.str(), 999, e.getLeftExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLeftExp().getLocation());
}
bool alreadyProcessed = false;
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, pCall->getLocation());
+ throw ast::InternalError(os.str(), 999, pCall->getLocation());
}
// prevent delete after extractFullMatrix
{
std::wostringstream os;
os << _W("Submatrix incorrectly defined.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
std::wostringstream os;
os << _W("Instruction left hand side: waiting for a name.");
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
// prevent delete after extractFullMatrix
{
pOut = evaluateFields(pCall, fields, pITR);
}
- catch (ast::ScilabError error)
+ catch (const InternalError& error)
{
// catch error when call overload
for (std::list<ExpHistory*>::const_iterator i = fields.begin(), end = fields.end(); i != end; i++)
{
std::wostringstream os;
os << _W("Fields evaluation failed.");
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
}
std::wostringstream os;
os << _W("Incompatible assignation: trying to assign ") << exec.getResultSize();
os << _W(" values in ") << iLhsCount << _W(" variables.") << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
exps_t::const_reverse_iterator it;
}
std::wostringstream os;
os << _W("Get fields from expression failed.");
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
try
}
std::wostringstream os;
os << _W("Fields evaluation failed.");
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
}
- catch (ScilabError error)
+ catch (const InternalError& error)
{
for (auto i : fields)
{
std::wostringstream os;
os << _W("unknow script form");
//os << ((Location)e.getRightExp().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRightExp().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRightExp().getLocation());
}
- catch (ast::ScilabError error)
+ catch (const InternalError& error)
{
throw error;
}
clearResult();
std::wostringstream os;
os << _W("Wrong number of output arguments.\n") << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
//get function arguments
std::wostringstream os;
os << _W("left side of optional parameter must be a variable") << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
SimpleVar* pVar = pL->getAs<SimpleVar>();
std::wostringstream os;
os << _W("Invalid index.\n");
- throw ast::ScilabError(os.str(), 999, e.getFirstLocation());
+ throw ast::InternalError(os.str(), 999, e.getFirstLocation());
}
}
else
{
std::wostringstream os;
os << _W("bad lhs, expected : ") << iRetCount << _W(" returned : ") << out.size() << std::endl;
- throw ScilabError(os.str(), 999, e.getLocation());
+ throw InternalError(os.str(), 999, e.getLocation());
}
setExpectedSize(iSaveExpectedSize);
{
std::wostringstream os;
os << _W("Invalid index.\n");
- throw ast::ScilabError(os.str(), 999, e.getFirstLocation());
+ throw ast::InternalError(os.str(), 999, e.getFirstLocation());
}
}
pListArg->killMe();
}
}
- catch (ScilabMessage & sm)
- {
- setExpectedSize(iSaveExpectedSize);
- if(pIT != getResult())
- {
- pIT->killMe();
- }
-
- clearResult();
- cleanInOut(in, out);
- cleanOpt(opt);
-
- if (pIT->isCallable())
- {
- Callable *pCall = pIT->getAs<Callable>();
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(pCall->getName());
- }
- }
-
- throw sm;
- }
catch (InternalAbort & ia)
{
setExpectedSize(iSaveExpectedSize);
throw ia;
}
- catch (ScilabError & se)
+ catch (const InternalError& ie)
{
setExpectedSize(iSaveExpectedSize);
if(pIT != getResult())
cleanInOut(in, out);
cleanOpt(opt);
- throw se;
+ throw ie;
}
}
}
if (pIT->isCell() == false)
{
- throw ast::ScilabError(_W("[error] Cell contents reference from a non-cell array object.\n"), 999, e.getFirstLocation());
+ throw ast::InternalError(_W("[error] Cell contents reference from a non-cell array object.\n"), 999, e.getFirstLocation());
}
//Create list of indexes
ast::exps_t exps = e.getArgs();
std::wostringstream os;
os << _W("inconsistent row/column dimensions\n");
//os << ((*e.args_get().begin())->getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getFirstLocation());
+ throw ast::InternalError(os.str(), 999, e.getFirstLocation());
}
if (pList->getSize() == 1)
{
(*col)->accept(*this);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
if (poRow)
{
{
poRow = callOverloadMatrixExp(L"c", poRow, pIT);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
if (poResult)
{
pIT->killMe();
std::wostringstream os;
os << _W("unable to concatenate\n");
- throw ast::ScilabError(os.str(), 999, (*col)->getLocation());
+ throw ast::InternalError(os.str(), 999, (*col)->getLocation());
}
GenericType* pGT = pIT->getAs<GenericType>();
{
poRow = callOverloadMatrixExp(L"c", poRow, pGT);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
if (poResult)
{
}
std::wostringstream os;
os << _W("inconsistent row/column dimensions\n");
- throw ast::ScilabError(os.str(), 999, (*row)->getLocation());
+ throw ast::InternalError(os.str(), 999, (*row)->getLocation());
}
// if we concatenate [Double Sparse], transform the Double to Sparse and perform [Sparse Sparse]
{
poRow = callOverloadMatrixExp(L"c", pGTResult, pGT);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
if (poResult)
{
{
poResult = callOverloadMatrixExp(L"f", poResult, poRow);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
throw error;
}
{
poResult = callOverloadMatrixExp(L"f", pGTResult, pGT);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
throw error;
}
{
poResult = callOverloadMatrixExp(L"f", pGTResult, pGT);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
throw error;
}
}
std::wostringstream os;
os << _W("inconsistent row/column dimensions\n");
- throw ast::ScilabError(os.str(), 999, (*e.getLines().begin())->getLocation());
+ throw ast::InternalError(os.str(), 999, (*e.getLines().begin())->getLocation());
}
// if we concatenate [Double Sparse], transform the Double to Sparse and perform [Sparse Sparse]
{
poResult = callOverloadMatrixExp(L"f", pGTResult, pGT);
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
throw error;
}
setResult(Double::Empty());
}
}
- catch (ast::ScilabError& error)
+ catch (const InternalError& error)
{
setResult(NULL);
throw error;
Ret = Overload::call(L"%" + _paramL->getAs<List>()->getShortTypeStr() + L"_" + strType + L"_" + _paramR->getAs<List>()->getShortTypeStr(), in, 1, out, this, true);
}
}
- catch (ast::ScilabError error)
+ catch (const InternalError& error)
{
cleanInOut(in, out);
throw error;
}
- catch (ast::ScilabMessage msg)
- {
- cleanInOut(in, out);
- throw ScilabError(msg.GetErrorMessage(), msg.GetErrorNumber(), msg.GetErrorLocation());
- }
if (Ret != Callable::OK)
{
cleanInOut(in, out);
- throw ScilabError();
+ throw InternalError(ConfigVariable::getLastErrorMessage());
}
cleanIn(in, out);
std::wostringstream os;
os << _W("Incompatible output argument.\n");
//os << ((Location)e.right_get().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRight().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
}
pITL = getResult();
std::wostringstream os;
os << _W("Incompatible output argument.\n");
//os << ((Location)e.right_get().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRight().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
}
pITR = getResult();
pITR->killMe();
}
}
- catch (ast::ScilabError & error)
+ catch (ast::InternalError& error)
{
setResult(NULL);
if (pResult)
std::wostringstream os;
os << _W("Incompatible output argument.\n");
//os << ((Location)e.right_get().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRight().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
}
setResult(NULL);
std::wostringstream os;
os << _W("Incompatible output argument.\n");
//os << ((Location)e.right_get().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRight().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
}
if (pITR->getType() == GenericType::ScilabImplicitList)
std::wostringstream os;
os << _W("Incompatible output argument.\n");
//os << ((Location)e.right_get().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getRight().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getRight().getLocation());
}
if (pITR->getType() == GenericType::ScilabImplicitList)
// unprotect pResult
pResult->DecreaseRef();
}
- catch (ast::ScilabError error)
+ catch (ast::InternalError& error)
{
clearResult();
error.SetErrorLocation(e.getLocation());
{
Overload::generateNameAndCall(Overload::getNameFromOper(_oper), in, 1, out, this, true);
}
- catch (ast::ScilabError e)
+ catch (const ast::InternalError& e)
{
_paramR->DecreaseRef();
throw e;
{
Overload::generateNameAndCall(Overload::getNameFromOper(_oper), in, 1, out, this, true);
}
- catch (ast::ScilabError e)
+ catch (const ast::InternalError& e)
{
_paramL->DecreaseRef();
_paramR->DecreaseRef();
std::wostringstream os;
os << _W("inconsistent row/column dimensions\n");
//os << ((Location)(*row)->getLocation()).getLocationString() << std::endl;
- throw ScilabError(os.str(), 999, (*row)->getLocation());
+ throw InternalError(os.str(), 999, (*row)->getLocation());
}
}
{
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("/!\\ Unmanaged FieldExp.\n").c_str());
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
try
{
e.getHead()->accept(*this);
}
- catch (const ScilabError& error)
+ catch (const InternalError& error)
{
throw error;
}
{
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("Attempt to reference field of non-structure array.\n").c_str());
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
// TODO: handle case where getSize() > 1
clearResult();
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("Not yet implemented in Scilab.\n").c_str());
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
SimpleVar * psvRightMember = static_cast<SimpleVar *>(const_cast<Exp *>(e.getTail()));
catch (std::wstring & err)
{
pValue->killMe();
- throw ScilabError(err.c_str(), 999, e.getTail()->getLocation());
+ throw InternalError(err.c_str(), 999, e.getTail()->getLocation());
}
if (ok)
{
std::wostringstream os;
os << _W("Invalid index.\n");
- throw ScilabError(os.str(), 999, e.getLocation());
+ throw InternalError(os.str(), 999, e.getLocation());
}
setResult(pReturn);
{
Ret = Overload::call(L"%" + stType + L"_e", in, 1, out, this);
}
- catch (ast::ScilabError & se)
+ catch (const InternalError& ie)
{
try
{
}
else
{
- throw se;
+ throw ie;
}
}
- catch (ast::ScilabError & se)
+ catch (const InternalError& ie)
{
// TList or Mlist
if (pValue->isList())
}
else
{
- throw se;
+ throw ie;
}
}
}
{
cleanInOut(in, out);
setResult(NULL);
- throw ScilabError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
+ throw InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
setResult(out);
pValue->killMe();
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("Attempt to reference field of non-structure array.\n").c_str());
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
}
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, e.getVardec().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getVardec().getLocation());
}
ctx->put(var, pIL);
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, e.getVardec().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getVardec().getLocation());
}
ctx->put(var, pIL);
{
e.getBody().accept(*this);
}
- catch (ScilabMessage& sm)
+ catch (const InternalError& ie)
{
//unlock loop index and implicit list
pIL->DecreaseRef();
pIT->killMe();
setResult(NULL);
- throw sm;
+ throw ie;
}
if (e.getBody().isBreak())
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, e.getVardec().getLocation());
+ throw ast::InternalError(os.str(), 999, e.getVardec().getLocation());
}
ctx->put(var, pNew);
{
e.getBody().accept(*this);
}
- catch (ScilabMessage& sm)
+ catch (const InternalError& ie)
{
//implicit list
pIT->DecreaseRef();
pIT->killMe();
setResult(NULL);
- throw sm;
+ throw ie;
}
if (e.getBody().isBreak())
{
pIT->DecreaseRef();
pIT->killMe();
- throw ScilabError(_W("for expression can only manage 1 or 2 dimensions variables\n"), 999, e.getVardec().getLocation());
+ throw InternalError(_W("for expression can only manage 1 or 2 dimensions variables\n"), 999, e.getVardec().getLocation());
}
symbol::Variable* var = e.getVardec().getAs<VarDec>()->getStack();
{
pIT->DecreaseRef();
pIT->killMe();
- throw ScilabError(_W("for expression : Wrong type for loop iterator.\n"), 999, e.getVardec().getLocation());
+ throw InternalError(_W("for expression : Wrong type for loop iterator.\n"), 999, e.getVardec().getLocation());
}
if (ctx->isprotected(var))
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, e.getVardec().getLocation());
+ throw InternalError(os.str(), 999, e.getVardec().getLocation());
}
ctx->put(var, pNew);
{
e.getBody().accept(*this);
}
- catch (ScilabMessage& sm)
+ catch (const InternalError& ie)
{
//implicit list
pIT->DecreaseRef();
pIT->killMe();
setResult(NULL);
- throw sm;
+ throw ie;
}
if (e.getBody().isBreak())
{
pIT->DecreaseRef();
pIT->killMe();
- throw ScilabError(_W("for expression : Wrong type for loop iterator.\n"), 999, e.getVardec().getLocation());
+ throw InternalError(_W("for expression : Wrong type for loop iterator.\n"), 999, e.getVardec().getLocation());
}
pIT->DecreaseRef();
// //the good one
// body->accept(*this);
// }
- // catch (ScilabMessage& sm)
+ // catch (const InternalError& ie)
// {
// pIT->killMe();
- // throw sm;
+ // throw ie;
// }
// if (e.isBreakable() && body->isBreak())
//the good one
body->accept(*this);
}
- catch (ScilabMessage& sm)
+ catch (const InternalError& ie)
{
pIT->killMe();
- throw sm;
+ throw ie;
}
if (e.isBreakable() && body->isBreak())
//the good one
pCase->getBody()->accept(*this);
}
- catch (ScilabMessage& sm)
+ catch (const InternalError& ie)
{
pIT->DecreaseRef();
pIT->killMe();
- throw sm;
+ throw ie;
}
if (e.isBreakable() && pCase->getBody()->isBreak())
//default case
e.getDefaultCase()->accept(*this);
}
- catch (ScilabMessage& sm)
+ catch (const InternalError& ie)
{
if (pIT)
{
pIT->DecreaseRef();
pIT->killMe();
}
- throw sm;
+ throw ie;
}
if (e.isBreakable() && e.getDefaultCase()->isBreak())
bImplicitCall = true;
}
- catch (ScilabMessage& sm)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(pCall->getName());
- }
-
- throw sm;
- }
- catch (ast::ScilabError & se)
+ catch (const InternalError& ie)
{
if (ConfigVariable::getLastErrorFunction() == L"")
{
ConfigVariable::setLastErrorLine(e.getLocation().first_line);
}
- throw se;
+ throw ie;
}
}
break;
}
}
- catch (ScilabMessage& sm)
+ catch (const InternalError& ie)
{
- ConfigVariable::fillWhereError(sm.GetErrorLocation().first_line);
- throw sm;
- }
- catch (const ScilabError& se)
- {
- // check on error number because error message can be empty.
- if (ConfigVariable::getLastErrorNumber() == 0)
- {
- ConfigVariable::setLastErrorMessage(se.GetErrorMessage());
- ConfigVariable::setLastErrorNumber(se.GetErrorNumber());
- ConfigVariable::setLastErrorLine(se.GetErrorLocation().first_line);
- ConfigVariable::setLastErrorFunction(wstring(L""));
- }
-
- ConfigVariable::fillWhereError(se.GetErrorLocation().first_line);
- throw ScilabMessage(se.GetErrorMessage(), se.GetErrorNumber(), se.GetErrorLocation());
+ ConfigVariable::fillWhereError(ie.GetErrorLocation().first_line);
+ throw ie;
}
// If something other than NULL is given to setResult, then that would imply
if (Ret != Callable::OK)
{
cleanInOut(in, out);
- throw ScilabError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
+ throw InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
setResult(out);
clearResult();
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%ls: Can not transpose multiple elements.\n").c_str(), L"Transpose");
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
InternalType * pValue = getResult();
if (Ret != Callable::OK)
{
cleanInOut(in, out);
- throw ScilabError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
+ throw InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
setResult(out);
FREE(pstFuncName);
FREE(pwstError);
delete pMacro;
- throw ScilabError(wstError, 999, e.getLocation());
+ throw InternalError(wstError, 999, e.getLocation());
}
delete pMacro;
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ScilabError(os.str(), 999, e.getLocation());
+ throw InternalError(os.str(), 999, e.getLocation());
}
ctx->addMacro(pMacro);
pITStart->killMe();
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%ls: Wrong type for argument %d: Real scalar expected.\n").c_str(), L"':'", 1);
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
InternalType * piStart = pITStart;
pITStep->killMe();
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%ls: Wrong type for argument %d: Real scalar expected.\n").c_str(), L"':'", 2);
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
InternalType* piStep = pITStep;
pITEnd->killMe();
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%ls: Wrong type for argument %d: Real scalar expected.\n").c_str(), L"':'", 3);
- throw ScilabError(szError, 999, e.getLocation());
+ throw InternalError(szError, 999, e.getLocation());
}
InternalType* piEnd = pITEnd;
Ret = Overload::call(L"%" + piStart->getShortTypeStr() + L"_b_" + piEnd->getShortTypeStr(), in, 1, out, this, true);
}
}
- catch (ScilabError& error)
+ catch (const InternalError& error)
{
cleanInOut(in, out);
throw error;
}
- catch (ast::ScilabMessage msg)
- {
- cleanInOut(in, out);
- throw msg;
- }
if (Ret != Callable::OK)
{
cleanInOut(in, out);
- throw ScilabError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
+ throw InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
setResult(out);
std::wostringstream os;
os << _W("Unknow expression");
//os << ((Location)e.getRightExp().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
return NULL;
}
if ((_dest && _dest->isTList() && pFunc == NULL) == false || _source->isListDelete())
{
bool bThrow = false;
- ast::ScilabError se;
+ const ast::InternalError* ie;
ast::ExecVisitor exec;
try
{
ret = Overload::call(function_name, in, 1, out, &exec);
}
- catch (ast::ScilabError error)
+ catch (const ast::InternalError& error)
{
bThrow = true;
- se = error;
+ ie = &error;
}
// unprotect variables
{
if (bThrow)
{
- throw se;
+ throw *ie;
}
//manage error
std::wostringstream os;
os << _W("Error in overload function: ") << function_name << std::endl;
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
}
{
std::wostringstream os;
os << _W("Redefining permanent variable.\n");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
InternalType* pIT = ctx->getCurrentLevel(pFirstField->getExp()->getSymbol());
{
std::wostringstream os;
os << _W("Unexpected redefinition of Scilab function or variable.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
if (pFirstField->isCellExp())
{
std::wostringstream os;
os << _W("Wrong insertion : use extraction with {} only on a Cell.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
if (pITCurrent->isStruct())
{
std::wostringstream os;
os << _W("Invalid index.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
// resize current struct
{
std::wostringstream os;
os << _W("Unable to insert multiple item in a Struct.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
// extract field x and append it to elements for next recursion.
pList->killMe();
std::wostringstream os;
os << _W("Unable to insert multiple item in a List.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
double* pdblArgs = (*pArgs)[0]->getAs<Double>()->get();
{
std::wostringstream os;
os << _W("Wrong insertion.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
// // pITCurrent is an extraction of other Type
// for (int iLoop = 0; iLoop < pL->getSize(); iLoop++)
{
std::wostringstream os;
os << _W("Invalid index.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
// resize current Cell
{
std::wostringstream os;
os << _W("Invalid index.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
// resize current Cell
// only a(x)
std::wostringstream os;
os << _W("Wrong insertion in a Cell.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
}
}
{
std::wostringstream os;
os << _W("Wrong insertion in a Cell.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
}
else if (pITCurrent->isUserType()) // not a Scilab defined datatype, access field after field
{
std::wostringstream os;
os << _W("Wrong insertion : function or macro are not expected.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
else
{
{
std::wostringstream os;
os << _W("evaluateFields : Cannot insert without arguments.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
if (pEH->isCellExp())
{
std::wostringstream os;
os << _W("Wrong insertion in a Cell.");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
pCell->insertCell(pArgs, _pAssignValue);
{
std::wostringstream os;
os << _W("Submatrix incorrectly defined.\n");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
if (pEH->setCurrent(pIT))
{
std::wostringstream os;
os << _W("Submatrix incorrectly defined.\n");
- throw ast::ScilabError(os.str(), 999, _pExp->getLocation());
+ throw ast::InternalError(os.str(), 999, _pExp->getLocation());
}
if (pEHParent->setCurrent(pIT))
return ctx->getCurrentLevel(pFirstField->getExp()->getSymbol());
}
- catch (ast::ScilabError error)
+ catch (const ast::InternalError error)
{
for (std::list<ExpHistory*>::reverse_iterator i = workFields.rbegin(); i != workFields.rend(); ++i)
{
//manage error
std::wostringstream os;
os << _W("Invalid Index.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
pStr->addField(pS->get(0));
//manage error
std::wostringstream os;
os << _W("Invalid Index.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
if (_pInsert->isListDelete())
//manage error
std::wostringstream os;
os << _W("Invalid Index.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
if (_pInsert->isListDelete())
}
else
{
- throw ast::ScilabMessage();
+ throw ast::InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
}
}
//manage error
std::wostringstream os;
os << _W("Wrong insertion: A Cell expected: use {...} instead of (...).\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
}
else
}
}
-List* getPropertyTree(ast::Exp* e, List* pList)
-{
-
- //a.b
- ast::SimpleVar* pVar = dynamic_cast<ast::SimpleVar*>(e);
- if (pVar)
- {
- pList->append(new String(pVar->getSymbol().getName().c_str()));
- return pList;
- }
-
- //a(x).b
- ast::CallExp* pCall = dynamic_cast<ast::CallExp*>(e);
- if (pCall)
- {
- pList = getPropertyTree(&pCall->getName(), pList);
- ast::ExecVisitor exec;
- ast::exps_t exps = pCall->getArgs();
- for (auto exp : exps)
- {
- try
- {
- exp->accept(exec);
- pList->append(exec.getResult());
- exec.clearResult();
- }
- catch (ast::ScilabException e)
- {
- throw e;
- }
- }
- return pList;
- }
-
- //a.b.c
- ast::FieldExp* pField = dynamic_cast<ast::FieldExp*>(e);
- if (pField)
- {
- pList = getPropertyTree(pField->getHead(), pList);
- pList = getPropertyTree(pField->getTail(), pList);
- return pList;
- }
-
- return pList;
-}
-
ast::Exp* callTyper(ast::Exp* _tree, std::wstring _msg)
{
ast::Exp* newTree = NULL;
#include "operations.hxx"
#include "double.hxx"
#include "int.hxx"
-#include "scilabexception.hxx"
extern "C"
{
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
std::wostringstream os;
os << _W("variables don't have the same formal variable");
//os << ((Location)e.right_get().getLocation()).getLocationString() << std::endl;
- throw ast::ScilabError(os.str());
+ throw ast::InternalError(os.str());
}
if (_pR->isIdentity())
{
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
int* piDims1 = _pL->getDimsArray();
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
}
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
int* piDims1 = _pR->getDimsArray();
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
}
if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
//dimensions not match
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
if (_pL->nonZeros() == 0)
}
else
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return _pL->newLogicalAnd(*_pR);
/* check dimension*/
if (_pL->getDims() != _pR->getDims())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
#include "sparse.hxx"
#include "int.hxx"
-#include "scilabexception.hxx"
-
extern "C"
{
#include "localization.h"
int iResult = DoubleLessDouble(pL, pR, (Bool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = SparseLessSparse(pL, pR, (SparseBool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = DoubleLessSparse(pL, pR, (SparseBool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = SparseLessDouble(pL, pR, (SparseBool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = IntLessInt(_pLeftOperand, _pRightOperand, (GenericType**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = DoubleLessEqualDouble(pL, pR, (Bool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = SparseLessEqualSparse(pL, pR, (SparseBool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = DoubleLessEqualSparse(pL, pR, (SparseBool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = SparseLessEqualDouble(pL, pR, (SparseBool**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = IntLessEqualInt(_pLeftOperand, _pRightOperand, (GenericType**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
/* check dimension*/
if (_pL->getDims() != _pR->getDims())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
#include "types_divide.hxx"
#include "types_finite.hxx"
-#include "scilabexception.hxx"
-
extern "C"
{
#include "matrix_right_division.h"
switch (iResult)
{
case 1 :
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
case 2 :
- throw ast::ScilabError(_W("With NaN or Inf a division by scalar expected.\n"));
+ throw ast::InternalError(_W("With NaN or Inf a division by scalar expected.\n"));
case 3 :
- throw ast::ScilabError(_W("Division by zero...\n"));
+ throw ast::InternalError(_W("Division by zero...\n"));
case 4 :
if (getWarningMode())
{
sciprint(_("Warning : Division by zero...\n"));
}
break;
- // default : throw ast::ScilabError(_W("Operator / : Error %d not yet managed.\n"), iResult);
+ // default : throw ast::InternalError(_W("Operator / : Error %d not yet managed.\n"), iResult);
default :
sciprint(_("Operator / : Error %d not yet managed.\n"), iResult);
}
delete[] pDbl;
delete[] pDblSp;
- throw ast::ScilabError(_W("Invalid exponent.\n"));
+ throw ast::InternalError(_W("Invalid exponent.\n"));
return 1;
}
*/
#include "types_dotdivide.hxx"
-#include "scilabexception.hxx"
#include "double.hxx"
#include "int.hxx"
#include "sparse.hxx"
if (ConfigVariable::getIeee() == 0)
{
pResult->killMe();
- throw ast::ScilabError(_("Division by zero...\n"));
+ throw ast::InternalError(_("Division by zero...\n"));
}
if (ConfigVariable::getIeee() == 1)
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
//check dimensions
if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
Sparse* pSparseOut = _pL->dotDivide(*_pR);
//check dimensions
if (_pL->getDims() != 2 || _pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
//get some information
//check dimensions
if (_pR->getDims() != 2 || _pR->getRows() != _pL->getRows() || _pR->getCols() != _pL->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
//get some information
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pR->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
*/
#include "types_dotmultiplication.hxx"
-#include "scilabexception.hxx"
#include "double.hxx"
#include "int.hxx"
#include "sparse.hxx"
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
//check dimensions
if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return _pL->dotMultiply(*_pR);
//check dimensions
if (_pL->getDims() != 2 || _pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
//get some information
//check dims
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
for (int i = 0 ; i < iDimsL ; ++i)
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
int iResult = KroneckerMultiplyDoubleByDouble(pL, pR, &pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iErr = KroneckerRDivideDoubleByDouble(pL, pR, &pResult);
if (iErr == 1)
{
- throw ast::ScilabError(_W("Division by zero...\n"));
+ throw ast::InternalError(_W("Division by zero...\n"));
}
else if (iErr == 2)
{
- throw ast::ScilabError(_W("Bad value in the left or right operand.\n"));
+ throw ast::InternalError(_W("Bad value in the left or right operand.\n"));
}
else if (iErr == 3)
{
- throw ast::ScilabError(_W("Bad size for left or right operand.\n"));
+ throw ast::InternalError(_W("Bad size for left or right operand.\n"));
}
return pResult;
int iErr = KroneckerLDivideDoubleByDouble(pL, pR, &pResult);
if (iErr == 1)
{
- throw ast::ScilabError(_W("Division by zero...\n"));
+ throw ast::InternalError(_W("Division by zero...\n"));
}
else if (iErr == 2)
{
- throw ast::ScilabError(_W("Bad value in the left operand.\n"));
+ throw ast::InternalError(_W("Bad value in the left operand.\n"));
}
return pResult;
#include "types_divide.hxx"
#include "types_finite.hxx"
-#include "scilabexception.hxx"
-
extern "C"
{
#include "matrix_left_division.h"
switch (iResult)
{
case 1 :
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
case 2 :
- throw ast::ScilabError(_W("With NaN or Inf a left division by scalar expected.\n"));
+ throw ast::InternalError(_W("With NaN or Inf a left division by scalar expected.\n"));
case 3 :
- throw ast::ScilabError(_W("Left division by zero...\n"));
+ throw ast::InternalError(_W("Left division by zero...\n"));
case 4 :
sciprint(_("Warning : Left division by zero...\n"));
break;
#include "polynom.hxx"
#include "singlepoly.hxx"
-#include "scilabexception.hxx"
-
extern "C"
{
#include "matrix_multiplication.h"
int iResult = MultiplyDoubleByDouble(pL, pR, (Double**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = MultiplyDoubleByPoly(pL, pR, (Polynom**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = MultiplyPolyByDouble(pL, pR, (Polynom**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = MultiplyPolyByPoly(pL, pR, (Polynom**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = MultiplySparseBySparse(pL, pR, (Sparse**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = MultiplyDoubleBySparse(pL, pR, (GenericType**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = MultiplySparseByDouble(pL, pR, (GenericType**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return _pL->newLogicalOr(*_pR);
#include "types_power.hxx"
#include "types_multiplication.hxx"
-#include "scilabexception.hxx"
extern "C"
{
int iResult = PowerDoubleByDouble(pL, pR, (Double**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
switch (iResult)
{
case 1 :
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
case 2 :
- throw ast::ScilabError(_W("Invalid exponent.\n"));
+ throw ast::InternalError(_W("Invalid exponent.\n"));
default:
//OK
break;
int iResult = DotPowerDoubleByDouble(pL, pR, (Double**)&pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
int iResult = DotPowerSpaseByDouble(pL, pR, &pResult);
if (iResult)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
return pResult;
switch (iResult)
{
case 1 :
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
case 2 :
- throw ast::ScilabError(_W("Invalid exponent.\n"));
+ throw ast::InternalError(_W("Invalid exponent.\n"));
default:
//OK
break;
else
{
delete[] pDblSp;
- throw ast::ScilabError(_W("Invalid exponent.\n"));
+ throw ast::InternalError(_W("Invalid exponent.\n"));
return 1;
}
else
{
delete[] pDblPower;
- throw ast::ScilabError(_W("Invalid exponent.\n"));
+ throw ast::InternalError(_W("Invalid exponent.\n"));
}
InternalType* pITTempOut = NULL;
case 1 :
{
delete pPolyOut;
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
case 2 :
{
delete pPolyOut;
- throw ast::ScilabError(_W("Invalid exponent.\n"));
+ throw ast::InternalError(_W("Invalid exponent.\n"));
}
default:
//OK
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDimsL != iDimsR)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDimsL = _pL->getDimsArray();
{
if (piDimsL[i] != piDimsR[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (iDims1 != iDims2)
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
int* piDims1 = _pL->getDimsArray();
{
if (piDims1[i] != piDims2[i])
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"-", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
int* piDims1 = _pR->getDimsArray();
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"-", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
}
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
int* piDims1 = _pR->getDimsArray();
{
wchar_t pMsg[bsiz];
os_swprintf(pMsg, bsiz, _W("Error: operator %ls: Matrix dimensions must agree (op1 is %ls, op2 is %ls).\n").c_str(), L"+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
- throw ast::ScilabError(pMsg);
+ throw ast::InternalError(pMsg);
}
}
if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
//dimensions not match
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
types::Sparse* pSPOut = _pL->substract(*_pR);
}
else
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
}
if (_pL->getRows() != _pR->getRows() || _pL->getCols() != _pR->getCols())
{
- throw ast::ScilabError(_W("Inconsistent row/column dimensions.\n"));
+ throw ast::InternalError(_W("Inconsistent row/column dimensions.\n"));
}
//SP - D
#include <string.h>
#include "parser.hxx"
#include "parser_private.hxx"
-#include "scilabexception.hxx"
#ifdef _MSC_VER
#include "windows.h"
{
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%ls: Cannot open file %ls.\n").c_str(), L"parser", fileName.c_str());
- throw ast::ScilabError(szError, 999, *new Location());
+ throw ast::InternalError(szError);
}
** \{
*/
-std::wstring ConfigVariable::m_wstErrorFunction;
+std::wstring ConfigVariable::m_wstErrorFunction = L"";
void ConfigVariable::setLastErrorFunction(const std::wstring& _wstErrorFunction)
{
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("Invalid index.\n").c_str());
- throw ast::ScilabError(szError);
+ throw ast::InternalError(szError);
}
if (pSource->isScalar())
#include <sstream>
#include <vector>
#include "callable.hxx"
-#include "scilabexception.hxx"
#include "configvariable.hxx"
-
namespace types
{
Ret = call(in, opt, _iRetCount, out, &execFunc);
ConfigVariable::where_end();
}
- catch (ast::ScilabMessage & sm)
+ catch (ast::InternalError & ie)
{
ConfigVariable::where_end();
ConfigVariable::setLastErrorFunction(getName());
- throw sm;
+ throw ie;
}
catch (ast::InternalAbort & ia)
{
throw ia;
}
- catch (ast::ScilabError & se)
- {
- ConfigVariable::where_end();
- ConfigVariable::setLastErrorFunction(getName());
-
- throw se;
- }
if (Ret == Callable::Error)
{
ConfigVariable::setLastErrorFunction(getName());
ConfigVariable::setLastErrorLine(e.getLocation().first_line);
- throw ast::ScilabError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
+ throw ast::InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
return true;
#include "double.hxx"
#include "doubleexp.hxx"
#include "tostring_common.hxx"
-#include "scilabexception.hxx"
#include "configvariable.hxx"
#include "type_traits.hxx"
{
m_pOldFunc(nlhs, plhs, nrhs, prhs);
}
- catch (ast::ScilabError& se)
+ catch (const ast::InternalError& ie)
{
delete[] plhs;
delete[] prhs;
- throw se;
+ throw ie;
}
if (_iRetCount == 1 && plhs[0] == NULL)
#include <sstream>
#include "graphichandle.hxx"
#include "tostring_common.hxx"
-#include "scilabexception.hxx"
#include "overload.hxx"
#include "type_traits.hxx"
{
std::wostringstream os;
os << _W("Invalid index.\n");
- throw ast::ScilabError(os.str(), 999, e.getLocation());
+ throw ast::InternalError(os.str(), 999, e.getLocation());
}
out.push_back(_out);
}
#include "listundefined.hxx"
#include "listinsert.hxx"
#include "types_tools.hxx"
-#include "scilabexception.hxx"
#include "localization.hxx"
#include "scilabWrite.hxx"
#include "types_tools.hxx"
cleanIndexesArguments(_pArgs, &pArg);
std::wostringstream os;
os << _W("Unable to insert multiple item in a list.\n");
- throw ast::ScilabError(os.str());
+ throw ast::InternalError(os.str());
}
else if (iSeqCount < 0)
{
cleanIndexesArguments(_pArgs, &pArg);
std::wostringstream os;
os << _W("Index out of bounds.\n");
- throw ast::ScilabError(os.str());
+ throw ast::InternalError(os.str());
}
InternalType* pInsert = _pSource->getAs<ListInsert>()->getInsert()->clone();
#include "context.hxx"
#include "symbol.hxx"
#include "scilabWrite.hxx"
-#include "scilabexception.hxx"
#include "configvariable.hxx"
#include "mutevisitor.hxx"
#include "serializervisitor.hxx"
//restore previous prompt mode
ConfigVariable::setPromptMode(oldVal);
}
- catch (ast::ScilabMessage & sm)
+ catch (const ast::InternalError& ie)
{
cleanCall(pContext, oldVal);
- throw sm;
+ throw ie;
}
- catch (ast::InternalAbort & ia)
+ catch (const ast::InternalAbort& ia)
{
cleanCall(pContext, oldVal);
throw ia;
{
ret = Overload::call(L"%" + getShortTypeStr() + L"_e", in, 1, out, &execFunc);
}
- catch (ast::ScilabError & /*se*/)
+ catch (ast::InternalError & /*se*/)
{
ret = Overload::call(L"%l_e", in, 1, out, &execFunc);
}
if (ret == Callable::Error)
{
- throw ast::ScilabError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
+ throw ast::InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
return true;
#include "callable.hxx"
#include "overload.hxx"
#include "context.hxx"
-#include "scilabexception.hxx"
std::wstring Overload::buildOverloadName(std::wstring _stFunctionName, types::typed_list &in, int /*_iRetCount*/, bool _isOperator, bool _truncated)
{
types::Function::ReturnValue Overload::generateNameAndCall(std::wstring _stFunctionName, types::typed_list &in, int _iRetCount, types::typed_list &out, ast::ConstVisitor *_execMe, bool _isOperator)
{
std::wstring stFunc = buildOverloadName(_stFunctionName, in, _iRetCount, _isOperator);
- types::Function::ReturnValue ret = types::Function::Error;
- try
+ if (symbol::Context::getInstance()->get(symbol::Symbol(stFunc)))
{
- ret = call(stFunc, in, _iRetCount, out, _execMe, _isOperator);
+ return call(stFunc, in, _iRetCount, out, _execMe, _isOperator);
}
- catch (ast::ScilabError se)
+
+ // if overload doesn't existe try with short name
+ std::wstring stFunc2 = buildOverloadName(_stFunctionName, in, _iRetCount, _isOperator, true);
+ if (symbol::Context::getInstance()->get(symbol::Symbol(stFunc)))
{
- std::wstring stFunc2 = buildOverloadName(_stFunctionName, in, _iRetCount, _isOperator, true);
- ret = call(stFunc2, in, _iRetCount, out, _execMe, _isOperator);
+ types::Function::ReturnValue ret = call(stFunc, in, _iRetCount, out, _execMe, _isOperator);
if (ret == types::Function::OK && ConfigVariable::getWarningMode())
{
char* pstFunc2 = wide_string_to_UTF8(stFunc2.c_str());
FREE(pstFunc);
FREE(pstFunc2);
}
+ return ret;
}
- return ret;
+
+ // get exeception with overloading error
+ return call(stFunc, in, _iRetCount, out, _execMe, _isOperator);
}
types::Function::ReturnValue Overload::call(std::wstring _stOverloadingFunctionName, types::typed_list &in, int _iRetCount, types::typed_list &out, ast::ConstVisitor *_execMe, bool _isOperator)
os_sprintf(pstError1, "%s%s", _("Function not defined for given argument type(s),\n"), pstError2);
}
- pwstError = to_wide_string(pstError1);
- std::wstring wstError(pwstError);
- FREE(pwstError);
FREE(pstFuncName);
- throw ast::ScilabError(wstError, 999, Location(0, 0, 0, 0));
+ ast::InternalError ie(pstError1);
+ ie.SetErrorType(ast::TYPE_EXCEPTION);
+ throw ie;
}
pCall = pIT->getAs<types::Callable>();
return ret;
}
- catch (ast::ScilabMessage sm)
- {
- // remove function name in where
- ConfigVariable::where_end();
- throw sm;
- }
- catch (ast::ScilabError se)
+ catch (ast::InternalError ie)
{
- ConfigVariable::fillWhereError(se.GetErrorLocation().first_line);
- if (ConfigVariable::getLastErrorNumber() == 0)
- {
- ConfigVariable::setLastErrorMessage(se.GetErrorMessage());
- ConfigVariable::setLastErrorNumber(se.GetErrorNumber());
- ConfigVariable::setLastErrorLine(se.GetErrorLocation().first_line);
- ConfigVariable::setLastErrorFunction(std::wstring(L""));
- }
-
+ ConfigVariable::fillWhereError(ie.GetErrorLocation().first_line);
if (pCall)
{
+ if (ConfigVariable::getLastErrorFunction() == L"")
+ {
+ ConfigVariable::setLastErrorFunction(pCall->getName());
+ ConfigVariable::setLastErrorLine(ie.GetErrorLocation().first_line);
+ }
+
// remove function name in where
ConfigVariable::where_end();
}
- throw ast::ScilabMessage(se.GetErrorMessage(), se.GetErrorNumber(), se.GetErrorLocation());
+ throw ie;
}
}
{
switch (_oper)
{
- /* standard operators */
+ /* standard operators */
case ast::OpExp::plus :
return std::wstring(L"a");
case ast::OpExp::unaryMinus :
return std::wstring(L"l");
case ast::OpExp::power :
return std::wstring(L"p");
- /* dot operators */
+ /* dot operators */
case ast::OpExp::dottimes :
return std::wstring(L"x");
case ast::OpExp::dotrdivide :
return std::wstring(L"q");
case ast::OpExp::dotpower :
return std::wstring(L"j");
- /* Kron operators */
+ /* Kron operators */
case ast::OpExp::krontimes :
return std::wstring(L"k");
case ast::OpExp::kronrdivide :
return std::wstring(L"y");
case ast::OpExp::kronldivide :
return std::wstring(L"z");
- /* Control Operators ??? */
+ /* Control Operators ??? */
case ast::OpExp::controltimes :
return std::wstring(L"u");
case ast::OpExp::controlrdivide :
wchar_t* pwstError = to_wide_string(szError);
std::wstring wstError(pwstError);
FREE(pwstError);
- throw ast::ScilabError(wstError, 999, *new Location());
+ throw ast::InternalError(wstError);
}
return ArrayOf<SinglePoly*>::insert(_pArgs, _pSource);
}
m_pImgData = NULL;
char message[bsiz];
os_sprintf(message, _("Can not allocate negative size (%d).\n"), _iSize);
- ast::ScilabError se(message);
- se.SetErrorNumber(999);
- throw (se);
+ throw ast::InternalError(message);
}
else
{
{
char message[bsiz];
os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double) (_iSize * sizeof(double)) / 1.e6);
- ast::ScilabError se(message);
- se.SetErrorNumber(999);
- throw (se);
+ throw ast::InternalError(message);
}
return pDbl;
#include "singlestruct.hxx"
#include "string.hxx"
#include "double.hxx"
-#include "scilabexception.hxx"
#include "localization.hxx"
#include "scilabWrite.hxx"
{
std::wostringstream os;
os << _W("Unable to insert multiple item in a struct.\n");
- throw ast::ScilabError(os.str());
+ throw ast::InternalError(os.str());
}
if ((*_pArgs)[0]->isString() == false)
{
std::wostringstream os;
os << _W("Assignment between unlike types is not allowed.\n");
- throw ast::ScilabError(os.str());
+ throw ast::InternalError(os.str());
}
String* pstKey = (*_pArgs)[0]->getAs<String>();
{
char message[bsiz];
os_sprintf(message, _("Can not allocate data.\n"));
- ast::ScilabError se(message);
- se.SetErrorNumber(999);
- throw (se);
+ throw ast::InternalError(message);
}
- return NULL;
+ return NULL;
}
wchar_t* String::copyValue(const wchar_t* _pwstData)
{
char message[bsiz];
os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double)(_iSize * sizeof(char*)) / 1.e6);
- ast::ScilabError se(message);
- se.SetErrorNumber(999);
- throw (se);
+ throw ast::InternalError(message);
}
return pStr;
}
{
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("Field \"%ls\" does not exists\n").c_str(), wstField.c_str());
- throw ast::ScilabError(szError, 999, e.getLocation());
+ throw ast::InternalError(szError, 999, e.getLocation());
}
}
{
ret = Overload::call(L"%" + stType + L"_e", in, _iRetCount, out, &execFunc);
}
- catch (ast::ScilabError &se)
+ catch (const ast::InternalError &ie)
{
try
{
}
else
{
- throw se;
+ throw ie;
}
}
- catch (ast::ScilabError & /*se*/)
+ catch (ast::InternalError & /*se*/)
{
ret = Overload::call(L"%l_e", in, 1, out, &execFunc);
}
if (ret == Callable::Error)
{
- throw ast::ScilabError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
+ throw ast::InternalError(ConfigVariable::getLastErrorMessage(), ConfigVariable::getLastErrorNumber(), e.getLocation());
}
return true;
DecreaseRef();
return true;
}
- catch (ast::ScilabMessage /* &e */)
+ catch (ast::InternalError& e)
{
+ if (e.GetErrorType() == ast::TYPE_ERROR)
+ {
+ DecreaseRef();
+ throw e;
+ }
+
// avoid error message about undefined overload %type_p
ConfigVariable::resetError();
}
#include <sstream>
#include "types.hxx"
-#include "scilabexception.hxx"
-
extern "C"
{
#include "localization.h"
{
switch (val->getType())
{
- //scalar
+ //scalar
case InternalType::ScilabDouble:
{
return getIndex(val->getAs<Double>());
{
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("variable size exceeded : less than %d expected.\n").c_str(), INT_MAX);
- throw ast::ScilabError(szError);
+ throw ast::InternalError(szError);
}
int d = static_cast<int>(pCurrentArg->get(j));
delete[] _piCountDim;
cleanIndexesArguments(_pArgsIn, _pArgsOut);
- throw ast::ScilabError(szError);
+ throw ast::InternalError(szError);
}
_pArgsOut->push_back(pCurrentArg);
pIT->DecreaseRef();
return ret;
}
- catch (ast::ScilabError &e)
+ catch (const ast::InternalError &ie)
{
pIT->DecreaseRef();
- throw e;
+ throw ie;
}
}
else
#include "threadmanagement.hxx"
#include "configvariable.hxx"
#include "threadId.hxx"
-#include "scilabexception.hxx"
extern "C"
{
b(1)(1) = 2;
// a must not be modified !
assert_checkequal(a, list(list(1)));
+// check error in print overload
+ml=mlist(["test" "f1"], 15);
+function %test_p(varargin)
+ error("overload error");
+end
+assert_checkerror("disp(ml)", "overload error");
// a must not be modified !
assert_checkequal(a, list(list(1)));
+// check error in print overload
+ml=mlist(["test" "f1"], 15);
+function %test_p(varargin)
+ error("overload error");
+end
+assert_checkerror("disp(ml)", "overload error");
{
C2F(colnew)(&ncomp, M, &aleft, &aright, pDblZeta->get(), ipar, ltol, pDblTol->get(), pDblFixpnt->get(), iwork, rwork, &iflag, bvode_fsub, bvode_dfsub, bvode_gsub, bvode_dgsub, bvode_guess);
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "bvode", "bvode");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
if (iflag != 1)
Scierror(999, _("%s: %s return with state %d.\n"), "daskr", "ddaskr", ididtmp);
}
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- iret = 1;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
iret = 1;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "daskr", "ddaskr");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
Scierror(999, _("%s: %s return with state %d.\n"), "dasrt", "ddasrt", idid);
}
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- iret = 1;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
iret = 1;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "dasrt", "ddasrt");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
// error message catched
std::wostringstream os;
- bool bCatched = false;
+ bool bCatch = false;
// *** check the minimal number of input args. ***
if (in.size() < 4 || in.size() > 9)
Scierror(999, _("%s: %s return with state %d.\n"), "dassl", "dassl", idid);
}
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatched = true;
- iret = 1;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
- bCatched = true;
+ os << ie.GetErrorMessage();
+ bCatch = true;
iret = 1;
}
FREE(rtol);
}
- if (bCatched)
+ if (bCatch)
{
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "dassl", "dassl");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
{
deFunctionsManager.execFevalF(&nn, &valX, &valY, res, &itype);
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "feval", "execFevalF");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
if (itype) // is complex
}
}
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- err = 1;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
err = 1;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "impl", "lsodi");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
{
C2F(twodq)(int2d_f, &size, pDblX->get(), pDblY->get(), &tol, &iclose, &maxtri, &mevals, &result, &err, &nu, &nd, &nevals, &iflag, dwork, iwork);
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = false;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = false;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "int2d", "twodq");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
if (iflag)
{
C2F(dcutet)(int3d_f, &nf, pdData, &cols, &minpts, &maxpts, &epsabs, &epsrel, &maxsub, &dworkSize, &irestar, pdResult, pdErr, &nevals, &ifail, dwork, iwork);
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
}
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
- bCatch = true;
- }
-
FREE(pdData);
FREE(dwork);
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "int3d", "dcutet");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
if (ifail)
&result, &abserr, &neval, &ier,
&limit, &lenw, &last, iwork, dwork);
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "intg", "dqags");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
if (ier)
Scierror(999, _("%s: %s exit with state %d.\n"), "ode", strMeth.c_str(), istate);
}
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
+ err = 1;
}
// FREE allocated data
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "ode", strMeth.c_str());
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
Scierror(999, _("%s: %s exit with state %d.\n"), "ode", strMeth.c_str(), istate);
}
}
- catch (ast::ScilabMessage &sm)
- {
- os << sm.GetErrorMessage();
- bCatch = true;
- err = 1;
- }
- catch (ast::ScilabError &e)
+ catch (ast::InternalError &ie)
{
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
err = 1;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "ode", strMeth.c_str());
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
{
ode_f(&sizeYc, &tright, pdYData, pdYData + sizeYc);
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "odedc", "tright");
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
deFunctionsManager.resetOdedcFlag();
Scierror(999, _("%s: %s exit with state %d.\n"), "odedc", strMeth.c_str(), istate);
}
}
- catch (ast::ScilabMessage &sm)
- {
- os << sm.GetErrorMessage();
- bCatch = true;
- err = 1;
- }
- catch (ast::ScilabError &e)
+ catch (ast::InternalError &ie)
{
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
err = 1;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "odedc", strMeth.c_str());
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
Scierror(999, _("%s: %s exit with state %d.\n"), "odedc", strMeth.c_str(), istate);
}
}
- catch (ast::ScilabMessage &sm)
+ catch (ast::InternalError &ie)
{
- os << sm.GetErrorMessage();
- bCatch = true;
- err = 1;
- }
- catch (ast::ScilabError &e)
- {
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
err = 1;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "odedc", strMeth.c_str());
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
return types::Function::Error;
{
ode_f(&sizeYc, &tright, pdYData, pdYData + sizeYc);
}
- catch (ast::ScilabMessage &sm)
- {
- os << sm.GetErrorMessage();
- bCatch = true;
- }
- catch (ast::ScilabError &e)
+ catch (ast::InternalError &ie)
{
- os << e.GetErrorMessage();
+ os << ie.GetErrorMessage();
bCatch = true;
}
wchar_t szError[bsiz];
os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "odedc", tright);
os << szError;
- throw ast::ScilabMessage(os.str());
+ throw ast::InternalError(os.str());
}
deFunctionsManager.resetOdedcFlag();
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringGFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((dasrt_g_t)(func->functionPtr))(ny, t, y, ng, gout, rpar, ipar);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "g");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((dassl_f_t)(func->functionPtr))(t, y, ydot, delta, ires, rpar, ipar);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "f");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringJacFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((dassl_jac_t)(func->functionPtr))(t, y, ydot, pd, cj, rpar, ipar);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "jacobian");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringPjacFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((daskr_pjac_t)(func->functionPtr))(res, ires, neq, t, y, ydot, rewt, savr,
wk, h, cj, wp, iwp, ier, rpar, ipar);
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "pjac");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringPsolFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((daskr_psol_t)(func->functionPtr))(neq, t, y, ydot, savr, wk, cj, wght,
wp, iwp, b, eplin, ier, rpar, ipar);
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "psol");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((impl_f_t)(func->functionPtr))(neq, t, y, s, r, ires);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "f");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringGFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((impl_g_t)(func->functionPtr))(neq, t, y, ml, mu, p, nrowp);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "g");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringJacFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((impl_jac_t)(func->functionPtr))(neq, t, y, s, ml, mu, p, nrowp);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "jacobian");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringGuessFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((bvode_ddd_t)(func->functionPtr))(x, z, d);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "guess");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringDfsubFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((bvode_ddd_t)(func->functionPtr))(x, z, d);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "fsub");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFsubFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((bvode_ddd_t)(func->functionPtr))(x, z, d);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "fsub");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringDgsubFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((bvode_idd_t)(func->functionPtr))(i, z, g);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "gsub");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringGsubFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((bvode_idd_t)(func->functionPtr))(i, z, g);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "gsub");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((feval_f_t)(func->functionPtr))(nn, x1, x2, xres, itype);
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "f");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((int3d_f_t)(func->functionPtr))(x, numfun, funvls);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "f");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
return ((int2d_f_t)(func->functionPtr))(x, y);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "f");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
return ((intg_f_t)(func->functionPtr))(x);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "f");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringFFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (m_wstrCaller == L"ode")
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "f");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringJacFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((func_jac_t)(func->functionPtr))(n, t, y, ml, mu, J, nrpd);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "jacobian");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
if (func == NULL)
{
sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringGFunctionDyn->get(0));
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
((func_g_t)(func->functionPtr))(n, t, y, ng, gout);
}
else
{
sprintf(errorMsg, _("User function '%s' have not been setted.\n"), "g");
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
}
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_FArgs.size(); i++)
+ {
+ m_FArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_FArgs.size(); i++)
m_FArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFFunction->getName());
- }
-
- if (m_pCallFFunction->isMacro() || m_pCallFFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
if (pDblOut->isComplex())
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (m_odedcFlag && m_odedcYDSize)
int iRetCount = 1;
int one = 1;
int iMaxSize = (*n) * (*nrpd);
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallJacFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallJacFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_JacArgs.size(); i++)
+ {
+ m_JacArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_JacArgs.size(); i++)
m_JacArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallJacFunction->getName());
- }
-
- if (m_pCallJacFunction->isMacro() || m_pCallJacFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallJacFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
out[0]->IncreaseRef();
pDblT->DecreaseRef();
pDblY->DecreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->DecreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A size less or equal than %d expected.\n"), pstrName, 1, iMaxSize);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(&iSizeOut, pDblOut->get(), &one, J, &one);
char errorMsg[256];
int iRetCount = 1;
int one = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallGFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallGFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_odeGArgs.size(); i++)
+ {
+ m_odeGArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_odeGArgs.size(); i++)
m_odeGArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallGFunction->getName());
- }
-
- if (m_pCallGFunction->isMacro() || m_pCallGFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallGFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(ng, out[0]->getAs<types::Double>()->get(), &one, gout, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_FArgs.size(); i++)
+ {
+ m_FArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_FArgs.size(); i++)
m_FArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFFunction->getName());
- }
-
- if (m_pCallFFunction->isMacro() || m_pCallFFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Scalar expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
double res = pDblOut->get(0);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_FArgs.size(); i++)
+ {
+ m_FArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_FArgs.size(); i++)
m_FArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFFunction->getName());
- }
-
- if (m_pCallFFunction->isMacro() || m_pCallFFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Scalar expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
double res = pDblOut->get(0);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_FArgs.size(); i++)
+ {
+ m_FArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_FArgs.size(); i++)
m_FArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFFunction->getName());
- }
-
- if (m_pCallFFunction->isMacro() || m_pCallFFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: Matrix of size %d expected.\n"), pstrName, 1, *numfun);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(numfun, pDblOut->get(), &one, funvls, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
}
try
{
- bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_FArgs.size(); i++)
+ {
+ m_FArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_FArgs.size(); i++)
m_FArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFFunction->getName());
- }
-
- if (m_pCallFFunction->isMacro() || m_pCallFFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Scalar expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (pDblOut->isComplex())
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallGsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallGsubFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_GsubArgs.size(); i++)
+ {
+ m_GsubArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_GsubArgs.size(); i++)
m_GsubArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallGsubFunction->getName());
- }
-
- if (m_pCallGsubFunction->isMacro() || m_pCallGsubFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallGsubFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallGsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallGsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallGsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Scalar expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
*g = pDblOut->get(0);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallDgsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallDgsubFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_DgsubArgs.size(); i++)
+ {
+ m_DgsubArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_DgsubArgs.size(); i++)
m_DgsubArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallDgsubFunction->getName());
- }
-
- if (m_pCallDgsubFunction->isMacro() || m_pCallDgsubFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallDgsubFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallDgsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallDgsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallDgsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Matrix of size %d expected.\n"), pstrName, 1, m_bvodeM);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(&m_bvodeM, pDblOut->get(), &one, g, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallFsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFsubFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_FsubArgs.size(); i++)
+ {
+ m_FsubArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_FsubArgs.size(); i++)
m_FsubArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFsubFunction->getName());
- }
-
- if (m_pCallFsubFunction->isMacro() || m_pCallFsubFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFsubFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallFsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallFsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, m_bvodeN);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(&m_bvodeN, pDblOut->get(), &one, d, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallDfsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallDfsubFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_DfsubArgs.size(); i++)
+ {
+ m_DfsubArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_DfsubArgs.size(); i++)
m_DfsubArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallDfsubFunction->getName());
- }
-
- if (m_pCallDfsubFunction->isMacro() || m_pCallDfsubFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallDfsubFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallDfsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallDfsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallDfsubFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, size);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(&size, pDblOut->get(), &one, d, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 2;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallGuessFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallGuessFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_GuessArgs.size(); i++)
+ {
+ m_GuessArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_GuessArgs.size(); i++)
m_GuessArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallGuessFunction->getName());
- }
-
- if (m_pCallGuessFunction->isMacro() || m_pCallGuessFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallGuessFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallGuessFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallGuessFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[1]->DecreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallGuessFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 2);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutZ = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallGuessFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, m_bvodeM);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutD = out[1]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallGuessFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, m_bvodeN);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(&m_bvodeM, pDblOutZ->get(), &one, z, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
*ires = 2;
try
{
- bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
- }
- catch (ast::ScilabMessage & /* sm */)
- {
- bOk = false;
- }
-
- for (int i = 0; i < (int)m_FArgs.size(); i++)
- {
- m_FArgs[i]->DecreaseRef();
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
-
- if (bOk == false)
+ catch (const ast::InternalError& ie)
{
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFFunction->getName());
- }
-
- if (m_pCallFFunction->isMacro() || m_pCallFFunction->isMacroFile())
+ for (int i = 0; i < (int)m_FArgs.size(); i++)
{
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
+ m_FArgs[i]->DecreaseRef();
}
- throw ast::ScilabMessage();
+ throw ie;
}
if (out.size() != iRetCount)
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutR = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Matrix of size %d expected.\n"), pstrName, 1, *neq);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(neq, pDblOutR->get(), &one, r, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallGFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallGFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_odeGArgs.size(); i++)
+ {
+ m_odeGArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_odeGArgs.size(); i++)
m_odeGArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallGFunction->getName());
- }
-
- if (m_pCallGFunction->isMacro() || m_pCallGFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallGFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutP = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d x %d expected.\n"), pstrName, 1, *neq, *nrowp);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
int size = *neq **nrowp;
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallJacFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallJacFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_JacArgs.size(); i++)
+ {
+ m_JacArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_JacArgs.size(); i++)
m_JacArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallJacFunction->getName());
- }
-
- if (m_pCallJacFunction->isMacro() || m_pCallJacFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallJacFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutP = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d x %d expected.\n"), pstrName, 1, *neq, *nrowp);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
int size = *neq **nrowp;
char errorMsg[256];
int one = 1;
int iRetCount = 2;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallFFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_FArgs.size(); i++)
+ {
+ m_FArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_FArgs.size(); i++)
m_FArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallFFunction->getName());
- }
-
- if (m_pCallFFunction->isMacro() || m_pCallFFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallFFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[1]->DecreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 2);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutDelta = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, m_odeYRows);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutIres = out[1]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallFFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Scalar expected.\n"), pstrName, 2);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(&m_odeYRows, pDblOutDelta->get(), &one, delta, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallJacFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallJacFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_JacArgs.size(); i++)
+ {
+ m_JacArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_JacArgs.size(); i++)
m_JacArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallJacFunction->getName());
- }
-
- if (m_pCallJacFunction->isMacro() || m_pCallJacFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallJacFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutPd = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallJacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d x %d expected.\n"), pstrName, 1, m_odeYRows, (2 * m_ml + m_mu + 1));
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
int size = pDblOutPd->getSize();
char errorMsg[256];
int one = 1;
int iRetCount = 1;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallGFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallGFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_odeGArgs.size(); i++)
+ {
+ m_odeGArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_odeGArgs.size(); i++)
m_odeGArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallGFunction->getName());
- }
-
- if (m_pCallGFunction->isMacro() || m_pCallGFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallGFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
types::Double* pDblOutGout = out[0]->getAs<types::Double>();
char* pstrName = wide_string_to_UTF8(m_pCallGFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, *ng);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
C2F(dcopy)(ng, pDblOutGout->get(), &one, gout, &one);
char errorMsg[256];
int one = 1;
int iRetCount = 3;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- bOk = m_pCallPjacFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallPjacFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_pJacArgs.size(); i++)
+ {
+ m_pJacArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_pJacArgs.size(); i++)
m_pJacArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallPjacFunction->getName());
- }
-
- if (m_pCallPjacFunction->isMacro() || m_pCallPjacFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallPjacFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallPjacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallPjacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (out[1]->isDouble() == false)
char* pstrName = wide_string_to_UTF8(m_pCallPjacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 2);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (out[2]->isDouble() == false)
char* pstrName = wide_string_to_UTF8(m_pCallPjacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 3);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
// return [R, iR, ier]
char* pstrName = wide_string_to_UTF8(m_pCallPjacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, *neq **neq);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (pDblOutIwp->getSize() != 2 * *neq **neq)
char* pstrName = wide_string_to_UTF8(m_pCallPjacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 2, 2 * *neq **neq);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (pDblOutIer->isScalar() == false)
char* pstrName = wide_string_to_UTF8(m_pCallPjacFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Scalar expected.\n"), pstrName, 3);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
// copy output macro results in output variables
char errorMsg[256];
int one = 1;
int iRetCount = 2;
- bool bOk = false;
typed_list in;
typed_list out;
try
{
- // call macro
- bOk = m_pCallPsolFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ // new std::wstring(L"") is delete in destructor of ast::CommentExp
+ m_pCallPsolFunction->invoke(in, opt, iRetCount, out, execFunc, ast::CommentExp(Location(), new std::wstring(L"")));
}
- catch (ast::ScilabMessage & /* sm */)
+ catch (const ast::InternalError& ie)
{
- bOk = false;
+ for (int i = 0; i < (int)m_pSolArgs.size(); i++)
+ {
+ m_pSolArgs[i]->DecreaseRef();
+ }
+
+ throw ie;
}
for (int i = 0; i < (int)m_pSolArgs.size(); i++)
m_pSolArgs[i]->DecreaseRef();
}
- if (bOk == false)
- {
- if (ConfigVariable::getLastErrorFunction() == L"")
- {
- ConfigVariable::setLastErrorFunction(m_pCallPsolFunction->getName());
- }
-
- if (m_pCallPsolFunction->isMacro() || m_pCallPsolFunction->isMacroFile())
- {
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n").c_str(), ConfigVariable::getLastErrorLine(), m_pCallPsolFunction->getName().c_str());
- throw ast::ScilabMessage(szError);
- }
-
- throw ast::ScilabMessage();
- }
-
// get output
if (out.size() != iRetCount)
{
char* pstrName = wide_string_to_UTF8(m_pCallPsolFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong number of output argument(s): %d expected.\n"), pstrName, iRetCount);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
out[0]->IncreaseRef();
char* pstrName = wide_string_to_UTF8(m_pCallPsolFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
if (out[1]->isDouble() == false)
char* pstrName = wide_string_to_UTF8(m_pCallPsolFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 2);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
// return arguments [b, ier] = psol()
char* pstrName = wide_string_to_UTF8(m_pCallPsolFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), pstrName, 1, *neq);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
// get scalar ier
char* pstrName = wide_string_to_UTF8(m_pCallPsolFunction->getName().c_str());
sprintf(errorMsg, _("%s: Wrong size for output argument #%d: A Scalar expected.\n"), pstrName, 2);
FREE(pstrName);
- throw ast::ScilabError(errorMsg);
+ throw ast::InternalError(errorMsg);
}
// copy output macro results in output variables
if (deFunction == NULL)
{
- throw ast::ScilabError(_("An error occurred while getting DifferentialEquationFunctions object.\n"));
+ throw ast::InternalError(_("An error occurred while getting DifferentialEquationFunctions object.\n"));
}
deFunction->execOdeF(n, t, y, ydot);
if (deFunction == NULL)
{
- throw ast::ScilabError(_("An error occurred while getting DifferentialEquationFunctions object.\n"));
+ throw ast::InternalError(_("An error occurred while getting DifferentialEquationFunctions object.\n"));
}
deFunction->execFunctionJac(n, t, y, ml, mu, J, nrpd);