,mc_iSizeValEntry( 2 + mc_iSizeVal)
70,mc_iSizeValEntry( 2 + mc_iSizeVal)
95 #pragma warning( disable : 4311 ) 117 #if defined(_MSC_VER) 118 #pragma warning( default : 4311 ) 129 if(
this==&a_ByteCode)
153 for(
int i=0;
i<iSize; ++
i)
322std::cout <<
"No bytecode available\n";
326std::cout <<
"Entries:"<< (
int)
m_vBase.size()
329<<
" entries, MapSize:"<<
sizeof(
map_type)
335std::cout <<
"IDX["<< (
int)
m_vBase[
i++] <<
"]\t";
338 case cmVAL: std::cout <<
"VAL "; ++
i;
339std::cout <<
"["<< *(
reinterpret_cast<double*
>(&
m_vBase[
i]) ) <<
"]\n";
343 case cmVAR: std::cout <<
"VAR "; ++
i;
353std::cout <<
"CALL\t"; ++
i;
354std::cout <<
"[ARG:"<< std::dec << (
int)
m_vBase[
i] <<
"]"; ++
i;
360std::cout <<
"CALL STRFUNC\t"; ++
i;
361std::cout <<
"[ARG:"<< std::dec << (
int)
m_vBase[
i] <<
"]"; ++
i;
362std::cout <<
"[IDX:"<< std::dec << (
int)
m_vBase[
i] <<
"]"; ++
i;
367 case cmLT: std::cout <<
"LT\n"; ++
i;
break;
368 case cmGT: std::cout <<
"GT\n"; ++
i;
break;
369 case cmLE: std::cout <<
"LE\n"; ++
i;
break;
370 case cmGE: std::cout <<
"GE\n"; ++
i;
break;
371 case cmEQ: std::cout <<
"EQ\n"; ++
i;
break;
372 case cmNEQ: std::cout <<
"NEQ\n"; ++
i;
break;
373 case cmADD: std::cout <<
"ADD\n"; ++
i;
break;
374 case cmAND: std::cout <<
"AND\n"; ++
i;
break;
375 case cmOR: std::cout <<
"OR\n"; ++
i;
break;
376 case cmXOR: std::cout <<
"XOR\n"; ++
i;
break;
377 case cmSUB: std::cout <<
"SUB\n"; ++
i;
break;
378 case cmMUL: std::cout <<
"MUL\n"; ++
i;
break;
379 case cmDIV: std::cout <<
"DIV\n"; ++
i;
break;
380 case cmPOW: std::cout <<
"POW\n"; ++
i;
break;
383std::cout <<
"ASSIGN\t"; ++
i;
388 default: std::cout <<
"(unknown code: "<< (
int)
m_vBase[
i] <<
")\n";
394std::cout <<
"END"<< std::endl;
Bytecode implementation of the Math Parser.
ParserByteCode & operator=(const ParserByteCode &a_ByteCode)
Assignment operator.
void AddOp(ECmdCode a_Oprt)
Add an operator identifier to bytecode.
bytecode_type map_type
Underlying type of the container.
const map_type * GetRawData() const
Get Pointer to bytecode data storage.
const int mc_iSizeValEntry
A value entry requires that much entires in the bytecode.
void Assign(const ParserByteCode &a_ByteCode)
Copy state of another object to this.
const int mc_iSizePtr
Size of a pointer, relative to size of underlying TMapType.
void AddVal(value_type a_fVal)
Add a Variable pointer to bytecode.
void RemoveValEntries(unsigned a_iNumber)
Remove a value number of entries from the bytecode.
ParserByteCode()
Bytecode default constructor.
void clear()
Delete the bytecode.
const int mc_iSizeVal
Size of a value entry in the bytecode, relative to TMapType size.
std::size_t GetBufSize() const
void AsciiDump()
Dump bytecode (for debugging only!).
~ParserByteCode()
Destructor (trivial).
void StorePtr(void *a_pAddr)
Store an address in bytecode.
void AddStrFun(void *a_pFun, int a_iArgc, int a_iIdx)
Add Strung function entry to the parser bytecode.
void AddVar(value_type *a_pVar)
Add a Variable pointer to bytecode.
std::vector< map_type > storage_type
Core type of the bytecode.
unsigned m_iStackPos
Position in the Calculation array.
void Finalize()
Add end marker to bytecode.
void AddAssignOp(value_type *a_pVar)
Add an assignement operator.
storage_type m_vBase
Core type of the bytecode.
void AddFun(void *a_pFun, int a_iArgc)
Add function to bytecode.
unsigned int
A callback function used to compare two keys in a database.
static void hex(unsigned char c)
Definition of the parser bytecode class.
This file contains standard definitions used by the parser.
This file defines the error class used by the parser.
This file contains the parser token definition.
Namespace for mathematical applications.
ECmdCode
Bytecode values.
@ cmADD
Operator item: add.
@ cmGE
Operator item: greater or equal.
@ cmLT
Operator item: less than.
@ cmPOW
Operator item: y to the power of ...
@ cmASSIGN
Operator item: Assignment operator.
@ cmLE
Operator item: less or equal.
@ cmMUL
Operator item: multiply.
@ cmXOR
Operator item: logical xor.
@ cmDIV
Operator item: division.
@ cmAND
Operator item: logical and.
@ cmOR
Operator item: logical or.
@ cmNEQ
Operator item: not equal.
@ cmGT
Operator item: greater than.
@ cmEQ
Operator item: equals.
@ cmSUB
Operator item: subtract.
@ cmFUNC_STR
Code for a function with a string parameter.
@ cmFUNC
Code for a function item.
double value_type
The numeric datatype used by the parser.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4