#include <iostream>
#include <fstream>
#include <set>
#include <OMEmanifests.h>
|
const char * | promotedType (const struct opDescription *op, const struct typeDescription *leftType, const struct typeDescription *rightType) |
|
uint32_t | isLegalFunction (const char *opText, uint32_t leftType, uint32_t rightType) |
|
uint32_t | findPermittedTypes (const legalOperandTypes *t, const uint32_t findType) |
|
uint32_t | isPermittedOperand (const opDescription *opDesc, const typeDescription *leftTypeDesc, const typeDescription *rightTypeDesc) |
|
promotionResult | promoteIfNeeded (const opDescription *opDesc, const typeDescription *left, const typeDescription *right, bool leftIsOMEtype, bool rightIsOMEtype) |
|
void | outputCompareOp (const opDescription *opDesc, typeDescription *leftType, typeDescription *rightType) |
|
const char * | makeVarName (char *bfr, bool isInstanceVar, bool isOMEtype, const char *baseName, const char *qualifier, const char *suffix, bool isExtendedType=false) |
|
const char * | LEFT_VAR (const char *leftArgName, const char *altName) |
|
void | doBinaryOp (const opDescription *opDesc, const char *resultType, typeDescription *leftArgType, typeDescription *rightArgType, bool doMemberFunction) |
|
void | doRelativeOp (const opDescription *opDesc, const char *resultType) |
|
void | doUnaryOp (const opDescription *opDesc) |
|
void | emitUtilityRoutines () |
|
int | main (int argc, const char *argv[]) |
|
◆ ALL_CONTAINERS
◆ ALL_FLOATS
◆ ALL_INTEGERS
◆ ALL_INTEGERS_OR_ANY
◆ ALL_NATIVE_NUMBERS
◆ ALL_NATIVE_NUMBERS_OR_ANY
◆ ALL_NUMERICS
◆ ALL_NUMERICS_OR_ANY
◆ ANY_OMETYPE
◆ EVERYTHING
#define EVERYTHING (~static_cast<uint32_t>(0)) |
◆ INTEGERS_AND_SETS
◆ INTEGERS_AND_SETS_OR_ANY
◆ IS_NATIVE_TYPE
◆ IS_OMETYPE
◆ LARGE_INTEGERS
◆ NATIVE_NUMBERS_AND_SETS
◆ NATIVE_NUMBERS_AND_SETS_OR_ANY
◆ NATIVE_NUMBERS_AND_STRINGS
◆ NATIVE_NUMBERS_AND_STRINGS_OR_ANY
◆ NATIVE_NUMBERS_STRINGS_AND_SETS
◆ NATIVE_NUMBERS_STRINGS_SETS_OR_ANY
◆ NUMBERS_AND_SETS
◆ NUMBERS_AND_SETS_OR_ANY
◆ NUMBERS_AND_STRINGS
◆ NUMBERS_AND_STRINGS_OR_ANY
◆ NUMBERS_STRINGS_AND_SETS
◆ NUMBERS_STRINGS_SETS_OR_ANY
◆ SMALL_INTEGERS
◆ TYPE_BIT
#define TYPE_BIT |
( |
|
n | ) |
(1 << (n)) |
◆ doBinaryOp()
void doBinaryOp |
( |
const opDescription * |
opDesc, |
|
|
const char * |
resultType, |
|
|
typeDescription * |
leftArgType, |
|
|
typeDescription * |
rightArgType, |
|
|
bool |
doMemberFunction |
|
) |
| |
References ALL_FLOATS, findPermittedTypes(), hdrFile, IS_NATIVE_TYPE, IS_OMETYPE, isPermittedOperand(), makeVarName(), OME_ANY, OME_NIL, OME_POINTER, promoteIfNeeded(), srcFile, TYPE_BIT, and typeList.
Referenced by doRelativeOp(), and doUnaryOp().
◆ doRelativeOp()
void doRelativeOp |
( |
const opDescription * |
opDesc, |
|
|
const char * |
resultType |
|
) |
| |
◆ doUnaryOp()
void doUnaryOp |
( |
const opDescription * |
opDesc | ) |
|
◆ emitUtilityRoutines()
void emitUtilityRoutines |
( |
| ) |
|
◆ findPermittedTypes()
uint32_t findPermittedTypes |
( |
const legalOperandTypes * |
t, |
|
|
const uint32_t |
findType |
|
) |
| |
◆ isLegalFunction()
uint32_t isLegalFunction |
( |
const char * |
opText, |
|
|
uint32_t |
leftType, |
|
|
uint32_t |
rightType |
|
) |
| |
References ALL_INTEGERS_OR_ANY, ALL_NATIVE_NUMBERS, ALL_NATIVE_NUMBERS_OR_ANY, ALL_NUMERICS_OR_ANY, INTEGERS_AND_SETS_OR_ANY, NUMBERS_AND_SETS_OR_ANY, NUMBERS_AND_STRINGS_OR_ANY, NUMBERS_STRINGS_SETS_OR_ANY, OME_ANY, OME_SET, and TYPE_BIT.
Referenced by doRelativeOp(), and doUnaryOp().
◆ isPermittedOperand()
uint32_t isPermittedOperand |
( |
const opDescription * |
opDesc, |
|
|
const typeDescription * |
leftTypeDesc, |
|
|
const typeDescription * |
rightTypeDesc |
|
) |
| |
◆ LEFT_VAR()
const char* LEFT_VAR |
( |
const char * |
leftArgName, |
|
|
const char * |
altName |
|
) |
| |
◆ main()
int main |
( |
int |
argc, |
|
|
const char * |
argv[] |
|
) |
| |
◆ makeVarName()
const char* makeVarName |
( |
char * |
bfr, |
|
|
bool |
isInstanceVar, |
|
|
bool |
isOMEtype, |
|
|
const char * |
baseName, |
|
|
const char * |
qualifier, |
|
|
const char * |
suffix, |
|
|
bool |
isExtendedType = false |
|
) |
| |
◆ outputCompareOp()
void outputCompareOp |
( |
const opDescription * |
opDesc, |
|
|
typeDescription * |
leftType, |
|
|
typeDescription * |
rightType |
|
) |
| |
◆ promotedType()
const char* promotedType |
( |
const struct opDescription * |
op, |
|
|
const struct typeDescription * |
leftType, |
|
|
const struct typeDescription * |
rightType |
|
) |
| |
◆ promoteIfNeeded()
promotionResult promoteIfNeeded |
( |
const opDescription * |
opDesc, |
|
|
const typeDescription * |
left, |
|
|
const typeDescription * |
right, |
|
|
bool |
leftIsOMEtype, |
|
|
bool |
rightIsOMEtype |
|
) |
| |
◆ allSameContainerTypes
struct legalOperandTypes allSameContainerTypes[] |
◆ binaryMathOperatorList
struct opDescription binaryMathOperatorList[] |
Initial value:= {
{{"+"}, {"plus"}, {""}, 0,
{{"-"}, {"subtract"}, {""}, 0,
{{"*"}, {"multiply"}, {""}, 0,
{{"/"}, {"divide"}, {""}, 0,
{{"%"}, {"modulo"}, {""}, 0,
{{"&"}, {"logical-and"}, {""}, 0,
{{"|"}, {"logical-or"}, {""}, 0,
{{"^"}, {"logical-xor"}, {""}, 0,
{{""}, {""}, {""}, 0, 0, nullptr, 0, 0}}
Referenced by main().
◆ hdrFile
◆ logicalBitwiseTypes
struct legalOperandTypes logicalBitwiseTypes[] |
◆ numberAndStringTypes
struct legalOperandTypes numberAndStringTypes[] |
◆ numericTypes
struct legalOperandTypes numericTypes[] |
◆ onlyIntegerTypes
struct legalOperandTypes onlyIntegerTypes[] |
◆ plusTypes
struct legalOperandTypes plusTypes[] |
◆ relativeOperatorList
struct opDescription relativeOperatorList[] |
Initial value:= {
{{"=="}, {"equals"}, {"false"}, 0,
{{"!="}, {"not-equals"}, {"true"}, 0,
{{"<"}, {"less-than"}, {""}, 0,
{{"<="}, {"less-than-equals"}, {""}, 0,
{{">"}, {"greater-than"}, {""}, 0,
{{">="}, {"greater-than-equals"}, {""}, 0,
{{""}, {""}, {""}, 0, 0, nullptr, 0, 0}
}
Referenced by main().
◆ setTypes
struct legalOperandTypes setTypes[] |
◆ srcFile
◆ typeList
struct typeDescription typeList[] |
Initial value:= {
{{
"OMEtype"}, {
"OME_ANY"}, {
""}, {
""}, 0, 0, 0, 0, 0,
TYPE_BIT(
OME_ANY)},
{{
"OMEtype"}, {
"OME_NIL"}, {
""}, {
""}, 0, 0, 0, 0, 0,
TYPE_BIT(
OME_NIL)},
{{
"int32_t"}, {
"OME_INT32"}, {
""}, {
"i"}, 4, 1, 0, 1, 0,
TYPE_BIT(
OME_INT32)},
{{
"int64_t"}, {
"OME_INT64"}, {
""}, {
"i64"}, 8, 1, 0, 1, 1,
TYPE_BIT(
OME_INT64)},
{{
"uint64_t"}, {
"OME_UINT64"}, {
""}, {
"ui64"}, 8, 1, 0, 0, 1,
TYPE_BIT(
OME_UINT64)},
{{
"uint32_t"}, {
"OME_UINT32"}, {
""}, {
"ui"}, 4, 1, 0, 0, 0,
TYPE_BIT(
OME_UINT32)},
{{
"uint16_t"}, {
"OME_UINT16"}, {
""}, {
"ui"}, 2, 1, 0, 0, 0,
TYPE_BIT(
OME_UINT16)},
{{
"uint8_t"}, {
"OME_UINT8"}, {
""}, {
"ui"}, 1, 1, 0, 0, 0,
TYPE_BIT(
OME_UINT8)},
{{
"float"}, {
"OME_FLOAT"}, {
""}, {
"f"}, 4, 0, 1, 1, 0,
TYPE_BIT(
OME_FLOAT)},
{{
"double"}, {
"OME_DOUBLE"}, {
""}, {
"df"}, 8, 0, 1, 1, 1,
TYPE_BIT(
OME_DOUBLE)},
{{
"OMEfixed"}, {
"OME_FIXED"}, {
"*"}, {
"fixed"}, 8, 0, 0, 1, 4,
TYPE_BIT(
OME_FIXED)},
{{
"OMEoid"}, {
"OME_OID"}, {
"*"}, {
"oid"}, 8, 0, 0, 0, 4,
TYPE_BIT(
OME_OID)},
{{
"OMEstring"}, {
"OME_STRING"}, {
"*"}, {
"s"}, 8, 0, 0, 0, 4,
TYPE_BIT(
OME_STRING)},
{{
"OMEarray"}, {
"OME_ARRAY"}, {
"*"}, {
"arrayPtr"}, 8, 0, 0, 0, 4,
TYPE_BIT(
OME_ARRAY)},
{{
"OMEassoc"}, {
"OME_ASSOC"}, {
"*"}, {
"assoc"}, 8, 0, 0, 0, 4,
TYPE_BIT(
OME_ASSOC)},
{{
"OMEset"}, {
"OME_SET"}, {
"*"}, {
"set"}, 8, 0, 0, 0, 4,
TYPE_BIT(
OME_SET)},
{{
"OMEnlm"}, {
"OME_NLM"}, {
"*"}, {
"nlm"}, 8, 0, 0, 0, 4,
TYPE_BIT(
OME_NLM)},
{{""}, {""}, {""}, {""}, 0, 0, 0, 0, 0, 0}}
Referenced by doBinaryOp(), doRelativeOp(), and doUnaryOp().
◆ unaryMathOperatorList
struct opDescription unaryMathOperatorList[] |
Initial value:= {
{{"+="}, {"plus-equals"}, {""}, 1,
{{"-="}, {"minus-equals"}, {""}, 1,
{{"&="}, {"and-equals"}, {""}, 1,
{{"|="}, {"or-equals"}, {""}, 1,
{{"*="}, {"times-equals"}, {""}, 1,
{{"/="}, {"divide-equals"}, {""}, 1,
{{"%="}, {"modulo-equals"}, {""}, 1,
{{"^="}, {"xor-equals"}, {""}, 1,
{{""}, {""}, {""}, 0, 0, nullptr, 0, 0}
}
Referenced by main().
#define NUMBERS_AND_STRINGS_OR_ANY
Definition: generateOMEtypesOps.cpp:37
@ OME_NLM
Definition: OMEmanifests.h:90
@ OME_FLOAT
Definition: OMEmanifests.h:82
#define NATIVE_NUMBERS_AND_SETS_OR_ANY
Definition: generateOMEtypesOps.cpp:47
@ OME_UINT16
Definition: OMEmanifests.h:98
struct legalOperandTypes onlyIntegerTypes[]
Definition: generateOMEtypesOps.cpp:113
#define NUMBERS_AND_SETS_OR_ANY
Definition: generateOMEtypesOps.cpp:45
#define ALL_NATIVE_NUMBERS_OR_ANY
Definition: generateOMEtypesOps.cpp:25
#define NUMBERS_STRINGS_SETS_OR_ANY
Definition: generateOMEtypesOps.cpp:53
@ OME_DOUBLE
Definition: OMEmanifests.h:83
@ OME_UINT32
Definition: OMEmanifests.h:96
#define EVERYTHING
Definition: generateOMEtypesOps.cpp:63
struct legalOperandTypes plusTypes[]
Definition: generateOMEtypesOps.cpp:123
@ OME_STRING
Definition: OMEmanifests.h:85
struct legalOperandTypes logicalBitwiseTypes[]
Definition: generateOMEtypesOps.cpp:138
@ OME_NIL
Definition: OMEmanifests.h:78
#define TYPE_BIT(n)
Definition: generateOMEtypesOps.cpp:9
struct legalOperandTypes setTypes[]
Definition: generateOMEtypesOps.cpp:131
@ OME_OID
Definition: OMEmanifests.h:84
struct legalOperandTypes allSameContainerTypes[]
Definition: generateOMEtypesOps.cpp:144
struct legalOperandTypes numericTypes[]
Definition: generateOMEtypesOps.cpp:109
@ OME_UINT64
Definition: OMEmanifests.h:97
#define ALL_NUMERICS
Definition: generateOMEtypesOps.cpp:27
#define NATIVE_NUMBERS_STRINGS_SETS_OR_ANY
Definition: generateOMEtypesOps.cpp:55
#define ALL_INTEGERS_OR_ANY
Definition: generateOMEtypesOps.cpp:19
@ OME_SET
Definition: OMEmanifests.h:89
@ OME_UINT8
Definition: OMEmanifests.h:99
#define ALL_NUMERICS_OR_ANY
Definition: generateOMEtypesOps.cpp:29
@ OME_FIXED
Definition: OMEmanifests.h:91
#define ALL_INTEGERS
Definition: generateOMEtypesOps.cpp:17
@ OME_ANY
Definition: OMEmanifests.h:93
struct legalOperandTypes numberAndStringTypes[]
Definition: generateOMEtypesOps.cpp:117
@ OME_ARRAY
Definition: OMEmanifests.h:86
@ OME_ASSOC
Definition: OMEmanifests.h:87
@ OME_INT32
Definition: OMEmanifests.h:79
@ OME_INT64
Definition: OMEmanifests.h:81