Example #1
0
INT16 CDgen::OnScan()
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	fst* itDeps = MIC_GET_I_EX(itDeps,fst,1,1);
	char* sParser = MIC_GET_S(2,0);
	char* sFilename = MIC_GET_S(3,1);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	__nErr = Scan(sFilename, sParser, itDeps);
	return __nErr;
}
Example #2
0
INT16 CDgen::OnTable()
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	char* sSuf = MIC_GET_S(1,0);
	char* sDel = MIC_GET_S(2,1);
	char* sPre = MIC_GET_S(3,2);
	data* idTable = MIC_GET_I_EX(idTable,data,4,1);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	__nErr = Table(idTable, sPre, sDel, sSuf);
	return __nErr;
}
Example #3
0
//{{CGEN_PMIC
INT16 CDgen::OnEditSection()
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	char* sOpname = MIC_GET_S(1,0);
	data* idText = MIC_GET_I_EX(idText,data,2,1);
	char* sMarkOff = MIC_GET_S(3,1);
	char* sMarkOn = MIC_GET_S(4,2);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	__nErr = EditSection(sMarkOn, sMarkOff, idText, sOpname);
	return __nErr;
}
Example #4
0
INT16 CDlpFile_OnImport(CDlpObject* __this)
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	const char* sFilename;
	const char* sFilter;
	CDlpObject* iInst;
	GET_THIS_VIRTUAL_RV(CDlpFile,NOT_EXEC);
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	iInst = MIC_GET_I(1,1);
	sFilter = MIC_GET_S(2,0);
	sFilename = MIC_GET_S(3,1);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	__nErr = CDlpFile_Import(_this, sFilename, sFilter, iInst);
	return __nErr;
}
Example #5
0
INT16 CDgen::OnAddText()
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	char* sText = MIC_GET_S(1,0);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	__nErr = AddText(sText);
	return __nErr;
}
Example #6
0
INT16 CDlpFile_OnGetRootClass(CDlpObject* __this)
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	char* sFilename;
	GET_THIS_VIRTUAL_RV(CDlpFile,NOT_EXEC);
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	sFilename = MIC_GET_S(1,0);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	MIC_PUT_S(CDlpFile_GetRootClass(_this, sFilename));
	return __nErr;
}
Example #7
0
INT16 CDgen::OnParse()
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	INT32 nLtok = (INT32)MIC_GET_N(1,0);
	INT32 nFtok = (INT32)MIC_GET_N(2,1);
	fst* itDeps = MIC_GET_I_EX(itDeps,fst,3,1);
	char* sParser = MIC_GET_S(4,0);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	__nErr = Parse(sParser, itDeps, nFtok, nLtok);
	return __nErr;
}
Example #8
0
INT16 CPMproc::OnFill()
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
    INT16 __nErr    = O_K;
    INT32  __nErrCnt = 0;
    MIC_CHECK;
    __nErrCnt = CDlpObject_GetErrorCount();
    const char* method = MIC_GET_S(1,0);
    INT32 n = (INT32)MIC_GET_N(2,0);
    data* idDst = MIC_GET_I_EX(idDst,data,3,1);
    data* idSrc = MIC_GET_I_EX(idSrc,data,4,2);
    if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
    __nErr = Fill(idSrc, idDst, n, method);
    return __nErr;
}
Example #9
0
/*{{CGEN_CPMIC */
INT16 CFvrtools_OnFromString(CDlpObject* __this)
/* DO NOT CALL THIS FUNCTION FROM C++ SCOPE.     */
/* IT MAY INTERFERE WITH THE INTERPRETER SESSION */
{
	INT16 __nErr    = O_K;
	INT32  __nErrCnt = 0;
	char* src;
	fst* itFvr;
	GET_THIS_VIRTUAL_RV(CFvrtools,NOT_EXEC);
	MIC_CHECK;
	__nErrCnt = CDlpObject_GetErrorCount();
	itFvr = MIC_GET_I_EX(itFvr,fst,1,1);
	src = MIC_GET_S(2,0);
	if (CDlpObject_GetErrorCount()>__nErrCnt) return NOT_EXEC;
	__nErr = CFvrtools_FromString(_this, src, itFvr);
	return __nErr;
}
Example #10
0
/**
 * Polymorphic set operations.
 * 
 * @param lpsOpname
 *          <p>Operator name</p>
 *          <table>
 *            <tr><th><code>lpsOpname</code></th><th>Boolean</th><th>Numeric</th><th>String</th><th>Instance</th></tr>
 *            <tr><td><code>=  </code></td><td>x</td><td>x</td><td>x</td><td>x</td></tr>
 *            <tr><td><code>+= </code></td><td>x</td><td>x</td><td>x</td><td>-</td></tr>
 *            <tr><td><code>-= </code></td><td>-</td><td>x</td><td>-</td><td>-</td></tr>
 *            <tr><td><code>*= </code></td><td>x</td><td>x</td><td>-</td><td>-</td></tr>
 *            <tr><td><code>/= </code></td><td>-</td><td>x</td><td>-</td><td>-</td></tr>
 *            <tr><td><code>++=</code></td><td>-</td><td>x</td><td>-</td><td>-</td></tr>
 *            <tr><td><code>--=</code></td><td>-</td><td>x</td><td>-</td><td>-</td></tr>
 *          </table>
 *          <p>For type conversion rules see
 *            <code><a href="function.html"><code�class="link">CFunction</code></a><code>::StackLogic</code>,
 *            <code><a href="function.html"><code�class="link">CFunction</code></a><code>::StackNumber</code>,
 *            <code><a href="function.html"><code�class="link">CFunction</code></a><code>::StackString</code> and
 *            <code><a href="function.html"><code�class="link">CFunction</code></a><code>::StackInstance</code>.
 *          </p>
 * @return <code>O_K</code> if successfull, a (negative) error code otherwise
 */
