G:/ScriptBasic/source/execute.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include "basext.h"
#include "sym.h"
#include "errcodes.h"
#include "report.h"
#include "lexer.h"
#include "expression.h"
#include "builder.h"
#include "memory.h"
#include "syntax.h"
#include "execute.h"
#include "myalloc.h"
#include "modumana.h"

Go to the source code of this file.

Defines

#define REPORT(x)   if( pEo->report )pEo->report(pEo->reportptr,"",0,x,REPORT_ERROR,NULL,NULL,&(pEo->fErrorFlags))
#define ASSERT_NON_NULL(x)   if( (x) == NULL ){ *piErrorCode = EXE_ERROR_MEMORY_LOW; return NULL; }

Functions

static double pow10 (double a)
long execute_GetCommandByName (pExecuteObject pEo, char *pszCommandName, long lCodeHint)
int execute_CopyCommandTable (pExecuteObject pEo)
int execute_InitStructure (pExecuteObject pEo, pBuildObject pBo)
int execute_ReInitStructure (pExecuteObject pEo, pBuildObject pBo)
void execute_Execute_r (pExecuteObject pEo, int *piErrorCode)
void execute_InitExecute (pExecuteObject pEo, int *piErrorCode)
void execute_FinishExecute (pExecuteObject pEo, int *piErrorCode)
void execute_Execute (pExecuteObject pEo, int *piErrorCode)
void execute_ExecuteFunction (pExecuteObject pEo, unsigned long StartNode, long cArgs, pFixSizeMemoryObject *pArgs, pFixSizeMemoryObject *pResult, int *piErrorCode)
pFixSizeMemoryObject execute_Evaluate (pExecuteObject pEo, unsigned long lExpressionRootNode, pMortalList pMyMortal, int *piErrorCode, int iArrayAccepted)
pFixSizeMemoryObject * execute_LeftValue (pExecuteObject pEo, unsigned long lExpressionRootNode, pMortalList pMyMortal, int *piErrorCode, int iArrayAccepted)
pFixSizeMemoryObject execute_EvaluateArray (pExecuteObject pEo, unsigned long lExpressionRootNode, pMortalList pMyMortal, int *piErrorCode)
pFixSizeMemoryObject execute_EvaluateSarray (pExecuteObject pEo, unsigned long lExpressionRootNode, pMortalList pMyMortal, int *piErrorCode)
pFixSizeMemoryObject * execute_LeftValueArray (pExecuteObject pEo, unsigned long lExpressionRootNode, pMortalList pMyMortal, int *piErrorCode)
static int STRCMP (VARIABLE Op1, VARIABLE Op2, int iCase)
pFixSizeMemoryObject * execute_LeftValueSarray (pExecuteObject pEo, unsigned long lExpressionRootNode, pMortalList pMyMortal, int *piErrorCode)
pFixSizeMemoryObject execute_Convert2String (pExecuteObject pEo, pFixSizeMemoryObject pVar, pMortalList pMyMortal)
pFixSizeMemoryObject execute_Convert2Long (pExecuteObject pEo, pFixSizeMemoryObject pVar, pMortalList pMyMortal)
pFixSizeMemoryObject execute_Convert2LongS (pExecuteObject pEo, pFixSizeMemoryObject pVar, pMortalList pMyMortal)
pFixSizeMemoryObject execute_Convert2Double (pExecuteObject pEo, pFixSizeMemoryObject pVar, pMortalList pMyMortal)
pFixSizeMemoryObject execute_Convert2DoubleS (pExecuteObject pEo, pFixSizeMemoryObject pVar, pMortalList pMyMortal)
pFixSizeMemoryObject execute_Convert2Numeric (pExecuteObject pEo, pFixSizeMemoryObject pVar, pMortalList pMyMortal)
pFixSizeMemoryObject execute_Dereference (pExecuteObject pEo, pFixSizeMemoryObject p, int *piErrorCode)
int execute_DereferenceS (unsigned long refcount, pFixSizeMemoryObject *p)
double execute_GetDoubleValue (pExecuteObject pEo, pFixSizeMemoryObject pVar)
long execute_GetLongValue (pExecuteObject pEo, pFixSizeMemoryObject pVar)
int execute_IsStringInteger (pFixSizeMemoryObject pVar)
int execute_IsInteger (pFixSizeMemoryObject pVar)


Define Documentation

#define ASSERT_NON_NULL  )     if( (x) == NULL ){ *piErrorCode = EXE_ERROR_MEMORY_LOW; return NULL; }
 

Referenced by ex_IsCommandThis(), and execute_Evaluate().

#define REPORT  )     if( pEo->report )pEo->report(pEo->reportptr,"",0,x,REPORT_ERROR,NULL,NULL,&(pEo->fErrorFlags))
 

Definition at line 172 of file execute.c.


Function Documentation

pFixSizeMemoryObject execute_Convert2Double pExecuteObject  pEo,
pFixSizeMemoryObject  pVar,
pMortalList  pMyMortal
 

Definition at line 1595 of file execute.c.

