All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Enumerations
value.h File Reference
#include <string>
#include "tclass.h"

Go to the source code of this file.

Classes

struct  uscript::ObjString
 
struct  uscript::ObjTInstance
 
struct  uscript::Value
 

Namespaces

 uscript
 

Macros

#define BOOL_VAL(value)   ((uscript::Value){ uscript::VAL_BOOL, { .boolean = value }})
 
#define NIL_VAL   ((uscript::Value){ uscript::VAL_NIL, { .integer = 0 }})
 
#define NUMBER_VAL(value)   ((uscript::Value){ uscript::VAL_NUMBER, { .number = value }})
 
#define INTEGER_VAL(value)   ((uscript::Value){ uscript::VAL_INTEGER, { .integer = value }})
 
#define STRING_VAL(value)   ((uscript::Value){ uscript::VAL_OBJ_STRING, { .string = (uscript::ObjString){ value } }})
 
#define TINSTANCE_VAL(value)   ((uscript::Value){ uscript::VAL_OBJ_TINSTANCE, { .tinst = value }})
 
#define AS_BOOL(value)   ((value).as.boolean)
 
#define AS_NUMBER(value)   ((value).as.number)
 
#define AS_INTEGER(value)   ((value).as.integer)
 
#define AS_STRING(value)   ((value).as.string)
 
#define AS_CSTRING(value)   ((value).as.string.string)
 
#define AS_TINSTANCE(value)   ((value).as.tinst)
 
#define IS_NIL(value)   ((value).val == uscript::VAL_NIL)
 
#define IS_BOOL(value)   ((value).val == uscript::VAL_BOOL)
 
#define IS_NUMBER(value)   ((value).val == uscript::VAL_NUMBER)
 
#define IS_INTEGER(value)   ((value).val == uscript::VAL_INTEGER)
 
#define IS_STRING(value)   ((value).val == uscript::VAL_OBJ_STRING)
 
#define IS_TINSTANCE(value)   ((value).val == uscript::VAL_OBJ_TINSTANCE)
 

Enumerations

enum  uscript::ValueType {
  uscript::VAL_BOOL, uscript::VAL_NIL, uscript::VAL_NUMBER, uscript::VAL_INTEGER,
  uscript::VAL_OBJ_STRING, uscript::VAL_OBJ_TINSTANCE
}
 

Macro Definition Documentation

#define AS_BOOL (   value)    ((value).as.boolean)

Definition at line 52 of file value.h.

#define AS_CSTRING (   value)    ((value).as.string.string)

Definition at line 56 of file value.h.

#define AS_INTEGER (   value)    ((value).as.integer)

Definition at line 54 of file value.h.

#define AS_NUMBER (   value)    ((value).as.number)

Definition at line 53 of file value.h.

#define AS_STRING (   value)    ((value).as.string)

Definition at line 55 of file value.h.

#define AS_TINSTANCE (   value)    ((value).as.tinst)

Definition at line 57 of file value.h.

#define BOOL_VAL (   value)    ((uscript::Value){ uscript::VAL_BOOL, { .boolean = value }})

Definition at line 45 of file value.h.

#define INTEGER_VAL (   value)    ((uscript::Value){ uscript::VAL_INTEGER, { .integer = value }})

Definition at line 48 of file value.h.

#define IS_BOOL (   value)    ((value).val == uscript::VAL_BOOL)

Definition at line 60 of file value.h.

#define IS_INTEGER (   value)    ((value).val == uscript::VAL_INTEGER)

Definition at line 62 of file value.h.

#define IS_NIL (   value)    ((value).val == uscript::VAL_NIL)

Definition at line 59 of file value.h.

#define IS_NUMBER (   value)    ((value).val == uscript::VAL_NUMBER)

Definition at line 61 of file value.h.

#define IS_STRING (   value)    ((value).val == uscript::VAL_OBJ_STRING)

Definition at line 63 of file value.h.

#define IS_TINSTANCE (   value)    ((value).val == uscript::VAL_OBJ_TINSTANCE)

Definition at line 64 of file value.h.

#define NIL_VAL   ((uscript::Value){ uscript::VAL_NIL, { .integer = 0 }})

Definition at line 46 of file value.h.

#define NUMBER_VAL (   value)    ((uscript::Value){ uscript::VAL_NUMBER, { .number = value }})

Definition at line 47 of file value.h.

#define STRING_VAL (   value)    ((uscript::Value){ uscript::VAL_OBJ_STRING, { .string = (uscript::ObjString){ value } }})

Definition at line 49 of file value.h.

#define TINSTANCE_VAL (   value)    ((uscript::Value){ uscript::VAL_OBJ_TINSTANCE, { .tinst = value }})

Definition at line 50 of file value.h.