INT16 CGEN_PROTECTED CVar_SetOp(CVar *_this,const char* lpsOpname)
{
  StkItm si;
  if (dlp_strcmp(lpsOpname,"++=")!=0 && dlp_strcmp(lpsOpname,"--=")!=0)
  {
    if (!CDlpObject_MicGet(BASEINST(_this))->GetX)
      return
        IERROR(_this,VAR_NOTSUPPORTED,"Polymorphic signatures"," by caller",0);
    if (!MIC_GET_X(1,&si)) return NOT_EXEC;
  }
    
  if (dlp_strcmp(lpsOpname,"=")==0)
    switch (si.nType)
    {
      case T_BOOL    : return CVar_Bset(_this,si.val.b);
      case T_COMPLEX : return CVar_Vset(_this,si.val.n);
      case T_STRING  : return CVar_Sset(_this,si.val.s);
      case T_INSTANCE: return CVar_Iset(_this,si.val.i);
      default:
        DLPASSERT(FMSG("Unknown variable type"));
        return NOT_EXEC;
    }
  else if (dlp_strcmp(lpsOpname,"+=")==0)
  {
    if (_this->m_nType==T_COMPLEX) return CVar_Vset(_this,CMPLX_PLUS(_this->m_nNVal,si.val.n));
    if (_this->m_nType==T_STRING)
    {
      char* lpsSi = NULL;
      MIC_PUT_X(&si);
      lpsSi = MIC_GET_S(1,0);
      _this->m_lpsSVal = (char*)dlp_realloc(_this->m_lpsSVal,
        dlp_strlen(_this->m_lpsSVal)+dlp_strlen(lpsSi)+1,sizeof(char));
      if (!_this->m_lpsSVal) return IERROR(_this,ERR_NOMEM,0,0,0);
      dlp_strcat(_this->m_lpsSVal,lpsSi);
      return O_K;
    }
    if (_this->m_nType==T_BOOL)
    {
      MIC_PUT_X(&si);
      _this->m_bBVal|=MIC_GET_B(1,0);
      return O_K;
    }
    return
      IERROR(_this,VAR_NOTSUPPORTED,"Operator +="," for this variable type",0);
  }
  else if (dlp_strcmp(lpsOpname,"*=")==0)
  {
    if (_this->m_nType==T_COMPLEX) return CVar_Vset(_this,CMPLX_MULT(_this->m_nNVal,si.val.n));
    if (_this->m_nType==T_BOOL)
    {
      MIC_PUT_X(&si);
      _this->m_bBVal&=MIC_GET_B(1,0);
      return O_K;
    }
    return
      IERROR(_this,VAR_NOTSUPPORTED,"Operator *="," for this variable type",0);
  }
  else if (dlp_strcmp(lpsOpname,"-=")==0)
  {
    if (_this->m_nType==T_COMPLEX) return CVar_Vset(_this,CMPLX_MINUS(_this->m_nNVal,si.val.n));
    return
      IERROR(_this,VAR_NOTSUPPORTED,"Operator -="," for this variable type",0);
  }
  else if (dlp_strcmp(lpsOpname,"/=")==0)
  {
    if (_this->m_nType==T_COMPLEX) return CVar_Vset(_this,CMPLX_MULT(_this->m_nNVal,CMPLX_INVT(si.val.n)));
    return
      IERROR(_this,VAR_NOTSUPPORTED,"Operator /="," for this variable type",0);
  }
  else if (dlp_strcmp(lpsOpname,"++=")==0)
  {
    if (_this->m_nType==T_COMPLEX) return CVar_Vset(_this,CMPLX_INC(_this->m_nNVal));
    return
      IERROR(_this,VAR_NOTSUPPORTED,"Operator ++="," for this variable type",0);
  }
  else if (dlp_strcmp(lpsOpname,"--=")==0)
  {
    if (_this->m_nType==T_COMPLEX) return CVar_Vset(_this,CMPLX_DEC(_this->m_nNVal));
    return 
      IERROR(_this,VAR_NOTSUPPORTED,"Operator --="," for this variable type",0);
  }
  
  return NOT_EXEC;
}