References execute_DereferenceS(), i, memory_IsUndef(), memory_NewMortalDouble(), NULL, pow10(), s, and sLen.

Referenced by execute_Convert2DoubleS(), and execute_Convert2Numeric().

pFixSizeMemoryObject execute_Convert2DoubleS pExecuteObject  pEo,
pFixSizeMemoryObject  pVar,
pMortalList  pMyMortal
 

Definition at line 1682 of file execute.c.

References execute_Convert2Double(), execute_DereferenceS(), memory_IsUndef(), memory_NewMortalDouble(), and NULL.

Referenced by modu_Init().

pFixSizeMemoryObject execute_Convert2Long pExecuteObject  pEo,
pFixSizeMemoryObject  pVar,
pMortalList  pMyMortal
 

Definition at line 1450 of file execute.c.

References execute_DereferenceS(), i, memory_IsUndef(), memory_NewMortalLong(), NULL, pow10(), s, and sLen.

Referenced by execute_Convert2LongS(), and execute_Convert2Numeric().

pFixSizeMemoryObject execute_Convert2LongS pExecuteObject  pEo,
pFixSizeMemoryObject  pVar,
pMortalList  pMyMortal
 

Definition at line 1543 of file execute.c.

References execute_Convert2Long(), execute_DereferenceS(), memory_IsUndef(), memory_NewMortalLong(), and NULL.

Referenced by modu_Init().

pFixSizeMemoryObject execute_Convert2Numeric pExecuteObject  pEo,
pFixSizeMemoryObject  pVar,
pMortalList  pMyMortal
 

Definition at line 1735 of file execute.c.

References execute_Convert2Double(), execute_Convert2Long(), execute_DereferenceS(), memory_IsUndef(), memory_NewMortalLong(), and NULL.

pFixSizeMemoryObject execute_Convert2String pExecuteObject  pEo,
pFixSizeMemoryObject  pVar,
pMortalList  pMyMortal
 

Definition at line 1394 of file execute.c.

References buffer, execute_DereferenceS(), memcpy(), memory_IsUndef(), memory_NewMortalString(), NULL, and sprintf().

Referenced by modu_Init().

int execute_CopyCommandTable pExecuteObject  pEo  ) 
 

Definition at line 279 of file execute.c.

References ALLOC, COMMAND_ERROR_MEMORY_LOW, COMMAND_ERROR_SUCCESS, memcpy(), NULL, and p.

Referenced by modu_Init().

pFixSizeMemoryObject execute_Dereference pExecuteObject  pEo,
pFixSizeMemoryObject  p,
int *  piErrorCode
 

Definition at line 1781 of file execute.c.

References NULL, and refcount.

int execute_DereferenceS unsigned long  refcount,
pFixSizeMemoryObject *  p
 

Definition at line 1810 of file execute.c.

References NULL.

Referenced by execute_Convert2Double(), execute_Convert2DoubleS(), execute_Convert2Long(), execute_Convert2LongS(), execute_Convert2Numeric(), execute_Convert2String(), execute_GetDoubleValue(), execute_GetLongValue(), and modu_Init().

pFixSizeMemoryObject execute_Evaluate pExecuteObject  pEo,
unsigned long  lExpressionRootNode,
pMortalList  pMyMortal,
int *  piErrorCode,
int  iArrayAccepted
 

Definition at line 746 of file execute.c.

References ASSERT_NON_NULL, EXE_ERROR_INTERNAL, execute_EvaluateArray(), execute_EvaluateSarray(), execute_Execute_r(), memcpy(), memory_Mortalize(), memory_NewDouble(), memory_NewLong(), memory_NewMortalCString(), memory_ReleaseVariable(), memory_SelfOrRealUndef(), NULL, refcount, s, SaveErrorGoto, SaveErrorResume, SavefErrorGoto, SaveFunctionResultPointer, SaveStepCounter, and slen.

Referenced by execute_LeftValueArray(), execute_LeftValueSarray(), and modu_Init().

pFixSizeMemoryObject execute_EvaluateArray pExecuteObject  pEo,
unsigned long  lExpressionRootNode,
pMortalList  pMyMortal,
int *  piErrorCode
 

Definition at line 1039 of file execute.c.

References execute_LeftValueArray().

Referenced by execute_Evaluate().

pFixSizeMemoryObject execute_EvaluateSarray pExecuteObject  pEo,
unsigned long  lExpressionRootNode,
pMortalList  pMyMortal,
int *  piErrorCode
 

Definition at line 1075 of file execute.c.

References execute_LeftValueSarray().

Referenced by execute_Evaluate().

void execute_Execute pExecuteObject  pEo,
int *  piErrorCode
 

Definition at line 600 of file execute.c.

References execute_Execute_r(), execute_FinishExecute(), execute_InitExecute(), and REPORT.

Referenced by HttpExtensionProc(), and main().

void execute_Execute_r pExecuteObject  pEo,
int *  piErrorCode
 

Definition at line 415 of file execute.c.

References NULL.

Referenced by execute_Evaluate(), execute_Execute(), and scriba_Run().

void execute_ExecuteFunction pExecuteObject  pEo,
unsigned long  StartNode,
long  cArgs,
pFixSizeMemoryObject *  pArgs,
pFixSizeMemoryObject *  pResult,
int *  piErrorCode
 

Definition at line 640 of file execute.c.

References i, memory_NewArray(), memory_NewRef(), memory_SetRef(), nItem, and NULL.

Referenced by scriba_Call(), and scriba_CallArg().

void execute_FinishExecute pExecuteObject  pEo,
int *  piErrorCode
 

Definition at line 573 of file execute.c.

References i.

Referenced by execute_Execute(), and scriba_PurgeExecuteMemory().

long execute_GetCommandByName pExecuteObject  pEo,
char *  pszCommandName,
long  lCodeHint
 

Definition at line 234 of file execute.c.

Referenced by modu_Init().

double execute_GetDoubleValue pExecuteObject  pEo,
pFixSizeMemoryObject  pVar
 

Definition at line 1850 of file execute.c.

References execute_DereferenceS(), i, memory_IsUndef(), pow10(), s, and sLen.

Referenced by modu_Init().

long execute_GetLongValue pExecuteObject  pEo,
pFixSizeMemoryObject  pVar
 

Definition at line 1929 of file execute.c.

References execute_DereferenceS(), i, memory_IsUndef(), pow10(), s, and sLen.

Referenced by modu_Init().

void execute_InitExecute pExecuteObject  pEo,
int *  piErrorCode
 

Definition at line 532 of file execute.c.

References alloc_Alloc(), i, memory_NewArray(), memset(), and NULL.

Referenced by execute_Execute(), scriba_NoRun(), and scriba_Run().

int execute_InitStructure pExecuteObject  pEo,
pBuildObject  pBo
 

Definition at line 300 of file execute.c.

References alloc_Alloc(), alloc_InitSegment(), alloc_SegmentLimit(), build_MagicCode(), cft_GetEx(), COMMAND_ERROR_MEMORY_LOW, hook_Init(), iError, memory_InitStructure(), memory_RegisterTypes(), modu_Preload(), and NULL.

Referenced by HttpExtensionProc(), main(), and scriba_PreRun().

int execute_IsInteger pFixSizeMemoryObject  pVar  ) 
 

Definition at line 2107 of file execute.c.

References memory_IsUndef().

int execute_IsStringInteger pFixSizeMemoryObject  pVar  ) 
 

Definition at line 2014 of file execute.c.

References frac(), memory_IsUndef(), pow10(), s, and sLen.

Referenced by modu_Init().

pFixSizeMemoryObject* execute_LeftValue pExecuteObject  pEo,
unsigned long  lExpressionRootNode,
pMortalList  pMyMortal,
int *  piErrorCode,
int  iArrayAccepted
 

Definition at line 956 of file execute.c.

References EXE_ERROR_INTERNAL, execute_LeftValueArray(), execute_LeftValueSarray(), and NULL.

Referenced by modu_Init().

pFixSizeMemoryObject* execute_LeftValueArray pExecuteObject  pEo,
unsigned long  lExpressionRootNode,
pMortalList  pMyMortal,
int *  piErrorCode
 

Definition at line 1093 of file execute.c.

References __refcount_, EXE_ERROR_INTERNAL, execute_Evaluate(), execute_LeftValueSarray(), memory_CheckArrayIndex(), memory_NewArray(), and NULL.

Referenced by COMMAND_EXTERNAL(), COMMAND_FUNCTIONARG(), execute_EvaluateArray(), execute_LeftValue(), and execute_LeftValueSarray().

pFixSizeMemoryObject* execute_LeftValueSarray pExecuteObject  pEo,
unsigned long  lExpressionRootNode,
pMortalList  pMyMortal,
int *  piErrorCode
 

Definition at line 1225 of file execute.c.

References __refcount_, EXE_ERROR_INTERNAL, execute_Evaluate(), execute_LeftValueArray(), iCase, memory_CheckArrayIndex(), memory_DupVar(), memory_Immortalize(), memory_IsUndef(), memory_NewArray(), NULL, options_Get(), and STRCMP().

Referenced by COMMAND_EXTERNAL(), COMMAND_FUNCTIONARG(), execute_EvaluateSarray(), execute_LeftValue(), and execute_LeftValueArray().

int execute_ReInitStructure pExecuteObject  pEo,
pBuildObject  pBo
 

Definition at line 388 of file execute.c.

References modu_Preload(), and NULL.

Referenced by scriba_PreRun().

static double pow10 double  a  )  [static]
 

Definition at line 178 of file execute.c.

References i, and j.

Referenced by execute_Convert2Double(), execute_Convert2Long(), execute_GetDoubleValue(), execute_GetLongValue(), and execute_IsStringInteger().

static int STRCMP VARIABLE  Op1,
VARIABLE  Op2,
int  iCase
[static]
 

Definition at line 1187 of file execute.c.

References memory_IsUndef(), STRINGVALUE(), and STRLEN().


Generated on Sun Mar 12 23:56:34 2006 for ScriptBasic by  doxygen 1.4.6-NO